Ignore:
Timestamp:
Jul 2, 2025, 4:26:06 PM (41 hours ago)
Author:
dcugnet
Message:

Make the ioipsl_getin_p routine more flexible: optional default value
and optional flag to print or not the effective value of the key
=> get rid of the get_in routine

File:
1 edited

Legend:

Unmodified
Added
Removed
  • LMDZ6/trunk/libf/phylmdiso/isotopes_mod.F90

    r5748 r5754  
    66   USE infotrac_phy, ONLY: isoName, niso, ntiso
    77   USE iso_params_mod
     8   USE ioipsl_getin_p_mod, ONLY : getin_p
    89   IMPLICIT NONE
    9    INTERFACE get_in; MODULE PROCEDURE getinp_s, getinp_i, getinp_r, getinp_l;  END INTERFACE get_in
    1010
    1111  !--- Contains all isotopic variables + their initialization
     
    187187
    188188         !--- Initialisation: reading the isotopic parameters.
    189          CALL get_in('lambda',     lambda_sursat, 0.004); IF(ok_nocinsat) lambda_sursat = 0.
    190          CALL get_in('thumxt1',    thumxt1,       0.75*1.2)
    191          CALL get_in('ntot',       ntot,          20,  .FALSE.)
    192          CALL get_in('h_land_ice', h_land_ice,    20., .FALSE.)
    193          CALL get_in('P_veg',      P_veg,         1.0, .FALSE.)
    194          CALL get_in('bidouille_anti_divergence', bidouille_anti_divergence, .FALSE.)
    195          CALL get_in('essai_convergence',         essai_convergence,         .FALSE.)
    196          CALL get_in('initialisation_iso',        initialisation_iso,        0)
     189         CALL getin_p('lambda',     lambda_sursat, 0.004); IF(ok_nocinsat) lambda_sursat = 0.
     190         CALL getin_p('thumxt1',    thumxt1,       0.75*1.2)
     191         CALL getin_p('ntot',       ntot,          20,  lDisp=.FALSE.)
     192         CALL getin_p('h_land_ice', h_land_ice,    20., lDisp=.FALSE.)
     193         CALL getin_p('P_veg',      P_veg,         1.0, lDisp=.FALSE.)
     194         CALL getin_p('bidouille_anti_divergence', bidouille_anti_divergence, .FALSE.)
     195         CALL getin_p('essai_convergence',         essai_convergence,         .FALSE.)
     196         CALL getin_p('initialisation_iso',        initialisation_iso,        0)
    197197
    198198!        IF(nzone>0 .AND. initialisation_iso==0) &
    199 !           CALL get_in('initialisation_isotrac',initialisation_isotrac)
    200          CALL get_in('modif_sst',      modif_sst,         0)
    201          CALL get_in('deltaTtest',     deltaTtest,      0.0)     !--- For modif_sst>=1
    202          CALL get_in('deltaTtestpoles',deltaTtestpoles, 0.0)     !--- For modif_sst>=2
    203          CALL get_in( 'sstlatcrit',    sstlatcrit,     30.0)     !--- For modif_sst>=3
    204          CALL get_in('dsstlatcrit',   dsstlatcrit,      0.0)     !--- For modif_sst>=3
     199!           CALL getin_p('initialisation_isotrac',initialisation_isotrac)
     200         CALL getin_p('modif_sst',      modif_sst,         0)
     201         CALL getin_p('deltaTtest',     deltaTtest,      0.0)     !--- For modif_sst>=1
     202         CALL getin_p('deltaTtestpoles',deltaTtestpoles, 0.0)     !--- For modif_sst>=2
     203         CALL getin_p( 'sstlatcrit',    sstlatcrit,     30.0)     !--- For modif_sst>=3
     204         CALL getin_p('dsstlatcrit',   dsstlatcrit,      0.0)     !--- For modif_sst>=3
    205205#ifdef ISOVERIF
    206206         CALL msg('iso_init 270:  sstlatcrit='//num2str( sstlatcrit), modname, sstlatcrit < 0.0) !--- For modif_sst>=2
     
    209209#endif             
    210210
    211          CALL get_in('modif_sic', modif_sic,  0)
     211         CALL getin_p('modif_sic', modif_sic,  0)
    212212         IF(modif_sic >= 1) &
    213          CALL get_in('deltasic',  deltasic, 0.1)
    214 
    215          CALL get_in('albedo_prescrit', albedo_prescrit, 0)
     213         CALL getin_p('deltasic',  deltasic, 0.1)
     214
     215         CALL getin_p('albedo_prescrit', albedo_prescrit, 0)
    216216         IF(albedo_prescrit == 1) THEN
    217             CALL get_in('lon_min_albedo', lon_min_albedo, -200.)
    218             CALL get_in('lon_max_albedo', lon_max_albedo,  200.)
    219             CALL get_in('lat_min_albedo', lat_min_albedo, -100.)
    220             CALL get_in('lat_max_albedo', lat_max_albedo,  100.)
    221          END IF
    222          CALL get_in('deltaO18_oce',        deltaO18_oce,   0.0)
    223          CALL get_in('deltaP_BL',           deltaP_BL,     10.0)
    224          CALL get_in('ruissellement_pluie', ruissellement_pluie, 0)
    225          CALL get_in('alphak_stewart',      alphak_stewart,      1)
    226          CALL get_in('tdifexp_sol',         tdifexp_sol,      0.67)
    227          CALL get_in('calendrier_guide',    calendrier_guide,    0)
    228          CALL get_in('cste_surf_cond',      cste_surf_cond,      0)
    229          CALL get_in('mixlen',              mixlen,           35.0)
    230          CALL get_in('evap_cont_cste',      evap_cont_cste,      0)
    231          CALL get_in('deltaO18_evap_cont',  deltaO18_evap_cont,0.0)
    232          CALL get_in('d_evap_cont',         d_evap_cont,       0.0)
    233          CALL get_in('nudge_qsol',          nudge_qsol,          0)
    234          CALL get_in('region_nudge_qsol',   region_nudge_qsol,   1)
     217            CALL getin_p('lon_min_albedo', lon_min_albedo, -200.)
     218            CALL getin_p('lon_max_albedo', lon_max_albedo,  200.)
     219            CALL getin_p('lat_min_albedo', lat_min_albedo, -100.)
     220            CALL getin_p('lat_max_albedo', lat_max_albedo,  100.)
     221         END IF
     222         CALL getin_p('deltaO18_oce',        deltaO18_oce,   0.0)
     223         CALL getin_p('deltaP_BL',           deltaP_BL,     10.0)
     224         CALL getin_p('ruissellement_pluie', ruissellement_pluie, 0)
     225         CALL getin_p('alphak_stewart',      alphak_stewart,      1)
     226         CALL getin_p('tdifexp_sol',         tdifexp_sol,      0.67)
     227         CALL getin_p('calendrier_guide',    calendrier_guide,    0)
     228         CALL getin_p('cste_surf_cond',      cste_surf_cond,      0)
     229         CALL getin_p('mixlen',              mixlen,           35.0)
     230         CALL getin_p('evap_cont_cste',      evap_cont_cste,      0)
     231         CALL getin_p('deltaO18_evap_cont',  deltaO18_evap_cont,0.0)
     232         CALL getin_p('d_evap_cont',         d_evap_cont,       0.0)
     233         CALL getin_p('nudge_qsol',          nudge_qsol,          0)
     234         CALL getin_p('region_nudge_qsol',   region_nudge_qsol,   1)
    235235         nlevmaxO17 = 50
    236236         CALL msg('nlevmaxO17='//TRIM(num2str(nlevmaxO17)))
    237          CALL get_in('no_pce',   no_pce,     0)
    238          CALL get_in('A_satlim', A_satlim, 1.0)
    239          CALL get_in('ok_restrict_A_satlim', ok_restrict_A_satlim, 0)
     237         CALL getin_p('no_pce',   no_pce,     0)
     238         CALL getin_p('A_satlim', A_satlim, 1.0)
     239         CALL getin_p('ok_restrict_A_satlim', ok_restrict_A_satlim, 0)
    240240#ifdef ISOVERIF
    241          CALL msg(' 315: A_satlim='//num2str(A_satlim), modname, A_satlim > 1.0)
     241         CALL msg(' 315: A_satlim='//TRIM(num2str(A_satlim)), modname, A_satlim > 1.0)
    242242         IF(A_satlim > 1.0) STOP
    243243#endif
    244 !        CALL get_in('slope_limiterxy',   slope_limiterxy,  2.0)
    245 !        CALL get_in('slope_limiterz',    slope_limiterz,   2.0)
    246          CALL get_in('modif_ratqs',       modif_ratqs,        0)
    247          CALL get_in('Pcrit_ratqs',       Pcrit_ratqs,    500.0)
    248          CALL get_in('ratqsbasnew',       ratqsbasnew,     0.05)
    249          CALL get_in('fac_modif_evaoce',  fac_modif_evaoce, 1.0)
    250          CALL get_in('ok_bidouille_wake', ok_bidouille_wake,  0)
     244!        CALL getin_p('slope_limiterxy',   slope_limiterxy,  2.0)
     245!        CALL getin_p('slope_limiterz',    slope_limiterz,   2.0)
     246         CALL getin_p('modif_ratqs',       modif_ratqs,        0)
     247         CALL getin_p('Pcrit_ratqs',       Pcrit_ratqs,    500.0)
     248         CALL getin_p('ratqsbasnew',       ratqsbasnew,     0.05)
     249         CALL getin_p('fac_modif_evaoce',  fac_modif_evaoce, 1.0)
     250         CALL getin_p('ok_bidouille_wake', ok_bidouille_wake,  0)
    251251         ! si oui, la temperature de cond est celle de l'environnement, pour eviter
    252252         ! bugs quand temperature dans ascendances convs est mal calculee
    253          CALL get_in('cond_temp_env',        cond_temp_env,        .FALSE.)
     253         CALL getin_p('cond_temp_env',        cond_temp_env,        .FALSE.)
    254254         IF(ANY(isoName == 'HTO')) &
    255          CALL get_in('ok_prod_nucl_tritium', ok_prod_nucl_tritium, .FALSE., .FALSE.)
    256          CALL get_in('tnateq1', ltnat1, .TRUE.)
     255         CALL getin_p('ok_prod_nucl_tritium', ok_prod_nucl_tritium, .FALSE., lDisp=.FALSE.)
     256         CALL getin_p('tnateq1', ltnat1, .TRUE.)
    257257
    258258         CALL msg('iso_O18, iso_HDO, iso_eau = '//TRIM(strStack(num2str([iso_O18, iso_HDO, iso_eau]))), modname)
Note: See TracChangeset for help on using the changeset viewer.