Changeset 6319 for branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate
- Timestamp:
- 2019-11-08T13:00:52+01:00 (5 years ago)
- Location:
- branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate.f90
r6160 r6319 430 430 !! dimension(#pixels,0:100) 431 431 !$OMP THREADPRIVATE(flux100) 432 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:,:) :: co2_flux !! CO2 flux between atmosphere and biosphere 433 !! @tex $(gC m^{-2} one_day^{-1})$ @endtex 434 !$OMP THREADPRIVATE(co2_flux) 432 435 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: fco2_lu !! CO2 flux between atmosphere and biosphere from land-use 433 436 !! (without forest management) 434 437 !! @tex $(gC m^{-2} one_day^{-1})$ @endtex 435 438 !$OMP THREADPRIVATE(fco2_lu) 439 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: fco2_wh !! CO2 Flux to Atmosphere from Wood Harvesting (positive from atm to land) 440 !! @tex $(gC m^{-2} one_day^{-1})$ @endtex 441 !$OMP THREADPRIVATE(fco2_wh) 442 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: fco2_ha !! CO2 Flux to Atmosphere from Crop Harvesting (positive from atm to land) 443 !! @tex $(gC m^{-2} one_day^{-1})$ @endtex 444 !$OMP THREADPRIVATE(fco2_ha) 445 436 446 REAL(r_std),ALLOCATABLE,SAVE,DIMENSION(:) :: convflux !! Release during first year following land cover change 437 447 !! (paper, burned, etc...) … … 630 640 contfrac, totfrac_nobio, clay, temp_air, & 631 641 lai, veget, veget_max, & 632 co2_flux, co2_to_bm_radia, fco2_lu_out, deadleaf_cover, assim_param, temp_growth ) 642 co2_to_bm_radia,deadleaf_cover, assim_param, temp_growth ) 643 633 644 634 645 IMPLICIT NONE … … 656 667 657 668 !! 0.2 Output variables 658 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux !! CO2 flux between atmosphere and biosphere 669 659 670 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_to_bm_radia !! virtual gpp flux between atmosphere and biosphere 660 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: fco2_lu_out !! CO2 flux between atmosphere and biosphere from land-use (without forest management)661 671 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: deadleaf_cover !! Fraction of soil covered by dead leaves (unitless) 662 672 REAL(r_std),DIMENSION(kjpindex,nvm,npco2),INTENT(out) :: assim_param !! min+max+opt temperatures (K) & vmax for photosynthesis … … 764 774 765 775 !! 1.4.3.1 Read initial values for STOMATE's variables from the _restart_ file 766 co2_flux(:,:) = zero767 776 768 777 ! Get values from _restart_ file. Note that only ::kjpindex, ::index, ::lalo … … 795 804 litterpart, litter, dead_leaves, & 796 805 carbon, lignin_struc,turnover_time,& 797 fco2_lu,&806 co2_flux, fco2_lu, fco2_wh, fco2_ha, & 798 807 prod10,prod100,flux10, flux100, & 799 808 convflux, cflux_prod10, cflux_prod100, & … … 807 816 MatrixV, VectorU, previous_stock, current_stock, assim_param) 808 817 809 ! Copy module variable fco2_lu into local variable to allow it to be in the argument output list of the subroutine810 fco2_lu_out(:)=fco2_lu(:)811 812 818 !! 1.4.5 Check time step 813 819 … … 1160 1166 !! 1161 1167 !! MAIN OUTPUT VARIABLE(S): deadleaf_cover, assim_param, lai, height, veget, 1162 !! veget_max, resp_maint, 1163 !! resp_hetero,resp_growth, co2_flux, fco2_lu_out.1168 !! veget_max, resp_maint, resp_hetero, resp_growth, 1169 !! co2_flux_out, fco2_lu_out, fco2_wh_out, fco2_ha_out. 1164 1170 !! 1165 1171 !! REFERENCES : … … 1183 1189 & veget_max_new, woodharvest, totfrac_nobio_new, fraclut, & 1184 1190 & rest_id_stom, hist_id_stom, hist_id_stom_IPCC, & 1185 & co2_flux, fco2_lu_out, resp_maint,resp_hetero,resp_growth,co2_to_bm_radia,temp_growth) 1191 & co2_flux_out, fco2_lu_out, fco2_wh_out, fco2_ha_out, & 1192 & resp_maint, resp_hetero, resp_growth, co2_to_bm_radia, temp_growth) 1186 1193 1187 1194 IMPLICIT NONE … … 1236 1243 !! 0.2 Output variables 1237 1244 1238 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux 1245 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: co2_flux_out !! CO2 flux between atmosphere and biosphere per 1239 1246 !! average ground area 1240 1247 !! @tex $(gC m^{-2} dt_sechiba^{-1})$ @endtex 1241 1248 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: fco2_lu_out !! CO2 flux between atmosphere and biosphere from 1242 !! land-use (without forest management) 1243 !! @tex $(gC m^{-2} dt_stomate^{-1})$ @endtex 1249 !! land-use (without forest management) (gC/m2/dt_stomate) 1250 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: fco2_wh_out !! CO2 Flux to Atmosphere from Wood Harvesting (gC/m2/dt_stomate) 1251 REAL(r_std),DIMENSION(kjpindex),INTENT(out) :: fco2_ha_out !! CO2 Flux to Atmosphere from Crop Harvesting (gC/m2/dt_stomate) 1244 1252 REAL(r_std),DIMENSION(kjpindex,nvm),INTENT(out) :: resp_maint !! Maitenance component of autotrophic respiration in 1245 1253 !! @tex $(gC m^{-2} dt_stomate^{-1})$ @endtex … … 1599 1607 & Tseason, Tmin_spring_time, begin_leaves, onset_date) 1600 1608 1609 1601 1610 !! 5.3.2 Calculate the total CO2 flux from land use change 1602 fco2_lu(:) = convflux(:) & 1603 & + cflux_prod10(:) & 1604 & + cflux_prod100(:) & 1605 & + harvest_above(:) & 1606 & + convflux_harvest(:) & 1607 & + cflux_prod10_harvest(:) & 1608 & + cflux_prod100_harvest(:) 1611 1612 ! CO2 from land-use change 1613 fco2_lu(:) = convflux(:) + cflux_prod10(:) + cflux_prod100(:) 1614 1615 ! CO2 from wood harvest 1616 fco2_wh(:) = convflux_harvest(:) + cflux_prod10_harvest(:) + cflux_prod100_harvest(:) 1609 1617 1618 ! CO2 from harvest 1619 fco2_ha(:) = harvest_above(:) 1620 1610 1621 !! 5.4 Calculate veget and veget_max 1611 1622 veget_max(:,:) = zero … … 1758 1769 CALL xios_orchidee_send_field("rhSoil",SUM(resp_hetero_soil*veget_cov_max,dim=2)/1e3) 1759 1770 CALL xios_orchidee_send_field("rhLitter",SUM(resp_hetero_litter*veget_cov_max,dim=2)/1e3) 1760 1761 1771 1772 ! Calculate co2_flux as (-1)*nep_daily*veget_cov_max. 1773 ! This variable will be used for the coupling to LMDZ for ESM configuration. 1774 co2_flux(:,:) = (resp_hetero_d(:,:) + resp_maint_d(:,:) + resp_growth_d(:,:) & 1775 + co2_fire(:,:) - gpp_daily(:,:))*veget_cov_max 1776 1762 1777 IF ( hist_id_stom_IPCC > 0 ) THEN 1763 1778 vartmp(:) = SUM(nep_daily*veget_cov_max,dim=2)/1e3/one_day*contfrac … … 1846 1861 !! 6. Outputs from Stomate 1847 1862 1848 ! co2_flux receives a value from STOMATE only if STOMATE is activated.1849 ! Otherwise, the calling hydrological module must do this itself.1850 1851 1863 !! 6.1 Respiration and fluxes 1852 1864 resp_maint(:,:) = resp_maint_radia(:,:)*veget_cov_max(:,:) … … 1856 1868 resp_hetero(:,:) = resp_hetero_radia(:,:)*veget_cov_max(:,:) 1857 1869 1858 !! 6.2 Derived CO2 fluxes1859 ! CO2 flux in gC m^{-2} s^{-1} (positive towards the atmosphere) is sum of:1860 ! (1) heterotrophic respiration from ground + (2) maintenance respiration1861 ! from the plants + (3) growth respiration from the plants + (4) co21862 ! emissions from fire - (5) co2 taken up in the DGVM to establish1863 ! saplings - (6) co2 taken up by photosyntyhesis1864 ! co2_to_bm is not included here as it is already encounted in the gpp1865 co2_flux(:,:) = resp_hetero(:,:) + resp_maint(:,:) + resp_growth(:,:) &1866 & + co2_fire(:,:)*veget_cov_max(:,:)*dt_sechiba/one_day &1867 & - gpp(:,:)1868 1869 1870 temp_growth(:)=t2m_month(:)-tp_00 1870 1871 1871 ! Copy module variable fco2_lu into local variable to allow it to be in the argument output list of the subroutine 1872 1873 ! Copy module variables into local variables to allow them to be in the argument output list of the subroutine 1874 co2_flux_out(:,:)=co2_flux(:,:) 1872 1875 fco2_lu_out(:)=fco2_lu(:) 1876 fco2_wh_out(:)=fco2_wh(:) 1877 fco2_ha_out(:)=fco2_ha(:) 1873 1878 1874 1879 … … 2123 2128 litterpart, litter, dead_leaves, & 2124 2129 carbon, lignin_struc,turnover_time,& 2125 fco2_lu,&2130 co2_flux, fco2_lu, fco2_wh, fco2_ha, & 2126 2131 prod10,prod100,flux10, flux100, & 2127 2132 convflux, cflux_prod10, cflux_prod100, & … … 3080 3085 ENDIF 3081 3086 3087 ALLOCATE (co2_flux(kjpindex,nvm), stat=ier) 3088 l_error = l_error .OR. (ier /= 0) 3089 IF (l_error) THEN 3090 WRITE(numout,*) 'Memory allocation error for co2_flux. We stop. We need kjpindex words',kjpindex,nvm 3091 STOP 'stomate_init' 3092 ENDIF 3093 3082 3094 ALLOCATE (fco2_lu(kjpindex), stat=ier) 3083 3095 l_error = l_error .OR. (ier /= 0) 3084 3096 IF (l_error) THEN 3085 3097 WRITE(numout,*) 'Memory allocation error for fco2_lu. We stop. We need kjpindex words',kjpindex 3098 STOP 'stomate_init' 3099 ENDIF 3100 3101 ALLOCATE (fco2_wh(kjpindex), stat=ier) 3102 l_error = l_error .OR. (ier /= 0) 3103 IF (l_error) THEN 3104 WRITE(numout,*) 'Memory allocation error for fco2_wh. We stop. We need kjpindex words',kjpindex 3105 STOP 'stomate_init' 3106 ENDIF 3107 3108 ALLOCATE (fco2_ha(kjpindex), stat=ier) 3109 l_error = l_error .OR. (ier /= 0) 3110 IF (l_error) THEN 3111 WRITE(numout,*) 'Memory allocation error for fco2_ha. We stop. We need kjpindex words',kjpindex 3086 3112 STOP 'stomate_init' 3087 3113 ENDIF … … 3594 3620 IF ( ALLOCATED (horip11_index)) DEALLOCATE (horip11_index) 3595 3621 IF ( ALLOCATED (horip101_index)) DEALLOCATE (horip101_index) 3622 IF ( ALLOCATED (co2_flux)) DEALLOCATE (co2_flux) 3596 3623 IF ( ALLOCATED (fco2_lu)) DEALLOCATE (fco2_lu) 3624 IF ( ALLOCATED (fco2_wh)) DEALLOCATE (fco2_wh) 3625 IF ( ALLOCATED (fco2_ha)) DEALLOCATE (fco2_ha) 3597 3626 IF ( ALLOCATED (prod10)) DEALLOCATE (prod10) 3598 3627 IF ( ALLOCATED (prod100)) DEALLOCATE (prod100) -
branches/ORCHIDEE_2_2/ORCHIDEE/src_stomate/stomate_io.f90
r6160 r6319 80 80 & litterpart, litter, dead_leaves, & 81 81 & carbon, lignin_struc,turnover_time, & 82 & fco2_lu, &82 & co2_flux, fco2_lu, fco2_wh, fco2_ha, & 83 83 & prod10,prod100,flux10, flux100, & 84 84 & convflux, cflux_prod10, cflux_prod100, & … … 327 327 ! products remaining in the 10/100 year-turnover pool after the annual release for each compartment 328 328 ! (10 or 100 + 1 : input from year of land cover change) 329 REAL(r_std),DIMENSION(npts, nvm),INTENT(out) :: co2_flux 329 330 REAL(r_std),DIMENSION(npts),INTENT(out) :: fco2_lu 331 REAL(r_std),DIMENSION(npts),INTENT(out) :: fco2_wh 332 REAL(r_std),DIMENSION(npts),INTENT(out) :: fco2_ha 330 333 REAL(r_std),DIMENSION(npts,0:10),INTENT(out) :: prod10 331 334 REAL(r_std),DIMENSION(npts,0:100),INTENT(out) :: prod100 … … 1034 1037 !- 1035 1038 ! Read from restart file or set to zero if the variables or restart file were not found 1039 1040 var_name = 'co2_flux' 1041 CALL restget_p (rest_id_stomate, var_name, nbp_glo, nvm, 1, itime, & 1042 .TRUE., co2_flux, 'gather', nbp_glo, index_g) 1043 IF (ALL(co2_flux(:,:) == val_exp)) co2_flux(:,:) = zero 1044 1036 1045 var_name = 'fco2_lu' 1037 1046 CALL restget_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 1038 1047 .TRUE., fco2_lu, 'gather', nbp_glo, index_g) 1039 1048 IF (ALL(fco2_lu(:) == val_exp)) fco2_lu(:) = zero 1049 1050 var_name = 'fco2_wh' 1051 CALL restget_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 1052 .TRUE., fco2_wh, 'gather', nbp_glo, index_g) 1053 IF (ALL(fco2_wh(:) == val_exp)) fco2_wh(:) = zero 1054 1055 var_name = 'fco2_ha' 1056 CALL restget_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 1057 .TRUE., fco2_ha, 'gather', nbp_glo, index_g) 1058 IF (ALL(fco2_ha(:) == val_exp)) fco2_ha(:) = zero 1059 1040 1060 1041 1061 IF (vegetmap_reset) THEN … … 1332 1352 & litterpart, litter, dead_leaves, & 1333 1353 & carbon, lignin_struc, turnover_time, & 1334 & fco2_lu,&1354 & co2_flux, fco2_lu, fco2_wh, fco2_ha, & 1335 1355 & prod10,prod100 ,flux10, flux100, & 1336 1356 & convflux, cflux_prod10, cflux_prod100, & … … 1570 1590 ! products remaining in the 10/100 year-turnover pool after the annual release for each compartment 1571 1591 ! (10 or 100 + 1 : input from year of land cover change) 1592 REAL(r_std),DIMENSION(npts,nvm),INTENT(in) :: co2_flux 1572 1593 REAL(r_std),DIMENSION(npts),INTENT(in) :: fco2_lu 1594 REAL(r_std),DIMENSION(npts),INTENT(in) :: fco2_wh 1595 REAL(r_std),DIMENSION(npts),INTENT(in) :: fco2_ha 1573 1596 REAL(r_std),DIMENSION(npts,0:10),INTENT(in) :: prod10 1574 1597 REAL(r_std),DIMENSION(npts,0:100),INTENT(in) :: prod100 … … 2074 2097 ! 18 land cover change 2075 2098 !- 2099 var_name = 'co2_flux' 2100 CALL restput_p (rest_id_stomate, var_name, nbp_glo, nvm, 1, itime, & 2101 & co2_flux, 'scatter', nbp_glo, index_g) 2076 2102 var_name = 'fco2_lu' 2077 2103 CALL restput_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 2078 2104 & fco2_lu, 'scatter', nbp_glo, index_g) 2105 var_name = 'fco2_wh' 2106 CALL restput_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 2107 & fco2_wh, 'scatter', nbp_glo, index_g) 2108 var_name = 'fco2_ha' 2109 CALL restput_p (rest_id_stomate, var_name, nbp_glo, 1, 1, itime, & 2110 & fco2_ha, 'scatter', nbp_glo, index_g) 2111 2079 2112 var_name = 'prod10' 2080 2113 CALL restput_p (rest_id_stomate, var_name, nbp_glo, 11, 1, itime, &
Note: See TracChangeset
for help on using the changeset viewer.