Changeset 4110 for trunk/LMDZ.COMMON/libf/evolution/config.F90
- Timestamp:
- Mar 9, 2026, 10:29:53 AM (8 days ago)
- File:
-
- 1 edited
-
trunk/LMDZ.COMMON/libf/evolution/config.F90 (modified) (19 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LMDZ.COMMON/libf/evolution/config.F90
r4091 r4110 23 23 implicit none 24 24 25 character(7), parameter :: rundef_name = 'run.def'26 character(11), parameter :: run_pcmdef_name = 'run_pcm.def'27 character(12), parameter :: callphys_name = 'callphys.def'25 character(7), parameter, private :: rundef_name = 'run.def' 26 character(11), parameter, private :: runPCMdef_name = 'run_pcm.def' 27 character(12), parameter :: callphys_name = 'callphys.def' 28 28 29 29 contains … … 68 68 use atmosphere, only: set_atmosphere_config 69 69 use stoppage, only: stop_clean 70 use display, only: print_msg 70 use display, only: print_msg, LVL_NFO 71 71 72 72 ! DECLARATION … … 76 76 ! LOCAL VARIABLES 77 77 ! --------------- 78 logical(k4) :: here, evo l_orbit_l, evol_obl_l, evol_ecc_l, evol_lsp_l, do_soil_l, reg_thprop_dependp_l, do_sorption_l, hybrid78 logical(k4) :: here, evo_orbit_l, evo_obl_l, evo_ecc_l, evo_lsp_l, do_soil_l, reg_thprop_dependp_l, do_sorption_l, hybrid 79 79 logical(k4) :: icetable_equilibrium_l, icetable_dynamic_l, h2oice_flow_l, co2ice_flow_l, do_layering_l, impose_dust_ratio_l 80 80 integer(di) :: output_rate_l … … 87 87 inquire(file = rundef_name,exist = here) 88 88 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//rundef_name//'" (PEM)!',1) 89 call print_msg('> Reading "'//rundef_name//'"' )90 91 ! Output 92 ! ~~~~~~ 89 call print_msg('> Reading "'//rundef_name//'"',LVL_NFO) 90 91 ! Outputs 92 ! ~~~~~~~ 93 93 output_rate_l = 1_di ! Default value: every year 94 94 call getin('output_rate',output_rate_l) … … 96 96 ! Orbital parameters 97 97 ! ~~~~~~~~~~~~~~~~~~ 98 evo l_orbit_l = .false.99 call getin('evo l_orbit',evol_orbit_l)98 evo_orbit_l = .false. 99 call getin('evo_orbit',evo_orbit_l) 100 100 101 101 pem_ini_earth_date = 0_di 102 102 call getin('pem_ini_earth_date',pem_ini_earth_date) 103 103 104 evo l_obl_l = .true.105 call getin('evo l_obl',evol_obl_l)106 107 evo l_ecc_l = .true.108 call getin('evo l_ecc',evol_ecc_l)109 110 evo l_lsp_l = .true.111 call getin('evo l_lsp',evol_lsp_l)104 evo_obl_l = .true. 105 call getin('evo_obl',evo_obl_l) 106 107 evo_ecc_l = .true. 108 call getin('evo_ecc',evo_ecc_l) 109 110 evo_lsp_l = .true. 111 call getin('evo_lsp',evo_lsp_l) 112 112 113 113 dt_l = 1._dp … … 193 193 ! Setters 194 194 call set_output_config(output_rate_l) 195 call set_orbit_config(evo l_orbit_l,evol_obl_l,evol_ecc_l,evol_lsp_l,max_change_obl_l,max_change_ecc_l,max_change_lsp_l)195 call set_orbit_config(evo_orbit_l,evo_obl_l,evo_ecc_l,evo_lsp_l,max_change_obl_l,max_change_ecc_l,max_change_lsp_l) 196 196 call set_evolution_config(pem_ini_earth_date,dt_l,nmax_yr_run_l) 197 197 call set_stopping_crit_config(h2oice_crit_l,co2ice_crit_l,ps_crit_l) … … 235 235 use soil, only: do_soil, reg_thprop_dependp, flux_geo 236 236 use sorption, only: do_sorption 237 use orbit, only: evo l_orbit237 use orbit, only: evo_orbit 238 238 use evolution, only: pem_ini_date 239 239 use ice_table, only: icetable_equilibrium, icetable_dynamic 240 use display, only: print_msg 240 use display, only: print_msg, LVL_WRN 241 241 242 242 ! DECLARATION … … 247 247 ! ---- 248 248 ! Warnings (possible incompatibilities) 249 if (evo l_orbit .and. abs(pem_ini_date) < minieps) call print_msg('Warning: evol_orbit = .true. but the initial date of the PEM is set to 0!')249 if (evo_orbit .and. abs(pem_ini_date) < minieps) call print_msg('''evo_orbit = .true.'' but the initial date of the PEM is set to 0!',LVL_WRN) 250 250 251 251 ! Errors (true incompatibilities) … … 286 286 use ioipsl_getincom, only: getin 287 287 #endif 288 use atmosphere, only: CO2cond_ps_PCM289 288 use stoppage, only: stop_clean 290 use display, only: print_msg 289 use display, only: print_msg, LVL_NFO 290 use atmosphere, only: set_CO2cond_ps_PCM 291 291 292 292 ! DECLARATION … … 297 297 ! --------------- 298 298 logical(k4) :: here 299 real(dp) :: CO2cond_ps_PCM_l 299 300 300 301 ! CODE … … 302 303 inquire(file = callphys_name,exist = here) 303 304 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//callphys_name//'"!',1) 304 call print_msg('> Reading "'//callphys_name//'"' )305 306 CO2cond_ps_PCM = 1._dp ! Default value307 call getin("CO2cond_ps",CO2cond_ps_PCM )308 if (CO2cond_ps_PCM < 0._dp .or. CO2cond_ps_PCM > 1._dp) call stop_clean(__FILE__,__LINE__,'Value for ''CO2cond_ps'' is not between 0 and 1. Please, specify a correct value in "'//callphys_name//'"!',1)305 call print_msg('> Reading "'//callphys_name//'"',LVL_NFO) 306 307 CO2cond_ps_PCM_l = 1._dp 308 call getin("CO2cond_ps",CO2cond_ps_PCM_l) 309 call set_CO2cond_ps_PCM(CO2cond_ps_PCM_l) 309 310 310 311 END SUBROUTINE read_callphys … … 330 331 ! ------------ 331 332 use stoppage, only: stop_clean 332 use display, only: print_msg 333 use display, only: print_msg, LVL_NFO, LVL_WRN 333 334 use utility, only: bool2str 334 335 … … 350 351 ! CODE 351 352 ! ---- 352 inquire(file = run _pcmdef_name,exist = here)353 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//run _pcmdef_name//'"!',1)354 call print_msg('> Reading "'//run _pcmdef_name//'"')355 open(newunit = funit,file = run _pcmdef_name,status = 'old',form = 'formatted',action = 'read',iostat = ierr)356 if (ierr /= 0) call stop_clean(__FILE__,__LINE__,'error opening file "'//run _pcmdef_name//'"!',ierr)353 inquire(file = runPCMdef_name,exist = here) 354 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//runPCMdef_name//'"!',1) 355 call print_msg('> Reading "'//runPCMdef_name//'"',LVL_NFO) 356 open(newunit = funit,file = runPCMdef_name,status = 'old',form = 'formatted',action = 'read',iostat = ierr) 357 if (ierr /= 0) call stop_clean(__FILE__,__LINE__,'error opening file "'//runPCMdef_name//'"!',ierr) 357 358 358 359 found = .false. … … 385 386 close(funit) 386 387 387 if (.not. found) call print_msg(' Warning: key ''hybrid'' not found in the file "'//run_pcmdef_name//'"!')388 if (hybrid .eqv. hybrid_in) call print_msg('USING DEFAULTS : hybrid = '//bool2str(hybrid_in) )388 if (.not. found) call print_msg('Key ''hybrid'' not found in the file "'//runPCMdef_name//'"!',LVL_WRN) 389 if (hybrid .eqv. hybrid_in) call print_msg('USING DEFAULTS : hybrid = '//bool2str(hybrid_in),LVL_NFO) 389 390 390 391 END SUBROUTINE get_hybrid … … 392 393 393 394 !======================================================================= 394 SUBROUTINE read_control data()395 !----------------------------------------------------------------------- 396 ! NAME 397 ! read_control data395 SUBROUTINE read_control_data() 396 !----------------------------------------------------------------------- 397 ! NAME 398 ! read_control_data 398 399 ! 399 400 ! DESCRIPTION … … 414 415 use soil, only: volcapa 415 416 use stoppage, only: stop_clean 416 use display, only: print_msg 417 use display, only: print_msg, LVL_NFO 417 418 418 419 ! DECLARATION … … 427 428 ! CODE 428 429 ! ---- 429 call print_msg('> Reading control data ("'//startfi_name//'")' )430 call print_msg('> Reading control data ("'//startfi_name//'")',LVL_NFO) 430 431 ! Open the "startfi.nc" file 431 432 call open_nc(startfi_name,'read') … … 443 444 ! Initialize physical data 444 445 ! Arguments order: rad, g, mugaz, rcp 445 call print_msg(' > Initializing physical constants' )446 call print_msg(' > Initializing physical constants',LVL_NFO) 446 447 call init_physics(controle(5),controle(7),controle(8),controle(9)) 447 448 448 449 ! Initialize soil data 449 call print_msg(' > Initializing soil parameters' )450 call print_msg(' > Initializing soil parameters',LVL_NFO) 450 451 volcapa = controle(35) 451 452 if (abs(volcapa) < minieps) call stop_clean(__FILE__,__LINE__,'volcapa is 0 in "'//startfi_name//'"!',1) … … 453 454 ! Initialize orbital data 454 455 ! Arguments order: Obliquity, Perihelion, Aphelion, Date of perihelion, Year length, Sol length 455 call print_msg(' > Initializing orbital characteristics of the planet' )456 call print_msg(' > Initializing orbital characteristics of the planet',LVL_NFO) 456 457 call init_orbit(controle(18),controle(15),controle(16),controle(17),controle(14),controle(10)) 457 458 458 459 deallocate(controle) 459 460 460 END SUBROUTINE read_controldata 461 END SUBROUTINE read_control_data 462 !======================================================================= 463 464 !======================================================================= 465 SUBROUTINE read_display_config() 466 !----------------------------------------------------------------------- 467 ! NAME 468 ! read_display_config 469 ! 470 ! DESCRIPTION 471 ! Read PEM runtime configuration for display from getin keys, then 472 ! set module-scoped parameters accordingly. 473 ! 474 ! AUTHORS & DATE 475 ! JB Clement, 03/2026 476 ! 477 ! NOTES 478 ! 479 !----------------------------------------------------------------------- 480 481 ! DEPENDENCIES 482 ! ------------ 483 #ifdef CPP_IOIPSL 484 use IOIPSL, only: getin 485 #else 486 ! If not using IOIPSL, we still need to use (a local version of) getin 487 use ioipsl_getincom, only: getin 488 #endif 489 use stoppage, only: stop_clean 490 use display, only: set_display_config, LVL_NFO 491 492 ! DECLARATION 493 ! ----------- 494 implicit none 495 496 ! LOCAL VARIABLES 497 ! --------------- 498 logical(k4) :: here, out2term_l, out2log_l 499 integer(di) :: verbosity_lvl_l 500 501 ! CODE 502 ! ---- 503 inquire(file = rundef_name,exist = here) 504 if (.not. here) call stop_clean(__FILE__,__LINE__,'cannot find required file "'//rundef_name//'" (PEM)!',1) 505 506 ! Display 507 ! ~~~~~~~ 508 out2term_l = .true. 509 call getin('out2term',out2term_l) 510 511 out2log_l = .false. 512 call getin('out2log',out2log_l) 513 514 verbosity_lvl_l = LVL_NFO 515 call getin('verbosity_lvl',verbosity_lvl_l) 516 517 ! Setter 518 call set_display_config(out2term_l,out2log_l,verbosity_lvl_l) 519 520 END SUBROUTINE read_display_config 461 521 !======================================================================= 462 522
Note: See TracChangeset
for help on using the changeset viewer.
