Changeset 3450 for LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90
- Timestamp:
- Jan 25, 2019, 7:51:34 PM (6 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90
r3435 r3450 11 11 USE dimphy 12 12 USE infotrac_phy 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 13 USE geometry_mod, ONLY: cell_area 14 USE carbon_cycle_mod, ONLY: id_CO2, nbcf_in, fields_in, cfname_in, fco2_ocn_day, fco2_ff, fco2_bb 15 USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_rad, RCO2_glo, RCO2_tot 15 16 USE mod_grid_phy_lmdz 16 USE mod_phys_lmdz_mpi_data, ONLY :is_mpi_root17 USE mod_phys_lmdz_mpi_data, ONLY: is_mpi_root 17 18 USE mod_phys_lmdz_para, ONLY: gather, bcast, scatter 18 19 USE phys_cal_mod 20 USE phys_state_var_mod, ONLY: pctsrf 21 USE indice_sol_mod, ONLY: nbsrf, is_ter, is_lic, is_oce, is_sic 19 22 20 23 IMPLICIT NONE … … 45 48 !---------------- 46 49 47 INTEGER, PARAMETER :: id_CO2=1 !--temporaire OB -- to be changed48 50 INTEGER :: it, k, i, nb 49 51 REAL, DIMENSION(klon,klev) :: m_air ! mass of air in every grid box [kg] … … 53 55 REAL, DIMENSION(klon_glo,klev) :: m_air_glo ! variable temporaire sur la grille global 54 56 55 56 INTEGER, SAVE :: mth_pre=0 57 !$OMP THREADPRIVATE(mth_pre) 58 REAL, SAVE :: RCO2_glo 59 !$OMP THREADPRIVATE(RCO2_glo) 57 INTEGER, SAVE :: mth_pre=0, day_pre=0 58 !$OMP THREADPRIVATE(mth_pre, day_pre) 60 59 61 60 IF (is_mpi_root) THEN … … 68 67 IF (debutphy) THEN 69 68 IF (MAXVAL(tr_seri(:,:,id_CO2)).LT.1.e-15) THEN 70 tr_seri(:,:,id_CO2)=280.e-6/RMD*RMCO2 69 !!tr_seri(:,:,id_CO2)=280.e-6/RMD*RMCO2 70 tr_seri(:,:,id_CO2)=400.e-6/RMD*RMCO2 !--initialised to 400 ppm for a test 71 71 ENDIF 72 72 ENDIF … … 85 85 86 86 !--retrieving land and ocean CO2 flux 87 !--fCO2_nep comes in unit of g CO2 m-2 dt_stomate-188 !--this needs to be changed in ORCHIDEE89 87 co2land(:)=0.0 90 88 co2ocean(:)=0.0 91 89 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 90 !--fCO2_nep comes in unit of kg C m-2 s-1 91 !--converting to kg CO2 m-2 s-1 92 IF (cfname_in(nb) == "fCO2_nep" ) co2land(:)=fields_in(:,nb)*RMCO2/RMC*pctsrf(:,is_ter) 93 !--fCO2_fgco2 comes in unit of mol C02 m-2 s-1 94 !--converting to kg CO2 m-2 s-1 + change sign 95 IF (cfname_in(nb) == "fCO2_fgco2" ) co2ocean(:)=-1.*fco2_ocn_day(:)*RMCO2/1.e3*(pctsrf(:,is_oce)+pctsrf(:,is_sic)) 94 96 ENDDO 95 97 … … 99 101 100 102 !--computing global mean CO2 for radiation 101 !--every timestep for now but enough every month103 !--every timestep for now but enough every day 102 104 ! IF (debutphy.OR.mth_cur.NE.mth_pre) THEN 105 ! IF (debutphy.OR.day_cur.NE.day_pre) THEN 103 106 CALL gather(tr_seri(:,:,id_CO2),co2_glo) 104 107 CALL gather(m_air,m_air_glo) 105 108 !$OMP MASTER 106 !--co nversion from kg CO2/kg air intoppm109 !--compute a global mean CO2 value and print its value in ppm 107 110 IF (is_mpi_root) THEN 108 RCO2_glo=SUM(co2_glo*m_air_glo)/SUM(m_air_glo)*1.e6*RMD/RMCO2 111 RCO2_tot=SUM(co2_glo*m_air_glo) !--unit kg CO2 112 RCO2_glo=RCO2_tot/SUM(m_air_glo) !--unit kg CO2 / kg air 113 PRINT *,'tracco2i: global CO2 in ppm =', RCO2_glo*1.e6*RMD/RMCO2 114 PRINT *,'tracco2i: total CO2 in kg =', RCO2_tot 109 115 ENDIF 110 PRINT *,'toto in tracco2i: global CO2 in ppm =', RCO2_glo111 116 !$OMP END MASTER 112 117 CALL bcast(RCO2_glo) 113 118 mth_pre=mth_cur 119 day_pre=day_cur 120 !--if not carbon_cycle_tr, then we reinitialize the CO2 each day to its global mean value 121 IF (.NOT.carbon_cycle_tr) THEN 122 tr_seri(:,:,id_CO2)=RCO2_glo 123 ENDIF 114 124 ! ENDIF 115 125
Note: See TracChangeset
for help on using the changeset viewer.