Ignore:
Timestamp:
Mar 19, 2026, 2:07:40 PM (3 weeks ago)
Author:
jbclement
Message:

PEM:

  • Fix the writing of potential temperature and air mass in "start.nc".
  • Add the checking of variable validity when writing a variable in a NetCDF file.

JBC

Location:
trunk/LMDZ.COMMON/libf/evolution
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/atmosphere.F90

    r4138 r4145  
    470470    do i = 1,nlayer
    471471        call compute_hybrid_sig(sig(i),pa,preff,newsig)
    472         bp(i) = exp(1._dp - 1._dp/(newsig**2))
    473         ap_l(i) = pa*(newsig - bp(i))
     472        bp_l(i) = exp(1._dp - 1._dp/(newsig**2))
     473        ap_l(i) = pa*(newsig - bp_l(i))
    474474    end do
    475475    ap_l(nlayer + 1) = 0._dp
    476     bp(nlayer + 1) = 0._dp
     476    bp_l(nlayer + 1) = 0._dp
    477477else
    478478    call print_msg('> Defining sigma altitude coordinates',LVL_NFO)
    479479    ap_l(:) = 0._dp
    480     bp(1:nlayer) = sig(1:nlayer)
    481     bp(nlayer + 1) = 0._dp
     480    bp_l(1:nlayer) = sig(1:nlayer)
     481    bp_l(nlayer + 1) = 0._dp
    482482end if
    483483
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r4140 r4145  
    930930== 18/03/2026 == JBC
    931931Fix to avoid building large temporary arrays in the arguments evaluation of "compute_tendice" which caused memory to stall.
     932
     933== 19/03/2026 == JBC
     934- Fix the writing of potential temperature and air mass in "start.nc".
     935- Add the checking of variable validity when writing a variable in a NetCDF file.
  • trunk/LMDZ.COMMON/libf/evolution/clim_state_rec.F90

    r4134 r4145  
    9898
    9999! Potential temperature
    100 call vect2dyngrd(nlon + 1,nlat,ngrid,teta4PCM,var_dyn)
     100do l = 1,nlayer
     101    call vect2dyngrd(nlon + 1,nlat,ngrid,teta4PCM,var_dyn(:,:,l))
     102end do
    101103call put_var_nc('teta',var_dyn,1)
    102104
    103105! Air mass
    104 call vect2dyngrd(nlon + 1,nlat,ngrid,air_mass4PCM,var_dyn)
     106do l = 1,nlayer
     107    call vect2dyngrd(nlon + 1,nlat,ngrid,air_mass4PCM,var_dyn(:,:,l))
     108end do
    105109call put_var_nc('masse',var_dyn,1)
    106110
  • trunk/LMDZ.COMMON/libf/evolution/io_netcdf.F90

    r4134 r4145  
    4545integer(di), protected, private :: ncid_file              ! File ID
    4646integer(di), protected, private :: varid                  ! Variable ID
    47 integer(di)          :: ncid_diagevo           ! File ID specific to "diagevo.nc"
     47integer(di)                     :: ncid_diagevo           ! File ID specific to "diagevo.nc"
    4848
    4949! INTERFACES
     
    340340! CODE
    341341! ----
     342! Read
    342343if (present(found)) then
    343344    call check_nc(nf90_inq_varid(ncid_file,var_name,varid),'inquiring '//var_name,found)
     
    347348    call check_nc(nf90_get_var(ncid_file,varid,var),'getting '//var_name)
    348349end if
     350
     351! Check the variable validity
    349352call check_valid_var_nc(var_name,var)
    350353
     
    380383! CODE
    381384! ----
     385! Read
    382386if (present(found)) then
    383387    call check_nc(nf90_inq_varid(ncid_file,var_name,varid),'inquiring '//var_name,found)
     
    387391    call check_nc(nf90_get_var(ncid_file,varid,var),'getting '//var_name)
    388392end if
     393
     394! Check the variable validity
    389395call check_valid_var_nc(var_name,var)
    390396
     
    420426! CODE
    421427! ----
     428! Read
    422429if (present(found)) then
    423430    call check_nc(nf90_inq_varid(ncid_file,var_name,varid),'inquiring '//var_name,found)
     
    427434    call check_nc(nf90_get_var(ncid_file,varid,var),'getting '//var_name)
    428435end if
     436
     437! Check the variable validity
    429438call check_valid_var_nc(var_name,var)
    430439
     
    460469! CODE
    461470! ----
     471! Read
    462472if (present(found)) then
    463473    call check_nc(nf90_inq_varid(ncid_file,var_name,varid),'inquiring '//var_name,found)
     
    467477    call check_nc(nf90_get_var(ncid_file,varid,var),'getting '//var_name)
    468478end if
     479
     480! Check the variable validity
    469481call check_valid_var_nc(var_name,var)
    470482
     
    500512! CODE
    501513! ----
     514! Read
    502515if (present(found)) then
    503516    call check_nc(nf90_inq_varid(ncid_file,var_name,varid),'inquiring '//var_name,found)
     
    507520    call check_nc(nf90_get_var(ncid_file,varid,var),'getting '//var_name)
    508521end if
     522
     523! Check the variable validity
    509524call check_valid_var_nc(var_name,var)
    510525
     
    546561! CODE
    547562! ----
     563! Check the variable validity
     564call check_valid_var_nc(var_name,var)
     565
    548566! Diagevol logic priority over standard logic
    549567if (open_diagevo) then
     
    610628! CODE
    611629! ----
     630! Check the variable validity
     631call check_valid_var_nc(var_name,var)
     632
    612633! Diagevol logic priority over standard logic
    613634if (open_diagevo) then
     
    681702! CODE
    682703! ----
     704! Check the variable validity
     705call check_valid_var_nc(var_name,var)
     706
    683707! Diagevol logic priority over standard logic
    684708if (open_diagevo) then
     
    752776! CODE
    753777! ----
     778! Check the variable validity
     779call check_valid_var_nc(var_name,var)
     780
    754781! Diagevol logic priority over standard logic
    755782if (open_diagevo) then
     
    823850! CODE
    824851! ----
     852! Check the variable validity
     853call check_valid_var_nc(var_name,var)
     854
    825855! Diagevol logic priority over standard logic
    826856if (open_diagevo) then
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r4140 r4145  
    2929use display,            only: print_ini, print_end, print_msg, LVL_NFO, LVL_WRN
    3030use evolution,          only: n_yr_run, n_yr_sim, ntot_yr_sim, nmax_yr_run, dt, idt, r_plnt2earth_yr, pem_ini_date
    31 use geometry,           only: ngrid, nslope, nday, nsoil_PCM, nsoil, cell_area, total_surface, nlayer
     31use geometry,           only: ngrid, nslope, nday, nsoil_PCM, nsoil, cell_area, total_surface
    3232use glaciers,           only: h2oice_flow, co2ice_flow, flow_co2glaciers, flow_h2oglaciers
    3333use ice_table,          only: icetable_equilibrium, icetable_dynamic, evolve_ice_table
  • trunk/LMDZ.COMMON/libf/evolution/surface.F90

    r4134 r4145  
    316316! LOCAL VARIABLES
    317317! ---------------
    318 logical(k4)                         :: here, cst_h2oice_albedo
     318logical(k4)                         :: cst_h2oice_albedo
    319319integer(di)                         :: i, nindex
    320320real(dp), dimension(:), allocatable :: controle
Note: See TracChangeset for help on using the changeset viewer.