Changeset 3421 for LMDZ6/trunk
- Timestamp:
- Dec 7, 2018, 10:08:07 PM (6 years ago)
- Location:
- LMDZ6/trunk/libf/phylmd
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/carbon_cycle_mod.F90
r3391 r3421 74 74 REAL, DIMENSION(:), ALLOCATABLE :: fco2_lu_day ! Emission from land use change for 1 day (cumulated) [gC/m2/d] 75 75 !$OMP THREADPRIVATE(fco2_lu_day) 76 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_ff ! Emission from fossil fuel [kgCO2/m2/s] 77 !$OMP THREADPRIVATE(fco2_ff) 78 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_bb ! Emission from biomass burning [kgCO2/m2/s] 79 !$OMP THREADPRIVATE(fco2_bb) 76 80 77 81 REAL, DIMENSION(:,:), ALLOCATABLE :: dtr_add ! Tracer concentration to be injected -
LMDZ6/trunk/libf/phylmd/phyetat0.F90
r3317 r3421 435 435 END DO 436 436 CALL traclmdz_from_restart(trs) 437 437 ENDIF 438 439 !--OB now this is for co2i 440 IF (type_trac == 'co2i') THEN 438 441 IF (carbon_cycle_cpl) THEN 439 442 ALLOCATE(co2_send(klon), stat=ierr) -
LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90
r3383 r3421 12 12 USE infotrac 13 13 USE geometry_mod, ONLY : cell_area 14 USE carbon_cycle_mod, ONLY : nbcf_in, fields_in, cfname_in, fco2_ocn_day, fco2_ff, fco2_bb 14 15 USE mod_grid_phy_lmdz 15 16 USE mod_phys_lmdz_mpi_data, ONLY : is_mpi_root … … 44 45 !---------------- 45 46 46 INTEGER, PARAMETER :: id_CO2=1 !--temporaire OB=> PC to be changed 47 REAL, PARAMETER :: MCO2=44.011 !--g/mol 48 INTEGER :: it, k, i 49 REAL, DIMENSION(klon,klev) :: m_air ! mass of air in every grid box [kg] 50 REAL, DIMENSION(klon) :: co2ff ! surface fossil-fuel CO2 emissions [kg CO2/m2/s] 51 REAL, DIMENSION(klon) :: co2bb ! surface biomass burning CO2 emissions [kg CO2/m2/s] 47 INTEGER, PARAMETER :: id_CO2=1 !--temporaire OB -- to be changed 48 INTEGER :: it, k, i, nb 49 REAL, DIMENSION(klon,klev) :: m_air ! mass of air in every grid box [kg] 50 REAL, DIMENSION(klon) :: co2land ! surface land CO2 emissions [kg CO2/m2/s] 51 REAL, DIMENSION(klon) :: co2ocean ! surface ocean CO2 emissions [kg CO2/m2/s] 52 52 REAL, DIMENSION(klon_glo,klev) :: co2_glo ! variable temporaire sur la grille global 53 53 REAL, DIMENSION(klon_glo,klev) :: m_air_glo ! variable temporaire sur la grille global … … 68 68 IF (debutphy) THEN 69 69 IF (MAXVAL(tr_seri(:,:,id_CO2)).LT.1.e-15) THEN 70 tr_seri(:,:,id_CO2)=280.e-6/RMD* MCO270 tr_seri(:,:,id_CO2)=280.e-6/RMD*RMCO2 71 71 ENDIF 72 72 ENDIF 73 73 74 !--calculate mass of air in every grid box in kg 74 !--calculate mass of air in every grid box in kg air 75 75 DO i=1, klon 76 76 DO k=1, klev … … 81 81 !--call CO2 emission routine 82 82 !--co2bb is zero for now 83 CALL co2_emissions(debutphy,co2ff,co2bb) 83 !--unit kg CO2 m-2 s-1 84 CALL co2_emissions(debutphy) 85 86 !--retrieving land and ocean CO2 flux 87 !--fCO2_nep comes in unit of g CO2 m-2 dt_stomate-1 88 !--this needs to be changed in ORCHIDEE 89 co2land(:)=0.0 90 co2ocean(:)=0.0 91 DO nb=1, nbcf_in 92 IF (cfname_in(nb) == "fCO2_nep" ) co2land(:)=fields_in(:,nb)*RMCO2/RMC/86400./1000. 93 !!IF (cfname_in(nb) == "fCO2_fgco2" ) co2ocean(:)=fco2_ocn_day(:) !--for now 94 ENDDO 84 95 85 96 !--preparing the net anthropogenic flux at the surface for mixing layer 86 97 !--unit kg CO2 / m2 / s 87 source(:,id_CO2)= co2ff(:)+co2bb(:)98 source(:,id_CO2)=fco2_ff(:)+fco2_bb(:)+co2land(:)+co2ocean(:) 88 99 89 100 !--computing global mean CO2 for radiation 101 !--every timestep for now but enough every month 90 102 ! IF (debutphy.OR.mth_cur.NE.mth_pre) THEN 91 103 CALL gather(tr_seri(:,:,id_CO2),co2_glo) 92 104 CALL gather(m_air,m_air_glo) 93 105 !$OMP MASTER 106 !--conversion from kg CO2/kg air into ppm 94 107 IF (is_mpi_root) THEN 95 RCO2_glo=SUM(co2_glo*m_air_glo)/SUM(m_air_glo)*1.e6*RMD/ MCO2108 RCO2_glo=SUM(co2_glo*m_air_glo)/SUM(m_air_glo)*1.e6*RMD/RMCO2 96 109 ENDIF 97 PRINT *,' in tracco2i: global CO2 in ppm =', RCO2_glo110 PRINT *,'toto in tracco2i: global CO2 in ppm =', RCO2_glo 98 111 !$OMP END MASTER 99 112 CALL bcast(RCO2_glo) … … 103 116 END SUBROUTINE tracco2i 104 117 105 SUBROUTINE co2_emissions(debutphy ,co2ff,co2bb)118 SUBROUTINE co2_emissions(debutphy) 106 119 107 120 USE dimphy … … 116 129 USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite 117 130 131 USE carbon_cycle_mod, ONLY : fco2_ff, fco2_bb 132 118 133 IMPLICIT NONE 119 134 120 135 INCLUDE "YOMCST.h" 121 136 LOGICAL,INTENT(IN) :: debutphy 122 REAL,DIMENSION(klon),INTENT(out) :: co2ff ! fossil-fuel CO2 emissions123 REAL,DIMENSION(klon),INTENT(out) :: co2bb ! biomass burning CO2 emissions124 137 125 138 ! For NetCDF: … … 130 143 REAL, POINTER:: vector(:), time(:) 131 144 REAL,ALLOCATABLE :: flx_co2ff_glo(:,:) ! fossil-fuel CO2 145 REAL,ALLOCATABLE :: flx_co2bb_glo(:,:) ! biomass-burning CO2 132 146 REAL,ALLOCATABLE, SAVE :: flx_co2ff(:,:) ! fossil-fuel CO2 133 REAL,ALLOCATABLE :: flx_co2bb_glo(:,:) ! biomass-burning CO2134 147 REAL,ALLOCATABLE, SAVE :: flx_co2bb(:,:) ! biomass-burning CO2 135 !$OMP THREADPRIVATE(flx_co2ff, 148 !$OMP THREADPRIVATE(flx_co2ff,flx_co2bb) 136 149 137 150 !! may be controlled via the .def later on … … 234 247 PRINT *,'probleme avec le mois dans co2_ini =', mth_cur 235 248 ENDIF 236 co2ff(:) = flx_co2ff(:,mth_cur) 237 co2bb(:) = flx_co2bb(:,mth_cur) 249 IF (.NOT.ALLOCATED(fco2_ff)) ALLOCATE(fco2_ff(klon)) 250 IF (.NOT.ALLOCATED(fco2_bb)) ALLOCATE(fco2_bb(klon)) 251 fco2_ff(:) = flx_co2ff(:,mth_cur) 252 fco2_bb(:) = flx_co2bb(:,mth_cur) 238 253 239 254 END SUBROUTINE co2_emissions
Note: See TracChangeset
for help on using the changeset viewer.