Changeset 3605 for LMDZ6/branches/Ocean_skin/libf/phy_common
- Timestamp:
- Nov 21, 2019, 4:43:45 PM (5 years ago)
- Location:
- LMDZ6/branches/Ocean_skin
- Files:
-
- 10 edited
- 1 copied
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin
-
LMDZ6/branches/Ocean_skin/libf/phy_common/geometry_mod.F90
r2395 r3605 30 30 !$OMP THREADPRIVATE(cell_area) 31 31 32 INTEGER,SAVE,ALLOCATABLE :: ind_cell_glo(:) ! global indice of a local cell 33 !$OMP THREADPRIVATE(ind_cell_glo) 32 34 33 35 CONTAINS … … 35 37 SUBROUTINE init_geometry(klon,longitude_,latitude_, & 36 38 boundslon_,boundslat_, & 37 cell_area_, dx_,dy_)39 cell_area_,ind_cell_glo_,dx_,dy_) 38 40 USE mod_grid_phy_lmdz, ONLY: nvertex 39 41 USE nrtype, ONLY : PI … … 45 47 REAL,INTENT(IN) :: boundslat_(klon,nvertex) 46 48 REAL,INTENT(IN) :: cell_area_(klon) 49 INTEGER,OPTIONAL,INTENT(IN) :: ind_cell_glo_(klon) 47 50 REAL,OPTIONAL,INTENT(IN) :: dx_(klon) 48 51 REAL,OPTIONAL,INTENT(IN) :: dy_(klon) … … 55 58 ALLOCATE(boundslat(klon,nvertex)) 56 59 ALLOCATE(cell_area(klon)) 60 IF (PRESENT(ind_cell_glo_)) ALLOCATE(ind_cell_glo(klon)) 57 61 IF (PRESENT(dx_)) ALLOCATE(dx(klon)) 58 62 IF (PRESENT(dy_))ALLOCATE(dy(klon)) … … 65 69 boundslat(:,:) = boundslat_(:,:) 66 70 cell_area(:) = cell_area_(:) 71 IF (PRESENT(ind_cell_glo_)) ind_cell_glo(:) = ind_cell_glo_(:) 67 72 IF (PRESENT(dx_)) dx(:) = dx_(:) 68 73 IF (PRESENT(dy_)) dy(:) = dy_(:) -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_data.F90
r2429 r3605 3 3 ! 4 4 MODULE mod_phys_lmdz_mpi_data 5 ! USE mod_const_mpi6 5 7 6 INTEGER,SAVE :: ii_begin … … 36 35 INTEGER,SAVE :: mpi_size 37 36 INTEGER,SAVE :: mpi_master 38 ! INTEGER,SAVE :: mpi_root39 37 LOGICAL,SAVE :: is_mpi_root 40 38 LOGICAL,SAVE :: is_using_mpi 41 39 42 40 43 ! LOGICAL,SAVE :: is_north_pole44 ! LOGICAL,SAVE :: is_south_pole45 41 LOGICAL,SAVE :: is_north_pole_dyn 46 42 LOGICAL,SAVE :: is_south_pole_dyn … … 50 46 CONTAINS 51 47 52 ! SUBROUTINE Init_phys_lmdz_mpi_data(iim,jjp1,nb_proc,distrib)53 48 SUBROUTINE init_phys_lmdz_mpi_data(nbp, nbp_lon, nbp_lat, communicator) 54 ! USE mod_const_mpi, ONLY : COMM_LMDZ55 49 IMPLICIT NONE 56 50 #ifdef CPP_MPI 57 51 INCLUDE 'mpif.h' 58 52 #endif 59 INTEGER,INTENT( in) :: nbp60 INTEGER,INTENT( in) :: nbp_lon61 INTEGER,INTENT( in) :: nbp_lat62 INTEGER,INTENT( in) :: communicator53 INTEGER,INTENT(IN) :: nbp 54 INTEGER,INTENT(IN) :: nbp_lon 55 INTEGER,INTENT(IN) :: nbp_lat 56 INTEGER,INTENT(IN) :: communicator 63 57 64 58 INTEGER,ALLOCATABLE :: distrib(:) … … 189 183 190 184 SUBROUTINE print_module_data 191 !USE print_control_mod, ONLY: lunout185 USE print_control_mod, ONLY: lunout 192 186 IMPLICIT NONE 193 INCLUDE "iniprint.h"187 ! INCLUDE "iniprint.h" 194 188 195 189 WRITE(lunout,*) 'ii_begin =', ii_begin -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
r2429 r3605 42 42 END INTERFACE 43 43 44 INTERFACE reduce_min_mpi 45 MODULE PROCEDURE reduce_min_mpi_i,reduce_min_mpi_i1,reduce_min_mpi_i2,reduce_min_mpi_i3,reduce_min_mpi_i4, & 46 reduce_min_mpi_r,reduce_min_mpi_r1,reduce_min_mpi_r2,reduce_min_mpi_r3,reduce_min_mpi_r4 47 END INTERFACE 48 44 49 INTERFACE grid1dTo2d_mpi 45 50 MODULE PROCEDURE grid1dTo2d_mpi_i,grid1dTo2d_mpi_i1,grid1dTo2d_mpi_i2,grid1dTo2d_mpi_i3, & … … 986 991 END SUBROUTINE reduce_sum_mpi_r4 987 992 993 994 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 995 !! Definition des reduce_min --> 4D !! 996 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 997 998 SUBROUTINE reduce_min_mpi_i(VarIn, VarOut) 999 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1000 IMPLICIT NONE 1001 1002 INTEGER,INTENT(IN) :: VarIn 1003 INTEGER,INTENT(OUT) :: VarOut 1004 INTEGER :: VarIn_tmp(1) 1005 INTEGER :: VarOut_tmp(1) 1006 1007 VarIn_tmp(1)=VarIn 1008 CALL reduce_min_mpi_igen(VarIn_tmp,Varout_tmp,1) 1009 VarOut=VarOut_tmp(1) 1010 1011 END SUBROUTINE reduce_min_mpi_i 1012 1013 SUBROUTINE reduce_min_mpi_i1(VarIn, VarOut) 1014 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1015 IMPLICIT NONE 1016 1017 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn 1018 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut 1019 1020 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn)) 1021 1022 END SUBROUTINE reduce_min_mpi_i1 1023 1024 SUBROUTINE reduce_min_mpi_i2(VarIn, VarOut) 1025 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1026 IMPLICIT NONE 1027 1028 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn 1029 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut 1030 1031 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn)) 1032 1033 END SUBROUTINE reduce_min_mpi_i2 1034 1035 SUBROUTINE reduce_min_mpi_i3(VarIn, VarOut) 1036 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1037 IMPLICIT NONE 1038 1039 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn 1040 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 1041 1042 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn)) 1043 1044 END SUBROUTINE reduce_min_mpi_i3 1045 1046 SUBROUTINE reduce_min_mpi_i4(VarIn, VarOut) 1047 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1048 IMPLICIT NONE 1049 1050 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 1051 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 1052 1053 CALL reduce_min_mpi_igen(VarIn,Varout,SIZE(VarIn)) 1054 1055 END SUBROUTINE reduce_min_mpi_i4 1056 1057 1058 SUBROUTINE reduce_min_mpi_r(VarIn, VarOut) 1059 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1060 IMPLICIT NONE 1061 1062 REAL,INTENT(IN) :: VarIn 1063 REAL,INTENT(OUT) :: VarOut 1064 REAL :: VarIn_tmp(1) 1065 REAL :: VarOut_tmp(1) 1066 1067 VarIn_tmp(1)=VarIn 1068 CALL reduce_min_mpi_rgen(VarIn_tmp,Varout_tmp,1) 1069 VarOut=VarOut_tmp(1) 1070 1071 END SUBROUTINE reduce_min_mpi_r 1072 1073 SUBROUTINE reduce_min_mpi_r1(VarIn, VarOut) 1074 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1075 IMPLICIT NONE 1076 1077 REAL,INTENT(IN),DIMENSION(:) :: VarIn 1078 REAL,INTENT(OUT),DIMENSION(:) :: VarOut 1079 1080 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn)) 1081 1082 END SUBROUTINE reduce_min_mpi_r1 1083 1084 SUBROUTINE reduce_min_mpi_r2(VarIn, VarOut) 1085 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1086 IMPLICIT NONE 1087 1088 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn 1089 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut 1090 1091 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn)) 1092 1093 END SUBROUTINE reduce_min_mpi_r2 1094 1095 SUBROUTINE reduce_min_mpi_r3(VarIn, VarOut) 1096 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1097 IMPLICIT NONE 1098 1099 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn 1100 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 1101 1102 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn)) 1103 1104 END SUBROUTINE reduce_min_mpi_r3 1105 1106 SUBROUTINE reduce_min_mpi_r4(VarIn, VarOut) 1107 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root 1108 IMPLICIT NONE 1109 1110 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 1111 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 1112 1113 CALL reduce_min_mpi_rgen(VarIn,Varout,SIZE(VarIn)) 1114 1115 END SUBROUTINE reduce_min_mpi_r4 1116 1117 988 1118 989 1119 … … 1678 1808 1679 1809 1810 SUBROUTINE reduce_min_mpi_igen(VarIn,VarOut,nb) 1811 USE mod_phys_lmdz_mpi_data 1812 USE mod_grid_phy_lmdz 1813 IMPLICIT NONE 1814 1815 #ifdef CPP_MPI 1816 INCLUDE 'mpif.h' 1817 #endif 1818 1819 INTEGER,INTENT(IN) :: nb 1820 INTEGER,DIMENSION(nb),INTENT(IN) :: VarIn 1821 INTEGER,DIMENSION(nb),INTENT(OUT) :: VarOut 1822 INTEGER :: ierr 1823 1824 IF (.not.is_using_mpi) THEN 1825 VarOut(:)=VarIn(:) 1826 RETURN 1827 ENDIF 1828 1829 1830 #ifdef CPP_MPI 1831 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_INTEGER,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr) 1832 #endif 1833 1834 END SUBROUTINE reduce_min_mpi_igen 1835 1836 SUBROUTINE reduce_min_mpi_rgen(VarIn,VarOut,nb) 1837 USE mod_phys_lmdz_mpi_data 1838 USE mod_grid_phy_lmdz 1839 1840 IMPLICIT NONE 1841 1842 #ifdef CPP_MPI 1843 INCLUDE 'mpif.h' 1844 #endif 1845 1846 INTEGER,INTENT(IN) :: nb 1847 REAL,DIMENSION(nb),INTENT(IN) :: VarIn 1848 REAL,DIMENSION(nb),INTENT(OUT) :: VarOut 1849 INTEGER :: ierr 1850 1851 IF (.not.is_using_mpi) THEN 1852 VarOut(:)=VarIn(:) 1853 RETURN 1854 ENDIF 1855 1856 #ifdef CPP_MPI 1857 CALL MPI_REDUCE(VarIn,VarOut,nb,MPI_REAL_LMDZ,MPI_MIN,mpi_master,COMM_LMDZ_PHY,ierr) 1858 #endif 1859 1860 END SUBROUTINE reduce_min_mpi_rgen 1861 1862 1863 1864 1865 1866 1867 1680 1868 SUBROUTINE grid1dTo2d_mpi_igen(VarIn,VarOut,dimsize) 1681 1869 USE mod_phys_lmdz_mpi_data -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_data.F90
r2429 r3605 7 7 INTEGER,SAVE :: omp_rank 8 8 LOGICAL,SAVE :: is_omp_root 9 LOGICAL,SAVE :: is_omp_master ! alias of is_omp_root 9 10 LOGICAL,SAVE :: is_using_omp 10 11 LOGICAL,SAVE :: is_north_pole_phy, is_south_pole_phy … … 17 18 INTEGER,SAVE :: klon_omp_begin 18 19 INTEGER,SAVE :: klon_omp_end 19 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root, klon_omp_begin,klon_omp_end)20 !$OMP THREADPRIVATE(omp_rank,klon_omp,is_omp_root,is_omp_master,klon_omp_begin,klon_omp_end) 20 21 !$OMP THREADPRIVATE(is_north_pole_phy, is_south_pole_phy) 21 22 … … 60 61 ELSE 61 62 abort_message = 'ANORMAL : OMP_MASTER /= 0' 62 CALL abort_ gcm(modname,abort_message,1)63 CALL abort_physic (modname,abort_message,1) 63 64 ENDIF 64 65 !$OMP END MASTER 65 66 is_omp_master=is_omp_root 66 67 67 68 !$OMP MASTER … … 106 107 107 108 SUBROUTINE Print_module_data 109 USE print_control_mod, ONLY: lunout 108 110 IMPLICIT NONE 109 INCLUDE "iniprint.h"111 ! INCLUDE "iniprint.h" 110 112 111 113 !$OMP CRITICAL -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_omp_transfert.F90
r2326 r3605 47 47 END INTERFACE 48 48 49 50 PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, omp_barrier 49 INTERFACE reduce_min_omp 50 MODULE PROCEDURE reduce_min_omp_i,reduce_min_omp_i1,reduce_min_omp_i2,reduce_min_omp_i3,reduce_min_omp_i4, & 51 reduce_min_omp_r,reduce_min_omp_r1,reduce_min_omp_r2,reduce_min_omp_r3,reduce_min_omp_r4 52 END INTERFACE 53 54 55 PUBLIC bcast_omp,scatter_omp,gather_omp,reduce_sum_omp, reduce_min_omp, omp_barrier 51 56 52 57 CONTAINS … … 710 715 END SUBROUTINE reduce_sum_omp_r4 711 716 717 718 719 SUBROUTINE reduce_min_omp_i(VarIn, VarOut) 720 IMPLICIT NONE 721 722 INTEGER,INTENT(IN) :: VarIn 723 INTEGER,INTENT(OUT) :: VarOut 724 INTEGER :: VarIn_tmp(1) 725 INTEGER :: VarOut_tmp(1) 726 727 VarIn_tmp(1)=VarIn 728 CALL Check_buffer_i(1) 729 CALL reduce_min_omp_igen(VarIn_tmp,Varout_tmp,1,buffer_i) 730 VarOut=VarOut_tmp(1) 731 732 END SUBROUTINE reduce_min_omp_i 733 734 SUBROUTINE reduce_min_omp_i1(VarIn, VarOut) 735 IMPLICIT NONE 736 737 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn 738 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut 739 740 CALL Check_buffer_i(size(VarIn)) 741 CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i) 742 743 END SUBROUTINE reduce_min_omp_i1 744 745 746 SUBROUTINE reduce_min_omp_i2(VarIn, VarOut) 747 IMPLICIT NONE 748 749 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn 750 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut 751 752 CALL Check_buffer_i(size(VarIn)) 753 CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i) 754 755 END SUBROUTINE reduce_min_omp_i2 756 757 758 SUBROUTINE reduce_min_omp_i3(VarIn, VarOut) 759 IMPLICIT NONE 760 761 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn 762 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 763 764 CALL Check_buffer_i(size(VarIn)) 765 CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i) 766 767 END SUBROUTINE reduce_min_omp_i3 768 769 770 SUBROUTINE reduce_min_omp_i4(VarIn, VarOut) 771 IMPLICIT NONE 772 773 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 774 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 775 776 CALL Check_buffer_i(size(VarIn)) 777 CALL reduce_min_omp_igen(VarIn,Varout,Size(VarIn),buffer_i) 778 779 END SUBROUTINE reduce_min_omp_i4 780 781 782 SUBROUTINE reduce_min_omp_r(VarIn, VarOut) 783 IMPLICIT NONE 784 785 REAL,INTENT(IN) :: VarIn 786 REAL,INTENT(OUT) :: VarOut 787 REAL :: VarIn_tmp(1) 788 REAL :: VarOut_tmp(1) 789 790 VarIn_tmp(1)=VarIn 791 CALL Check_buffer_r(1) 792 CALL reduce_min_omp_rgen(VarIn_tmp,Varout_tmp,1,buffer_r) 793 VarOut=VarOut_tmp(1) 794 795 END SUBROUTINE reduce_min_omp_r 796 797 SUBROUTINE reduce_min_omp_r1(VarIn, VarOut) 798 IMPLICIT NONE 799 800 REAL,INTENT(IN),DIMENSION(:) :: VarIn 801 REAL,INTENT(OUT),DIMENSION(:) :: VarOut 802 803 CALL Check_buffer_r(size(VarIn)) 804 CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r) 805 806 END SUBROUTINE reduce_min_omp_r1 807 808 809 SUBROUTINE reduce_min_omp_r2(VarIn, VarOut) 810 IMPLICIT NONE 811 812 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn 813 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut 814 815 CALL Check_buffer_r(size(VarIn)) 816 CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r) 817 818 END SUBROUTINE reduce_min_omp_r2 819 820 821 SUBROUTINE reduce_min_omp_r3(VarIn, VarOut) 822 IMPLICIT NONE 823 824 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn 825 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 826 827 CALL Check_buffer_r(size(VarIn)) 828 CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r) 829 830 END SUBROUTINE reduce_min_omp_r3 831 832 833 SUBROUTINE reduce_min_omp_r4(VarIn, VarOut) 834 IMPLICIT NONE 835 836 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 837 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 838 839 CALL Check_buffer_r(size(VarIn)) 840 CALL reduce_min_omp_rgen(VarIn,Varout,Size(VarIn),buffer_r) 841 842 END SUBROUTINE reduce_min_omp_r4 843 844 845 846 712 847 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 713 848 ! LES ROUTINES GENERIQUES ! … … 1062 1197 END SUBROUTINE reduce_sum_omp_rgen 1063 1198 1199 1200 SUBROUTINE reduce_min_omp_igen(VarIn,VarOut,dimsize,Buff) 1201 IMPLICIT NONE 1202 1203 INTEGER,INTENT(IN) :: dimsize 1204 INTEGER,INTENT(IN),DIMENSION(dimsize) :: VarIn 1205 INTEGER,INTENT(OUT),DIMENSION(dimsize) :: VarOut 1206 INTEGER,INTENT(INOUT),DIMENSION(dimsize) :: Buff 1207 1208 INTEGER :: i 1209 INTEGER :: var 1210 1211 !$OMP MASTER 1212 Buff(:)=HUGE(var) 1213 !$OMP END MASTER 1214 !$OMP BARRIER 1215 1216 !$OMP CRITICAL 1217 DO i=1,dimsize 1218 Buff(i)=MIN(Buff(i),VarIn(i)) 1219 ENDDO 1220 !$OMP END CRITICAL 1221 !$OMP BARRIER 1222 1223 !$OMP MASTER 1224 DO i=1,dimsize 1225 VarOut(i)=Buff(i) 1226 ENDDO 1227 !$OMP END MASTER 1228 !$OMP BARRIER 1229 1230 END SUBROUTINE reduce_min_omp_igen 1231 1232 SUBROUTINE reduce_min_omp_rgen(VarIn,VarOut,dimsize,Buff) 1233 IMPLICIT NONE 1234 1235 INTEGER,INTENT(IN) :: dimsize 1236 REAL,INTENT(IN),DIMENSION(dimsize) :: VarIn 1237 REAL,INTENT(OUT),DIMENSION(dimsize) :: VarOut 1238 REAL,INTENT(INOUT),DIMENSION(dimsize) :: Buff 1239 1240 INTEGER :: i 1241 REAL :: var 1242 1243 !$OMP MASTER 1244 Buff(:)=HUGE(var) 1245 !$OMP END MASTER 1246 !$OMP BARRIER 1247 1248 !$OMP CRITICAL 1249 DO i=1,dimsize 1250 Buff(i)=MIN(Buff(i),VarIn(i)) 1251 ENDDO 1252 !$OMP END CRITICAL 1253 !$OMP BARRIER 1254 1255 !$OMP MASTER 1256 DO i=1,dimsize 1257 VarOut(i)=Buff(i) 1258 ENDDO 1259 !$OMP END MASTER 1260 !$OMP BARRIER 1261 1262 END SUBROUTINE reduce_min_omp_rgen 1263 1264 1064 1265 END MODULE mod_phys_lmdz_omp_transfert -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_para.F90
r2429 r3605 33 33 is_master=.FALSE. 34 34 ENDIF 35 CALL Test_transfert35 !ym CALL Test_transfert 36 36 !$OMP END PARALLEL 37 37 IF (is_using_mpi .OR. is_using_omp) THEN … … 49 49 SUBROUTINE Test_transfert 50 50 USE mod_grid_phy_lmdz 51 USE print_control_mod, ONLY: lunout 51 52 IMPLICIT NONE 52 INCLUDE "iniprint.h"53 ! INCLUDE "iniprint.h" 53 54 54 55 REAL :: Test_Field1d_glo(klon_glo,nbp_lev) -
LMDZ6/branches/Ocean_skin/libf/phy_common/mod_phys_lmdz_transfert_para.F90
r2326 r3605 1 1 ! 2 !$ Header$2 !$Id$ 3 3 ! 4 4 MODULE mod_phys_lmdz_transfert_para … … 46 46 END INTERFACE 47 47 48 INTERFACE reduce_min 49 MODULE PROCEDURE reduce_min_i,reduce_min_i1,reduce_min_i2,reduce_min_i3,reduce_min_i4, & 50 reduce_min_r,reduce_min_r1,reduce_min_r2,reduce_min_r3,reduce_min_r4 51 END INTERFACE 48 52 49 53 CONTAINS … … 1271 1275 END SUBROUTINE reduce_sum_r4 1272 1276 1277 1278 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1279 !! Definition des reduce_min --> 4D !! 1280 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1281 1282 ! Les entiers 1283 1284 SUBROUTINE reduce_min_i(VarIn, VarOut) 1285 IMPLICIT NONE 1286 1287 INTEGER,INTENT(IN) :: VarIn 1288 INTEGER,INTENT(OUT) :: VarOut 1289 1290 INTEGER :: Var_tmp 1291 1292 CALL reduce_min_omp(VarIn,Var_tmp) 1293 !$OMP MASTER 1294 CALL reduce_min_mpi(Var_tmp,VarOut) 1295 !$OMP END MASTER 1296 1297 END SUBROUTINE reduce_min_i 1298 1299 1300 SUBROUTINE reduce_min_i1(VarIn, VarOut) 1301 IMPLICIT NONE 1302 1303 INTEGER,INTENT(IN),DIMENSION(:) :: VarIn 1304 INTEGER,INTENT(OUT),DIMENSION(:) :: VarOut 1305 1306 INTEGER,DIMENSION(SIZE(VarIn)) :: Var_tmp 1307 1308 CALL reduce_min_omp(VarIn,Var_tmp) 1309 !$OMP MASTER 1310 CALL reduce_min_mpi(Var_tmp,VarOut) 1311 !$OMP END MASTER 1312 1313 END SUBROUTINE reduce_min_i1 1314 1315 1316 SUBROUTINE reduce_min_i2(VarIn, VarOut) 1317 IMPLICIT NONE 1318 1319 INTEGER,INTENT(IN),DIMENSION(:,:) :: VarIn 1320 INTEGER,INTENT(OUT),DIMENSION(:,:) :: VarOut 1321 1322 INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp 1323 1324 CALL reduce_min_omp(VarIn,Var_tmp) 1325 !$OMP MASTER 1326 CALL reduce_min_mpi(Var_tmp,VarOut) 1327 !$OMP END MASTER 1328 1329 END SUBROUTINE reduce_min_i2 1330 1331 1332 SUBROUTINE reduce_min_i3(VarIn, VarOut) 1333 IMPLICIT NONE 1334 1335 INTEGER,INTENT(IN),DIMENSION(:,:,:) :: VarIn 1336 INTEGER,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 1337 1338 INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp 1339 1340 CALL reduce_min_omp(VarIn,Var_tmp) 1341 !$OMP MASTER 1342 CALL reduce_min_mpi(Var_tmp,VarOut) 1343 !$OMP END MASTER 1344 1345 END SUBROUTINE reduce_min_i3 1346 1347 1348 SUBROUTINE reduce_min_i4(VarIn, VarOut) 1349 IMPLICIT NONE 1350 1351 INTEGER,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 1352 INTEGER,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 1353 1354 INTEGER,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp 1355 1356 CALL reduce_min_omp(VarIn,Var_tmp) 1357 !$OMP MASTER 1358 CALL reduce_min_mpi(Var_tmp,VarOut) 1359 !$OMP END MASTER 1360 1361 END SUBROUTINE reduce_min_i4 1362 1363 1364 ! Les reels 1365 1366 SUBROUTINE reduce_min_r(VarIn, VarOut) 1367 IMPLICIT NONE 1368 1369 REAL,INTENT(IN) :: VarIn 1370 REAL,INTENT(OUT) :: VarOut 1371 1372 REAL :: Var_tmp 1373 1374 CALL reduce_min_omp(VarIn,Var_tmp) 1375 !$OMP MASTER 1376 CALL reduce_min_mpi(Var_tmp,VarOut) 1377 !$OMP END MASTER 1378 1379 END SUBROUTINE reduce_min_r 1380 1381 1382 SUBROUTINE reduce_min_r1(VarIn, VarOut) 1383 IMPLICIT NONE 1384 1385 REAL,INTENT(IN),DIMENSION(:) :: VarIn 1386 REAL,INTENT(OUT),DIMENSION(:) :: VarOut 1387 1388 REAL,DIMENSION(SIZE(VarIn)) :: Var_tmp 1389 1390 CALL reduce_min_omp(VarIn,Var_tmp) 1391 !$OMP MASTER 1392 CALL reduce_min_mpi(Var_tmp,VarOut) 1393 !$OMP END MASTER 1394 1395 END SUBROUTINE reduce_min_r1 1396 1397 1398 SUBROUTINE reduce_min_r2(VarIn, VarOut) 1399 IMPLICIT NONE 1400 1401 REAL,INTENT(IN),DIMENSION(:,:) :: VarIn 1402 REAL,INTENT(OUT),DIMENSION(:,:) :: VarOut 1403 1404 REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2)) :: Var_tmp 1405 1406 CALL reduce_min_omp(VarIn,Var_tmp) 1407 !$OMP MASTER 1408 CALL reduce_min_mpi(Var_tmp,VarOut) 1409 !$OMP END MASTER 1410 1411 END SUBROUTINE reduce_min_r2 1412 1413 1414 SUBROUTINE reduce_min_r3(VarIn, VarOut) 1415 IMPLICIT NONE 1416 1417 REAL,INTENT(IN),DIMENSION(:,:,:) :: VarIn 1418 REAL,INTENT(OUT),DIMENSION(:,:,:) :: VarOut 1419 1420 REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3)) :: Var_tmp 1421 1422 CALL reduce_min_omp(VarIn,Var_tmp) 1423 !$OMP MASTER 1424 CALL reduce_min_mpi(Var_tmp,VarOut) 1425 !$OMP END MASTER 1426 1427 END SUBROUTINE reduce_min_r3 1428 1429 1430 SUBROUTINE reduce_min_r4(VarIn, VarOut) 1431 IMPLICIT NONE 1432 1433 REAL,INTENT(IN),DIMENSION(:,:,:,:) :: VarIn 1434 REAL,INTENT(OUT),DIMENSION(:,:,:,:) :: VarOut 1435 1436 REAL,DIMENSION(SIZE(VarIn,1),SIZE(VarIn,2),SIZE(VarIn,3),SIZE(VarIn,4)) :: Var_tmp 1437 1438 CALL reduce_min_omp(VarIn,Var_tmp) 1439 !$OMP MASTER 1440 CALL reduce_min_mpi(Var_tmp,VarOut) 1441 !$OMP END MASTER 1442 1443 END SUBROUTINE reduce_min_r4 1444 1445 1273 1446 1274 1447 END MODULE mod_phys_lmdz_transfert_para -
LMDZ6/branches/Ocean_skin/libf/phy_common/physics_distribution_mod.F90
r2351 r3605 10 10 nbp, nbp_lon, nbp_lat, nbp_lev, & 11 11 communicator) 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para 12 USE mod_phys_lmdz_para, ONLY: init_phys_lmdz_para, klon_omp 13 13 USE mod_grid_phy_lmdz, ONLY: init_grid_phy_lmdz 14 USE dimphy, ONLY : Init_dimphy 15 USE infotrac_phy, ONLY : type_trac 16 #ifdef REPROBUS 17 USE CHEM_REP, ONLY : Init_chem_rep_phys 18 #endif 19 14 20 IMPLICIT NONE 15 21 INTEGER,INTENT(IN) :: grid_type … … 24 30 CALL init_grid_phy_lmdz(grid_type,nvertex, nbp_lon,nbp_lat,nbp_lev) 25 31 CALL init_phys_lmdz_para(nbp,nbp_lon, nbp_lat, communicator) 32 !$OMP PARALLEL 33 CALL init_dimphy(klon_omp,nbp_lev) 34 35 ! Initialization of Reprobus 36 IF (type_trac == 'repr') THEN 37 #ifdef REPROBUS 38 CALL Init_chem_rep_phys(klon_omp,nbp_lev) 39 #endif 40 END IF 41 42 !$OMP END PARALLEL 26 43 27 44 END SUBROUTINE init_physics_distribution -
LMDZ6/branches/Ocean_skin/libf/phy_common/print_control_mod.F90
r2326 r3605 7 7 !$OMP THREADPRIVATE(lunout,prt_level,debug) 8 8 9 ! NB: Module variable Initializations done by set_print_control 10 ! routine from init_print_control_mod to avoid circular 11 ! module dependencies 12 9 13 CONTAINS 10 14 11 SUBROUTINE init_print_control 12 USE ioipsl_getin_p_mod, ONLY : getin_p 13 USE mod_phys_lmdz_para, ONLY: is_omp_root, is_master 15 SUBROUTINE set_print_control(lunout_,prt_level_,debug_) 14 16 IMPLICIT NONE 15 16 LOGICAL :: opened 17 INTEGER :: number 17 INTEGER :: lunout_ 18 INTEGER :: prt_level_ 19 LOGICAL :: debug_ 20 21 lunout = lunout_ 22 prt_level = prt_level_ 23 debug = debug_ 18 24 19 !Config Key = prt_level 20 !Config Desc = niveau d'impressions de débogage 21 !Config Def = 0 22 !Config Help = Niveau d'impression pour le débogage 23 !Config (0 = minimum d'impression) 24 prt_level = 0 25 CALL getin_p('prt_level',prt_level) 26 27 !Config Key = lunout 28 !Config Desc = unite de fichier pour les impressions 29 !Config Def = 6 30 !Config Help = unite de fichier pour les impressions 31 !Config (defaut sortie standard = 6) 32 lunout=6 33 CALL getin_p('lunout', lunout) 34 35 IF (is_omp_root) THEN 36 IF (lunout /= 5 .and. lunout /= 6) THEN 37 INQUIRE(FILE='lmdz.out_0000',OPENED=opened,NUMBER=number) 38 IF (opened) THEN 39 lunout=number 40 ELSE 41 OPEN(UNIT=lunout,FILE='lmdz.out_0000',ACTION='write', & 42 STATUS='unknown',FORM='formatted') 43 ENDIF 44 ENDIF 45 ENDIF 46 47 !Config Key = debug 48 !Config Desc = mode debogage 49 !Config Def = false 50 !Config Help = positionne le mode debogage 51 52 debug = .FALSE. 53 CALL getin_p('debug',debug) 54 55 IF (is_master) THEN 56 WRITE(lunout,*)"init_print_control: prt_level=",prt_level 57 WRITE(lunout,*)"init_print_control: lunout=",lunout 58 WRITE(lunout,*)"init_print_control: debug=",debug 59 ENDIF 60 61 END SUBROUTINE init_print_control 25 END SUBROUTINE set_print_control 62 26 63 27 END MODULE print_control_mod
Note: See TracChangeset
for help on using the changeset viewer.