Changeset 3599 for trunk/LMDZ.COMMON


Ignore:
Timestamp:
Jan 23, 2025, 4:28:27 PM (12 hours ago)
Author:
jbclement
Message:

PEM:
Few small optimizations.
JBC

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

Legend:

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

    r3598 r3599  
    554554== 23/01/2025 == JBC
    555555Correction of typos and minor bugs.
     556
     557== 23/01/2025 == JBC
     558Few small optimizations
  • trunk/LMDZ.COMMON/libf/evolution/pem.F90

    r3598 r3599  
    285285! Loop variables
    286286integer :: i, l, ig, nnq, t, islope, ig_loop, islope_loop, isoil, icap
     287logical :: num_str
    287288
    288289! Elapsed time with system clock
     
    291292timewall = .true.
    292293timelimit = 86400 ! 86400 seconds = 24 h by default
    293 timewall = .false.
    294294if (command_argument_count() > 0) then ! Get the number of command-line arguments
    295295    call get_command_argument(1,arg) ! Read the argument given to the program
    296     select case (trim(adjustl(arg)))
    297         case('version')
    298             call print_version_info()
    299             stop
    300         case default ! This is the job id
     296    num_str = .true.
     297    do i = 1,len_trim(arg)
     298        if (arg(i:i) < '0' .or. arg(i:i) > '9') then
     299            num_str = .false.
     300            exit
     301        endif
     302    enddo
     303   
     304    if (num_str) then ! This is a numeric sting so we considerer this is the job id
    301305           ! Execute the system command
    302306            call execute_command_line('squeue -j '//trim(adjustl(arg))//' -h --Format TimeLimit > tmp_cmdout.txt',cmdstat = cstat)
     
    330334                timelimit = minutes*60 + seconds
    331335            endif
    332     end select
     336    else ! Arg is not a numeric string
     337        select case (trim(adjustl(arg)))
     338            case('version')
     339                call print_version_info()
     340                stop
     341            case default
     342                error stop "The argument given to the program is unknown!"
     343        end select
     344    endif
     345else
     346    timewall = .false.
    333347endif
    334348
     
    528542allocate(min_co2_ice(ngrid,nslope,2),min_h2o_ice(ngrid,nslope,2))
    529543allocate(tsurf_avg_yr1(ngrid,nslope),tsurf_avg(ngrid,nslope))
    530 allocate(tsoil_avg(ngrid,nsoilmx,nslope),tsoil_timeseries(ngrid,nsoilmx,nslope,timelen),tsoil_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
     544allocate(tsoil_avg(ngrid,nsoilmx,nslope),tsoil_timeseries(ngrid,nsoilmx,nslope,timelen))
    531545allocate(watersurf_density_avg(ngrid,nslope),watersoil_density_timeseries(ngrid,nsoilmx,nslope,timelen))
    532546
     
    551565call ini_ice_table(ngrid,nslope,nsoilmx_PEM)
    552566
    553 allocate(watersoil_density_PEM_avg(ngrid,nsoilmx_PEM,nslope),watersoil_density_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
     567allocate(tsoil_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen),watersoil_density_PEM_avg(ngrid,nsoilmx_PEM,nslope),watersoil_density_PEM_timeseries(ngrid,nsoilmx_PEM,nslope,timelen))
    554568if (soil_pem) then
    555569    call soil_settings_PEM(ngrid,nslope,nsoilmx_PEM,nsoilmx,inertiesoil,TI_PEM)
  • trunk/LMDZ.COMMON/libf/evolution/read_data_PCM_mod.F90

    r3598 r3599  
    102102        write(num,'(i2.2)') islope
    103103        call get_var3("co2ice_slope"//num,co2_ice_slope_dyn(:,:,islope,:))
    104     enddo
    105     write(*,*) "Data for co2_ice downloaded."
    106 
    107     do islope = 1,nslope
    108         write(num,'(i2.2)') islope
     104        write(*,*) "Data for co2_ice_slope"//num//" downloaded."
    109105        call get_var3("h2o_ice_s_slope"//num,h2o_ice_s_dyn(:,:,islope,:))
    110     enddo
    111     write(*,*) "Data for h2o_ice_s downloaded."
    112 
    113     do islope = 1,nslope
    114         write(num,'(i2.2)') islope
     106        write(*,*) "Data for h2o_ice_s_slope"//num//" downloaded."
    115107        call get_var3("tsurf_slope"//num,tsurf_dyn(:,:,islope,:))
    116     enddo
    117     write(*,*) "Data for tsurf downloaded."
    118 
     108        write(*,*) "Data for tsurf_slope"//num//" downloaded."
    119109#ifndef CPP_STD
    120     do islope = 1,nslope
    121         write(num,'(i2.2)') islope
    122110        call get_var3("watercap_slope"//num,watercap(:,:,islope,:))
    123     enddo
    124     write(*,*) "Data for watercap downloaded."
    125 
    126     do islope = 1,nslope
    127         write(num,'(i2.2)') islope
     111        write(*,*) "Data for watercap_slope"//num//" downloaded."
    128112        call get_var3("perennial_co2ice_slope"//num,perennial_co2ice(:,:,islope,:))
    129     enddo
    130     write(*,*) "Data for perennial_co2ice downloaded."
    131 #endif
     113        write(*,*) "Data for perennial_co2ice_slope"//num//" downloaded."
     114#endif
     115    enddo
    132116endif
    133117
     
    209193        write(num,'(i2.2)') islope
    210194        call get_var3("co2ice_slope"//num,co2_ice_slope_dyn(:,:,islope,:))
    211     enddo
    212     write(*,*) "Data for co2_ice downloaded."
    213 
    214     do islope = 1,nslope
    215         write(num,'(i2.2)') islope
     195        write(*,*) "Data for co2_ice_slope"//num//" downloaded."
    216196        call get_var3("h2o_ice_s_slope"//num,h2o_ice_s_dyn(:,:,islope,:))
    217     enddo
    218     write(*,*) "Data for h2o_ice_s downloaded."
    219 
    220     do islope = 1,nslope
    221         write(num,'(i2.2)') islope
     197        write(*,*) "Data for h2o_ice_s_slope"//num//" downloaded."
    222198        call get_var3("tsurf_slope"//num,tsurf_dyn(:,:,islope,:))
    223     enddo
    224     write(*,*) "Data for tsurf downloaded."
    225 
     199        write(*,*) "Data for tsurf_slope"//num//" downloaded."
    226200#ifndef CPP_STD
    227     do islope = 1,nslope
    228         write(num,'(i2.2)') islope
    229201        call get_var3("watercap_slope"//num,watercap(:,:,islope,:))
    230     enddo
    231     write(*,*) "Data for watercap downloaded."
    232 
    233     do islope = 1,nslope
    234         write(num,'(i2.2)') islope
     202        write(*,*) "Data for watercap_slope"//num//" downloaded."
    235203        call get_var3("perennial_co2ice_slope"//num,perennial_co2ice(:,:,islope,:))
    236     enddo
    237     write(*,*) "Data for perennial_co2ice downloaded."
    238 
    239     if (soil_pem) then
    240         do islope = 1,nslope
    241             write(num,'(i2.2)') islope
     204        write(*,*) "Data for perennial_co2ice_slope"//num//" downloaded."
     205        if (soil_pem) then
    242206            call get_var4("soiltemp_slope"//num,tsoil_dyn(:,:,:,islope,:))
    243         enddo
    244         write(*,*) "Data for soiltemp downloaded."
    245 
    246         do islope = 1,nslope
    247             write(num,'(i2.2)') islope
     207            write(*,*) "Data for soiltemp_slope"//num//" downloaded."
    248208            call get_var4("waterdensity_soil_slope"//num,watersoil_density_dyn(:,:,:,islope,:))
    249         enddo
    250         write(*,*) "Data for waterdensity_soil downloaded."
    251 
    252         do islope = 1,nslope
    253             write(num,'(i2.2)') islope
     209            write(*,*) "Data for waterdensity_soil_slope"//num//" downloaded."
    254210            call get_var3("waterdensity_surface"//num,watersurf_density_dyn(:,:,islope,:))
    255         enddo
    256         write(*,*) "Data for waterdensity_surface downloaded."
    257     endif !soil_pem
    258 #endif
     211            write(*,*) "Data for waterdensity_surface_slope"//num//" downloaded."
     212        endif
     213#endif
     214    enddo
    259215endif
    260216
Note: See TracChangeset for help on using the changeset viewer.