Changeset 4163


Ignore:
Timestamp:
Apr 1, 2026, 9:31:51 PM (8 days ago)
Author:
yluo
Message:

Mars PCM:
Initialize mass_predyn to -999 so that newstart writes a defined value (-999) to mass_predyn_<tracer> in restartfi.nc, avoiding uninitialized values (e.g., 0 or random memory).
If mass_predyn_<tracer> <= 0 (such as -999 written by newstart) in startfi.nc, the mass fixer for dynamics is skipped at the first physiq step.
YCL

Location:
trunk/LMDZ.MARS
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.MARS/changelog.txt

    r4162 r4163  
    51515151Adding some missing slope fields in field_def_physics_mars.xml that are called
    51525152by xios in the code.
     5153
     5154== 01/04/2026 == YCL
     5155Initialize mass_predyn to -999 so that newstart writes a defined value (-999) to mass_predyn_<tracer> in restartfi.nc, avoiding uninitialized values (e.g., 0 or random memory).
     5156If mass_predyn_<tracer> <= 0 (such as -999 written by newstart) in startfi.nc, the mass fixer for dynamics is skipped at the first physiq step.
  • trunk/LMDZ.MARS/libf/phymars/phyetat0_mod.F90

    r4160 r4163  
    726726if (startphy_file .and. call_mass_fixer_dyn) then
    727727   call get_var("mass_predyn_co", mass_predyn_co, found)
    728    if (found) then
     728   if (found .and. mass_predyn_co > 0.d0) then
    729729      found_startfi_co = .true.
    730730   else
    731       write(*,*) "phyetat0: <mass_predyn_co> not in file"
     731      write(*,*) "phyetat0: <mass_predyn_co> not in file or invalid"
    732732   endif
    733733
    734734   call get_var("mass_predyn_o2", mass_predyn_o2, found)
    735    if (found) then
     735   if (found .and. mass_predyn_o2 > 0.d0) then
    736736      found_startfi_o2 = .true.
    737737   else
    738       write(*,*) "phyetat0: <mass_predyn_o2> not in file"
     738      write(*,*) "phyetat0: <mass_predyn_o2> not in file or invalid"
    739739   endif
    740740
    741741   call get_var("mass_predyn_h2", mass_predyn_h2, found)
    742    if (found) then
     742   if (found .and. mass_predyn_h2 > 0.d0) then
    743743      found_startfi_h2 = .true.
    744744   else
    745       write(*,*) "phyetat0: <mass_predyn_h2> not in file"
     745      write(*,*) "phyetat0: <mass_predyn_h2> not in file or invalid"
    746746   endif
    747747
    748748   call get_var("mass_predyn_ho2", mass_predyn_ho2, found)
    749    if (found) then
     749   if (found .and. mass_predyn_ho2 > 0.d0) then
    750750      found_startfi_ho2 = .true.
    751751   else
    752       write(*,*) "phyetat0: <mass_predyn_ho2> not in file"
     752      write(*,*) "phyetat0: <mass_predyn_ho2> not in file or invalid"
    753753   endif
    754754
    755755   call get_var("mass_predyn_h2o2", mass_predyn_h2o2, found)
    756    if (found) then
     756   if (found .and. mass_predyn_h2o2 > 0.d0) then
    757757      found_startfi_h2o2 = .true.
    758758   else
    759       write(*,*) "phyetat0: <mass_predyn_h2o2> not in file"
     759      write(*,*) "phyetat0: <mass_predyn_h2o2> not in file or invalid"
    760760   endif
    761761
    762762   call get_var("mass_predyn_n2", mass_predyn_n2, found)
    763    if (found) then
     763   if (found .and. mass_predyn_n2 > 0.d0) then
    764764      found_startfi_n2 = .true.
    765765   else
    766       write(*,*) "phyetat0: <mass_predyn_n2> not in file"
     766      write(*,*) "phyetat0: <mass_predyn_n2> not in file or invalid"
    767767   endif
    768768
    769769   call get_var("mass_predyn_ar", mass_predyn_ar, found)
    770    if (found) then
     770   if (found .and. mass_predyn_ar > 0.d0) then
    771771      found_startfi_ar = .true.
    772772   else
    773       write(*,*) "phyetat0: <mass_predyn_ar> not in file"
     773      write(*,*) "phyetat0: <mass_predyn_ar> not in file or invalid"
    774774   endif
    775775
    776776   call get_var("mass_predyn_he", mass_predyn_he, found)
    777    if (found) then
     777   if (found .and. mass_predyn_he > 0.d0) then
    778778      found_startfi_he = .true.
    779779   else
    780       write(*,*) "phyetat0: <mass_predyn_he> not in file"
     780      write(*,*) "phyetat0: <mass_predyn_he> not in file or invalid"
    781781   endif
    782782endif ! if (startphy_file .and. call_mass_fixer_dyn)
  • trunk/LMDZ.MARS/libf/phymars/tracer_mass_fixer_dyn_mod.F90

    r4150 r4163  
    200200
    201201        allocate(mass_predyn(nq))
     202        mass_predyn(1:nq) = -999.  ! newstart writes mass_predyn_<tracer> in startfi.nc with this value,
     203                                   ! ensuring mass_predyn_<tracer> <= 0. As a result, found_startfi_<tracer>
     204                                   ! remains .false., and no correction is applied at the first physics step
     205                                   ! when initialized from newstart output.
    202206
    203207    end subroutine ini_tracer_mass_fixer_dyn
Note: See TracChangeset for help on using the changeset viewer.