Ignore:
Timestamp:
Mar 24, 2026, 5:27:57 PM (3 weeks ago)
Author:
yluo
Message:

Mars PCM:
Refactored the tracer mass-conservation fixer for dynamics introduced in r4142:
Added a runtime flag to enable/disable the correction of tracer mass non-conservation in dynamics.
Reorganized the implementation into a modular structure.
Restricted the correction to a subset of tracers: CO, O2, H2, HO2, H2O2, N2, Ar, and He.
Enabled correction for dynamics timesteps preceding the first physics timestep of a simulation.
YCL

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/libf/phymars/phyredem.F90

    r3964 r4150  
    198198  use iostart,             only: open_restartphy, close_restartphy, put_var, put_field
    199199  use tracer_mod,          only: noms ! tracer names
     200  use tracer_mod,          only: igcm_co, igcm_o2, igcm_h2, igcm_ho2, igcm_h2o2, igcm_n2, igcm_ar, igcm_he
    200201  use nonoro_gwd_ran_mod,  only: du_nonoro_gwd, dv_nonoro_gwd
    201202  use compute_dtau_mod,    only: dtau
     
    206207  use comslope_mod,        only: nslope
    207208  use paleoclimate_mod,    only: paleoclimate
     209  use tracer_mass_fixer_dyn_mod, only: call_mass_fixer_dyn, mass_predyn
    208210  use callkeys_mod,        only: calltherm, dustinjection, calllott_nonoro
    209211  use callkeys_mod, only: CLFvarying
     
    392394  endif
    393395
     396  ! Correction to tracer mass non-conservations in dynamics
     397  if (call_mass_fixer_dyn) then
     398    if (igcm_co .ne. 0) then
     399      call put_var("mass_predyn_co", "Global mass of CO before the last physiq step ends", mass_predyn(igcm_co))
     400    endif
     401    if (igcm_o2 .ne. 0) then
     402      call put_var("mass_predyn_o2", "Global mass of O2 before the last physiq step ends", mass_predyn(igcm_o2))
     403    endif
     404    if (igcm_h2 .ne. 0) then
     405      call put_var("mass_predyn_h2", "Global mass of H2 before the last physiq step ends", mass_predyn(igcm_h2))
     406    endif
     407    if (igcm_ho2 .ne. 0) then
     408      call put_var("mass_predyn_ho2", "Global mass of HO2 before the last physiq step ends", mass_predyn(igcm_ho2))
     409    endif
     410    if (igcm_h2o2 .ne. 0) then
     411      call put_var("mass_predyn_h2o2", "Global mass of H2O2 before the last physiq step ends", mass_predyn(igcm_h2o2))
     412    endif
     413    if (igcm_n2 .ne. 0) then
     414      call put_var("mass_predyn_n2", "Global mass of N2 before the last physiq step ends", mass_predyn(igcm_n2))
     415    endif
     416    if (igcm_ar .ne. 0) then
     417      call put_var("mass_predyn_ar", "Global mass of Ar before the last physiq step ends", mass_predyn(igcm_ar))
     418    endif
     419    if (igcm_he .ne. 0) then
     420      call put_var("mass_predyn_he", "Global mass of He before the last physiq step ends", mass_predyn(igcm_he))
     421    endif
     422  endif
     423
    394424  ! Close file
    395425  call close_restartphy
Note: See TracChangeset for help on using the changeset viewer.