Changeset 4298


Ignore:
Timestamp:
Oct 17, 2022, 10:15:06 AM (2 years ago)
Author:
pcadule
Message:

modifications to ensure restartability of the model when CO2 tracer is passed to radiative code, and to add diagnostics variables

Location:
LMDZ6/trunk
Files:
12 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/DefLists/file_def_histday_lmdz.xml

    r4248 r4298  
    196196                <field field_ref="cdrh" level="10" />
    197197                <field field_ref="cldl" level="1" />
    198                 <field field_ref="cumCO2" level="5" />
     198                <field field_ref="cumCO2" level="5" />  <!-- Added PC -->
    199199                <field field_ref="cldm" level="1" />
    200200                <field field_ref="cldh" level="1" />
     
    245245                <field field_ref="colO3_strat" level="6" />     <!-- Added ThL -->
    246246                <field field_ref="colO3_trop"  level="6" />     <!-- Added ThL -->
     247                <field field_ref="flx_co2_ocean"  level="5" /> <!-- Added PC -->
     248                <field field_ref="flx_co2_land"   level="5" /> <!-- Added PC -->
     249                <field field_ref="flx_co2_ocean_cor" level="5" /> <!-- Added PC -->
     250                <field field_ref="flx_co2_land_cor"  level="5" /> <!-- Added PC -->
     251                <field field_ref="flx_co2_ff"  level="5" /> <!-- Added PC -->
     252                <field field_ref="flx_co2_bb"  level="5" /> <!-- Added PC -->
     253
    247254
    248255                <field_group operation="average" detect_missing_value=".true.">
     
    444451            <!-- VARS 3D -->
    445452            <field_group operation="average" grid_ref="grid_out_presnivs">
    446                 <field field_ref="CO2" level="5" />
     453                <field field_ref="CO2" level="5" /> <!-- Added PC -->
    447454                <field field_ref="dCO2_vdf" level="5" />
    448455                <field field_ref="dCO2_the" level="5" />
  • LMDZ6/trunk/DefLists/file_def_histhf_lmdz.xml

    r4248 r4298  
    430430                <field field_ref="dqthe2d" level="10" />
    431431                <field field_ref="dqajs2d" level="10" />
     432                <field field_ref="flx_co2_ocean"  level="10" /> <!-- Added PC -->
     433                <field field_ref="flx_co2_land"   level="10" /> <!-- Added PC -->
     434                <field field_ref="flx_co2_ocean_cor" level="10" /> <!-- Added PC -->
     435                <field field_ref="flx_co2_land_cor"  level="10" /> <!-- Added PC -->
     436                <field field_ref="flx_co2_ff"  level="10" /> <!-- Added PC -->
     437                <field field_ref="flx_co2_bb"  level="10" /> <!-- Added PC -->
     438
    432439            </field_group>
    433440
     
    464471            <!-- VARS 3D -->
    465472            <field_group operation="average" grid_ref="grid_out_presnivs">
     473                <field field_ref="CO2" level="10" /> <!-- Added PC -->
    466474                <field field_ref="tke" level="10" />
    467475                <field field_ref="tke_ter" level="10" />
  • LMDZ6/trunk/DefLists/file_def_histmth_lmdz.xml

    r4248 r4298  
    234234                <field field_ref="cldt" level="1" />
    235235                <field field_ref="cldq" level="1" />
     236                <field field_ref="cumCO2" level="5" />  <!-- Added PC -->
    236237                <field field_ref="lwp" level="1" />
    237238                <field field_ref="iwp" level="1" />
     
    498499            <!-- VARS 3D -->
    499500            <field_group operation="average" grid_ref="grid_out_presnivs">
     501                <field field_ref="CO2" level="5" />  <!-- Added PC -->
     502                <field field_ref="dCO2_vdf" level="5" />  <!-- Added PC -->
     503                <field field_ref="dCO2_the" level="5" />  <!-- Added PC -->
     504                <field field_ref="dCO2_con" level="5" />  <!-- Added PC -->
    500505                <field field_ref="tke" level="7" />
    501506                <field field_ref="tke_ter" level="10" />
  • LMDZ6/trunk/libf/phylmd/carbon_cycle_mod.F90

    r3876 r4298  
    237237       IF (.NOT.ALLOCATED(fco2_land)) ALLOCATE(fco2_land(klon), stat=ierr)
    238238       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land',1)
    239        fco2_land(1:klon) = 0.
    240239
    241240       IF (.NOT.ALLOCATED(fco2_land_nbp)) ALLOCATE(fco2_land_nbp(klon), stat=ierr)
    242241       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_nbp',1)
    243        fco2_land_nbp(1:klon) = 0.
    244242
    245243       IF (.NOT.ALLOCATED(fco2_land_nep)) ALLOCATE(fco2_land_nep(klon), stat=ierr)
    246244       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_nep',1)
    247        fco2_land_nep(1:klon) = 0.
    248245
    249246       IF (.NOT.ALLOCATED(fco2_land_fLuc)) ALLOCATE(fco2_land_fLuc(klon), stat=ierr)
    250247       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fLuc',1)
    251        fco2_land_fLuc(1:klon) = 0.
    252248
    253249       IF (.NOT.ALLOCATED(fco2_land_fwoodharvest)) ALLOCATE(fco2_land_fwoodharvest(klon), stat=ierr)
    254250       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fwoodharvest',1)
    255        fco2_land_fwoodharvest(1:klon) = 0.
    256251
    257252       IF (.NOT.ALLOCATED(fco2_land_fHarvest)) ALLOCATE(fco2_land_fHarvest(klon), stat=ierr)
    258253       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_fHarvest',1)
    259        fco2_land_fHarvest(1:klon) = 0.
    260254
    261255       IF (.NOT.ALLOCATED(fco2_ff)) ALLOCATE(fco2_ff(klon), stat=ierr)
    262256       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_ff',1)
    263        fco2_ff(1:klon) = 0.
    264257
    265258       IF (.NOT.ALLOCATED(fco2_bb)) ALLOCATE(fco2_bb(klon), stat=ierr)
    266259       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_bb',1)
    267        fco2_bb(1:klon) = 0.
    268260
    269261       IF (.NOT.ALLOCATED(fco2_ocean)) ALLOCATE(fco2_ocean(klon), stat=ierr)
    270262       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_ocean',1)
    271        fco2_ocean(1:klon) = 0.
    272263
    273264       IF (.NOT.ALLOCATED(fco2_ocean_cor)) ALLOCATE(fco2_ocean_cor(klon), stat=ierr)
    274265       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_ocean_cor',1)
    275        fco2_ocean_cor(1:klon) = 0.
     266
    276267       IF (.NOT.ALLOCATED(fco2_land_cor)) ALLOCATE(fco2_land_cor(klon), stat=ierr)
    277268       IF (ierr /= 0) CALL abort_physic('carbon_cycle_init', 'pb in allocation fco2_land_cor',1)
    278        fco2_land_cor(1:klon) = 0.
    279269
    280270    ENDIF
  • LMDZ6/trunk/libf/phylmd/phyetat0.F90

    r4263 r4298  
    2525  USE infotrac_phy,     ONLY: nqtot, nbtr, type_trac, types_trac, tracers
    2626  USE traclmdz_mod,     ONLY: traclmdz_from_restart
    27   USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl, co2_send
     27  USE carbon_cycle_mod, ONLY: carbon_cycle_init, carbon_cycle_cpl, carbon_cycle_tr, carbon_cycle_rad, co2_send, RCO2_glo
    2828  USE indice_sol_mod,   ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic
    2929  USE ocean_slab_mod,   ONLY: nslay, tslab, seaice, tice, ocean_slab_init
     
    113113
    114114  ! co2_ppm : value from the previous time step
     115
     116  ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
     117  co2_ppm0 = 284.32
     118  ! when no initial value is available e.g., from a restart
     119  ! this variable must be set  in a .def file which will then be
     120  ! used by the conf_phys_m.F90 routine.
     121  ! co2_ppm0 = 284.32 (illustrative example on how to set the variable in .def
     122  ! file, for a pre-industrial CO2 concentration value)
     123
    115124  IF (carbon_cycle_tr .OR. carbon_cycle_cpl) THEN
    116125     co2_ppm = tab_cntrl(3)
    117126     RCO2    = co2_ppm * 1.0e-06 * RMCO2 / RMD
     127     IF (tab_cntrl(17) > 0. .AND. carbon_cycle_rad) THEN
     128           RCO2_glo = tab_cntrl(17)
     129       ELSE
     130           RCO2_glo    = co2_ppm0 * 1.0e-06 * RMCO2 / RMD
     131     ENDIF
    118132     ! ELSE : keep value from .def
    119133  ENDIF
    120 
    121 ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
    122 ! co2_ppm0   = tab_cntrl(16)
    123 ! initial value for interactive CO2 run when there is no tracer field for CO2 in restart
    124   co2_ppm0=284.32
    125134
    126135  solaire_etat0      = tab_cntrl(4)
     
    145154  clesphy0(7)=tab_cntrl( 11 )
    146155  clesphy0(8)=tab_cntrl( 12 )
     156  clesphy0(9)=tab_cntrl( 17 )
    147157
    148158  ! set time iteration
     
    454464        ALLOCATE(co2_send(klon), stat=ierr)
    455465        IF (ierr /= 0) CALL abort_physic('phyetat0', 'pb allocation co2_send', 1)
    456         found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm)
     466        !found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm)
     467        found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm0)
    457468     ENDIF
    458469  ELSE IF (type_trac == 'lmdz') THEN
  • LMDZ6/trunk/libf/phylmd/phyredem.F90

    r4263 r4298  
    3636  USE traclmdz_mod, ONLY : traclmdz_to_restart
    3737  USE infotrac_phy, ONLY: type_trac, types_trac, nqtot, tracers, nbtr
    38   USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send
     38  USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo
    3939  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra
    4040  USE surface_data, ONLY: type_ocean, version_ocean
     
    108108
    109109  ! co2_ppm0 : initial value of atmospheric CO2
    110   tab_cntrl(16) = co2_ppm0
     110  ! tab_cntrl(16) = co2_ppm0
     111
     112  !  PC -- initial value of RCO2 for the radiation scheme
     113  !  tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD
     114  IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo
     115  !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo
    111116
    112117  DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
     
    140145
    141146    CALL put_field(pass,"FLIC", "fraction glace de terre", pctsrf(:, is_lic))
    142 
    143147    ! 3. fraction ocean
    144148
  • LMDZ6/trunk/libf/phylmd/physiq_mod.F90

    r4236 r4298  
    43204320          !
    43214321          !--interactive CO2 in ppm from carbon cycle
    4322           IF (carbon_cycle_rad.AND..NOT.debut) THEN
    4323             RCO2=RCO2_glo
    4324           ENDIF
     4322          IF (carbon_cycle_rad) RCO2=RCO2_glo
    43254323          !
    43264324          IF (prt_level .GE.10) THEN
  • LMDZ6/trunk/libf/phylmd/phytrac_mod.F90

    r4293 r4298  
    8181    IF(ANY(types_trac == 'co2i') .OR. ANY(types_trac == 'inco')) CALL tracco2i_init()
    8282
     83       !   -- types_trac == 'co2i' ! PC
     84       !   -- CO2 interactif --
     85       !   -- source is updated with FF and BB emissions
     86       !   -- and net fluxes from ocean and orchidee
     87       !   -- sign convention : positive into the atmosphere
    8388
    8489  END SUBROUTINE phytrac_init
  • LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90

    r4260 r4298  
    103103    IF (debutphy) THEN
    104104
    105 ! Initialisation de tr_seri(id_CO2) si pas initialise
     105! Initialization of tr_seri(id_CO2) If it is not initialized
    106106      IF (MAXVAL(tr_seri(:,:,id_CO2)).LT.1.e-15) THEN
    107107        tr_seri(:,:,id_CO2)=co2_ppm0*1.e-6/RMD*RMCO2 !--initialised from co2_ppm0 in rdem
     
    310310         RCO2_tot=SUM(co2_glo*m_air_glo)  !--unit kg CO2
    311311         RCO2_glo=RCO2_tot/SUM(m_air_glo) !--unit kg CO2 / kg air
     312         ! the following operation is only to maintain precision consistency
     313         ! of RCO2_glo which differs whether it is directly computed or read from
     314         ! a restart file (after having been computed)
     315         RCO2_glo = FLOAT(INT(RCO2_glo * 1e8))/1e8
    312316         PRINT *,'tracco2i: global CO2 in ppm =', RCO2_glo*1.e6*RMD/RMCO2
    313317         PRINT *,'tracco2i: total CO2 in kg =', RCO2_tot
     
    316320       CALL bcast(RCO2_glo)
    317321       day_pre=day_cur
     322
    318323!--if not carbon_cycle_tr, then we reinitialize the CO2 each day to its global mean value
    319324       IF (.NOT.carbon_cycle_tr) THEN
  • LMDZ6/trunk/libf/phylmdiso/phyetat0.F90

    r4170 r4298  
    3333  USE infotrac_phy,     ONLY: nqtot, nbtr, types_trac, tracers
    3434  USE traclmdz_mod,     ONLY: traclmdz_from_restart
    35   USE carbon_cycle_mod, ONLY: carbon_cycle_tr, carbon_cycle_cpl, co2_send
     35  USE carbon_cycle_mod, ONLY: carbon_cycle_init, carbon_cycle_cpl, carbon_cycle_tr, carbon_cycle_rad, co2_send, RCO2_glo
    3636  USE indice_sol_mod,   ONLY: nbsrf, is_ter, epsfra, is_lic, is_oce, is_sic
    3737  USE ocean_slab_mod,   ONLY: nslay, tslab, seaice, tice, ocean_slab_init
     
    134134
    135135  ! co2_ppm : value from the previous time step
     136
     137  ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
     138  co2_ppm0 = 284.32
     139  ! when no initial value is available e.g., from a restart
     140  ! this variable must be set  in a .def file which will then be
     141  ! used by the conf_phys_m.F90 routine.
     142  ! co2_ppm0 = 284.32 (illustrative example on how to set the variable in .def
     143  ! file, for a pre-industrial CO2 concentration value)
     144
    136145  IF (carbon_cycle_tr .OR. carbon_cycle_cpl) THEN
    137146     co2_ppm = tab_cntrl(3)
    138147     RCO2    = co2_ppm * 1.0e-06 * RMCO2 / RMD
     148     IF (tab_cntrl(17) > 0. .AND. carbon_cycle_rad) THEN
     149           RCO2_glo = tab_cntrl(17)
     150       ELSE
     151           RCO2_glo    = co2_ppm0 * 1.0e-06 * RMCO2 / RMD
     152     ENDIF
    139153     ! ELSE : keep value from .def
    140154  ENDIF
    141 
    142 ! co2_ppm0 : initial value of atmospheric CO2 (from create_etat0_limit.e .def)
    143 ! co2_ppm0   = tab_cntrl(16)
    144 ! initial value for interactive CO2 run when there is no tracer field for CO2 in restart
    145   co2_ppm0=284.32
    146155
    147156  solaire_etat0      = tab_cntrl(4)
     
    166175  clesphy0(7)=tab_cntrl( 11 )
    167176  clesphy0(8)=tab_cntrl( 12 )
     177  clesphy0(9)=tab_cntrl( 17 )
    168178
    169179  ! set time iteration
     
    473483        ALLOCATE(co2_send(klon), stat=ierr)
    474484        IF (ierr /= 0) CALL abort_physic('phyetat0', 'pb allocation co2_send', 1)
    475         found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm)
     485        found=phyetat0_get(1,co2_send,"co2_send","co2 send",co2_ppm0)
    476486     ENDIF
    477487  ELSE IF (ANY(types_trac == 'lmdz')) THEN
  • LMDZ6/trunk/libf/phylmdiso/phyredem.F90

    r4170 r4298  
    4545#endif
    4646#endif
    47   USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send
     47  USE carbon_cycle_mod, ONLY : carbon_cycle_cpl, co2_send, carbon_cycle_rad, RCO2_glo
    4848  USE indice_sol_mod, ONLY: nbsrf, is_oce, is_sic, is_ter, is_lic, epsfra
    4949  USE surface_data, ONLY: type_ocean, version_ocean
     
    130130
    131131  ! co2_ppm0 : initial value of atmospheric CO2
    132   tab_cntrl(16) = co2_ppm0
     132  ! tab_cntrl(16) = co2_ppm0
     133
     134  !  PC -- initial value of RCO2 for the radiation scheme
     135  !  tab_cntrl(17) = co2_ppm * 1.0e-06 * RMCO2 / RMD
     136  IF (carbon_cycle_rad) tab_cntrl(17) = RCO2_glo
     137  !PRINT*, "PC : phyredem RCO2_glo =",RCO2_glo
    133138
    134139  DO pass=1,2   ! pass=1 netcdf definition ; pass=2 netcdf write
  • LMDZ6/trunk/libf/phylmdiso/physiq_mod.F90

    r4234 r4298  
    54975497          !
    54985498          !--interactive CO2 in ppm from carbon cycle
    5499           IF (carbon_cycle_rad.AND..NOT.debut) THEN
    5500             RCO2=RCO2_glo
    5501           ENDIF
     5499          IF (carbon_cycle_rad) RCO2=RCO2_glo
    55025500          !
    55035501          IF (prt_level .GE.10) THEN
Note: See TracChangeset for help on using the changeset viewer.