Changeset 257 for branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate.f90
- Timestamp:
- 2011-06-17T14:02:17+02:00 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_EXT/ORCHIDEE/src_stomate/stomate.f90
r64 r257 227 227 INTEGER(i_std),ALLOCATABLE,SAVE,DIMENSION(:) :: nforce 228 228 229 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: harvest_above_monthly, cflux_prod_monthly 230 231 ! "maximal" coverage fraction of a PFT (LAI -> infinity) on ground 232 REAL(r_std), ALLOCATABLE,SAVE,DIMENSION(:,:) :: fpc_max 233 229 234 ! Date and EndOfYear, intialize and update in slowproc 230 235 ! (Now managed in slowproc for land_use) 231 236 ! time step of STOMATE in days 232 REAL(r_std),SAVE :: dt_days= 0.! Time step in days for stomate237 REAL(r_std),SAVE :: dt_days=zero ! Time step in days for stomate 233 238 ! to check 234 REAL(r_std),SAVE :: day_counter= 0.! count each sechiba (dtradia) time step each day239 REAL(r_std),SAVE :: day_counter=zero ! count each sechiba (dtradia) time step each day 235 240 ! date (d) 236 241 INTEGER(i_std),SAVE :: date=0 … … 242 247 ! Land cover change flag 243 248 LOGICAL,SAVE :: lcchange=.FALSE. 249 ! Do update of monthly variables ? 250 ! This variable must be .TRUE. once a month 251 LOGICAL, SAVE :: EndOfMonth=.FALSE. 244 252 PUBLIC dt_days, day_counter, date, do_slow, EndOfYear, lcchange 245 253 … … 554 562 555 563 REAL(r_std), DIMENSION(kjpindex) :: vartmp 564 REAL(r_std) :: net_cflux_prod_monthly_sum , net_cflux_prod_monthly_tot 565 REAL(r_std) :: net_harvest_above_monthly_sum, net_harvest_above_monthly_tot 566 REAL(r_std) :: net_biosp_prod_monthly_sum , net_biosp_prod_monthly_tot 556 567 !--------------------------------------------------------------------- 557 568 ! first of all: store time step in common value 558 569 itime = kjit 559 570 560 z_soil(0) = 0.571 z_soil(0) = zero 561 572 z_soil(1:nbdl) = diaglev(1:nbdl) 562 573 DO j=1,nvm … … 877 888 ENDIF 878 889 879 dt_forcesoil = 0.890 dt_forcesoil = zero 880 891 nparan = nparan+1 881 892 DO WHILE (dt_forcesoil < dt_slow/one_day) … … 951 962 l_first_stomate = .FALSE. 952 963 ! 953 ! 1.11 retu 964 ! 1.11 return 954 965 ! 955 966 RETURN … … 1158 1169 ENDDO 1159 1170 1171 IF ( day == 1 .AND. sec .LT. dtradia ) THEN 1172 EndOfMonth=.TRUE. 1173 ELSE 1174 EndOfMonth=.FALSE. 1175 ENDIF 1160 1176 ! 1161 1177 ! 5 "daily" variables … … 1293 1309 1294 1310 CALL StomateLpj & 1295 & (kjpindex, dt_days, EndOfYear, &1311 & (kjpindex, dt_days, EndOfYear, EndOfMonth, & 1296 1312 & neighbours, resolution, & 1297 1313 & clay, herbivores, & … … 1318 1334 & t_photo_min, t_photo_opt, t_photo_max,bm_to_litter,& 1319 1335 & prod10, prod100, flux10, flux100, veget_cov_max_new,& 1320 & convflux, cflux_prod10, cflux_prod100, harvest_above, lcchange) 1336 & convflux, cflux_prod10, cflux_prod100, harvest_above, lcchange,& 1337 & fpc_max) 1321 1338 1322 1339 ! … … 1534 1551 ! 1535 1552 co2_flux_monthly(:,:) = co2_flux_monthly(:,:) + co2_flux_daily(:,:) 1536 IF ( day == 1 .AND. sec .LT. dtradia ) THEN 1553 ! Monthly Cumulative fluxes of fluc and harvest 1554 harvest_above_monthly(:) = harvest_above_monthly(:) + harvest_above(:) 1555 cflux_prod_monthly(:) = cflux_prod_monthly(:) + convflux(:) + cflux_prod10(:) + cflux_prod100(:) 1556 IF ( EndOfMonth ) THEN 1537 1557 IF ( control%ok_stomate ) THEN 1538 CALL histwrite (hist_id_stomate, 'CO2FLUX _MONTHLY', itime, &1558 CALL histwrite (hist_id_stomate, 'CO2FLUX', itime, & 1539 1559 co2_flux_monthly, kjpindex*nvm, horipft_index) 1540 1560 ENDIF 1541 1561 !MM 1542 1562 ! Si on supprimer le cumul par mois, 1543 ! il ne faut pas oubli écette modif resolution(:,1)*resolution(:,2)*contfrac(:)1563 ! il ne faut pas oublier cette modif resolution(:,1)*resolution(:,2)*contfrac(:) 1544 1564 DO j=2, nvm 1545 1565 co2_flux_monthly(:,j) = co2_flux_monthly(:,j)* & … … 1551 1571 DO j=2,nvm 1552 1572 net_co2_flux_monthly = net_co2_flux_monthly + & 1553 & co2_flux_monthly(ji,j)*veget_ max(ji,j)1573 & co2_flux_monthly(ji,j)*veget_cov_max(ji,j) 1554 1574 ENDDO 1555 1575 ENDDO 1576 ! Total ( land) Cumulative fluxes of fluc and harvest 1577 net_cflux_prod_monthly_sum=& 1578 & SUM(cflux_prod_monthly(:)*resolution(:,1)*resolution(:,2)*contfrac(:))*1e-15 1579 CALL reduce_sum(net_cflux_prod_monthly_sum,net_cflux_prod_monthly_tot) 1580 CALL bcast(net_cflux_prod_monthly_tot) 1581 1582 net_harvest_above_monthly_sum=& 1583 & SUM(harvest_above_monthly(:)*resolution(:,1)*resolution(:,2)*contfrac(:))*1e-15 1584 CALL reduce_sum(net_harvest_above_monthly_sum,net_harvest_above_monthly_tot) 1585 CALL bcast(net_harvest_above_monthly_tot) 1586 1556 1587 net_co2_flux_monthly = net_co2_flux_monthly*1e-15 1557 WRITE(numout,*) 'net_co2_flux_monthly (Peta gC/month) = ',net_co2_flux_monthly1558 1559 1588 CALL reduce_sum(net_co2_flux_monthly,net_co2_flux_monthly_sum) 1560 IF ( control%ok_stomate ) THEN 1561 CALL histwrite (hist_id_stomate, 'CO2FLUX_MONTHLY_SUM', itime, & 1562 (/ net_co2_flux_monthly /), 1, (/ 1 /) ) 1563 ENDIF 1589 CALL bcast(net_co2_flux_monthly_sum) 1590 1591 WRITE(numout,9010) 'GLOBAL net_cflux_prod_monthly (Peta gC/month) = ',net_cflux_prod_monthly_tot 1592 WRITE(numout,9010) 'GLOBAL net_harvest_above_monthly (Peta gC/month) = ',net_harvest_above_monthly_tot 1593 WRITE(numout,9010) 'GLOBAL net_co2_flux_monthly (Peta gC/month) = ',net_co2_flux_monthly_sum 1594 1595 ! Calculation of net biospheric production 1596 net_biosp_prod_monthly_tot = & 1597 & ( net_co2_flux_monthly_sum + net_cflux_prod_monthly_tot + net_harvest_above_monthly_tot ) 1598 WRITE(numout,9010) 'GLOBAL net_biosp_prod_monthly (Peta gC/month) = ',net_biosp_prod_monthly_tot 1599 1600 9010 FORMAT(A52,F17.14) 1601 !!$ IF ( control%ok_stomate ) THEN 1602 !!$ vartmp(:)=net_co2_flux_monthly_sum 1603 !!$ CALL histwrite (hist_id_stomate, 'CO2FLUX_MONTHLY_SUM', itime, & 1604 !!$ vartmp, kjpindex, hori_index ) 1605 !!$ ENDIF 1564 1606 !!$ IF (is_root_prc) THEN 1565 1607 !!$ OPEN( unit=39, & … … 1579 1621 !!$ ENDIF 1580 1622 co2_flux_monthly(:,:) = zero 1623 harvest_above_monthly(:) = zero 1624 cflux_prod_monthly(:) = zero 1581 1625 ENDIF 1582 1626 ! … … 1599 1643 1600 1644 ENDIF ! daily processes? 1601 ! CO2FLUX Daily values are saved each dtradia,1602 ! then the value is wrong for the first day without restart.1603 IF ( hist_id > 0 ) THEN1604 CALL histwrite (hist_id, 'CO2FLUX', itime, &1605 co2_flux_daily, kjpindex*nvm, horipft_index)1606 ENDIF1607 IF ( hist2_id > 0 ) THEN1608 CALL histwrite (hist2_id, 'CO2FLUX', itime, &1609 co2_flux_daily, kjpindex*nvm, horipft_index)1610 ENDIF1611 1612 1645 ! 1613 1646 ! 7 Outputs from Stomate … … 1907 1940 ALLOCATE(co2_flux_monthly(kjpindex,nvm),stat=ier) 1908 1941 l_error = l_error .OR. (ier /= 0) 1942 ALLOCATE (cflux_prod_monthly(kjpindex), stat=ier) 1943 l_error = l_error .OR. (ier.NE.0) 1944 ALLOCATE (harvest_above_monthly(kjpindex), stat=ier) 1945 l_error = l_error .OR. (ier.NE.0) 1909 1946 ALLOCATE(bm_to_litter(kjpindex,nvm,nparts),stat=ier) 1910 1947 l_error = l_error .OR. (ier /= 0) … … 1955 1992 l_error = l_error .OR. (ier.NE.0) 1956 1993 ! 1994 ALLOCATE (fpc_max(kjpindex,nvm), stat=ier) 1995 l_error = l_error .OR. (ier.NE.0) 1996 ! 1957 1997 IF (l_error) THEN 1958 1998 STOP 'stomate_init: error in memory allocation' … … 2028 2068 WRITE(numout,*) & 2029 2069 & 'expansion across a grid cell is treated: ',treat_expansion 2070 2071 !Config Key = LPJ_GAP_CONST_MORT 2072 !Config Desc = prescribe mortality if not using DGVM? 2073 !Config Def = y 2074 !Config Help = set to TRUE if constant mortality is to be activated 2075 ! ignored if DGVM=true! 2076 ! 2077 lpj_gap_const_mort=.TRUE. 2078 CALL getin('LPJ_GAP_CONST_MORT', lpj_gap_const_mort) 2079 WRITE(numout,*) 'LPJ GAP: constant mortality:', lpj_gap_const_mort 2030 2080 2031 2081 !Config Key = HARVEST_AGRI … … 2046 2096 co2_flux_daily(:,:) = zero 2047 2097 co2_flux_monthly(:,:) = zero 2048 2098 cflux_prod_monthly(:) = zero 2099 harvest_above_monthly(:) = zero 2100 control_moist_daily(:,:) = zero 2101 control_temp_daily(:,:) = zero 2102 soilcarbon_input_daily(:,:,:) = zero 2049 2103 2050 2104 ! initialisation of land cover change variables … … 2056 2110 cflux_prod10(:) = zero 2057 2111 cflux_prod100(:)= zero 2112 2113 fpc_max(:,:)=zero 2058 2114 !-------------------------- 2059 2115 END SUBROUTINE stomate_init … … 2141 2197 IF (ALLOCATED(co2_flux_daily)) DEALLOCATE(co2_flux_daily) 2142 2198 IF (ALLOCATED(co2_flux_monthly)) DEALLOCATE(co2_flux_monthly) 2199 IF (ALLOCATED(harvest_above_monthly)) DEALLOCATE (harvest_above_monthly) 2200 IF (ALLOCATED(cflux_prod_monthly)) DEALLOCATE (cflux_prod_monthly) 2143 2201 IF (ALLOCATED(bm_to_litter)) DEALLOCATE(bm_to_litter) 2144 2202 IF (ALLOCATED(bm_to_littercalc)) DEALLOCATE(bm_to_littercalc) … … 2203 2261 IF ( ALLOCATED (control_temp_daily)) DEALLOCATE (control_temp_daily) 2204 2262 IF ( ALLOCATED (control_moist_daily)) DEALLOCATE (control_moist_daily) 2263 2264 IF ( ALLOCATED (fpc_max)) DEALLOCATE (fpc_max) 2205 2265 2206 2266 ! 2. reset l_first … … 2265 2325 !- 2266 2326 ! dummy time step, must be zero 2267 REAL(r_std),PARAMETER :: dt_0 = 0.2327 REAL(r_std),PARAMETER :: dt_0 = zero 2268 2328 REAL(r_std),DIMENSION(kjpindex,nvm) :: vcmax 2269 2329 REAL(r_std),DIMENSION(kjpindex,nvm) :: vjmax
Note: See TracChangeset
for help on using the changeset viewer.