Changeset 3620 for trunk/LMDZ.COMMON


Ignore:
Timestamp:
Feb 12, 2025, 12:03:26 PM (26 hours ago)
Author:
jbclement
Message:

PEM:
Few small adjustments in the code.
JBC

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

Legend:

Unmodified
Added
Removed
  • trunk/LMDZ.COMMON/libf/evolution/changelog.txt

    r3618 r3620  
    591591== 11/02/2025 == JBC
    592592Correction for a problem concerning an imported variable whether in 1D or 3D.
     593
     594== 12/02/2025 == JBC
     595Few small adjustments in the code.
  • trunk/LMDZ.COMMON/libf/evolution/deftank/lib_launchPEM.sh

    r3611 r3620  
    348348        il=$(echo "($irelaunch - $nPCM_ini + 1)%$nPCM + 1" | bc)
    349349        if [ $2 -ne 0 ]; then # Counting: PCM runs taken into account
    350             i_myear=$(($(awk "NR==$iPEM {print \$3}" "info_PEM.txt") + $il))
     350            i_myear=$(($(awk "NR==$iPEM {printf \"%s\n\", \$3}" "info_PEM.txt") + $il))
    351351        else # Counting: only PEM runs count
    352             i_myear=$(awk "NR==$iPEM {print \$3}" "info_PEM.txt")
     352            i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "info_PEM.txt")
    353353        fi
    354354        sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
     
    380380    iPEM=$(echo "$irelaunch + 1" | bc)
    381381    iPCM=$(echo "$nPCM_ini + $nPCM*($irelaunch - 1) + 1" | bc)
    382     i_myear=$(awk "NR==$(($iPEM + 1)) {print \$3}" "info_PEM.txt")
     382    i_myear=$(awk "NR==$iPEM {printf \"%s\n\", \$3}" "info_PEM.txt")
    383383    sed -i "1s/.*/$i_myear $n_myear $convert_years $iPCM $iPEM $nPCM $nPCM_ini/" info_PEM.txt
    384384    cleanfiles diags/diagfi .nc $(($iPCM - 1))
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3618 r3620  
    10151015!------------------------
    10161016    call recomp_tend_co2(ngrid,nslope,timelen,d_co2ice,d_co2ice_ini,co2_ice,emis,vmr_co2_PCM,vmr_co2_PEM_phys,ps_timeseries,ps_avg_global_old,ps_avg_global_new)
    1017    
    1018     do ig = 1,ngrid
    1019         do islope = 1,nslope
    1020             call recomp_tend_h2o(icetable_depth_old(ig,islope),icetable_depth(ig,islope),tsurf_avg(ig,islope),tsoil_PEM_timeseries_old(ig,:,islope,:),tsoil_PEM_timeseries(ig,:,islope,:),d_h2oice(ig,islope))
    1021         enddo
    1022     enddo
     1017    !write(*,*) "> Updating the H2O sub-surface ice tendency due to lag layer"
     1018    !do ig = 1,ngrid
     1019    !    do islope = 1,nslope
     1020    !        call recomp_tend_h2o(icetable_depth_old(ig,islope),icetable_depth(ig,islope),tsurf_avg(ig,islope),tsoil_PEM_timeseries_old(ig,:,islope,:),tsoil_PEM_timeseries(ig,:,islope,:),d_h2oice(ig,islope))
     1021    !    enddo
     1022    !enddo
    10231023    deallocate(vmr_co2_PEM_phys,icetable_depth_old,tsoil_PEM_timeseries_old)
    10241024
  • trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90

    r3616 r3620  
    5252real, dimension(ngrid,nsoilmx,nslope,timelen), intent(out) :: watersoil_density_timeseries ! Water density timeseries in the soil layer [kg/m^3]
    5353! Local variables
    54 integer                               :: i, j, l, islope                       ! Loop variables
     54integer                               :: i, j, t, islope                       ! Loop variables
    5555real                                  :: A, B                                  ! Intermediate variables to compute the mean molar mass of the layer
    5656character(:), allocatable             :: num                                   ! For reading sloped variables
     
    243243    !------
    244244    call get_var3("tsurf"//num,var3_read_1)
    245        write(*,*) "Data for tsurf"//num//" downloaded."
     245    write(*,*) "Data for tsurf"//num//" downloaded."
    246246
    247247    ! Compute average over the year for each point
     
    263263        var3_read_3 = sum(var4_read,4)/timelen
    264264#ifndef CPP_1D
    265         do l = 1,nsoilmx
    266             call gr_dyn_fi(timelen,iim_input + 1,jjm_input + 1,ngrid,var4_read(:,:,l,:),tsoil_timeseries(:,l,islope,:))
     265        do t = 1,timelen
     266            call gr_dyn_fi(nsoilmx,iim_input + 1,jjm_input + 1,ngrid,var4_read(:,:,:,t),tsoil_timeseries(:,:,islope,t))
    267267        enddo
    268268        call gr_dyn_fi(nsoilmx,iim_input + 1,jjm_input + 1,ngrid,var3_read_3,tsoil_avg(:,:,islope))
     
    277277        call get_var4("waterdensity_soil"//num,var4_read)
    278278#ifndef CPP_1D
    279         do l = 1,nsoilmx
    280             call gr_dyn_fi(timelen,iim_input + 1,jjm_input + 1,ngrid,var4_read(:,:,l,:),watersoil_density_timeseries(:,l,islope,:))
     279        do t = 1,timelen
     280            call gr_dyn_fi(nsoilmx,iim_input + 1,jjm_input + 1,ngrid,var4_read(:,:,:,t),watersoil_density_timeseries(:,:,islope,t))
    281281        enddo
    282282#else
  • trunk/LMDZ.COMMON/libf/evolution/recomp_tend_mod.F90

    r3610 r3620  
    8989real, parameter :: zcdv = 0.0325     ! Drag coefficient
    9090
    91 write(*,*) "> Updating the H2O tendency due to lag layer"
    92 
    9391! Higher resistance due to growing lag layer (higher depth)
    9492Rz_old = icetable_depth_old*zcdv/coef_diff ! Old resistance from PCM
Note: See TracChangeset for help on using the changeset viewer.