Changeset 3549


Ignore:
Timestamp:
Aug 5, 2019, 9:40:19 PM (5 years ago)
Author:
oboucher
Message:

Allocate CO2 flux variables at first timestep

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90

    r3531 r3549  
    6565!--convert 280 ppm into kg CO2 / kg air
    6666    IF (debutphy) THEN
     67
    6768      IF (MAXVAL(tr_seri(:,:,id_CO2)).LT.1.e-15) THEN
    6869        !!tr_seri(:,:,id_CO2)=280.e-6/RMD*RMCO2
    6970        tr_seri(:,:,id_CO2)=400.e-6/RMD*RMCO2 !--initialised to 400 ppm for a test
    7071      ENDIF
     72
     73      ALLOCATE(fco2_ff(klon))
     74      ALLOCATE(fco2_bb(klon))
     75      ALLOCATE(fco2_land(klon))
     76      ALLOCATE(fco2_ocean(klon))
     77
    7178    ENDIF
    7279
     
    8794    fco2_ocean(:)=0.0
    8895    DO nb=1, nbcf_in
     96      print *,'nb tracco2=', nb, cfname_in(nb)
    8997!--fCO2_nep comes in unit of kg C m-2 s-1
    9098!--converting to kg CO2 m-2 s-1
    91       IF (cfname_in(nb) == "fCO2_nep" )   fco2_land(:)=fields_in(:,nb)*RMCO2/RMC*pctsrf(:,is_ter)
     99      IF (cfname_in(nb) == "fCO2_nbp" )   fco2_land(:)=fields_in(:,nb)*RMCO2/RMC*pctsrf(:,is_ter)
    92100!--fCO2_fgco2 comes in unit of mol C02 m-2 s-1
    93101!--converting to kg CO2 m-2 s-1 + change sign
     
    106114      CALL gather(m_air,m_air_glo)
    107115!$OMP MASTER
     116
    108117!--compute a global mean CO2 value and print its value in ppm
    109118       IF (is_mpi_root) THEN
     
    138147    USE netcdf, ONLY: nf90_get_var, nf90_noerr, nf90_nowrite
    139148
    140     USE carbon_cycle_mod, ONLY : fco2_ff, fco2_bb
     149    USE carbon_cycle_mod, ONLY : fco2_ff, fco2_bb, fco2_land, fco2_ocean
    141150
    142151    IMPLICIT NONE
     
    259268    PRINT *,'probleme avec le mois dans co2_ini =', mth_cur
    260269  ENDIF
    261   IF (.NOT.ALLOCATED(fco2_ff)) ALLOCATE(fco2_ff(klon))
    262   IF (.NOT.ALLOCATED(fco2_bb)) ALLOCATE(fco2_bb(klon))
     270
    263271  fco2_ff(:) = flx_co2ff(:,mth_cur)
    264272  fco2_bb(:) = flx_co2bb(:,mth_cur)
Note: See TracChangeset for help on using the changeset viewer.