Changeset 3649


Ignore:
Timestamp:
Mar 17, 2020, 12:41:16 PM (5 years ago)
Author:
jghattas
Message:

Correction necessaire pour experience IPSLESM/CO2 pour eviter plantage aleatoire en mode debug : carbon_cpl_init doit etre appele avant premier appel a phys_output_write pour que tout les variables (fco2_land, etc..) soient allouees.

Location:
LMDZ6/trunk/libf/phylmd
Files:
3 edited

Legend:

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

    r3581 r3649  
    201201 
    202202  SUBROUTINE carbon_cycle_init()
    203 ! This subroutine is called from traclmdz_init, only at first timestep.
    204 ! - Read controle parameters from .def input file
    205 ! - Search for carbon tracers and set default values
    206 ! - Allocate variables
    207 ! - Test for compatibility
     203    ! This subroutine is called from tracco2i_init, which is called from phytrac_init only at first timestep.
     204    ! - Allocate variables. These variables must be allocated before first call to phys_output_write in physiq.
    208205
    209206    USE dimphy
  • LMDZ6/trunk/libf/phylmd/phytrac_mod.F90

    r3531 r3649  
    5656  SUBROUTINE phytrac_init()
    5757    USE dimphy
    58     USE infotrac_phy, ONLY: nbtr
     58    USE infotrac_phy, ONLY: nbtr, type_trac
     59    USE tracco2i_mod, ONLY: tracco2i_init
    5960    IMPLICIT NONE
    6061
     
    7071       ALLOCATE(d_tr_th(klon,klev,nbtr))
    7172       ALLOCATE(d_tr_lessi_impa(klon,klev,nbtr),d_tr_lessi_nucl(klon,klev,nbtr))
     73
     74
     75
     76    !===============================================================================
     77    !    -- Do specific treatment according to chemestry model or local LMDZ tracers
     78    !     
     79    !===============================================================================
     80    SELECT CASE(type_trac)
     81    CASE('co2i')
     82       !   -- CO2 interactif --
     83       CALL tracco2i_init()
     84    END SELECT
     85
    7286
    7387  END SUBROUTINE phytrac_init
  • LMDZ6/trunk/libf/phylmd/tracco2i_mod.F90

    r3581 r3649  
    1414CONTAINS
    1515
     16  SUBROUTINE tracco2i_init()
     17    ! This subroutine calls carbon_cycle_init needed to be done before first call to phys_output_write in physiq.
     18    USE carbon_cycle_mod, ONLY: carbon_cycle_init, carbon_cycle_cpl
     19
     20    ! Initialize carbon_cycle_mod
     21    IF (carbon_cycle_cpl) THEN
     22       CALL carbon_cycle_init()
     23    ENDIF
     24
     25  END SUBROUTINE tracco2i_init
     26
    1627  SUBROUTINE tracco2i(pdtphys, debutphy, &
    1728       xlat, xlon, pphis, pphi, &
     
    2132    USE infotrac_phy
    2233    USE geometry_mod, ONLY: cell_area
    23     USE carbon_cycle_mod, ONLY: carbon_cycle_init
    2434    USE carbon_cycle_mod, ONLY: id_CO2, nbcf_in, fields_in, cfname_in
    2535    USE carbon_cycle_mod, ONLY: fco2_ocn_day, fco2_ff, fco2_bb, fco2_land, fco2_ocean
     
    7989!--convert 280 ppm into kg CO2 / kg air
    8090    IF (debutphy) THEN
    81 
    82 ! Initialisation de module carbon_cycle_mod
    83       IF (carbon_cycle_cpl) THEN
    84         CALL carbon_cycle_init()
    85       ENDIF
    8691
    8792! Initialisation de tr_seri(id_CO2) si pas initialise
Note: See TracChangeset for help on using the changeset viewer.