- Timestamp:
- Nov 21, 2019, 4:43:45 PM (5 years ago)
- Location:
- LMDZ6/branches/Ocean_skin
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/branches/Ocean_skin
-
LMDZ6/branches/Ocean_skin/libf/phylmd/carbon_cycle_mod.F90
r3421 r3605 7 7 ! ----------------------- 8 8 ! Control module for the carbon CO2 tracers : 9 ! - Identification 10 ! - Get concentrations comming from coupled model or read from file to tracers 11 ! - Calculate new RCO2 for radiation scheme 12 ! - Calculate new carbon flux for sending to coupled models (PISCES and ORCHIDEE) 13 ! 14 ! Module permettant de mettre a jour les champs (puits et sources) pour le 15 ! transport de CO2 en online (IPSL-CM et LMDZOR) et offline (lecture de carte) 9 ! - Initialisation of carbon cycle fields 10 ! - Definition of fluxes to be exchanged 11 ! 12 ! Rest of code is in tracco2i.F90 16 13 ! 17 14 ! Le cas online/offline est defini par le flag carbon_cycle_cpl (y/n) … … 35 32 SAVE 36 33 PRIVATE 37 PUBLIC :: carbon_cycle_init, carbon_cycle,infocfields_init34 PUBLIC :: carbon_cycle_init, infocfields_init 38 35 39 36 ! Variables read from parmeter file physiq.def 37 LOGICAL, PUBLIC :: carbon_cycle_cpl ! Coupling of CO2 fluxes between LMDZ/ORCHIDEE and LMDZ/OCEAN(PISCES) 38 !$OMP THREADPRIVATE(carbon_cycle_cpl) 40 39 LOGICAL, PUBLIC :: carbon_cycle_tr ! 3D transport of CO2 in the atmosphere, parameter read in conf_phys 41 40 !$OMP THREADPRIVATE(carbon_cycle_tr) 42 LOGICAL, PUBLIC :: carbon_cycle_ cpl ! Coupling of CO2 fluxes between LMDZ/ORCHIDEE and LMDZ/OCEAN(PISCES)43 !$OMP THREADPRIVATE(carbon_cycle_ cpl)41 LOGICAL, PUBLIC :: carbon_cycle_rad ! CO2 interactive radiatively 42 !$OMP THREADPRIVATE(carbon_cycle_rad) 44 43 INTEGER, PUBLIC :: level_coupling_esm ! Level of coupling for the ESM - 0, 1, 2, 3 45 44 !$OMP THREADPRIVATE(level_coupling_esm) 45 REAL, PUBLIC :: RCO2_glo 46 !$OMP THREADPRIVATE(RCO2_glo) 47 REAL, PUBLIC :: RCO2_tot 48 !$OMP THREADPRIVATE(RCO2_tot) 46 49 47 50 LOGICAL :: carbon_cycle_emis_comp_omp=.FALSE. … … 78 81 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_bb ! Emission from biomass burning [kgCO2/m2/s] 79 82 !$OMP THREADPRIVATE(fco2_bb) 83 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 84 !$OMP THREADPRIVATE(fco2_land) 85 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land_nbp ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 86 !$OMP THREADPRIVATE(fco2_land_nbp) 87 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land_nep ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 88 !$OMP THREADPRIVATE(fco2_land_nep) 89 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land_fLuc ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 90 !$OMP THREADPRIVATE(fco2_land_fLuc) 91 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land_fwoodharvest ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 92 !$OMP THREADPRIVATE(fco2_land_fwoodharvest) 93 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_land_fHarvest ! Net flux from terrestrial ecocsystems [kgCO2/m2/s] 94 !$OMP THREADPRIVATE(fco2_land_fHarvest) 95 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: fco2_ocean ! Net flux from ocean [kgCO2/m2/s] 96 !$OMP THREADPRIVATE(fco2_ocean) 80 97 81 98 REAL, DIMENSION(:,:), ALLOCATABLE :: dtr_add ! Tracer concentration to be injected … … 91 108 REAL, DIMENSION(:), ALLOCATABLE, PUBLIC :: co2_send ! Field allocated in phyetat0 92 109 !$OMP THREADPRIVATE(co2_send) 110 111 INTEGER, PARAMETER, PUBLIC :: id_CO2=1 !--temporaire OB -- to be changed 93 112 94 113 ! nbfields : total number of fields … … 181 200 CONTAINS 182 201 183 SUBROUTINE carbon_cycle_init( tr_seri, pdtphys, aerosol, radio)202 SUBROUTINE carbon_cycle_init() 184 203 ! This subroutine is called from traclmdz_init, only at first timestep. 185 204 ! - Read controle parameters from .def input file … … 189 208 190 209 USE dimphy 191 USE geometry_mod, ONLY : cell_area192 USE mod_phys_lmdz_transfert_para193 USE infotrac_phy, ONLY: nbtr, nqo, niadv, tname194 210 USE IOIPSL 195 USE surface_data, ONLY : ok_veget, type_ocean196 USE phys_cal_mod, ONLY : mth_len197 211 USE print_control_mod, ONLY: lunout 198 212 … … 200 214 INCLUDE "clesphys.h" 201 215 202 ! Input argument203 REAL,DIMENSION(klon,klev,nbtr),INTENT(IN) :: tr_seri ! Concentration Traceur [U/KgA]204 REAL,INTENT(IN) :: pdtphys ! length of time step in physiq (sec)205 206 ! InOutput arguments207 LOGICAL,DIMENSION(nbtr), INTENT(INOUT) :: aerosol208 LOGICAL,DIMENSION(nbtr), INTENT(INOUT) :: radio209 210 216 ! Local variables 211 INTEGER :: ierr, it, iiq, itc 212 INTEGER :: teststop 213 214 ! 1) Read controle parameters from .def input file 215 ! ------------------------------------------------ 216 ! Read fosil fuel value if no transport 217 IF (.NOT. carbon_cycle_tr) THEN 218 !$OMP MASTER 219 fos_fuel_s_omp = 0. 220 CALL getin ('carbon_cycle_fos_fuel',fos_fuel_s_omp) 221 !$OMP END MASTER 222 !$OMP BARRIER 223 fos_fuel_s=fos_fuel_s_omp 224 WRITE(lunout,*) 'carbon_cycle_fos_fuel = ', fos_fuel_s 225 END IF 226 227 ! Read parmeter for calculation compatible emission 228 IF (.NOT. carbon_cycle_tr) THEN 229 !$OMP MASTER 230 carbon_cycle_emis_comp_omp=.FALSE. 231 CALL getin('carbon_cycle_emis_comp',carbon_cycle_emis_comp_omp) 232 !$OMP END MASTER 233 !$OMP BARRIER 234 carbon_cycle_emis_comp=carbon_cycle_emis_comp_omp 235 WRITE(lunout,*) 'carbon_cycle_emis_comp = ',carbon_cycle_emis_comp 236 IF (carbon_cycle_emis_comp) THEN 237 CALL abort_physic('carbon_cycle_init', 'carbon_cycle_emis_comp option not yet implemented!!',1) 238 END IF 239 END IF 240 241 ! Read parameter for interactive calculation of the CO2 value for the radiation scheme 242 !$OMP MASTER 243 RCO2_inter_omp=.FALSE. 244 CALL getin('RCO2_inter',RCO2_inter_omp) 245 !$OMP END MASTER 246 !$OMP BARRIER 247 RCO2_inter=RCO2_inter_omp 248 WRITE(lunout,*) 'RCO2_inter = ', RCO2_inter 249 IF (RCO2_inter) THEN 250 WRITE(lunout,*) 'RCO2 will be recalculated once a day' 251 WRITE(lunout,*) 'RCO2 initial = ', RCO2 252 END IF 253 254 255 ! 2) Search for carbon tracers and set default values 256 ! --------------------------------------------------- 257 itc=0 258 DO it=1,nbtr 259 !! iiq=niadv(it+2) ! jyg 260 iiq=niadv(it+nqo) ! jyg 261 262 SELECT CASE(tname(iiq)) 263 CASE("fCO2_ocn") 264 itc = itc + 1 265 co2trac(itc)%name='fCO2_ocn' 266 co2trac(itc)%id=it 267 co2trac(itc)%file='fl_co2_ocean.nc' 268 IF (carbon_cycle_cpl .AND. type_ocean=='couple') THEN 269 co2trac(itc)%cpl=.TRUE. 270 co2trac(itc)%updatefreq = 86400 ! Once a day as the coupling with OASIS/PISCES 271 ELSE 272 co2trac(itc)%cpl=.FALSE. 273 co2trac(itc)%updatefreq = 86400*mth_len ! Once a month 274 END IF 275 CASE("fCO2_land") 276 itc = itc + 1 277 co2trac(itc)%name='fCO2_land' 278 co2trac(itc)%id=it 279 co2trac(itc)%file='fl_co2_land.nc' 280 IF (carbon_cycle_cpl .AND. ok_veget) THEN 281 co2trac(itc)%cpl=.TRUE. 282 co2trac(itc)%updatefreq = INT(pdtphys) ! Each timestep as the coupling with ORCHIDEE 283 ELSE 284 co2trac(itc)%cpl=.FALSE. 285 ! co2trac(itc)%updatefreq = 10800 ! 10800sec = 3H 286 co2trac(itc)%updatefreq = 86400*mth_len ! Once a month 287 END IF 288 CASE("fCO2_land_use") 289 itc = itc + 1 290 co2trac(itc)%name='fCO2_land_use' 291 co2trac(itc)%id=it 292 co2trac(itc)%file='fl_co2_land_use.nc' 293 IF (carbon_cycle_cpl .AND. ok_veget) THEN 294 co2trac(it)%cpl=.TRUE. 295 co2trac(itc)%updatefreq = INT(pdtphys) ! Each timestep as the coupling with ORCHIDEE 296 ELSE 297 co2trac(itc)%cpl=.FALSE. 298 co2trac(itc)%updatefreq = 10800 ! 10800sec = 3H 299 END IF 300 CASE("fCO2_fos_fuel") 301 itc = itc + 1 302 co2trac(itc)%name='fCO2_fos_fuel' 303 co2trac(itc)%id=it 304 co2trac(itc)%file='fossil_fuel.nc' 305 co2trac(itc)%cpl=.FALSE. ! This tracer always read from file 306 ! co2trac(itc)%updatefreq = 86400 ! 86400sec = 24H Cadule case 307 co2trac(itc)%updatefreq = 86400*mth_len ! Once a month 308 CASE("fCO2_bbg") 309 itc = itc + 1 310 co2trac(itc)%name='fCO2_bbg' 311 co2trac(itc)%id=it 312 co2trac(itc)%file='fl_co2_bbg.nc' 313 co2trac(itc)%cpl=.FALSE. ! This tracer always read from file 314 co2trac(itc)%updatefreq = 86400*mth_len ! Once a month 315 CASE("fCO2") 316 ! fCO2 : One tracer transporting the total CO2 flux 317 itc = itc + 1 318 co2trac(itc)%name='fCO2' 319 co2trac(itc)%id=it 320 co2trac(itc)%file='fl_co2.nc' 321 IF (carbon_cycle_cpl) THEN 322 co2trac(itc)%cpl=.TRUE. 323 ELSE 324 co2trac(itc)%cpl=.FALSE. 325 END IF 326 co2trac(itc)%updatefreq = 86400 327 ! DOES THIS WORK ???? Problematic due to implementation of the coupled fluxes... 328 CALL abort_physic('carbon_cycle_init','transport of total CO2 has to be implemented and tested',1) 329 END SELECT 330 END DO 331 332 ! Total number of carbon CO2 tracers 333 ntr_co2 = itc 334 335 ! Definition of control varaiables for the tracers 336 DO it=1,ntr_co2 337 aerosol(co2trac(it)%id) = .FALSE. 338 radio(co2trac(it)%id) = .FALSE. 339 END DO 340 341 ! Vector indicating which timestep to read for each tracer 342 ! Always start read in the beginning of the file 343 co2trac(:)%readstep = 0 344 345 346 ! 3) Allocate variables 347 ! --------------------- 348 ! Allocate vector for storing fluxes to inject 349 ALLOCATE(dtr_add(klon,maxco2trac), stat=ierr) 350 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation 11',1) 351 352 ! Allocate variables for cumulating fluxes from ORCHIDEE 353 IF (RCO2_inter) THEN 354 IF (.NOT. carbon_cycle_tr .AND. carbon_cycle_cpl) THEN 355 ALLOCATE(fco2_land_day(klon), stat=ierr) 356 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation 2',1) 357 fco2_land_day(1:klon) = 0. 358 359 ALLOCATE(fco2_lu_day(klon), stat=ierr) 360 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation 3',1) 361 fco2_lu_day(1:klon) = 0. 362 END IF 363 END IF 364 365 366 ! 4) Test for compatibility 367 ! ------------------------- 368 ! IF (carbon_cycle_cpl .AND. type_ocean/='couple') THEN 369 ! WRITE(lunout,*) 'Coupling with ocean model is needed for carbon_cycle_cpl' 370 ! CALL abort_physic('carbon_cycle_init', 'coupled ocean is needed for carbon_cycle_cpl',1) 371 ! END IF 372 ! 373 ! IF (carbon_cycle_cpl .AND..NOT. ok_veget) THEN 374 ! WRITE(lunout,*) 'Coupling with surface land model ORCHDIEE is needed for carbon_cycle_cpl' 375 ! CALL abort_physic('carbon_cycle_init', 'ok_veget is needed for carbon_cycle_cpl',1) 376 ! END IF 377 378 ! Compiler test : following should never happen 379 teststop=0 380 DO it=1,teststop 381 CALL abort_physic('carbon_cycle_init', 'Entering loop from 1 to 0',1) 382 END DO 383 384 IF (ntr_co2==0) THEN 385 ! No carbon tracers found in tracer.def. It is not possible to do carbon cycle 386 WRITE(lunout,*) 'No carbon tracers found in tracer.def. Not ok with carbon_cycle_tr and/or carbon_cycle_cp' 387 CALL abort_physic('carbon_cycle_init', 'No carbon tracers found in tracer.def',1) 388 END IF 389 390 ! 5) Calculate total area of the earth surface 391 ! -------------------------------------------- 392 CALL reduce_sum(SUM(cell_area),airetot) 393 CALL bcast(airetot) 217 INTEGER :: ierr 218 219 IF (carbon_cycle_cpl) THEN 220 221 ierr=0 222 223 IF (.NOT.ALLOCATED(fco2_land)) ALLOCATE(fco2_land(klon), stat=ierr) 224 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land',1) 225 fco2_land(1:klon) = 0. 226 227 IF (.NOT.ALLOCATED(fco2_land_nbp)) ALLOCATE(fco2_land_nbp(klon), stat=ierr) 228 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_nbp',1) 229 fco2_land_nbp(1:klon) = 0. 230 231 IF (.NOT.ALLOCATED(fco2_land_nep)) ALLOCATE(fco2_land_nep(klon), stat=ierr) 232 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_nep',1) 233 fco2_land_nep(1:klon) = 0. 234 235 IF (.NOT.ALLOCATED(fco2_land_fLuc)) ALLOCATE(fco2_land_fLuc(klon), stat=ierr) 236 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fLuc',1) 237 fco2_land_fLuc(1:klon) = 0. 238 239 IF (.NOT.ALLOCATED(fco2_land_fwoodharvest)) ALLOCATE(fco2_land_fwoodharvest(klon), stat=ierr) 240 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fwoodharvest',1) 241 fco2_land_fwoodharvest(1:klon) = 0. 242 243 IF (.NOT.ALLOCATED(fco2_land_fHarvest)) ALLOCATE(fco2_land_fHarvest(klon), stat=ierr) 244 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fHarvest',1) 245 fco2_land_fHarvest(1:klon) = 0. 246 247 IF (.NOT.ALLOCATED(fco2_ff)) ALLOCATE(fco2_ff(klon), stat=ierr) 248 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_ff',1) 249 fco2_ff(1:klon) = 0. 250 251 IF (.NOT.ALLOCATED(fco2_bb)) ALLOCATE(fco2_bb(klon), stat=ierr) 252 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_bb',1) 253 fco2_bb(1:klon) = 0. 254 255 IF (.NOT.ALLOCATED(fco2_ocean)) ALLOCATE(fco2_ocean(klon), stat=ierr) 256 IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_ocean',1) 257 fco2_bb(1:klon) = 0. 258 ENDIF 394 259 395 260 END SUBROUTINE carbon_cycle_init 396 261 397 SUBROUTINE carbon_cycle(nstep, pdtphys, pctsrf, tr_seri, source)398 ! Subroutine for injection of co2 in the tracers399 !400 ! - Find out if it is time to update401 ! - Get tracer from coupled model or from file402 ! - Calculate new RCO2 value for the radiation scheme403 ! - Calculate CO2 flux to send to ocean and land models (PISCES and ORCHIDEE)404 405 USE infotrac_phy, ONLY: nbtr406 USE dimphy407 USE mod_phys_lmdz_transfert_para408 USE phys_cal_mod, ONLY : mth_cur, mth_len409 USE phys_cal_mod, ONLY : day_cur410 USE indice_sol_mod411 USE print_control_mod, ONLY: lunout412 USE geometry_mod, ONLY : cell_area413 414 IMPLICIT NONE415 416 INCLUDE "clesphys.h"417 INCLUDE "YOMCST.h"418 419 ! In/Output arguments420 INTEGER,INTENT(IN) :: nstep ! time step in physiq421 REAL,INTENT(IN) :: pdtphys ! length of time step in physiq (sec)422 REAL,DIMENSION(klon,nbsrf),INTENT(IN) :: pctsrf ! Surface fraction423 REAL, DIMENSION(klon,klev,nbtr), INTENT(INOUT) :: tr_seri ! All tracers424 REAL, DIMENSION(klon,nbtr), INTENT(INOUT) :: source ! Source for all tracers425 426 ! Local variables427 INTEGER :: it428 LOGICAL :: newmonth ! indicates if a new month just started429 LOGICAL :: newday ! indicates if a new day just started430 LOGICAL :: endday ! indicated if last time step in a day431 432 REAL, PARAMETER :: fact=1.E-15/2.12 ! transformation factor from gC/m2/day => ppm/m2/day433 REAL, DIMENSION(klon) :: fco2_tmp434 REAL :: sumtmp435 REAL :: delta_co2_ppm436 437 438 ! 1) Calculate logicals indicating if it is a new month, new day or the last time step in a day (end day)439 ! -------------------------------------------------------------------------------------------------------440 441 newday = .FALSE.; endday = .FALSE.; newmonth = .FALSE.442 443 IF (MOD(nstep,INT(86400./pdtphys))==1) newday=.TRUE.444 IF (MOD(nstep,INT(86400./pdtphys))==0) endday=.TRUE.445 IF (newday .AND. day_cur==1) newmonth=.TRUE.446 447 ! 2) For each carbon tracer find out if it is time to inject (update)448 ! --------------------------------------------------------------------449 DO it = 1, ntr_co2450 IF ( MOD(nstep,INT(co2trac(it)%updatefreq/pdtphys)) == 1 ) THEN451 co2trac(it)%updatenow = .TRUE.452 ELSE453 co2trac(it)%updatenow = .FALSE.454 END IF455 END DO456 457 ! 3) Get tracer update458 ! --------------------------------------459 DO it = 1, ntr_co2460 IF ( co2trac(it)%updatenow ) THEN461 IF ( co2trac(it)%cpl ) THEN462 ! Get tracer from coupled model463 SELECT CASE(co2trac(it)%name)464 CASE('fCO2_land') ! from ORCHIDEE465 dtr_add(:,it) = fco2_land_inst(:)*pctsrf(:,is_ter)*fact ! [ppm/m2/day]466 CASE('fCO2_land_use') ! from ORCHIDEE467 dtr_add(:,it) = fco2_lu_inst(:) *pctsrf(:,is_ter)*fact ! [ppm/m2/day]468 CASE('fCO2_ocn') ! from PISCES469 dtr_add(:,it) = fco2_ocn_day(:) *pctsrf(:,is_oce)*fact ! [ppm/m2/day]470 CASE DEFAULT471 WRITE(lunout,*) 'Error with tracer ',co2trac(it)%name472 CALL abort_physic('carbon_cycle', 'No coupling implemented for this tracer',1)473 END SELECT474 ELSE475 ! Read tracer from file476 co2trac(it)%readstep = co2trac(it)%readstep + 1 ! increment time step in file477 ! Patricia CALL read_map2D(co2trac(it)%file,'fco2',co2trac(it)%readstep,.FALSE.,dtr_add(:,it))478 CALL read_map2D(co2trac(it)%file,'fco2',co2trac(it)%readstep,.TRUE.,dtr_add(:,it))479 480 ! Converte from kgC/m2/h to kgC/m2/s481 dtr_add(:,it) = dtr_add(:,it)/3600482 ! Add individual treatment of values read from file483 SELECT CASE(co2trac(it)%name)484 CASE('fCO2_land')485 dtr_add(:,it) = dtr_add(:,it) *pctsrf(:,is_ter)486 CASE('fCO2_land_use')487 dtr_add(:,it) = dtr_add(:,it) *pctsrf(:,is_ter)488 CASE('fCO2_ocn')489 dtr_add(:,it) = dtr_add(:,it) *pctsrf(:,is_oce)490 ! Patricia :491 ! CASE('fCO2_fos_fuel')492 ! dtr_add(:,it) = dtr_add(:,it)/mth_len493 ! co2trac(it)%readstep = 0 ! Always read same value for fossil fuel(Cadule case)494 END SELECT495 END IF496 END IF497 END DO498 499 ! 4) Update co2 tracers :500 ! Loop over all carbon tracers and add source501 ! ------------------------------------------------------------------502 IF (carbon_cycle_tr) THEN503 DO it = 1, ntr_co2504 IF (.FALSE.) THEN505 tr_seri(1:klon,1,co2trac(it)%id) = tr_seri(1:klon,1,co2trac(it)%id) + dtr_add(1:klon,it)506 source(1:klon,co2trac(it)%id) = 0.507 ELSE508 source(1:klon,co2trac(it)%id) = dtr_add(1:klon,it)509 END IF510 END DO511 END IF512 513 514 ! 5) Calculations for new CO2 value for the radiation scheme(instead of reading value from .def)515 ! ----------------------------------------------------------------------------------------------516 IF (RCO2_inter) THEN517 ! Cumulate fluxes from ORCHIDEE at each timestep518 IF (.NOT. carbon_cycle_tr .AND. carbon_cycle_cpl) THEN519 IF (newday) THEN ! Reset cumulative variables once a day520 fco2_land_day(1:klon) = 0.521 fco2_lu_day(1:klon) = 0.522 END IF523 fco2_land_day(1:klon) = fco2_land_day(1:klon) + fco2_land_inst(1:klon) ![gC/m2/day]524 fco2_lu_day(1:klon) = fco2_lu_day(1:klon) + fco2_lu_inst(1:klon) ![gC/m2/day]525 END IF526 527 ! At the end of a new day, calculate a mean scalare value of CO2528 ! JG : Ici on utilise uniquement le traceur du premier couche du modele. Est-ce que c'est correcte ?529 IF (endday) THEN530 531 IF (carbon_cycle_tr) THEN532 ! Sum all co2 tracers to get the total delta CO2 flux533 fco2_tmp(:) = 0.534 DO it = 1, ntr_co2535 fco2_tmp(1:klon) = fco2_tmp(1:klon) + tr_seri(1:klon,1,co2trac(it)%id)536 END DO537 538 ELSE IF (carbon_cycle_cpl) THEN ! no carbon_cycle_tr539 ! Sum co2 fluxes comming from coupled models and parameter for fossil fuel540 fco2_tmp(1:klon) = fos_fuel_s + ((fco2_lu_day(1:klon) + fco2_land_day(1:klon))*pctsrf(1:klon,is_ter) &541 + fco2_ocn_day(:)*pctsrf(:,is_oce)) * fact542 END IF543 544 ! Calculate a global mean value of delta CO2 flux545 fco2_tmp(1:klon) = fco2_tmp(1:klon) * cell_area(1:klon)546 CALL reduce_sum(SUM(fco2_tmp),sumtmp)547 CALL bcast(sumtmp)548 delta_co2_ppm = sumtmp/airetot549 550 ! Add initial value for co2_ppm and delta value551 co2_ppm = co2_ppm0 + delta_co2_ppm552 553 ! Transformation of atmospheric CO2 concentration for the radiation code554 RCO2 = co2_ppm * 1.0e-06 * 44.011/28.97555 556 WRITE(lunout,*) 'RCO2 is now updated! RCO2 = ', RCO2557 END IF ! endday558 559 END IF ! RCO2_inter560 561 562 ! 6) Calculate CO2 flux to send to ocean and land models : PISCES and ORCHIDEE563 ! ----------------------------------------------------------------------------564 IF (carbon_cycle_cpl) THEN565 566 IF (carbon_cycle_tr) THEN567 ! Sum all co2 tracers to get the total delta CO2 flux at first model layer568 fco2_tmp(:) = 0.569 DO it = 1, ntr_co2570 fco2_tmp(1:klon) = fco2_tmp(1:klon) + tr_seri(1:klon,1,co2trac(it)%id)571 END DO572 co2_send(1:klon) = fco2_tmp(1:klon) + co2_ppm0573 ELSE574 ! Send a scalare value in 2D variable to ocean and land model (PISCES and ORCHIDEE)575 co2_send(1:klon) = co2_ppm576 END IF577 578 END IF579 580 END SUBROUTINE carbon_cycle581 582 262 SUBROUTINE infocfields_init 583 263 584 USE control_mod, ONLY: planet_type264 ! USE control_mod, ONLY: planet_type 585 265 USE phys_cal_mod, ONLY : mth_cur 586 266 USE mod_synchro_omp … … 656 336 657 337 CHARACTER(len=*),parameter :: modname="infocfields" 338 339 CHARACTER(len=10),SAVE :: planet_type="earth" 658 340 659 341 !----------------------------------------------------------------------- … … 718 400 WRITE(lunout,*) 'abort_gcm --- nbcf_in : ',nbcf_in 719 401 WRITE(lunout,*) 'abort_gcm --- nbcf_out: ',nbcf_out 720 CALL abort_ gcm('infocfields_init','Problem in the definition of the coupling fields',1)402 CALL abort_physic('infocfields_init','Problem in the definition of the coupling fields',1) 721 403 ENDIF 722 404 ENDDO !DO iq=1,nbcf … … 836 518 837 519 ALLOCATE(fields_in(klon,nbcf_in),stat=error) 838 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation fields_in',1)520 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation fields_in',1) 839 521 ALLOCATE(yfields_in(klon,nbcf_in),stat=error) 840 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation yfields_in',1)522 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation yfields_in',1) 841 523 ALLOCATE(fields_out(klon,nbcf_out),stat=error) 842 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation fields_out',1)524 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation fields_out',1) 843 525 ALLOCATE(yfields_out(klon,nbcf_out),stat=error) 844 IF (error /= 0) CALL abort_ gcm(modname,'Pb in allocation yfields_out',1)526 IF (error /= 0) CALL abort_physic(modname,'Pb in allocation yfields_out',1) 845 527 846 528 END SUBROUTINE infocfields_init
Note: See TracChangeset
for help on using the changeset viewer.