Ignore:
Timestamp:
Apr 1, 2026, 9:31:51 PM (9 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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • 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)
Note: See TracChangeset for help on using the changeset viewer.