Changeset 3465 for LMDZ6/trunk/libf
- Timestamp:
- Mar 14, 2019, 10:34:31 AM (6 years ago)
- Location:
- LMDZ6/trunk/libf
- Files:
-
- 21 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/dynphy_lonlat/phylmd/etat0phys_netcdf.F90
r3435 r3465 40 40 USE phys_state_var_mod, ONLY: zmea, zstd, zsig, zgam, zthe, zpic, zval, z0m, & 41 41 solsw, radsol, t_ancien, wake_deltat, wake_s, rain_fall, qsol, z0h, & 42 sollw, rugoro, q_ancien, wake_deltaq, wake_pe, snow_fall, ratqs,w01, &42 sollw,sollwdown, rugoro, q_ancien, wake_deltaq, wake_pe, snow_fall, ratqs,w01, & 43 43 sig1, ftsol, clwcon, fm_therm, wake_Cstar, pctsrf, entr_therm,radpas, f0,& 44 zmax0,fevap, rnebcon,falb_dir, wake_fip, agesno, detr_therm, pbl_tke, &44 zmax0,fevap, rnebcon,falb_dir, falb_dif, wake_fip, agesno, detr_therm, pbl_tke, & 45 45 phys_state_var_init, ql_ancien, qs_ancien, prlw_ancien, prsw_ancien, & 46 prw_ancien, sollwdown 46 prw_ancien, u10m,v10m, treedrg, u_ancien, v_ancien, wake_delta_pbl_TKE, wake_dens, & 47 ale_bl, ale_bl_trig, alp_bl 47 48 USE comconst_mod, ONLY: pi, dtvr 48 49 … … 194 195 falb_dir(:, :, is_oce) = 0.5 195 196 falb_dir(:, :, is_sic) = 0.6 197 198 !ym warning missing init for falb_dif => set to 0 199 falb_dif(:,:,:)=0 200 201 u10m(:,:)=0 202 v10m(:,:)=0 203 treedrg(:,:,:)=0 204 196 205 fevap(:,:) = 0. 197 206 DO i=1,nbsrf; qsolsrf(:,i)=150.; END DO … … 211 220 prw_ancien = 0. 212 221 agesno = 0. 213 222 223 u_ancien = 0. 224 v_ancien = 0. 225 wake_delta_pbl_TKE(:,:,:)=0 226 wake_dens(:)=0 227 ale_bl = 0. 228 ale_bl_trig =0. 229 alp_bl=0. 230 231 z0m(:,:)=0 ! ym missing 5th subsurface initialization 232 214 233 z0m(:,is_oce) = rugmer(:) 215 234 z0m(:,is_ter) = MAX(1.0e-05,zstd(:)*zsig(:)/2.0) -
LMDZ6/trunk/libf/misc/wxios.F90
r3435 r3465 348 348 INTEGER :: ind_cell_glo_mpi(klon_mpi) 349 349 TYPE(xios_domain) :: dom 350 350 351 LOGICAL :: remap_output 351 352 … … 369 370 IF (remap_output) THEN 370 371 CALL xios_set_domain_attr("dom_out", domain_ref="dom_regular") 371 CALL xios_set_fieldgroup_attr("dom_out", domain_ref="dom_regular")372 372 CALL xios_set_fieldgroup_attr("remap_expr", expr="@this_ref") 373 CALL xios_set_fieldgroup_attr("remap_1800s", freq_op=xios_duration_convert_from_string("1800s")) 374 CALL xios_set_fieldgroup_attr("remap_1h", freq_op=xios_duration_convert_from_string("1h")) 375 CALL xios_set_fieldgroup_attr("remap_3h", freq_op=xios_duration_convert_from_string("3h")) 376 CALL xios_set_fieldgroup_attr("remap_6h", freq_op=xios_duration_convert_from_string("6h")) 377 CALL xios_set_fieldgroup_attr("remap_1d", freq_op=xios_duration_convert_from_string("1d")) 378 CALL xios_set_fieldgroup_attr("remap_1mo", freq_op=xios_duration_convert_from_string("1mo")) 373 379 ENDIF 374 380 !$OMP END MASTER -
LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_mpi_transfert.F90
r2429 r3465 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/trunk/libf/phy_common/mod_phys_lmdz_omp_transfert.F90
r2326 r3465 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/trunk/libf/phy_common/mod_phys_lmdz_para.F90
r3435 r3465 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 -
LMDZ6/trunk/libf/phy_common/mod_phys_lmdz_transfert_para.F90
r2326 r3465 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/trunk/libf/phylmd/atm2geo.F90
r2429 r3465 5 5 USE dimphy 6 6 USE mod_phys_lmdz_para 7 USE mod_grid_phy_lmdz, only: grid_type, unstructured, regular_lonlat 7 8 IMPLICIT NONE 8 9 INCLUDE 'YOMCST.h' 10 11 CHARACTER (len = 6) :: clmodnam 12 CHARACTER (len = 20) :: modname = 'atm2geo' 13 CHARACTER (len = 80) :: abort_message 14 9 15 ! 10 16 ! Change wind local atmospheric coordinates to geocentric 11 17 ! 18 ! Geocentric : 19 ! axe x is eastward : crosses (0 N, 0 E) point. 20 ! axe y crosses (0 N, 90 E) point. 21 ! axe z is 'up' : crosses north pole 12 22 INTEGER, INTENT (in) :: im, jm 13 REAL, DIMENSION (im,jm), INTENT (in) :: pte, ptn 23 REAL, DIMENSION (im,jm), INTENT (in) :: pte ! Eastward vector component 24 REAL, DIMENSION (im,jm), INTENT (in) :: ptn ! Northward vector component 14 25 REAL, DIMENSION (im,jm), INTENT (in) :: plon, plat 15 REAL, DIMENSION (im,jm), INTENT(out) :: pxx, pyy, pzz 16 17 REAL :: rad 18 26 REAL, DIMENSION (im,jm), INTENT(out) :: pxx, pyy, pzz ! Component in the geocentric referential 27 REAL :: rad, reps 19 28 20 29 rad = rpi / 180.0E0 30 reps = 1.0e-5 21 31 22 32 pxx(:,:) = & … … 31 41 + ptn(:,:) * COS(rad * plat (:,:)) 32 42 33 ! Value at North Pole 34 IF (is_north_pole_dyn) THEN 35 pxx(:, 1) = - pte (1, 1) 36 pyy(:, 1) = - ptn (1, 1) 37 pzz(:, 1) = pzz(1,1) 38 ENDIF 43 IF (grid_type==regular_lonlat) THEN 44 ! Value at North Pole 45 IF (is_north_pole_dyn) THEN 46 pxx(:, 1) = - pte (1, 1) 47 pyy(:, 1) = - ptn (1, 1) 48 pzz(:, 1) = pzz(1,1) ! => 0 49 ENDIF 39 50 40 ! Value at South Pole 41 IF (is_south_pole_dyn) THEN 42 pxx(:,jm) = pxx(1,jm) 43 pyy(:,jm) = pyy(1,jm) 44 pzz(:,jm) = pzz(1,jm) 45 ENDIF 51 ! Value at South Pole 52 IF (is_south_pole_dyn) THEN 53 pxx(:,jm) = pxx(1,jm) 54 pyy(:,jm) = pyy(1,jm) 55 pzz(:,jm) = pzz(1,jm) ! => 0 56 ENDIF 57 58 ELSE IF (grid_type==unstructured) THEN 59 ! Pole nord pour Dynamico 60 WHERE ( plat(:,:) >= 90.0d+0-reps ) 61 pxx (:,:) = -ptn (:,:) 62 pyy (:,:) = pte (:,:) 63 pzz (:,:) = 0.0e0 64 END WHERE 65 66 ELSE 67 abort_message='Problem: unknown grid type' 68 CALL abort_physic(modname,abort_message,1) 69 END IF 70 46 71 47 72 END SUBROUTINE atm2geo -
LMDZ6/trunk/libf/phylmd/cpl_mod.F90
r3448 r3465 97 97 !$OMP THREADPRIVATE(cpl_atm_co22D) 98 98 99 !!!!!!!!!! variable for calving 100 INTEGER, PARAMETER :: nb_zone_calving = 3 101 REAL,ALLOCATABLE, DIMENSION(:,:,:),SAVE :: area_calving 102 !$OMP THREADPRIVATE(area_calving) 103 REAL,ALLOCATABLE, DIMENSION(:,:),SAVE :: cell_area2D 104 !$OMP THREADPRIVATE(cell_area2D) 105 INTEGER, SAVE :: ind_calving(nb_zone_calving) 106 !$OMP THREADPRIVATE(ind_calving) 107 108 LOGICAL,SAVE :: cpl_old_calving 109 !$OMP THREADPRIVATE(cpl_old_calving) 110 99 111 CONTAINS 100 112 ! … … 105 117 USE surface_data 106 118 USE indice_sol_mod 107 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid1dTo2d_glo 119 USE mod_grid_phy_lmdz, ONLY : nbp_lon, nbp_lat, grid1dTo2d_glo, klon_glo, grid_type, unstructured, regular_lonlat 108 120 USE time_phylmdz_mod, ONLY: annee_ref, day_ini, itau_phy, itaufin_phy 109 121 USE print_control_mod, ONLY: lunout 122 USE geometry_mod, ONLY : longitude_deg, latitude_deg, ind_cell_glo, cell_area 123 USE ioipsl_getin_p_mod, ONLY: getin_p 110 124 111 125 ! Input arguments … … 127 141 CHARACTER(len = 80) :: abort_message 128 142 CHARACTER(len=80) :: clintocplnam, clfromcplnam 143 REAL, DIMENSION(klon_mpi) :: rlon_mpi, rlat_mpi, cell_area_mpi 144 INTEGER, DIMENSION(klon_mpi) :: ind_cell_glo_mpi 145 REAL, DIMENSION(nbp_lon,jj_nb) :: lon2D, lat2D 146 INTEGER :: mask_calving(nbp_lon,jj_nb,nb_zone_calving) 147 REAL :: pos 148 149 !*************************************** 150 ! Use old calving or not (default no) 151 cpl_old_calving=.FALSE. 152 CALL getin_p("cpl_old_calving",cpl_old_calving) 153 129 154 130 155 !************************************************************************************* … … 208 233 ENDIF 209 234 235 ! calving initialization 236 ALLOCATE(area_calving(nbp_lon, jj_nb, nb_zone_calving), stat = error) 237 sum_error = sum_error + error 238 ALLOCATE(cell_area2D(nbp_lon, jj_nb), stat = error) 239 sum_error = sum_error + error 240 241 242 CALL gather_omp(longitude_deg,rlon_mpi) 243 CALL gather_omp(latitude_deg,rlat_mpi) 244 CALL gather_omp(ind_cell_glo,ind_cell_glo_mpi) 245 CALL gather_omp(cell_area,cell_area_mpi) 246 247 IF (is_omp_master) THEN 248 CALL Grid1DTo2D_mpi(rlon_mpi,lon2D) 249 CALL Grid1DTo2D_mpi(rlat_mpi,lat2D) 250 CALL Grid1DTo2D_mpi(cell_area_mpi,cell_area2D) 251 mask_calving(:,:,:) = 0 252 WHERE ( lat2D >= 40) mask_calving(:,:,1) = 1 253 WHERE ( lat2D < 40 .AND. lat2D > -50) mask_calving(:,:,2) = 1 254 WHERE ( lat2D <= -50) mask_calving(:,:,3) = 1 255 256 257 DO i=1,nb_zone_calving 258 area_calving(:,:,i)=mask_calving(:,:,i)*cell_area2D(:,:) 259 pos=1 260 IF (i>1) pos = 1 + ((nbp_lon*nbp_lat-1)*(i-1))/(nb_zone_calving-1) 261 262 ind_calving(i)=0 263 IF (grid_type==unstructured) THEN 264 265 DO ig=1,klon_mpi 266 IF (ind_cell_glo_mpi(ig)==pos) ind_calving(i)=ig 267 ENDDO 268 269 ELSE IF (grid_type==regular_lonlat) THEN 270 IF ((ij_begin<=pos .AND. ij_end>=pos) .OR. (ij_begin<=pos .AND. is_south_pole_dyn )) THEN 271 ind_calving(i)=pos-(jj_begin-1)*nbp_lon 272 ENDIF 273 ENDIF 274 275 ENDDO 276 ENDIF 277 278 210 279 IF (sum_error /= 0) THEN 211 280 abort_message='Pb allocation variables couplees' … … 1086 1155 ! Local variables 1087 1156 !************************************************************************************* 1088 INTEGER :: error, sum_error, j1157 INTEGER :: error, sum_error, i,j,k 1089 1158 INTEGER :: itau_w 1090 1159 INTEGER :: time_sec … … 1103 1172 ! Table with all fields to send to coupler 1104 1173 REAL, DIMENSION(nbp_lon, jj_nb, maxsend) :: tab_flds 1105 REAL, DIMENSION(klon_mpi) :: rlon_mpi, rlat_mpi 1106 1174 REAL, DIMENSION(klon_mpi) :: rlon_mpi, rlat_mpi 1175 REAL :: calving(nb_zone_calving) 1176 REAL :: calving_glo(nb_zone_calving) 1177 1107 1178 #ifdef CPP_MPI 1108 1179 INCLUDE 'mpif.h' … … 1131 1202 1132 1203 IF (version_ocean=='nemo') THEN 1133 tab_flds(:,:,ids_liqrun) = cpl_rriv2D(:,:) + cpl_rcoa2D(:,:)1204 tab_flds(:,:,ids_liqrun) = (cpl_rriv2D(:,:) + cpl_rcoa2D(:,:)) 1134 1205 IF (carbon_cycle_cpl) tab_flds(:,:,ids_atmco2)=cpl_atm_co22D(:,:) 1135 1206 ELSE IF (version_ocean=='opa8') THEN … … 1158 1229 !************************************************************************************* 1159 1230 IF (is_omp_root) THEN 1231 1232 IF (cpl_old_calving) THEN ! use old calving 1160 1233 1161 1234 DO j = 1, jj_nb … … 1190 1263 ENDIF 1191 1264 ENDIF 1265 tab_flds(:,:,ids_calvin) = tmp_calv(:,:) 1266 1267 ENDIF 1268 1269 DO k=1,nb_zone_calving 1270 calving(k)=0 1271 DO j = 1, jj_nb 1272 calving(k)= calving(k)+DOT_PRODUCT(cpl_rlic2D(:,j)*area_calving(:,j,k),pctsrf2D(:,j,is_lic)) 1273 ENDDO 1274 ENDDO 1192 1275 1193 tab_flds(:,:,ids_calvin) = tmp_calv(:,:) 1276 CALL MPI_ALLREDUCE(calving, calving_glo, nb_zone_calving, MPI_REAL_LMDZ, MPI_SUM, COMM_LMDZ_PHY, error) 1277 1278 tab_flds(:,:,ids_calvin) = 0 1279 DO k=1,nb_zone_calving 1280 IF (ind_calving(k)>0 ) THEN 1281 j=(ind_calving(k)-1)/nbp_lon + 1 1282 i=MOD(ind_calving(k)-1,nbp_lon)+1 1283 tab_flds(i,j,ids_calvin) = calving_glo(k) 1284 ENDIF 1285 ENDDO 1194 1286 1195 1287 !************************************************************************************* -
LMDZ6/trunk/libf/phylmd/create_etat0_limit_unstruct.F90
r3436 r3465 16 16 USE ioipsl, ONLY : getin, ioget_year_len 17 17 USE time_phylmdz_mod, ONLY : annee_ref 18 USE create_etat0_unstruct_mod 18 19 IMPLICIT NONE 19 20 … … 43 44 ENDIF 44 45 IF (is_omp_master) CALL xios_set_file_attr("limit_write",enabled=.TRUE.) 46 CALL init_create_etat0_unstruct 45 47 ENDIF 46 48 -
LMDZ6/trunk/libf/phylmd/create_etat0_unstruct.F90
r3435 r3465 7 7 8 8 CONTAINS 9 9 10 SUBROUTINE init_create_etat0_unstruct 11 USE xios 12 USE netcdf 13 USE mod_phys_lmdz_para 14 IMPLICIT NONE 15 INTEGER :: file_id, iret 16 17 ! for coupling activate ocean fraction reading from file "ocean_fraction.nc" 18 IF (is_omp_master) THEN 19 IF(NF90_OPEN("ocean_fraction.nc", NF90_NOWRITE, file_id)==NF90_NOERR) THEN 20 CALL xios_set_file_attr("frac_ocean",enabled=.TRUE.) 21 CALL xios_set_field_attr("mask",field_ref="frac_ocean_read") 22 iret=NF90_CLOSE(file_id) 23 ENDIF 24 ENDIF 25 26 END SUBROUTINE init_create_etat0_unstruct 27 28 10 29 SUBROUTINE create_etat0_unstruct 11 30 USE dimphy … … 18 37 USE indice_sol_mod 19 38 USE mod_phys_lmdz_para 39 USE print_control_mod, ONLY: lunout 40 USE geometry_mod 41 USE ioipsl_getin_p_mod, ONLY: getin_p 42 20 43 IMPLICIT NONE 21 44 INCLUDE 'dimsoil.h' 22 45 46 LOGICAL :: no_ter_antartique ! If true, no land points are allowed at Antartic 23 47 REAL, DIMENSION(klon) :: tsol 24 48 REAL, DIMENSION(klon) :: sn … … 33 57 REAL, DIMENSION(klon_mpi) :: tsol_mpi, qsol_mpi, zmasq_mpi, lic_mpi 34 58 REAL, DIMENSION(klon_mpi) :: zmea_mpi, zstd_mpi, zsig_mpi, zgam_mpi, zthe_mpi 59 REAL, DIMENSION(klon_mpi) :: cell_area_mpi 60 REAL, DIMENSION(klon_mpi,nbsrf) :: pctsrf_mpi 35 61 36 62 INTEGER :: ji,j,i … … 88 114 END IF 89 115 END DO 116 117 118 !--- Option no_ter_antartique removes all land fractions souther than 60S. 119 !--- Land ice is set instead of the land fractions on these latitudes. 120 !--- The ocean and sea-ice fractions are not changed. 121 no_ter_antartique=.FALSE. 122 CALL getin_p('no_ter_antartique',no_ter_antartique) 123 WRITE(lunout,*)"no_ter_antartique=",no_ter_antartique 124 IF (no_ter_antartique) THEN 125 ! Remove all land fractions souther than 60S and set land-ice instead 126 WRITE(lunout,*) "Remove land fractions souther than 60deg south by increasing" 127 WRITE(lunout,*) "the continental ice fractions. No land can now be found at Antartic." 128 DO ji=1, klon 129 IF (latitude_deg(ji)<-60.0) THEN 130 pctsrf(ji,is_lic) = pctsrf(ji,is_lic) + pctsrf(ji,is_ter) 131 pctsrf(ji,is_ter) = 0 132 END IF 133 END DO 134 END IF 90 135 91 136 ! sub-surface ocean and sea ice (sea ice set to zero for start) … … 182 227 CALL fonte_neige_init(run_off_lic_0) 183 228 CALL pbl_surface_init( fder, snsrf, qsolsrf, tsoil ) 229 230 CALL gather_omp(cell_area,cell_area_mpi) 231 CALL gather_omp(pctsrf,pctsrf_mpi) 232 IF (is_omp_master) THEN 233 CALL xios_send_field("area_ce0l",cell_area_mpi) 234 CALL xios_send_field("fract_oce_ce0l",pctsrf_mpi(:,is_oce)) 235 CALL xios_send_field("fract_sic_ce0l",pctsrf_mpi(:,is_sic)) 236 ENDIF 237 184 238 CALL phyredem( "startphy.nc" ) 185 239 -
LMDZ6/trunk/libf/phylmd/geo2atm.F90
r2429 r3465 5 5 USE dimphy 6 6 USE mod_phys_lmdz_para 7 7 USE mod_grid_phy_lmdz, only: grid_type, unstructured, regular_lonlat 8 8 IMPLICIT NONE 9 9 INCLUDE 'YOMCST.h' 10 CHARACTER (len = 6) :: clmodnam 11 CHARACTER (len = 20) :: modname = 'geo2atm' 12 CHARACTER (len = 80) :: abort_message 10 13 11 14 ! Change wind coordinates from cartesian geocentric to local spherical 12 15 ! NB! Fonctionne probablement uniquement en MPI seul (sans OpenMP) 13 16 ! 17 ! Geocentric : 18 ! axe x is eastward : crosses (0N,90E) point. 19 ! axe y crosses (0N,180E) point. 20 ! axe z is 'up' : crosses north pole. 21 ! 22 ! NB! Aux poles, fonctionne probablement uniquement en MPI seul (sans OpenMP) 23 14 24 INTEGER, INTENT (IN) :: im, jm 15 25 REAL, DIMENSION (im,jm), INTENT(IN) :: px, py, pz … … 17 27 REAL, DIMENSION (im,jm), INTENT(OUT) :: pu, pv, pr 18 28 19 REAL :: rad 29 REAL :: rad,reps 20 30 21 31 22 32 rad = rpi / 180.0E0 23 33 reps = 1.0e-5 34 24 35 pu(:,:) = & 25 36 - px(:,:) * SIN(rad * plon(:,:)) & … … 36 47 + pz(:,:) * SIN(rad * plat(:,:)) 37 48 38 ! Value at North Pole 39 IF (is_north_pole_dyn) THEN 40 pu(:, 1) = -px (1,1) 41 pv(:, 1) = -py (1,1) 42 pr(:, 1) = 0.0 43 ENDIF 49 IF (grid_type==regular_lonlat) THEN 50 ! Value at North Pole 51 IF (is_north_pole_dyn) THEN 52 pu(:, 1) = -px (1,1) 53 pv(:, 1) = -py (1,1) 54 pr(:, 1) = 0.0 55 ENDIF 44 56 45 ! Value at South Pole 46 IF (is_south_pole_dyn) THEN 47 pu(:,jm) = -px (1,jm) 48 pv(:,jm) = -py (1,jm) 49 pr(:,jm) = 0.0 50 ENDIF 57 ! Value at South Pole 58 IF (is_south_pole_dyn) THEN 59 pu(:,jm) = -px (1,jm) 60 pv(:,jm) = -py (1,jm) 61 pr(:,jm) = 0.0 62 ENDIF 63 64 ELSE IF (grid_type==unstructured) THEN 65 ! Pole nord pour Dynamico 66 WHERE ( plat(:,:) >= 90.0-reps ) 67 pu(:,:) = py(:,:) 68 pv(:,:) = -px(:,:) 69 pr(:,:) = 0.0e0 70 END WHERE 71 72 ELSE 73 abort_message='Problem: unknown grid type' 74 CALL abort_physic(modname,abort_message,1) 75 END IF 76 77 78 51 79 52 80 END SUBROUTINE geo2atm -
LMDZ6/trunk/libf/phylmd/iophy.F90
r3457 r3465 49 49 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, klon_glo, grid_type, unstructured 50 50 USE print_control_mod, ONLY: prt_level,lunout 51 USE surface_data, ONLY : type_ocean52 51 #ifdef CPP_IOIPSL 53 52 USE ioipsl, ONLY: flio_dom_set … … 74 73 75 74 #ifdef CPP_XIOS 76 IF ( type_ocean /= 'couple' ) THEN77 75 CALL wxios_context_init 78 ENDIF79 76 #endif 80 77 -
LMDZ6/trunk/libf/phylmd/iostart.F90
r3435 r3465 126 126 LOGICAL,OPTIONAL :: found 127 127 128 REAL :: field_glo(klon_glo,field_size)129 REAL :: field_glo_tmp(klon_glo,field_size)130 INTEGER :: ind_cell_glo_glo(klon_glo)128 REAL,ALLOCATABLE :: field_glo(:,:) 129 REAL,ALLOCATABLE :: field_glo_tmp(:,:) 130 INTEGER,ALLOCATABLE :: ind_cell_glo_glo(:) 131 131 LOGICAL :: tmp_found 132 132 INTEGER :: varid 133 133 INTEGER :: ierr,i 134 134 135 ! IF (is_master) ALLOCATE(ind_cell_glo_glo(1:klon_glo)) 135 IF (is_master) THEN 136 ALLOCATE(ind_cell_glo_glo(klon_glo)) 137 ALLOCATE(field_glo(klon_glo,field_size)) 138 ALLOCATE(field_glo_tmp(klon_glo,field_size)) 139 ELSE 140 ALLOCATE(ind_cell_glo_glo(0)) 141 ALLOCATE(field_glo(0,0)) 142 ENDIF 143 136 144 CALL gather(ind_cell_glo,ind_cell_glo_glo) 137 145 -
LMDZ6/trunk/libf/phylmd/oasis.F90
r3102 r3465 104 104 #ifdef CPP_XIOS 105 105 USE wxios, ONLY : wxios_context_init 106 USE xios 106 107 #endif 107 108 USE print_control_mod, ONLY: lunout 108 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat 109 USE mod_grid_phy_lmdz, ONLY: nbp_lon, nbp_lat, grid_type, unstructured, regular_lonlat 110 USE geometry_mod, ONLY: ind_cell_glo 111 USE mod_phys_lmdz_mpi_data, ONLY: klon_mpi_para_nb 112 113 109 114 110 115 ! Local variables … … 113 118 INTEGER :: ierror, il_commlocal 114 119 INTEGER :: il_part_id 115 INTEGER, DIMENSION(3) :: ig_paral120 INTEGER, ALLOCATABLE :: ig_paral(:) 116 121 INTEGER, DIMENSION(2) :: il_var_nodims 117 122 INTEGER, DIMENSION(4) :: il_var_actual_shape … … 136 141 ! Define the model name 137 142 ! 138 clmodnam = 'LMDZ' ! as in $NBMODEL in Cpl/Nam/namcouple.tmp 143 IF (grid_type==unstructured) THEN 144 clmodnam = 'icosa' ! as in $NBMODEL in Cpl/Nam/namcouple.tmp 145 ELSE IF (grid_type==regular_lonlat) THEN 146 clmodnam = 'LMDZ' ! as in $NBMODEL in Cpl/Nam/namcouple.tmp 147 ELSE 148 abort_message='Pb : type of grid unknown' 149 CALL abort_physic(modname,abort_message,1) 150 ENDIF 139 151 140 152 … … 236 248 ! Domain decomposition 237 249 !************************************************************************************ 238 ig_paral(1) = 1 ! apple partition for // 239 ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1 ! offset 240 ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1 241 242 IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1 250 IF (grid_type==unstructured) THEN 251 252 ALLOCATE( ig_paral(klon_mpi_para_nb(mpi_rank) + 2) ) 253 254 ig_paral(1) = 4 ! points partition for // 255 ig_paral(2) = klon_mpi_para_nb(mpi_rank) ! nb of local cells 256 257 DO jf=1, klon_mpi_para_nb(mpi_rank) 258 ig_paral(2+jf) = ind_cell_glo(jf) 259 ENDDO 260 261 ELSE IF (grid_type==regular_lonlat) THEN 262 263 ALLOCATE( ig_paral(3) ) 264 265 ig_paral(1) = 1 ! apple partition for // 266 ig_paral(2) = (jj_begin-1)*nbp_lon+ii_begin-1 ! offset 267 ig_paral(3) = (jj_end*nbp_lon+ii_end) - (jj_begin*nbp_lon+ii_begin) + 1 268 269 IF (mpi_rank==mpi_size-1) ig_paral(3)=ig_paral(3)+nbp_lon-1 270 ELSE 271 abort_message='Pb : type of grid unknown' 272 CALL abort_physic(modname,abort_message,1) 273 ENDIF 274 275 243 276 WRITE(lunout,*) mpi_rank,'ig_paral--->',ig_paral(2),ig_paral(3) 244 277 … … 253 286 ENDIF 254 287 255 il_var_nodims(1) = 2 256 il_var_nodims(2) = 1 257 258 il_var_actual_shape(1) = 1 259 il_var_actual_shape(2) = nbp_lon 260 il_var_actual_shape(3) = 1 261 il_var_actual_shape(4) = nbp_lat 288 il_var_nodims(1) = 2 ! rank of field array (1d or 2d) 289 il_var_nodims(2) = 1 ! always 1 in current oasis version" doc oasis3mct p18 290 291 il_var_actual_shape(1) = 1 ! min of 1st dimension (always 1) 292 il_var_actual_shape(2) = nbp_lon ! max of 1st dimension 293 il_var_actual_shape(3) = 1 ! min of 2nd dimension (always 1) 294 il_var_actual_shape(4) = nbp_lat ! max of 2nd dimension 262 295 263 296 il_var_type = PRISM_Real … … 302 335 ! End definition 303 336 !************************************************************************************ 337 #ifdef CPP_XIOS 338 CALL xios_oasis_enddef() 339 #endif 304 340 CALL prism_enddef_proto(ierror) 305 341 IF (ierror .NE. PRISM_Ok) THEN … … 311 347 312 348 #ifdef CPP_XIOS 313 CALL wxios_context_init()349 ! CALL wxios_context_init() 314 350 #endif 315 351 -
LMDZ6/trunk/libf/phylmd/phyetat0.F90
r3462 r3465 524 524 ENDIF 525 525 526 ! FH: Called outside phyetat0527 526 ! CALL init_iophy_new(latitude_deg, longitude_deg) 528 527 -
LMDZ6/trunk/libf/phylmd/physiq_mod.F90
r3462 r3465 243 243 #endif 244 244 USE indice_sol_mod 245 USE phytrac_mod, ONLY : phytrac 245 USE phytrac_mod, ONLY : phytrac_init, phytrac 246 246 USE carbon_cycle_mod, ONLY : infocfields_init, RCO2_glo, carbon_cycle_rad 247 247 … … 1488 1488 ENDIF 1489 1489 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1490 IF (grid_type/=unstructured)CALL init_iophy_new(latitude_deg,longitude_deg)1490 CALL init_iophy_new(latitude_deg,longitude_deg) 1491 1491 1492 1492 !=================================================================== … … 1581 1581 CALL init_readaerosolstrato(flag_aerosol_strat) !! initialise aero strato from file for XIOS interpolation (unstructured_grid) 1582 1582 1583 IF(read_climoz>=1 .AND. create_etat0_limit .AND. grid_type==unstructured) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz)1584 CALL create_etat0_limit_unstruct1585 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0)1586 IF (grid_type==unstructured) CALL init_iophy_new(latitude_deg,longitude_deg)1587 1588 !jyg<1589 IF (klon_glo==1) THEN1590 IF (iflag_pbl > 1) THEN1591 pbl_tke(:,:,is_ave) = 0.1592 DO nsrf=1,nbsrf1593 DO k = 1,klev+11594 pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) &1595 +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf)1596 ENDDO1597 ENDDO1598 ELSE ! (iflag_pbl > 1)1599 pbl_tke(:,:,:) = 0.1600 ENDIF ! (iflag_pbl > 1)1601 ELSE1602 pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ??1603 !>jyg1604 ENDIF1605 1583 #ifdef CPP_COSP 1606 1607 1584 IF (ok_cosp) THEN 1608 1585 CALL phys_cosp(itap,phys_tstep,freq_cosp, & 1609 1586 ok_mensuelCOSP,ok_journeCOSP,ok_hfCOSP, & 1610 1587 ecrit_mth,ecrit_day,ecrit_hf, ok_all_xml, missing_val, & … … 1620 1597 ENDIF 1621 1598 #endif 1622 1623 ! 1624 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!1599 ! 1600 ! 1601 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1625 1602 ! Nouvelle initialisation pour le rayonnement RRTM 1626 ! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1603 ! 1604 !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! 1627 1605 1628 1606 CALL iniradia(klon,klev,paprs(1,1:klev+1)) 1629 1607 ! Initialisation des champs dans phytrac qui sont utilisés par phys_output_write 1608 IF (iflag_phytrac == 1 ) THEN 1609 CALL phytrac_init() 1610 ENDIF 1611 1612 CALL phys_output_write(itap, pdtphys, paprs, pphis, & 1613 pplay, lmax_th, aerosol_couple, & 1614 ok_ade, ok_aie, ivap, iliq, isol, new_aod, ok_sync,& 1615 ptconv, read_climoz, clevSTD, & 1616 ptconvth, d_u, d_t, qx, d_qx, zmasse, & 1617 flag_aerosol, flag_aerosol_strat, ok_cdnc) 1630 1618 1631 1619 #ifdef CPP_XIOS 1632 1620 IF (is_omp_master) CALL xios_update_calendar(1) 1633 1621 #endif 1634 1622 IF(read_climoz>=1 .AND. create_etat0_limit) CALL regr_horiz_time_climoz(read_climoz,ok_daily_climoz) 1623 CALL create_etat0_limit_unstruct 1624 CALL phyetat0 ("startphy.nc",clesphy0,tabcntr0) 1625 1626 !jyg< 1627 IF (klon_glo==1) THEN 1628 pbl_tke(:,:,is_ave) = 0. 1629 DO nsrf=1,nbsrf 1630 DO k = 1,klev+1 1631 pbl_tke(:,k,is_ave) = pbl_tke(:,k,is_ave) & 1632 +pctsrf(:,nsrf)*pbl_tke(:,k,nsrf) 1633 ENDDO 1634 ENDDO 1635 ELSE 1636 pbl_tke(:,:,is_ave) = 0. !ym missing init : maybe must be initialized in the same way that for klon_glo==1 ?? 1637 !>jyg 1638 ENDIF 1635 1639 !IM begin 1636 1640 print*,'physiq: clwcon rnebcon ratqs',clwcon(1,1),rnebcon(1,1) & … … 1778 1782 tave = 'ave(X)' 1779 1783 !IM cf. AM 081204 BEG 1784 write(lunout,*)'AVANT HIST IFLAG_CON=',iflag_con 1780 1785 !IM cf. AM 081204 END 1781 1786 ! … … 1783 1788 ! Initialisation des sorties 1784 1789 !============================================================= 1785 1786 CALL phys_output_write(itap, pdtphys, paprs, pphis, &1787 pplay, lmax_th, aerosol_couple, &1788 ok_ade, ok_aie, ivap, iliq, isol, new_aod, ok_sync,&1789 ptconv, read_climoz, clevSTD, &1790 ptconvth, d_u, d_t, qx, d_qx, zmasse, &1791 flag_aerosol, flag_aerosol_strat, ok_cdnc)1792 1790 1793 1791 #ifdef CPP_XIOS … … 1874 1872 #endif 1875 1873 ENDIF 1874 1876 1875 !$omp single 1877 1876 IF (read_climoz >= 1) CALL open_climoz(ncid_climoz, press_cen_climoz, & -
LMDZ6/trunk/libf/phylmd/phytrac_mod.F90
r3450 r3465 53 53 54 54 CONTAINS 55 56 SUBROUTINE phytrac_init() 57 USE dimphy 58 USE infotrac_phy, ONLY: nbtr 59 IMPLICIT NONE 60 61 ALLOCATE(d_tr_cl(klon,klev,nbtr),d_tr_dry(klon,nbtr)) 62 ALLOCATE(flux_tr_dry(klon,nbtr),d_tr_dec(klon,klev,nbtr),d_tr_cv(klon,klev,nbtr)) 63 ALLOCATE(d_tr_insc(klon,klev,nbtr),d_tr_bcscav(klon,klev,nbtr)) 64 ALLOCATE(d_tr_evapls(klon,klev,nbtr),d_tr_ls(klon,klev,nbtr)) 65 ALLOCATE(qPrls(klon,nbtr),d_tr_trsp(klon,klev,nbtr)) 66 ALLOCATE(d_tr_sscav(klon,klev,nbtr),d_tr_sat(klon,klev,nbtr)) 67 ALLOCATE(d_tr_uscav(klon,klev,nbtr),qPr(klon,klev,nbtr),qDi(klon,klev,nbtr)) 68 ALLOCATE(qPa(klon,klev,nbtr),qMel(klon,klev,nbtr)) 69 ALLOCATE(qTrdi(klon,klev,nbtr),dtrcvMA(klon,klev,nbtr)) 70 ALLOCATE(d_tr_th(klon,klev,nbtr)) 71 ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr),d_tr_lessi_nucl(klon,klev,nbtr)) 72 73 END SUBROUTINE phytrac_init 55 74 56 75 SUBROUTINE phytrac( & -
LMDZ6/trunk/libf/phylmd/radlwsw_m.F90
r3435 r3465 403 403 zsolsw_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 404 404 zsolsw0_aero(:,:) = 0. !ym missing init : warning : not initialized in SW_AEROAR4 405 405 406 407 ZTOPSWADAERO(:) = 0. !ym missing init 408 ZSOLSWADAERO(:) = 0. !ym missing init 409 ZTOPSWAD0AERO(:) = 0. !ym missing init 410 ZSOLSWAD0AERO(:) = 0. !ym missing init 411 ZTOPSWAIAERO(:) = 0. !ym missing init 412 ZSOLSWAIAERO(:) = 0. !ym missing init 413 ZTOPSWCF_AERO(:,:)= 0.!ym missing init 414 ZSOLSWCF_AERO(:,:) =0. !ym missing init 415 406 416 ! 407 417 !------------------------------------------- -
LMDZ6/trunk/libf/phylmd/regr_horiz_time_climoz_m.F90
r3436 r3465 218 218 END DO 219 219 220 !--- Ensure first input longitudes interval contains first output point boundslon_reg(1,west) 221 dx1=locate(v1,boundslon_reg(1,west))-1 222 v1=CSHIFT(v1,SHIFT=dx1,DIM=1); v1(nlon_in-dx1+2:)=v1(nlon_in-dx1+2:)+2.*pi 223 !--- Extend input longitudes vector until last interval contains boundslon_reg(nlon_ou,east) 224 dx2=0; DO WHILE(v1(1+dx2)+2.*pi<=boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO 225 220 !--- Prepare quantities for time interpolation 221 tmidmonth=mid_month(annee_ref, cal_in) 222 IF(interpt) THEN 223 ntim_ou=ioget_year_len(annee_ref) 224 ALLOCATE(tmidday(ntim_ou)) 225 tmidday=[(REAL(k)-0.5,k=1,ntim_ou)] 226 CALL ioget_calendar(cal_ou) 227 ELSE 228 ntim_ou=14 229 cal_ou=cal_in 230 END IF 231 ENDIF 232 233 IF (grid_type==unstructured) THEN 234 CALL bcast_mpi(nlon_in) 235 CALL bcast_mpi(nlat_in) 236 CALL bcast_mpi(nlev_in) 237 CALL bcast_mpi(l3d) 238 CALL bcast_mpi(tmidmonth) 239 CALL bcast_mpi(tmidday) 240 CALL bcast_mpi(ntim_ou) 241 242 #ifdef CPP_XIOS 243 IF (is_mpi_root) THEN 244 CALL xios_set_domain_attr("domain_climoz",nj_glo=nlat_in, nj=nlat_in, jbegin=0, latvalue_1d=lat_in/deg2rad) 245 IF (l3D) THEN 246 CALL xios_set_domain_attr("domain_climoz",ni_glo=nlon_in, ni=nlon_in, ibegin=0, lonvalue_1d=lon_in/deg2rad) 247 ELSE 248 CALL xios_set_domain_attr("domain_climoz",ni_glo=8, ni=8, ibegin=0, lonvalue_1d = (/ 0.,45.,90.,135.,180.,225.,270., 315. /)) 249 ENDIF 250 ELSE 251 CALL xios_set_domain_attr("domain_climoz",nj_glo=nlat_in, nj=0, jbegin=0, latvalue_1d=null_array ) 252 IF (l3D) THEN 253 CALL xios_set_domain_attr("domain_climoz",ni_glo=nlon_in, ni=0, ibegin=0, lonvalue_1d=null_array) 254 ELSE 255 CALL xios_set_domain_attr("domain_climoz",ni_glo=8, ni=0, ibegin=0, lonvalue_1d=null_array) 256 ENDIF 257 ENDIF 258 CALL xios_set_axis_attr("axis_climoz", n_glo=nlev_in) 259 CALL xios_set_axis_attr("time_axis_climoz", n_glo=ntim_ou) 260 CALL xios_set_axis_attr("time_axis_climoz", n_glo=ntim_ou) 261 CALL xios_set_axis_attr("tr_climoz", n_glo=read_climoz) 262 CALL xios_set_field_attr("tro3_out", enabled=.TRUE.) 263 CALL xios_set_field_attr("tro3_out", enabled=.TRUE.) 264 #endif 265 226 266 IF (first) THEN 227 267 first=.FALSE. … … 254 294 dx1=locate(v1,boundslon_reg(1,west))-1 255 295 v1=CSHIFT(v1,SHIFT=dx1,DIM=1) 256 v1(nlon_in-dx1+ 1:)=v1(nlon_in-dx1+1:)+2.*pi296 v1(nlon_in-dx1+2:)=v1(nlon_in-dx1+2:)+2.*pi 257 297 258 298 !--- Extend input longitudes vector until last interval contains boundslon_reg(nlat_ou,east) 259 dx2=0; DO WHILE(v1(1+dx2)+2.*pi< boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO299 dx2=0; DO WHILE(v1(1+dx2)+2.*pi<=boundslon_reg(nlon_ou,east)); dx2=dx2+1; END DO 260 300 261 301 !--- Final edges longitudes vector (with margin and end point) -
LMDZ6/trunk/libf/phylmd/rrtm/readaerosolstrato2_rrtm.F90
r3438 r3465 318 318 CALL scatter(cgaerstrat_mois_glo,cg_aer_strat) 319 319 CALL scatter(taulwaerstrat_mois_glo,taulw_aer_strat) 320 IF (is_mpi_root.AND.is_omp_root) DEALLOCATE(tauaerstrat_mois, pizaerstrat_mois, cgaerstrat_mois, taulwaerstrat_mois) 320 321 321 322 ENDIF 322 323 323 324 IF (is_mpi_root.AND.is_omp_root) THEN 324 DEALLOCATE(tauaerstrat_mois, pizaerstrat_mois, cgaerstrat_mois)325 DEALLOCATE(taulwaerstrat_mois)326 325 DEALLOCATE(tauaerstrat, pizaerstrat, cgaerstrat,taulwaerstrat) 327 326 ENDIF -
LMDZ6/trunk/libf/phylmd/surf_land_orchidee_mod.F90
r3435 r3465 579 579 ! swdown_vrai(1:knon) = swnet(1:knon)/(1. - albedo_keep(1:knon)) 580 580 swdown_vrai(1:knon) = swdown(1:knon) 581 !$OMP BARRIER 581 582 582 583 IF (knon > 0) THEN
Note: See TracChangeset
for help on using the changeset viewer.