Changeset 3391 for LMDZ6/trunk
- Timestamp:
- Sep 16, 2018, 5:52:25 PM (6 years ago)
- Location:
- LMDZ6/trunk/libf/phylmd
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/carbon_cycle_mod.F90
r3390 r3391 84 84 !$OMP THREADPRIVATE(fco2_lu_inst) 85 85 86 ! Following 4 fields will be allocated and initialized in surf_land_orchidee87 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fCO2_nbp_inst ! flux CO2 from land at one time step88 !$OMP THREADPRIVATE(fCO2_nbp_inst)89 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fCO2_nep_inst ! flux CO2 from land at one time step90 !$OMP THREADPRIVATE(fCO2_nep_inst)91 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fCO2_fLuc_inst ! Emission from land use change at one time step92 !$OMP THREADPRIVATE(fCO2_fLuc_inst)93 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fCO2_fFire_inst ! flux CO2 from land at one time step94 !$OMP THREADPRIVATE(fCO2_fFire_inst)95 96 97 86 ! Calculated co2 field to be send to the ocean via the coupler and to ORCHIDEE 98 87 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: co2_send ! Field allocated in phyetat0 … … 155 144 !$OMP THREADPRIVATE(cfmod2) 156 145 157 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: zcfields_in 158 !$OMP THREADPRIVATE(zcfields_in) 159 160 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: zcfields_out 161 !$OMP THREADPRIVATE(zcfields_out) 146 CHARACTER(LEN=20), ALLOCATABLE, DIMENSION(:), PUBLIC :: field_out_names 147 !$OMP THREADPRIVATE(field_out_names) 148 149 CHARACTER(LEN=20), ALLOCATABLE, DIMENSION(:), PUBLIC :: field_in_names 150 !$OMP THREADPRIVATE(field_in_names) 151 152 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: fields_in ! klon,nbcf_in 153 !$OMP THREADPRIVATE(fields_in) 154 155 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: yfields_in ! knon,nbcf_in 156 !$OMP THREADPRIVATE(yfields_in) 157 158 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: fields_out ! klon,nbcf_out 159 !$OMP THREADPRIVATE(fields_out) 160 161 REAL, ALLOCATABLE, DIMENSION(:,:), PUBLIC :: yfields_out ! knon,nbcf_out 162 !$OMP THREADPRIVATE(yfields_out) 162 163 163 164 TYPE, PUBLIC :: co2_trac_type … … 830 831 ENDIF ! planet_type 831 832 832 ALLOCATE(zcfields_in(klon,nbcf_in),stat=error) 833 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation zcfields_in',1) 834 ALLOCATE(zcfields_out(klon,nbcf_out),stat=error) 835 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation zcfields_out',1) 833 ALLOCATE(fields_in(klon,nbcf_in),stat=error) 834 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation fields_in',1) 835 ALLOCATE(yfields_in(klon,nbcf_in),stat=error) 836 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation yfields_in',1) 837 ALLOCATE(fields_out(klon,nbcf_out),stat=error) 838 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation fields_out',1) 839 ALLOCATE(yfields_out(klon,nbcf_out),stat=error) 840 IF (error /= 0) CALL abort_gcm(modname,'Pb in allocation yfields_out',1) 836 841 837 842 END SUBROUTINE infocfields_init -
LMDZ6/trunk/libf/phylmd/pbl_surface_mod.F90
r3198 r3391 40 40 !$OMP THREADPRIVATE(ftsoil) 41 41 42 integer, save:: iflag_pbl_surface_t2m_bug42 INTEGER, SAVE :: iflag_pbl_surface_t2m_bug 43 43 !$OMP THREADPRIVATE(iflag_pbl_surface_t2m_bug) 44 44 !FC … … 68 68 REAL, DIMENSION(klon, nbsrf), INTENT(IN) :: qsurf_rst 69 69 REAL, DIMENSION(klon, nsoilmx, nbsrf), INTENT(IN) :: ftsoil_rst 70 71 70 72 71 ! Local variables … … 76 75 CHARACTER(len = 20) :: modname = 'pbl_surface_init' 77 76 78 79 77 !**************************************************************************************** 80 78 ! Allocate and initialize module variables with fields read from restart file. … … 92 90 ALLOCATE(ftsoil(klon,nsoilmx,nbsrf), stat=ierr) 93 91 IF (ierr /= 0) CALL abort_physic('pbl_surface_init', 'pb in allocation',1) 94 95 92 96 93 fder(:) = fder_rst(:) … … 98 95 qsurf(:,:) = qsurf_rst(:,:) 99 96 ftsoil(:,:,:) = ftsoil_rst(:,:,:) 100 101 97 102 98 !**************************************************************************************** … … 287 283 ! treedrg--output-R- tree drag (m) 288 284 ! 289 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send 285 USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, carbon_cycle_tr, level_coupling_esm 286 USE carbon_cycle_mod, ONLY : co2_send, nbcf_out, fields_out, yfields_out, cfname_out 290 287 USE indice_sol_mod 291 288 USE time_phylmdz_mod, ONLY : day_ini,annee_ref,itau_phy … … 379 376 REAL, DIMENSION(klon), INTENT(OUT) :: zv1 ! v wind speed in first layer 380 377 !albedo SB >>> 381 REAL, DIMENSION(klon, nsw), 378 REAL, DIMENSION(klon, nsw), INTENT(OUT) :: alb_dir_m,alb_dif_m 382 379 !albedo SB <<< 383 380 ! Martin … … 509 506 ! Other local variables 510 507 !**************************************************************************************** 508 ! >> PC 509 INTEGER :: ierr 510 INTEGER :: n 511 ! << PC 511 512 INTEGER :: iflag_split 512 513 INTEGER :: i, k, nsrf … … 587 588 !FC 588 589 589 590 590 CHARACTER(len=80) :: abort_message 591 591 CHARACTER(len=20) :: modname = 'pbl_surface' … … 724 724 REAL, DIMENSION(klon) :: ytrmb3_w 725 725 ! 726 REAL, DIMENSION(klon) 727 REAL, DIMENSION(klon) 728 ! 729 REAL, DIMENSION(klon) 730 REAL, DIMENSION(klon) 726 REAL, DIMENSION(klon) :: uzon_x, vmer_x, speed_x, zri1_x, pref_x !speed_x, zri1_x, pref_x, added by Fuxing WANG, 04/03/2015 727 REAL, DIMENSION(klon) :: zgeo1_x, tair1_x, qair1_x, tairsol_x 728 ! 729 REAL, DIMENSION(klon) :: uzon_w, vmer_w, speed_w, zri1_w, pref_w !speed_w, zri1_w, pref_w, added by Fuxing WANG, 04/03/2015 730 REAL, DIMENSION(klon) :: zgeo1_w, tair1_w, qair1_w, tairsol_w 731 731 732 732 !!! jyg le 25/03/2013 … … 784 784 785 785 REAL :: vent 786 787 788 789 790 !!! 791 786 ! 792 787 ! For debugging with IOIPSL 793 788 INTEGER, DIMENSION(nbp_lon*nbp_lat) :: ndexbg … … 874 869 CALL histdef(nidbg, cl_surf(nsrf),cl_surf(nsrf), "-",nbp_lon, & 875 870 nbp_lat,nhoridbg, 1, 1, 1, -99, 32, "inst", dtime,dtime) 876 END 871 ENDDO 877 872 878 873 CALL histend(nidbg) 879 874 CALL histsync(nidbg) 880 875 881 END 876 ENDIF 882 877 883 878 ENDIF … … 1012 1007 !FC 1013 1008 1014 1009 ! >> PC 1010 !the yfields_out variable is defined in (klon,nbcf_out) even if it is used on 1011 !the ORCHIDEE grid and as such should be defined in yfields_out(knon,nbcf_out) but 1012 !the knon variable is not known at that level of pbl_surface_mod 1013 1014 !the yfields_in variable is defined in (klon,nbcf_in) even if it is used on the 1015 !ORCHIDEE grid and as such should be defined in yfields_in(knon,nbcf_in) but the 1016 !knon variable is not known at that level of pbl_surface_mod 1017 1018 yfields_out(:,:) = 0. 1019 ! << PC 1015 1020 1016 1021 … … 1151 1156 DO i = 1, klon 1152 1157 alb_m(i) = alb_m(i) + alb_dir_m(i,k)*SFRWL(k) 1153 END 1158 ENDDO 1154 1159 ENDDO 1155 1160 !albedo SB <<< … … 1188 1193 DO i = 1, klon 1189 1194 meansqT(i) = meansqT(i)+(ts(i,nsrf)-ztsol(i))**2 *pctsrf(i,nsrf) 1190 END 1191 END 1195 ENDDO 1196 ENDDO 1192 1197 DO nsrf = 1, nbsrf 1193 1198 DO i = 1, klon … … 1198 1203 ENDIF ! iflag_order2_sollw == 1 1199 1204 !>al1 1205 1206 ! >> PC 1207 IF (carbon_cycle_cpl .AND. carbon_cycle_tr .AND. nbcf_out.GT.0 ) THEN 1208 r_co2_ppm(:) = co2_send(:) 1209 DO n=1,nbcf_out 1210 IF (cfname_out(n) == "atmco2" ) fields_out(:,n) = co2_send(:) 1211 ENDDO 1212 ENDIF 1213 IF ( .NOT. carbon_cycle_tr .AND. nbcf_out.GT.0 ) THEN 1214 r_co2_ppm(:) = co2_ppm ! Constant field 1215 DO n=1,nbcf_out 1216 IF (cfname_out(n) == "atmco2" ) fields_out(:,n) = co2_ppm 1217 ENDDO 1218 ENDIF 1219 ! << PC 1200 1220 1201 1221 !**************************************************************************************** … … 1231 1251 DO i=1,knon 1232 1252 tabindx(i)=REAL(i) 1233 END 1253 ENDDO 1234 1254 debugtab(:,:) = 0. 1235 1255 ndexbg(:) = 0 … … 1252 1272 !albedo SB >>> 1253 1273 yalb_vis(j) = alb_dir(i,1,nsrf) 1254 if(nsw==6)then1274 IF (nsw==6) THEN 1255 1275 yalb_vis(j)=(alb_dir(i,1,nsrf)*SFRWL(1)+alb_dir(i,2,nsrf)*SFRWL(2) & 1256 1276 +alb_dir(i,3,nsrf)*SFRWL(3))/(SFRWL(1)+SFRWL(2)+SFRWL(3)) 1257 endif1277 ENDIF 1258 1278 !albedo SB <<< 1259 1279 yrain_f(j) = rain_f(i) … … 1283 1303 y_delta_tsurf(j)=delta_tsurf(i,nsrf) 1284 1304 !!! 1285 END DO 1286 1305 ENDDO 1306 ! >> PC 1307 !--compressing fields_out onto ORCHIDEE grid 1308 !--these fields are shared and used directly surf_land_orchidee_mod 1309 DO n = 1, nbcf_out 1310 DO j = 1, knon 1311 i = ni(j) 1312 yfields_out(j,n) = fields_out(i,n) 1313 ENDDO 1314 ENDDO 1315 ! << PC 1287 1316 DO k = 1, klev 1288 1317 DO j = 1, knon … … 1293 1322 ENDDO 1294 1323 ENDDO 1324 ! 1295 1325 !!! jyg le 07/02/2012 et le 10/04/2013 1296 1326 DO k = 1, klev+1 … … 1306 1336 DO j = 1, knon 1307 1337 i = ni(j) 1308 !FC1309 1338 y_treedrg(j,k) = treedrg(i,k,nsrf) 1310 ! print*,nsrf, "treedrg ",y_treedrg(j,k),j,k1311 !FC1312 1313 1339 yu(j,k) = u(i,k) 1314 1340 yv(j,k) = v(i,k) … … 1318 1344 ENDDO 1319 1345 ! 1320 IF (iflag_split .ge.1) THEN1346 IF (iflag_split.GE.1) THEN 1321 1347 !!! nrlmd le 02/05/2011 1322 1348 DO k = 1, klev … … 1334 1360 ENDDO 1335 1361 ENDDO 1362 1336 1363 IF (prt_level .ge. 10) THEN 1337 1364 print *,'pbl_surface, wake_s(1), wake_dlt(1,:) ', wake_s(1), wake_dlt(1,:) 1338 1365 print *,'pbl_surface, wake_s(1), wake_dlq(1,:) ', wake_s(1), wake_dlq(1,:) 1339 1366 ENDIF 1367 1340 1368 !!! nrlmd le 02/05/2011 1341 1369 DO k = 1, klev+1 … … 1376 1404 i = ni(j) 1377 1405 ytsoil(j,k) = ftsoil(i,k,nsrf) 1378 END 1379 END 1406 ENDDO 1407 ENDDO 1380 1408 1381 1409 ! qsol(water height in soil) only for bucket continental model … … 1384 1412 i = ni(j) 1385 1413 yqsol(j) = qsol(i) 1386 END 1414 ENDDO 1387 1415 ENDIF 1388 1416 … … 1408 1436 * (ypaprs(i,1)-ypplay(i,1)) 1409 1437 speed(i) = SQRT(yu(i,1)**2+yv(i,1)**2) 1410 END 1438 ENDDO 1411 1439 CALL cdrag(knon, nsrf, & 1412 1440 speed, yt(:,1), yq(:,1), zgeo1, ypaprs(:,1),& … … 1439 1467 * (ypaprs(i,1)-ypplay(i,1)) 1440 1468 speed_x(i) = SQRT(yu_x(i,1)**2+yv_x(i,1)**2) 1441 END 1469 ENDDO 1442 1470 CALL cdrag(knon, nsrf, & 1443 1471 speed_x, yt_x(:,1), yq_x(:,1), zgeo1_x, ypaprs(:,1),& … … 1466 1494 * (ypaprs(i,1)-ypplay(i,1)) 1467 1495 speed_w(i) = SQRT(yu_w(i,1)**2+yv_w(i,1)**2) 1468 END 1496 ENDDO 1469 1497 CALL cdrag(knon, nsrf, & 1470 1498 speed_w, yt_w(:,1), yq_w(:,1), zgeo1_w, ypaprs(:,1),& … … 1693 1721 DO i=1,knon 1694 1722 r_co2_ppm(i) = co2_send(ni(i)) 1695 END 1723 ENDDO 1696 1724 ELSE 1697 1725 r_co2_ppm(:) = co2_ppm ! Constant field 1698 END IF 1699 1726 ENDIF 1700 1727 1701 1728 !!! nrlmd le 02/05/2011 -----------------------On raccorde les 2 colonnes dans la couche 1 … … 1790 1817 zgeo1(i) = RD * yt(i,1) / (0.5*(ypaprs(i,1)+ypplay(i,1))) & 1791 1818 * (ypaprs(i,1)-ypplay(i,1)) 1792 END 1819 ENDDO 1793 1820 1794 1821 ! Calculate the temperature et relative humidity at 2m and the wind at 10m … … 1798 1825 yt2m, yq2m, yt10m, yq10m, yu10m, yustar) 1799 1826 1800 END 1827 ENDIF 1801 1828 1802 1829 !**************************************************************************************** … … 1825 1852 y_flux_u1, y_flux_v1, & 1826 1853 yveget,ylai,yheight ) 1854 1827 1855 !FC quid qd yveget ylai yheight ne sont pas definit 1828 1856 !FC yveget,ylai,yheight, & 1829 if (ifl_pbltree .ge. 1) then1830 CALL freinage(knon, yu, yv, yt, &1831 ! yveget,ylai, yheight,ypaprs,ypplay,y_d_u_frein,y_d_v_frein)1832 yveget,ylai, yheight,ypaprs,ypplay,y_treedrg, y_d_u_frein,y_d_v_frein)1833 endif1857 IF (ifl_pbltree .ge. 1) THEN 1858 CALL freinage(knon, yu, yv, yt, & 1859 ! yveget,ylai, yheight,ypaprs,ypplay,y_d_u_frein,y_d_v_frein) 1860 yveget,ylai, yheight,ypaprs,ypplay,y_treedrg, y_d_u_frein,y_d_v_frein) 1861 ENDIF 1834 1862 1835 1863 1836 1864 ! Special DICE MPL 05082013 puis BOMEX 1837 1865 IF (ok_prescr_ust) THEN 1838 doj=1,knon1866 DO j=1,knon 1839 1867 ! ysnow(:)=0. 1840 1868 ! yqsol(:)=0. … … 1851 1879 y_flux_u1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yu(j,1)*ypplay(j,1)/RD/yt(j,1) 1852 1880 y_flux_v1(j)=ycdragm(j)*(1.+sqrt(yu(j,1)*yu(j,1)+yv(j,1)*yv(j,1)))*yv(j,1)*ypplay(j,1)/RD/yt(j,1) 1853 enddo1881 ENDDO 1854 1882 ENDIF 1855 1856 1883 1857 1884 CASE(is_lic) … … 1885 1912 sissnow(i) = ysissnow(j) 1886 1913 runoff(i) = yrunoff(j) 1887 END 1914 ENDDO 1888 1915 ! Martin 1889 1916 ! Special DICE MPL 05082013 puis BOMEX MPL 20150410 … … 1970 1997 !**************************************************************************************** 1971 1998 1972 if (evap0>=0.) then1999 IF (evap0>=0.) THEn 1973 2000 yevap(:)=evap0 1974 2001 yevap(:)=RLVTT*evap0 1975 endif 1976 2002 ENDIF 1977 2003 1978 2004 y_d_ts(1:knon) = ytsurf_new(1:knon) - yts(1:knon) … … 2000 2026 !! Test sur iflag_split retire le 2/02/2018, sans vraiment comprendre la raison de ce test. (jyg) 2001 2027 !! IF (iflag_split .eq.0) THEN 2002 doj=1,knon2028 DO j=1,knon 2003 2029 Kech_h(j) = ycdragh(j) * (1.0+SQRT(yu(j,1)**2+yv(j,1)**2)) * & 2004 2030 ypplay(j,1)/(RD*yt(j,1)) 2005 enddo2031 ENDDO 2006 2032 !! ENDIF ! (iflag_split .eq.0) 2007 2033 … … 2011 2037 ENDDO 2012 2038 2013 doj=1,knon2039 DO j=1,knon 2014 2040 y_d_ts(j) = ytsurf_new(j) - yts(j) 2015 enddo2041 ENDDO 2016 2042 2017 2043 ELSE ! (ok_flux_surf) 2018 doj=1,knon2044 DO j=1,knon 2019 2045 y_flux_t1(j) = yfluxsens(j) 2020 2046 y_flux_q1(j) = -yevap(j) 2021 enddo2047 ENDDO 2022 2048 ENDIF 2023 2049 … … 2248 2274 y_d_v(j,k) = y_d_v(j,k) * ypct(j) 2249 2275 !FC 2250 if (nsrf .EQ. is_ter .and. ifl_pbltree .ge. 1 ) then2276 IF (nsrf .EQ. is_ter .and. ifl_pbltree .ge. 1 ) THEn 2251 2277 ! if (y_d_u_frein(j,k).ne.0. ) then 2252 2278 ! print*, nsrf,'IS_TER ++', y_d_u_frein(j,k)*ypct(j),y_d_u(j,k),j,k 2253 ! endif2254 y_d_u(j,k) =y_d_u(j,k) + y_d_u_frein(j,k)*ypct(j)2255 y_d_v(j,k) =y_d_v(j,k) + y_d_v_frein(j,k)*ypct(j)2256 treedrg(i,k,nsrf)=y_treedrg(j,k)2257 else2258 treedrg(i,k,nsrf)=0.2259 endif2279 ! ENDIF 2280 y_d_u(j,k) =y_d_u(j,k) + y_d_u_frein(j,k)*ypct(j) 2281 y_d_v(j,k) =y_d_v(j,k) + y_d_v_frein(j,k)*ypct(j) 2282 treedrg(i,k,nsrf)=y_treedrg(j,k) 2283 ELSE 2284 treedrg(i,k,nsrf)=0. 2285 ENDIF 2260 2286 !FC 2261 2262 2287 flux_t(i,k,nsrf) = y_flux_t(j,k) 2263 2288 flux_q(i,k,nsrf) = y_flux_q(j,k) 2264 2289 flux_u(i,k,nsrf) = y_flux_u(j,k) 2265 2290 flux_v(i,k,nsrf) = y_flux_v(j,k) 2266 2267 2268 2291 ENDDO 2269 2292 ENDDO 2270 2271 2293 2272 2294 ELSE !(iflag_split .eq.0) … … 2347 2369 d_ts(i,nsrf) = y_d_ts(j) 2348 2370 !albedo SB >>> 2349 dok=1,nsw2350 alb_dir(i,k,nsrf) = yalb_dir_new(j,k)2351 alb_dif(i,k,nsrf) = yalb_dif_new(j,k)2352 enddo2371 DO k=1,nsw 2372 alb_dir(i,k,nsrf) = yalb_dir_new(j,k) 2373 alb_dif(i,k,nsrf) = yalb_dif_new(j,k) 2374 ENDDO 2353 2375 !albedo SB <<< 2354 2376 snow(i,nsrf) = ysnow(j) … … 2362 2384 dflux_t(i) = dflux_t(i) + y_dflux_t(j) 2363 2385 dflux_q(i) = dflux_q(i) + y_dflux_q(j) 2364 END 2386 ENDDO 2365 2387 2366 2388 ! print*,'Dans pbl OK2' … … 2387 2409 kh_w(i) = kh_w(i) + Kech_h_w(j)*ypct(j) 2388 2410 !!! 2389 END 2411 ENDDO 2390 2412 !!! 2391 2413 ENDIF ! (iflag_split .ge.1) … … 2422 2444 tke_x(i,k,is_ave) = tke_x(i,k,is_ave) + ytke(j,k)*ypct(j) 2423 2445 !>jyg 2424 END 2425 END 2446 ENDDO 2447 ENDDO 2426 2448 2427 2449 ELSE ! (iflag_split .eq.0) … … 2449 2471 zcoefh(i,k,is_ave) = zcoefh(i,k,is_ave) + ycoefh(j,k)*ypct(j) 2450 2472 zcoefm(i,k,is_ave) = zcoefm(i,k,is_ave) + ycoefm(j,k)*ypct(j) 2451 END 2452 END 2473 ENDDO 2474 ENDDO 2453 2475 2454 2476 ! print*,'Dans pbl OK3' … … 2458 2480 i = ni(j) 2459 2481 qsol(i) = yqsol(j) 2460 END 2461 END 2482 ENDDO 2483 ENDIF 2462 2484 2463 2485 !jyg< … … 2468 2490 i = ni(j) 2469 2491 ftsoil(i, k, nsrf) = ytsoil(j,k) 2470 END 2471 END 2492 ENDDO 2493 ENDDO 2472 2494 2473 2495 !!! jyg le 07/02/2012 … … 2492 2514 !! d_wake_dlt(i,k) = d_wake_dlt(i,k) + y_d_t_w(i,k)-y_d_t_x(i,k) 2493 2515 !! d_wake_dlq(i,k) = d_wake_dlq(i,k) + y_d_q_w(i,k)-y_d_q_x(i,k) 2494 END 2495 END 2516 ENDDO 2517 ENDDO 2496 2518 !!! 2497 2519 ENDIF ! (iflag_split .ge.1) … … 2506 2528 d_u(i,k) = d_u(i,k) + y_d_u(j,k) 2507 2529 d_v(i,k) = d_v(i,k) + y_d_v(j,k) 2508 END 2509 END 2530 ENDDO 2531 ENDDO 2510 2532 2511 2533 ! print*,'Dans pbl OK4' … … 2542 2564 tairsol(j) = yts(j) + y_d_ts(j) 2543 2565 qairsol(j) = yqsurf(j) 2544 END 2566 ENDDO 2545 2567 ELSE ! (iflag_split .eq.0) 2546 2568 DO j=1, knon … … 2554 2576 tairsol_x(j) = tairsol(j) - ywake_s(j)*y_delta_tsurf(j) 2555 2577 qairsol(j) = yqsurf(j) 2556 END 2578 ENDDO 2557 2579 DO j=1, knon 2558 2580 uzon_w(j) = yu_w(j,1) + y_d_u_w(j,1) … … 2564 2586 tairsol_w(j) = tairsol(j) + (1.- ywake_s(j))*y_delta_tsurf(j) 2565 2587 qairsol(j) = yqsurf(j) 2566 END 2588 ENDDO 2567 2589 !!! 2568 2590 ENDIF ! (iflag_split .eq.0) … … 2576 2598 psfce(j)=ypaprs(j,1) 2577 2599 patm(j)=ypplay(j,1) 2578 END 2600 ENDDO 2579 2601 2580 2602 IF (iflag_pbl_surface_t2m_bug==1) THEN … … 2617 2639 u10m(i,nsrf)=(yu10m(j) * uzon(j))/SQRT(uzon(j)**2+vmer(j)**2) 2618 2640 v10m(i,nsrf)=(yu10m(j) * vmer(j))/SQRT(uzon(j)**2+vmer(j)**2) 2619 END 2641 ENDDO 2620 2642 ELSE !(iflag_split .eq.0) 2621 2643 DO j=1, knon … … 2627 2649 u10m_x(i,nsrf)=(yu10m_x(j) * uzon_x(j))/SQRT(uzon_x(j)**2+vmer_x(j)**2) 2628 2650 v10m_x(i,nsrf)=(yu10m_x(j) * vmer_x(j))/SQRT(uzon_x(j)**2+vmer_x(j)**2) 2629 END 2651 ENDDO 2630 2652 DO j=1, knon 2631 2653 i = ni(j) … … 2640 2662 u10m(i,nsrf) = u10m_x(i,nsrf) + wake_s(i)*(u10m_w(i,nsrf)-u10m_x(i,nsrf)) 2641 2663 v10m(i,nsrf) = v10m_x(i,nsrf) + wake_s(i)*(v10m_w(i,nsrf)-v10m_x(i,nsrf)) 2642 END 2664 ENDDO 2643 2665 !!! 2644 2666 ENDIF ! (iflag_split .eq.0) … … 2661 2683 rh2m(i) = rh2m(i) + yq2m(j)/zx_qs1 * pctsrf(i,nsrf) 2662 2684 qsat2m(i) = qsat2m(i) + zx_qs1 * pctsrf(i,nsrf) 2663 END 2685 ENDDO 2664 2686 ELSE ! (iflag_split .eq.0) 2665 2687 DO j = 1, knon … … 2673 2695 rh2m_x(i) = rh2m_x(i) + yq2m_x(j)/zx_qs1 * pctsrf(i,nsrf) 2674 2696 qsat2m_x(i) = qsat2m_x(i) + zx_qs1 * pctsrf(i,nsrf) 2675 END 2697 ENDDO 2676 2698 DO j = 1, knon 2677 2699 i=ni(j) … … 2684 2706 rh2m_w(i) = rh2m_w(i) + yq2m_w(j)/zx_qs1 * pctsrf(i,nsrf) 2685 2707 qsat2m_w(i) = qsat2m_w(i) + zx_qs1 * pctsrf(i,nsrf) 2686 END 2708 ENDDO 2687 2709 !!! 2688 2710 ENDIF ! (iflag_split .eq.0) 2689 2711 !!! 2690 END 2712 ENDIF 2691 2713 ! 2692 2714 IF (prt_level >=10) THEN … … 2761 2783 trmb2(i,nsrf) = ytrmb2(j) 2762 2784 trmb3(i,nsrf) = ytrmb3(j) 2763 END 2785 ENDDO 2764 2786 IF (prt_level >=10) THEN 2765 2787 print *, 'After HBTM: pblh ', pblh … … 2781 2803 trmb2_x(i,nsrf) = ytrmb2_x(j) 2782 2804 trmb3_x(i,nsrf) = ytrmb3_x(j) 2783 END 2805 ENDDO 2784 2806 IF (prt_level >=10) THEN 2785 2807 print *, 'After HBTM: pblh_x ', pblh_x … … 2800 2822 trmb2_w(i,nsrf) = ytrmb2_w(j) 2801 2823 trmb3_w(i,nsrf) = ytrmb3_w(j) 2802 END 2824 ENDDO 2803 2825 IF (prt_level >=10) THEN 2804 2826 print *, 'After HBTM: pblh_w ', pblh_w … … 2821 2843 ! 2822 2844 !**************************************************************************************** 2823 END 2845 ENDDO loop_nbsrf 2824 2846 2825 2847 !**************************************************************************************** … … 2862 2884 zxfluxu_w(i,k) = zxfluxu_w(i,k) + flux_u_w(i,k,nsrf) * pctsrf(i,nsrf) 2863 2885 zxfluxv_w(i,k) = zxfluxv_w(i,k) + flux_v_w(i,k,nsrf) * pctsrf(i,nsrf) 2864 END 2865 END 2866 END 2886 ENDDO 2887 ENDDO 2888 ENDDO 2867 2889 2868 2890 DO i = 1, klon 2869 2891 zxsens_x(i) = - zxfluxt_x(i,1) 2870 2892 zxsens_w(i) = - zxfluxt_w(i,1) 2871 END 2893 ENDDO 2872 2894 !!! 2873 2895 ENDIF ! (iflag_split .ge.1) … … 2881 2903 zxfluxu(i,k) = zxfluxu(i,k) + flux_u(i,k,nsrf) * pctsrf(i,nsrf) 2882 2904 zxfluxv(i,k) = zxfluxv(i,k) + flux_v(i,k,nsrf) * pctsrf(i,nsrf) 2883 END 2884 END 2885 END 2905 ENDDO 2906 ENDDO 2907 ENDDO 2886 2908 2887 2909 DO i = 1, klon … … 2928 2950 zxtsol(i) = zxtsol(i) + ts(i,nsrf) * pctsrf(i,nsrf) 2929 2951 zxfluxlat(i) = zxfluxlat(i) + fluxlat(i,nsrf) * pctsrf(i,nsrf) 2930 END 2931 END 2952 ENDDO 2953 ENDDO 2932 2954 ! 2933 2955 !<al1 order 2 correction to zxtsol, for radiation computations (main atm effect of Ts) … … 2937 2959 DO i = 1, klon 2938 2960 meansqT(i) = meansqT(i)+(ts(i,nsrf)-zxtsol(i))**2 *pctsrf(i,nsrf) 2939 END 2940 END 2961 ENDDO 2962 ENDDO 2941 2963 zxtsol(:) = zxtsol(:)+1.5*meansqT(:)/zxtsol(:) 2942 2964 ENDIF ! iflag_order2_sollw == 1 … … 2964 2986 s_trmb2(i) = s_trmb2(i) + trmb2(i,nsrf) * pctsrf(i,nsrf) 2965 2987 s_trmb3(i) = s_trmb3(i) + trmb3(i,nsrf) * pctsrf(i,nsrf) 2966 END 2967 END 2988 ENDDO 2989 ENDDO 2968 2990 ELSE !(iflag_split .eq.0) 2969 2991 DO nsrf = 1, nbsrf … … 3001 3023 s_trmb2(i) = s_trmb2(i) + trmb2_x(i,nsrf) * pctsrf(i,nsrf) 3002 3024 s_trmb3(i) = s_trmb3(i) + trmb3_x(i,nsrf) * pctsrf(i,nsrf) 3003 END 3004 END 3025 ENDDO 3026 ENDDO 3005 3027 DO i = 1, klon 3006 3028 qsat2m(i)= qsat2m_x(i)+ wake_s(i)*(qsat2m_x(i)-qsat2m_w(i)) 3007 END 3029 ENDDO 3008 3030 !!! 3009 3031 ENDIF ! (iflag_split .eq.0) … … 3060 3082 zxqsurf(i) = zxqsurf(i) + qsurf(i,nsrf) * pctsrf(i,nsrf) 3061 3083 zxsnow(i) = zxsnow(i) + snow(i,nsrf) * pctsrf(i,nsrf) 3062 END 3063 END 3084 ENDDO 3085 ENDDO 3064 3086 3065 3087 ! Premier niveau de vent sortie dans physiq.F 3066 3088 zu1(:) = u(:,1) 3067 3089 zv1(:) = v(:,1) 3068 3069 3090 3070 3091 END SUBROUTINE pbl_surface … … 3200 3221 u10m(i,nsrf) = u10m(i,nsrf_comp1) 3201 3222 v10m(i,nsrf) = v10m(i,nsrf_comp1) 3202 if (iflag_pbl > 1) then3223 IF (iflag_pbl > 1) THEN 3203 3224 tke(i,:,nsrf) = tke(i,:,nsrf_comp1) 3204 endif3225 ENDIF 3205 3226 mfois(nsrf) = mfois(nsrf) + 1 3206 3227 ! F. Codron sensible default values for ocean and sea ice … … 3210 3231 alb_dir(i,k,nsrf) = 0.06 ! typical Ocean albedo 3211 3232 alb_dif(i,k,nsrf) = 0.06 3212 END 3233 ENDDO 3213 3234 ELSE IF (nsrf.EQ.is_sic) THEN 3214 3235 tsurf(i,nsrf) = 273.15 ! Melting ice … … 3216 3237 alb_dir(i,k,nsrf) = 0.3 ! thin ice 3217 3238 alb_dif(i,k,nsrf) = 0.3 3218 END 3219 END 3239 ENDDO 3240 ENDIF 3220 3241 ! F. Codron 3221 3242 ELSE … … 3237 3258 u10m(i,nsrf) = u10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + u10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3238 3259 v10m(i,nsrf) = v10m(i,nsrf_comp2) *pctsrf_old(i,nsrf_comp2) + v10m(i,nsrf_comp3) *pctsrf_old(i,nsrf_comp3) 3239 if (iflag_pbl > 1) then3260 IF (iflag_pbl > 1) THEN 3240 3261 tke(i,:,nsrf) = tke(i,:,nsrf_comp2)*pctsrf_old(i,nsrf_comp2) + tke(i,:,nsrf_comp3)*pctsrf_old(i,nsrf_comp3) 3241 endif3262 ENDIF 3242 3263 3243 3264 ! Security abort. This option has never been tested. To test, comment the following line. … … 3245 3266 ! CALL abort_physic(modname,abort_message,1) 3246 3267 nfois(nsrf) = nfois(nsrf) + 1 3247 END 3268 ENDIF 3248 3269 snow(i,nsrf) = 0. 3249 3270 agesno(i,nsrf) = 0. … … 3251 3272 ELSE 3252 3273 pfois(nsrf) = pfois(nsrf)+ 1 3253 END 3254 END 3274 ENDIF 3275 ENDDO 3255 3276 3256 END 3277 ENDDO 3257 3278 3258 3279 END SUBROUTINE pbl_surface_newfrac 3259 3260 3280 ! 3261 3281 !**************************************************************************************** 3262 3282 ! 3263 3264 3283 END MODULE pbl_surface_mod 3265 -
LMDZ6/trunk/libf/phylmd/surf_land_mod.F90
r3102 r3391 24 24 USE dimphy 25 25 USE surface_data, ONLY : ok_veget 26 ! >> PC 27 USE carbon_cycle_mod 28 ! << PC 26 29 27 30 ! See comments in each module surf_land_orchidee_xxx for compatiblity with ORCHIDEE … … 47 50 USE indice_sol_mod 48 51 52 ! >> PC 53 USE print_control_mod, ONLY: lunout 54 ! << PC 55 49 56 INCLUDE "dimsoil.h" 50 57 INCLUDE "YOMCST.h" 51 58 INCLUDE "clesphys.h" 52 59 INCLUDE "dimpft.h" 53 54 60 55 61 ! Input variables … … 118 124 !albedo SB <<< 119 125 120 121 126 !**************************************************************************************** 122 127 ! Choice between call to vegetation model (ok_veget=true) or simple calculation below … … 159 164 emis_new, z0m, z0h, qsurf, & 160 165 veget, lai, height) 161 162 163 166 ! 164 167 !* Add contribution of relief to surface roughness … … 198 201 199 202 !albedo SB >>> 200 201 202 select case(NSW) 203 case(2) 203 SELECT CASE(NSW) 204 CASE(2) 204 205 alb_dir_new(1:knon,1)=alb1_new(1:knon) 205 206 alb_dir_new(1:knon,2)=alb2_new(1:knon) 206 case(4)207 CASE(4) 207 208 alb_dir_new(1:knon,1)=alb1_new(1:knon) 208 209 alb_dir_new(1:knon,2)=alb2_new(1:knon) 209 210 alb_dir_new(1:knon,3)=alb2_new(1:knon) 210 211 alb_dir_new(1:knon,4)=alb2_new(1:knon) 211 case(6)212 CASE(6) 212 213 alb_dir_new(1:knon,1)=alb1_new(1:knon) 213 214 alb_dir_new(1:knon,2)=alb1_new(1:knon) … … 216 217 alb_dir_new(1:knon,5)=alb2_new(1:knon) 217 218 alb_dir_new(1:knon,6)=alb2_new(1:knon) 218 end select 219 alb_dif_new=alb_dir_new 219 END SELECT 220 221 alb_dif_new=alb_dir_new 220 222 !albedo SB <<< 221 222 223 223 224 224 END SUBROUTINE surf_land -
LMDZ6/trunk/libf/phylmd/surf_land_orchidee_mod.F90
r3102 r3391 26 26 USE mod_grid_phy_lmdz 27 27 USE mod_phys_lmdz_para, mpi_root_rank=>mpi_master 28 USE carbon_cycle_mod, ONLY : nbcf_in_orc, nbcf_out, fields_in, yfields_in, yfields_out, cfname_in, cfname_out 28 29 29 30 IMPLICIT NONE … … 48 49 veget, lai, height ) 49 50 50 51 51 USE mod_surf_para 52 52 USE mod_synchro_omp 53 USE carbon_cycle_mod , ONLY : carbon_cycle_cpl53 USE carbon_cycle_mod 54 54 USE indice_sol_mod 55 55 USE print_control_mod, ONLY: lunout … … 96 96 ! ps pression au sol 97 97 ! radsol rayonnement net aus sol (LW + SW) 98 !99 98 ! 100 99 ! output: … … 113 112 INCLUDE "YOMCST.h" 114 113 INCLUDE "dimpft.h" 115 116 117 118 114 ! 119 115 ! Parametres d'entree … … 149 145 REAL, DIMENSION(klon,nvm_lmdz), INTENT(OUT) :: height 150 146 151 152 147 ! Local 153 148 !**************************************************************************************** 154 INTEGER :: ij, jj, igrid, ireal, index 149 INTEGER :: ij, jj, igrid, ireal, index, nb 155 150 INTEGER :: error 156 151 REAL, DIMENSION(klon) :: swdown_vrai … … 365 360 ! carbon_cycle_cpl not possible with this interface and version of ORHCHIDEE 366 361 ! 367 IF (carbon_cycle_cpl) THEN 368 abort_message='carbon_cycle_cpl not yet possible with this interface of ORCHIDEE' 369 CALL abort_physic(modname,abort_message,1) 370 END IF 362 ! >> PC 363 ! IF (carbon_cycle_cpl) THEN 364 ! abort_message='carbon_cycle_cpl not yet possible with this interface of ORCHIDEE' 365 ! CALL abort_physic(modname,abort_message,1) 366 ! END IF 367 ! << PC 371 368 372 369 ENDIF ! (fin debut) 373 370 374 375 371 ! 376 372 ! Appel a la routine sols continentaux … … 413 409 IF (knon > 0) THEN 414 410 411 print *,'OB before intersurf=', SIZE(cfname_in), SIZE(cfname_out) 415 412 #ifdef CPP_VEGET 416 413 CALL intersurf_initialize_gathered (itime+itau_phy-1, nbp_lon, nbp_lat, knon, ktindex, dtime, & … … 421 418 evap, fluxsens, fluxlat, coastalflow, riverflow, & 422 419 tsol_rad, tsurf_new, qsurf, albedo_out, emis_new, z0m_new, & 423 lon_scat, lat_scat, q2m, t2m, z0h_new, nvm_orch) 420 ! >> PC 421 !lon_scat, lat_scat, q2m, t2m, z0h_new, nvm_orch) 422 lon_scat, lat_scat, q2m, t2m, z0h_new, nvm_orch, & 423 field_out_names=cfname_out, field_in_names=cfname_in(1:nbcf_in_orc)) 424 ! << PC 424 425 #endif 425 426 ENDIF … … 430 431 431 432 ENDIF 432 433 433 434 434 ! swdown_vrai(1:knon) = swnet(1:knon)/(1. - albedo_keep(1:knon)) … … 452 452 lon_scat, lat_scat, q2m, t2m, z0h_new(1:knon),& 453 453 veget(1:knon,:),lai(1:knon,:),height(1:knon,:),& 454 fields_out=yfields_out(1:knon,1:nbcf_out), & 455 fields_in=yfields_in(1:knon,1:nbcf_in_orc), & 454 456 coszang=yrmu0(1:knon)) 455 457 #endif … … 480 482 IF (debut) CALL Finalize_surf_para 481 483 484 ! >> PC 485 ! Decompressing variables into LMDz for the module carbon_cycle_mod 486 ! nbcf_in can be zero, in which case the loop does not operate 487 ! fields_in can then used elsewhere in the model 488 489 fields_in(:,:)=0.0 490 491 DO nb=1, nbcf_in_orc 492 DO igrid = 1, knon 493 ireal = knindex(igrid) 494 fields_in(ireal,nb)=yfields_in(igrid,nb) 495 ENDDO 496 WRITE(*,*) 'surf_land_orchidee_mod --- yfields_in :',cfname_in(nb) 497 ENDDO 498 ! >> PC 482 499 483 500 END SUBROUTINE surf_land_orchidee … … 541 558 !**************************************************************************************** 542 559 543 544 560 IF (is_omp_root) THEN 545 561 … … 566 582 ENDDO 567 583 ENDIF 568 569 584 570 585 END SUBROUTINE Get_orchidee_communicator … … 628 643 off_ini(4,3) = 1 ; off_ini(5,3) = nbp_lon ; off_ini(6,3) = nbp_lon - 1 629 644 off_ini(7,3) = -1 ; off_ini(8,3) = - nbp_lon - 1 630 !631 645 ! 632 646 ! Attention aux poles … … 645 659 ENDDO 646 660 ELSE 647 print*,'sonia : knon_glo,ij,jj', knon_glo, ij,jj648 661 649 662 DO igrid = 1, knon_glo
Note: See TracChangeset
for help on using the changeset viewer.