diff --git a/.bzrignore b/.bzrignore index abe04cc56..382e883e8 100644 --- a/.bzrignore +++ b/.bzrignore @@ -1730,3 +1730,2639 @@ ED/dbgbuild/bin/rk4_stepper.F90 ED/dbgbuild/bin/rsys.F90 ED/dbgbuild/bin/soil_coms.F90 ED/dbgbuild/ed_2.1-opt +check_diff.sh +BRAMS/line_counter.sh +ED/line_counter.sh +ED/dbgbuild/bin/a3e0_mod.mod +ED/dbgbuild/bin/a3e1_mod.mod +ED/dbgbuild/bin/a3e2_mod.mod +ED/dbgbuild/bin/accum_mod.mod +ED/dbgbuild/bin/acnst_mod.mod +ED/dbgbuild/bin/adivb_mod.mod +ED/dbgbuild/bin/adjust_sfcw_properties_mod.mod +ED/dbgbuild/bin/adjust_topsoil_properties_mod.mod +ED/dbgbuild/bin/adjust_veg_properties_mod.mod +ED/dbgbuild/bin/ae0_mod.mod +ED/dbgbuild/bin/ae1m1_mod.mod +ED/dbgbuild/bin/ae1_mod.mod +ED/dbgbuild/bin/ae1p1_mod.mod +ED/dbgbuild/bin/ae1p1p1_mod.mod +ED/dbgbuild/bin/ae1t0_mod.mod +ED/dbgbuild/bin/ae1t0p1_mod.mod +ED/dbgbuild/bin/ae1t1_mod.mod +ED/dbgbuild/bin/ae1t1p1_mod.mod +ED/dbgbuild/bin/ae1tn1_mod.mod +ED/dbgbuild/bin/ae2_mod.mod +ED/dbgbuild/bin/ae3m3d0_mod.mod +ED/dbgbuild/bin/ae3m3_mod.mod +ED/dbgbuild/bin/ae3_mod.mod +ED/dbgbuild/bin/ae3p3_mod.mod +ED/dbgbuild/bin/ae3t0p3_mod.mod +ED/dbgbuild/bin/ae3t3_mod.mod +ED/dbgbuild/bin/ae3t3p3_mod.mod +ED/dbgbuild/bin/aen1_mod.mod +ED/dbgbuild/bin/aen3t0p3_mod.mod +ED/dbgbuild/bin/alebl_mod.mod +ED/dbgbuild/bin/angle_of_incid_mod.mod +ED/dbgbuild/bin/aone2_mod.mod +ED/dbgbuild/bin/aone3_mod.mod +ED/dbgbuild/bin/aone4_mod.mod +ED/dbgbuild/bin/aone5_mod.mod +ED/dbgbuild/bin/aone_mod.mod +ED/dbgbuild/bin/aonev_mod.mod +ED/dbgbuild/bin/apply_forestry_mod.mod +ED/dbgbuild/bin/assign_prescribed_phen_mod.mod +ED/dbgbuild/bin/atimb_mod.mod +ED/dbgbuild/bin/atob_log_mod.mod +ED/dbgbuild/bin/atob_mod.mod +ED/dbgbuild/bin/avg_ed_daily_output_pool_mod.mod +ED/dbgbuild/bin/azero2_mod.mod +ED/dbgbuild/bin/azero3_mod.mod +ED/dbgbuild/bin/azero4_mod.mod +ED/dbgbuild/bin/azero5_mod.mod +ED/dbgbuild/bin/azero_mod.mod +ED/dbgbuild/bin/azerov_mod.mod +ED/dbgbuild/bin/banbks_mod.mod +ED/dbgbuild/bin/bandec_mod.mod +ED/dbgbuild/bin/calc_flow_routing_mod.mod +ED/dbgbuild/bin/calchydrosubsurface_mod.mod +ED/dbgbuild/bin/calchydrosurface_mod.mod +ED/dbgbuild/bin/calc_met_lapse_mod.mod +ED/dbgbuild/bin/calcwatertable_mod.mod +ED/dbgbuild/bin/canopy_derivs_two_mod.mod +ED/dbgbuild/bin/canopy_photosynthesis_mod.mod +ED/dbgbuild/bin/cbrt8_mod.mod +ED/dbgbuild/bin/cbrt_mod.mod +ED/dbgbuild/bin/cdf2normal_mod.mod +ED/dbgbuild/bin/cdf_mod.mod +ED/dbgbuild/bin/char_strip_var_mod.mod +ED/dbgbuild/bin/check_real_mod.mod +ED/dbgbuild/bin/compute_budget_mod.mod +ED/dbgbuild/bin/compute_c_and_n_storage_mod.mod +ED/dbgbuild/bin/compute_co2_storage_mod.mod +ED/dbgbuild/bin/compute_energy_storage_mod.mod +ED/dbgbuild/bin/compute_netrad_mod.mod +ED/dbgbuild/bin/compute_water_storage_mod.mod +ED/dbgbuild/bin/copy_met_2_rk4site_mod.mod +ED/dbgbuild/bin/copy_nl_mod.mod +ED/dbgbuild/bin/copy_patch_init_carbon_mod.mod +ED/dbgbuild/bin/copy_patch_init_mod.mod +ED/dbgbuild/bin/copy_path_from_grid_1_mod.mod +ED/dbgbuild/bin/copy_rk4_patch_mod.mod +ED/dbgbuild/bin/count_pft_xml_config_mod.mod +ED/dbgbuild/bin/cputime_mod.mod +ED/dbgbuild/bin/create_ed10_ed20_fname_mod.mod +ED/dbgbuild/bin/cumsum_mod.mod +ED/dbgbuild/bin/cvmgm_mod.mod +ED/dbgbuild/bin/cvmgn_mod.mod +ED/dbgbuild/bin/cvmgp_mod.mod +ED/dbgbuild/bin/cvmgz_mod.mod +ED/dbgbuild/bin/date_2_seconds_mod.mod +ED/dbgbuild/bin/date_abs_secs2_mod.mod +ED/dbgbuild/bin/date_add_to_mod.mod +ED/dbgbuild/bin/date_secs_ymdt_mod.mod +ED/dbgbuild/bin/date_unmake_big_mod.mod +ED/dbgbuild/bin/daylength_mod.mod +ED/dbgbuild/bin/dcvmgm_mod.mod +ED/dbgbuild/bin/dcvmgp_mod.mod +ED/dbgbuild/bin/dcw_swap16_mod.mod +ED/dbgbuild/bin/dcw_swap32_mod.mod +ED/dbgbuild/bin/dcw_swap64_mod.mod +ED/dbgbuild/bin/ddens_dt_effect_mod.mod +ED/dbgbuild/bin/deblank_mod.mod +ED/dbgbuild/bin/detab_mod.mod +ED/dbgbuild/bin/diagon_mod.mod +ED/dbgbuild/bin/dist_gc_mod.mod +ED/dbgbuild/bin/disturbance_utils.mod +ED/dbgbuild/bin/dmax2_mod.mod +ED/dbgbuild/bin/dmin2_mod.mod +ED/dbgbuild/bin/dssum_mod.mod +ED/dbgbuild/bin/dump_radinfo_mod.mod +ED/dbgbuild/bin/ed1_fileinfo_mod.mod +ED/dbgbuild/bin/ed_1st_master_mod.mod +ED/dbgbuild/bin/ed_1st_node_mod.mod +ED/dbgbuild/bin/ed21_fileinfo_mod.mod +ED/dbgbuild/bin/ed_datp_datq_mod.mod +ED/dbgbuild/bin/ed_datp_datsoil_mod.mod +ED/dbgbuild/bin/ed_driver_mod.mod +ED/dbgbuild/bin/ed_filelist_mod.mod +ED/dbgbuild/bin/ed_gridset_mod.mod +ED/dbgbuild/bin/ed_init_atm_mod.mod +ED/dbgbuild/bin/ed_ll_xy_mod.mod +ED/dbgbuild/bin/ed_load_work_from_history_mod.mod +ED/dbgbuild/bin/ed_masterput_met_header_mod.mod +ED/dbgbuild/bin/ed_masterput_nl_mod.mod +ED/dbgbuild/bin/ed_masterput_poly_dims_mod.mod +ED/dbgbuild/bin/ed_masterput_processid_mod.mod +ED/dbgbuild/bin/ed_masterput_worklist_info_mod.mod +ED/dbgbuild/bin/ed_mem_alloc_mod.mod +ED/dbgbuild/bin/ed_model_mod.mod +ED/dbgbuild/bin/ed_newgrid_mod.mod +ED/dbgbuild/bin/ed_node_decomp_mod.mod +ED/dbgbuild/bin/ed_nodeget_met_header_mod.mod +ED/dbgbuild/bin/ed_nodeget_nl_mod.mod +ED/dbgbuild/bin/ed_nodeget_poly_dims_mod.mod +ED/dbgbuild/bin/ed_nodeget_processid_mod.mod +ED/dbgbuild/bin/ed_nodeget_worklist_info_mod.mod +ED/dbgbuild/bin/ed_opspec_grid_mod.mod +ED/dbgbuild/bin/ed_opspec_misc_mod.mod +ED/dbgbuild/bin/ed_opspec_par_mod.mod +ED/dbgbuild/bin/ed_opspec_times_mod.mod +ED/dbgbuild/bin/ed_output_mod.mod +ED/dbgbuild/bin/ed_parvec_work_mod.mod +ED/dbgbuild/bin/ed_polarst_mod.mod +ED/dbgbuild/bin/ed_xy_ll_mod.mod +ED/dbgbuild/bin/ed_zen_mod.mod +ED/dbgbuild/bin/eifun8_mod.mod +ED/dbgbuild/bin/endian_mod.mod +ED/dbgbuild/bin/errorfun_mod.mod +ED/dbgbuild/bin/euler_integ_mod.mod +ED/dbgbuild/bin/euler_timestep_mod.mod +ED/dbgbuild/bin/event_fertilize_mod.mod +ED/dbgbuild/bin/event_fire_mod.mod +ED/dbgbuild/bin/event_harvest_mod.mod +ED/dbgbuild/bin/event_irrigate_mod.mod +ED/dbgbuild/bin/event_planting_mod.mod +ED/dbgbuild/bin/event_till_mod.mod +ED/dbgbuild/bin/expected_mod.mod +ED/dbgbuild/bin/expmsq_mod.mod +ED/dbgbuild/bin/exterminate_patches_except_mod.mod +ED/dbgbuild/bin/fatal_error_mod.mod +ED/dbgbuild/bin/fill_history_grid_mod.mod +ED/dbgbuild/bin/fill_history_patch_mod.mod +ED/dbgbuild/bin/fill_history_polygon_mod.mod +ED/dbgbuild/bin/fill_history_site_mod.mod +ED/dbgbuild/bin/fillvar_l_mod.mod +ED/dbgbuild/bin/find_closing_comment_mod.mod +ED/dbgbuild/bin/find_frqsum_mod.mod +ED/dbgbuild/bin/findln_mod.mod +ED/dbgbuild/bin/find_rank_mod.mod +ED/dbgbuild/bin/fire_frequency_mod.mod +ED/dbgbuild/bin/first_phenology_mod.mod +ED/dbgbuild/bin/flag_stable_cohorts_mod.mod +ED/dbgbuild/bin/getconfigint_mod.mod +ED/dbgbuild/bin/getconfigreal_mod.mod +ED/dbgbuild/bin/getconfigstring_mod.mod +ED/dbgbuild/bin/get_errmax_mod.mod +ED/dbgbuild/bin/get_file_indices_mod.mod +ED/dbgbuild/bin/get_grid_mod.mod +ED/dbgbuild/bin/geth5dims_mod.mod +ED/dbgbuild/bin/getll_mod.mod +ED/dbgbuild/bin/get_work_mod.mod +ED/dbgbuild/bin/get_yscal_mod.mod +ED/dbgbuild/bin/h5_output_mod.mod +ED/dbgbuild/bin/harv_immat_patches_mod.mod +ED/dbgbuild/bin/harv_mat_patches_mod.mod +ED/dbgbuild/bin/hdf_getslab_d_mod.mod +ED/dbgbuild/bin/hdf_getslab_i_mod.mod +ED/dbgbuild/bin/hdf_getslab_r_mod.mod +ED/dbgbuild/bin/heav_mod.mod +ED/dbgbuild/bin/het_resp_weight_mod.mod +ED/dbgbuild/bin/heun_integ_mod.mod +ED/dbgbuild/bin/heun_stepper_mod.mod +ED/dbgbuild/bin/heun_timestep_mod.mod +ED/dbgbuild/bin/how_to_read_a_file_mod.mod +ED/dbgbuild/bin/ibias_mod.mod +ED/dbgbuild/bin/ibindec_mod.mod +ED/dbgbuild/bin/ifirstchar_mod.mod +ED/dbgbuild/bin/inc_rk4_patch_mod.mod +ED/dbgbuild/bin/init_can_air_params_mod.mod +ED/dbgbuild/bin/init_can_lyr_params_mod.mod +ED/dbgbuild/bin/init_can_rad_params_mod.mod +ED/dbgbuild/bin/init_cohorts_by_layers_mod.mod +ED/dbgbuild/bin/init_decomp_params_mod.mod +ED/dbgbuild/bin/init_disturb_params_mod.mod +ED/dbgbuild/bin/init_ed_cohort_vars_mod.mod +ED/dbgbuild/bin/init_ed_misc_coms_mod.mod +ED/dbgbuild/bin/init_ed_patch_vars_mod.mod +ED/dbgbuild/bin/init_ed_poly_vars_mod.mod +ED/dbgbuild/bin/init_ed_site_vars_mod.mod +ED/dbgbuild/bin/init_ff_coms_mod.mod +ED/dbgbuild/bin/init_full_history_restart_mod.mod +ED/dbgbuild/bin/init_hydro_coms_mod.mod +ED/dbgbuild/bin/inithydrology_mod.mod +ED/dbgbuild/bin/inithydrosubsurface_mod.mod +ED/dbgbuild/bin/initialize_rk4patches_mod.mod +ED/dbgbuild/bin/init_lapse_params_mod.mod +ED/dbgbuild/bin/init_met_drivers_mod.mod +ED/dbgbuild/bin/init_met_params_mod.mod +ED/dbgbuild/bin/init_nbg_cohorts_mod.mod +ED/dbgbuild/bin/init_pft_alloc_params_mod.mod +ED/dbgbuild/bin/init_pft_derived_params_mod.mod +ED/dbgbuild/bin/init_pft_leaf_params_mod.mod +ED/dbgbuild/bin/init_pft_mort_params_mod.mod +ED/dbgbuild/bin/init_pft_nitro_params_mod.mod +ED/dbgbuild/bin/init_pft_photo_params_mod.mod +ED/dbgbuild/bin/init_pft_repro_params_mod.mod +ED/dbgbuild/bin/init_pft_resp_params_mod.mod +ED/dbgbuild/bin/init_phen_coms_mod.mod +ED/dbgbuild/bin/init_physiology_params_mod.mod +ED/dbgbuild/bin/init_rk4_params_mod.mod +ED/dbgbuild/bin/init_soil_coms_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_flux_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_state_mod.mod +ED/dbgbuild/bin/integrate_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/integrate_patch_euler_mod.mod +ED/dbgbuild/bin/integrate_patch_heun_mod.mod +ED/dbgbuild/bin/int_met_avg_mod.mod +ED/dbgbuild/bin/inventory_mat_forests_mod.mod +ED/dbgbuild/bin/iprim_mod.mod +ED/dbgbuild/bin/iran_recsize_mod.mod +ED/dbgbuild/bin/is_finite8_mod.mod +ED/dbgbuild/bin/is_finite_mod.mod +ED/dbgbuild/bin/isleap_mod.mod +ED/dbgbuild/bin/ismax_mod.mod +ED/dbgbuild/bin/ismin_mod.mod +ED/dbgbuild/bin/is_resolvable_mod.mod +ED/dbgbuild/bin/ivalugp_mod.mod +ED/dbgbuild/bin/izero2_mod.mod +ED/dbgbuild/bin/izero3_mod.mod +ED/dbgbuild/bin/izero4_mod.mod +ED/dbgbuild/bin/izero5_mod.mod +ED/dbgbuild/bin/izero_mod.mod +ED/dbgbuild/bin/izerov_mod.mod +ED/dbgbuild/bin/julday1000_mod.mod +ED/dbgbuild/bin/julday_mod.mod +ED/dbgbuild/bin/landuse_init_mod.mod +ED/dbgbuild/bin/large_error_mod.mod +ED/dbgbuild/bin/lastchar_mod.mod +ED/dbgbuild/bin/lastmonthdate_mod.mod +ED/dbgbuild/bin/lastslash_mod.mod +ED/dbgbuild/bin/leaf_database_mod.mod +ED/dbgbuild/bin/leaf_derivs_mod.mod +ED/dbgbuild/bin/leaftw_derivs_mod.mod +ED/dbgbuild/bin/libxml2f90__closeall_mod.mod +ED/dbgbuild/bin/libxml2f90__closefile_mod.mod +ED/dbgbuild/bin/libxml2f90_error_getline_mod.mod +ED/dbgbuild/bin/libxml2f90__existid_mod.mod +ED/dbgbuild/bin/libxml2f90_existid_mod.mod +ED/dbgbuild/bin/libxml2f90__existpid_mod.mod +ED/dbgbuild/bin/libxml2f90__findinchara_mod.mod +ED/dbgbuild/bin/libxml2f90__flush_mod.mod +ED/dbgbuild/bin/libxml2f90__get_fileunit_mod.mod +ED/dbgbuild/bin/libxml2f90_getline_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafec8_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafei4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafel4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafer8_mod.mod +ED/dbgbuild/bin/libxml2f90__getunit_mod.mod +ED/dbgbuild/bin/libxml2f90_interface_module.mod +ED/dbgbuild/bin/libxml2f90__ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpureid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_down_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_exist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_scal_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_initlist_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_inittag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_report_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_wrap_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selectlist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selecttag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_up_mod.mod +ED/dbgbuild/bin/libxml2f90_module.mod +ED/dbgbuild/bin/libxml2f90__openfile_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_file_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_find_char_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90_readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_nfil_mod.mod +ED/dbgbuild/bin/libxml2f90__set_casesensitive_mod.mod +ED/dbgbuild/bin/libxml2f90__set_default_ll_id_mod.mod +ED/dbgbuild/bin/libxml2f90__setformat_mod.mod +ED/dbgbuild/bin/libxml2f90__set_paw_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmcomma_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmquotes_mod.mod +ED/dbgbuild/bin/libxml2f90__settransform_exm_mod.mod +ED/dbgbuild/bin/libxml2f90__setwrite_exm_mod.mod +ED/dbgbuild/bin/libxml2f90_strings_module.mod +ED/dbgbuild/bin/libxml2f90_tostringa_mod.mod +ED/dbgbuild/bin/libxml2f90_tostring_mod.mod +ED/dbgbuild/bin/libxml2f90_transform_paw_mod.mod +ED/dbgbuild/bin/lisys_solver8_mod.mod +ED/dbgbuild/bin/lisys_solver_mod.mod +ED/dbgbuild/bin/ll_module.mod +ED/dbgbuild/bin/load_ecosystem_state_mod.mod +ED/dbgbuild/bin/load_ed_ecosystem_params_mod.mod +ED/dbgbuild/bin/lw_multiple_scatter_mod.mod +ED/dbgbuild/bin/lw_twostream_mod.mod +ED/dbgbuild/bin/makefnam_mod.mod +ED/dbgbuild/bin/match_poly_grid_mod.mod +ED/dbgbuild/bin/mat_forest_harv_rates_mod.mod +ED/dbgbuild/bin/mean_daysecz_mod.mod +ED/dbgbuild/bin/met_sanity_check_mod.mod +ED/dbgbuild/bin/mk_2_buff_mod.mod +ED/dbgbuild/bin/mk_2p_buff_mod.mod +ED/dbgbuild/bin/mk_3_buff_mod.mod +ED/dbgbuild/bin/mk_4_buff_mod.mod +ED/dbgbuild/bin/mprove_mod.mod +ED/dbgbuild/bin/near_bare_ground_init_mod.mod +ED/dbgbuild/bin/new_patch_sfc_props_mod.mod +ED/dbgbuild/bin/normalize_averaged_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_dailynpp_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/norm_harv_patch_mod.mod +ED/dbgbuild/bin/num_days_mod.mod +ED/dbgbuild/bin/odeint_mod.mod +ED/dbgbuild/bin/opspec_fatal_mod.mod +ED/dbgbuild/bin/overwrite_with_xml_config_mod.mod +ED/dbgbuild/bin/parsefnam_mod.mod +ED/dbgbuild/bin/parse_mod.mod +ED/dbgbuild/bin/pheninit_balive_bstorage_mod.mod +ED/dbgbuild/bin/phenology_driver_eq_0_mod.mod +ED/dbgbuild/bin/phenology_driver_mod.mod +ED/dbgbuild/bin/phenology_thresholds_mod.mod +ED/dbgbuild/bin/plant_structural_allocation_mod.mod +ED/dbgbuild/bin/prescribed_event_mod.mod +ED/dbgbuild/bin/prescribed_leaf_state_mod.mod +ED/dbgbuild/bin/print_c_and_n_budgets_mod.mod +ED/dbgbuild/bin/print_csiteipa_mod.mod +ED/dbgbuild/bin/print_errmax_mod.mod +ED/dbgbuild/bin/print_fields_mod.mod +ED/dbgbuild/bin/print_photo_details_mod.mod +ED/dbgbuild/bin/print_rk4patch_mod.mod +ED/dbgbuild/bin/print_rk4_state_mod.mod +ED/dbgbuild/bin/print_soil_info_mod.mod +ED/dbgbuild/bin/putconfigint_mod.mod +ED/dbgbuild/bin/putconfigreal8_mod.mod +ED/dbgbuild/bin/putconfigreal_mod.mod +ED/dbgbuild/bin/putconfigstring_mod.mod +ED/dbgbuild/bin/radiate_driver_mod.mod +ED/dbgbuild/bin/rams_f_open_mod.mod +ED/dbgbuild/bin/rank_down_mod.mod +ED/dbgbuild/bin/rank_up_mod.mod +ED/dbgbuild/bin/read_ed10_ed20_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_unstruct_mod.mod +ED/dbgbuild/bin/read_ed_xml_config_mod.mod +ED/dbgbuild/bin/read_events_xml_mod.mod +ED/dbgbuild/bin/read_met_driver_head_mod.mod +ED/dbgbuild/bin/read_met_drivers_init_mod.mod +ED/dbgbuild/bin/read_met_drivers_mod.mod +ED/dbgbuild/bin/read_nl_mod.mod +ED/dbgbuild/bin/read_ol_file_mod.mod +ED/dbgbuild/bin/read_plantation_fractions_mod.mod +ED/dbgbuild/bin/read_site_file_mod.mod +ED/dbgbuild/bin/read_soil_depth_mod.mod +ED/dbgbuild/bin/read_soil_moist_temp_mod.mod +ED/dbgbuild/bin/rearrange_mod.mod +ED/dbgbuild/bin/reproduction_eq_0_mod.mod +ED/dbgbuild/bin/reproduction_mod.mod +ED/dbgbuild/bin/reset_averaged_vars_mod.mod +ED/dbgbuild/bin/resp_f_decomp_mod.mod +ED/dbgbuild/bin/resp_rh_mod.mod +ED/dbgbuild/bin/root_resp_norm_mod.mod +ED/dbgbuild/bin/scale_ed_radiation_mod.mod +ED/dbgbuild/bin/seed_dispersal_mod.mod +ED/dbgbuild/bin/setlapseparms_mod.mod +ED/dbgbuild/bin/set_polygon_coordinates_mod.mod +ED/dbgbuild/bin/set_site_defprops_mod.mod +ED/dbgbuild/bin/sfcdata_ed_mod.mod +ED/dbgbuild/bin/sfcrad_ed_mod.mod +ED/dbgbuild/bin/short2diff_sib_mod.mod +ED/dbgbuild/bin/short_bdown_weissnorman_mod.mod +ED/dbgbuild/bin/sngloff_mod.mod +ED/dbgbuild/bin/soil_depth_fill_mod.mod +ED/dbgbuild/bin/soil_respiration_mod.mod +ED/dbgbuild/bin/solar_radiation_breakdown_mod.mod +ED/dbgbuild/bin/sort3_mod.mod +ED/dbgbuild/bin/sort_down_mod.mod +ED/dbgbuild/bin/sort_up_mod.mod +ED/dbgbuild/bin/spatial_averages_mod.mod +ED/dbgbuild/bin/ssum_mod.mod +ED/dbgbuild/bin/structural_growth_eq_0_mod.mod +ED/dbgbuild/bin/structural_growth_mod.mod +ED/dbgbuild/bin/sum_plant_cfluxes_mod.mod +ED/dbgbuild/bin/sw_multiple_scatter_mod.mod +ED/dbgbuild/bin/sw_twostream_clump_mod.mod +ED/dbgbuild/bin/test_mod.mod +ED/dbgbuild/bin/timing_mod.mod +ED/dbgbuild/bin/tokenize1_mod.mod +ED/dbgbuild/bin/tolower_mod.mod +ED/dbgbuild/bin/transfer_ol_month_mod.mod +ED/dbgbuild/bin/trid2_mod.mod +ED/dbgbuild/bin/trid_mod.mod +ED/dbgbuild/bin/ugetarg_mod.mod +ED/dbgbuild/bin/unarrange_mod.mod +ED/dbgbuild/bin/update_budget_mod.mod +ED/dbgbuild/bin/update_c_and_n_pools_mod.mod +ED/dbgbuild/bin/update_derived_cohort_props_mod.mod +ED/dbgbuild/bin/update_derived_props_mod.mod +ED/dbgbuild/bin/update_diagnostic_vars_mod.mod +ED/dbgbuild/bin/update_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/updatehydroparms_mod.mod +ED/dbgbuild/bin/update_met_drivers_mod.mod +ED/dbgbuild/bin/update_model_time_dm_mod.mod +ED/dbgbuild/bin/update_mod.mod +ED/dbgbuild/bin/update_patch_derived_props_mod.mod +ED/dbgbuild/bin/update_patch_thermo_props_mod.mod +ED/dbgbuild/bin/update_phenology_mod.mod +ED/dbgbuild/bin/update_polygon_derived_props_mod.mod +ED/dbgbuild/bin/update_rad_avg_mod.mod +ED/dbgbuild/bin/update_site_derived_props_mod.mod +ED/dbgbuild/bin/update_thermal_sums_mod.mod +ED/dbgbuild/bin/update_turnover_mod.mod +ED/dbgbuild/bin/update_vital_rates_mod.mod +ED/dbgbuild/bin/updatewatertableadd_mod.mod +ED/dbgbuild/bin/updatewatertablebaseflow_mod.mod +ED/dbgbuild/bin/updatewatertablesubtract_mod.mod +ED/dbgbuild/bin/update_workload_mod.mod +ED/dbgbuild/bin/valugp_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_eq_0_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_mod.mod +ED/dbgbuild/bin/walltime_mod.mod +ED/dbgbuild/bin/warning_mod.mod +ED/dbgbuild/bin/write_ed_xml_config_mod.mod +ED/dbgbuild/bin/writehydro_mod.mod +ED/dbgbuild/bin/yesterday_mod.mod +ED/dbgbuild/bin/zero_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_daily_vars_mod.mod +ED/dbgbuild/bin/zero_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/a3e0_mod.f90 +ED/dbgbuild/bin/a3e1_mod.f90 +ED/dbgbuild/bin/a3e2_mod.f90 +ED/dbgbuild/bin/accum_mod.f90 +ED/dbgbuild/bin/acnst_mod.f90 +ED/dbgbuild/bin/adivb_mod.f90 +ED/dbgbuild/bin/adjust_sfcw_properties_mod.f90 +ED/dbgbuild/bin/adjust_topsoil_properties_mod.f90 +ED/dbgbuild/bin/adjust_veg_properties_mod.f90 +ED/dbgbuild/bin/ae0_mod.f90 +ED/dbgbuild/bin/ae1m1_mod.f90 +ED/dbgbuild/bin/ae1_mod.f90 +ED/dbgbuild/bin/ae1p1_mod.f90 +ED/dbgbuild/bin/ae1p1p1_mod.f90 +ED/dbgbuild/bin/ae1t0_mod.f90 +ED/dbgbuild/bin/ae1t0p1_mod.f90 +ED/dbgbuild/bin/ae1t1_mod.f90 +ED/dbgbuild/bin/ae1t1p1_mod.f90 +ED/dbgbuild/bin/ae1tn1_mod.f90 +ED/dbgbuild/bin/ae2_mod.f90 +ED/dbgbuild/bin/ae3m3d0_mod.f90 +ED/dbgbuild/bin/ae3m3_mod.f90 +ED/dbgbuild/bin/ae3_mod.f90 +ED/dbgbuild/bin/ae3p3_mod.f90 +ED/dbgbuild/bin/ae3t0p3_mod.f90 +ED/dbgbuild/bin/ae3t3_mod.f90 +ED/dbgbuild/bin/ae3t3p3_mod.f90 +ED/dbgbuild/bin/aen1_mod.f90 +ED/dbgbuild/bin/aen3t0p3_mod.f90 +ED/dbgbuild/bin/alebl_mod.f90 +ED/dbgbuild/bin/angle_of_incid_mod.f90 +ED/dbgbuild/bin/aone2_mod.f90 +ED/dbgbuild/bin/aone3_mod.f90 +ED/dbgbuild/bin/aone4_mod.f90 +ED/dbgbuild/bin/aone5_mod.f90 +ED/dbgbuild/bin/aone_mod.f90 +ED/dbgbuild/bin/aonev_mod.f90 +ED/dbgbuild/bin/apply_forestry_mod.f90 +ED/dbgbuild/bin/assign_prescribed_phen_mod.f90 +ED/dbgbuild/bin/atimb_mod.f90 +ED/dbgbuild/bin/atob_log_mod.f90 +ED/dbgbuild/bin/atob_mod.f90 +ED/dbgbuild/bin/avg_ed_daily_output_pool_mod.f90 +ED/dbgbuild/bin/azero2_mod.f90 +ED/dbgbuild/bin/azero3_mod.f90 +ED/dbgbuild/bin/azero4_mod.f90 +ED/dbgbuild/bin/azero5_mod.f90 +ED/dbgbuild/bin/azero_mod.f90 +ED/dbgbuild/bin/azerov_mod.f90 +ED/dbgbuild/bin/banbks_mod.f90 +ED/dbgbuild/bin/bandec_mod.f90 +ED/dbgbuild/bin/calc_flow_routing_mod.f90 +ED/dbgbuild/bin/calchydrosubsurface_mod.f90 +ED/dbgbuild/bin/calchydrosurface_mod.f90 +ED/dbgbuild/bin/calc_met_lapse_mod.f90 +ED/dbgbuild/bin/calcwatertable_mod.f90 +ED/dbgbuild/bin/canopy_derivs_two_mod.f90 +ED/dbgbuild/bin/canopy_photosynthesis_mod.f90 +ED/dbgbuild/bin/cbrt8_mod.f90 +ED/dbgbuild/bin/cbrt_mod.f90 +ED/dbgbuild/bin/cdf2normal_mod.f90 +ED/dbgbuild/bin/cdf_mod.f90 +ED/dbgbuild/bin/char_strip_var_mod.f90 +ED/dbgbuild/bin/check_real_mod.f90 +ED/dbgbuild/bin/compute_budget_mod.f90 +ED/dbgbuild/bin/compute_c_and_n_storage_mod.f90 +ED/dbgbuild/bin/compute_co2_storage_mod.f90 +ED/dbgbuild/bin/compute_energy_storage_mod.f90 +ED/dbgbuild/bin/compute_netrad_mod.f90 +ED/dbgbuild/bin/compute_water_storage_mod.f90 +ED/dbgbuild/bin/copy_met_2_rk4site_mod.f90 +ED/dbgbuild/bin/copy_nl_mod.f90 +ED/dbgbuild/bin/copy_patch_init_carbon_mod.f90 +ED/dbgbuild/bin/copy_patch_init_mod.f90 +ED/dbgbuild/bin/copy_path_from_grid_1_mod.f90 +ED/dbgbuild/bin/copy_rk4_patch_mod.f90 +ED/dbgbuild/bin/count_pft_xml_config_mod.f90 +ED/dbgbuild/bin/cputime_mod.f90 +ED/dbgbuild/bin/create_ed10_ed20_fname_mod.f90 +ED/dbgbuild/bin/cumsum_mod.f90 +ED/dbgbuild/bin/cvmgm_mod.f90 +ED/dbgbuild/bin/cvmgn_mod.f90 +ED/dbgbuild/bin/cvmgp_mod.f90 +ED/dbgbuild/bin/cvmgz_mod.f90 +ED/dbgbuild/bin/date_2_seconds_mod.f90 +ED/dbgbuild/bin/date_abs_secs2_mod.f90 +ED/dbgbuild/bin/date_add_to_mod.f90 +ED/dbgbuild/bin/date_secs_ymdt_mod.f90 +ED/dbgbuild/bin/date_unmake_big_mod.f90 +ED/dbgbuild/bin/daylength_mod.f90 +ED/dbgbuild/bin/dcvmgm_mod.f90 +ED/dbgbuild/bin/dcvmgp_mod.f90 +ED/dbgbuild/bin/dcw_swap16_mod.f90 +ED/dbgbuild/bin/dcw_swap32_mod.f90 +ED/dbgbuild/bin/dcw_swap64_mod.f90 +ED/dbgbuild/bin/ddens_dt_effect_mod.f90 +ED/dbgbuild/bin/deblank_mod.f90 +ED/dbgbuild/bin/detab_mod.f90 +ED/dbgbuild/bin/diagon_mod.f90 +ED/dbgbuild/bin/dist_gc_mod.f90 +ED/dbgbuild/bin/dmax2_mod.f90 +ED/dbgbuild/bin/dmin2_mod.f90 +ED/dbgbuild/bin/dssum_mod.f90 +ED/dbgbuild/bin/dump_radinfo_mod.f90 +ED/dbgbuild/bin/ed1_fileinfo_mod.f90 +ED/dbgbuild/bin/ed_1st_master_mod.f90 +ED/dbgbuild/bin/ed_1st_node_mod.f90 +ED/dbgbuild/bin/ed21_fileinfo_mod.f90 +ED/dbgbuild/bin/ed_datp_datq_mod.f90 +ED/dbgbuild/bin/ed_datp_datsoil_mod.f90 +ED/dbgbuild/bin/ed_driver_mod.f90 +ED/dbgbuild/bin/ed_filelist_mod.f90 +ED/dbgbuild/bin/ed_gridset_mod.f90 +ED/dbgbuild/bin/ed_init_atm_mod.f90 +ED/dbgbuild/bin/ed_ll_xy_mod.f90 +ED/dbgbuild/bin/ed_load_work_from_history_mod.f90 +ED/dbgbuild/bin/ed_masterput_met_header_mod.f90 +ED/dbgbuild/bin/ed_masterput_nl_mod.f90 +ED/dbgbuild/bin/ed_masterput_poly_dims_mod.f90 +ED/dbgbuild/bin/ed_masterput_processid_mod.f90 +ED/dbgbuild/bin/ed_masterput_worklist_info_mod.f90 +ED/dbgbuild/bin/ed_mem_alloc_mod.f90 +ED/dbgbuild/bin/ed_model_mod.f90 +ED/dbgbuild/bin/ed_nbg_init.f90 +ED/dbgbuild/bin/ed_newgrid_mod.f90 +ED/dbgbuild/bin/ed_node_decomp_mod.f90 +ED/dbgbuild/bin/ed_nodeget_met_header_mod.f90 +ED/dbgbuild/bin/ed_nodeget_nl_mod.f90 +ED/dbgbuild/bin/ed_nodeget_poly_dims_mod.f90 +ED/dbgbuild/bin/ed_nodeget_processid_mod.f90 +ED/dbgbuild/bin/ed_nodeget_worklist_info_mod.f90 +ED/dbgbuild/bin/ed_opspec_grid_mod.f90 +ED/dbgbuild/bin/ed_opspec_misc_mod.f90 +ED/dbgbuild/bin/ed_opspec_par_mod.f90 +ED/dbgbuild/bin/ed_opspec_times_mod.f90 +ED/dbgbuild/bin/ed_output_mod.f90 +ED/dbgbuild/bin/ed_parvec_work_mod.f90 +ED/dbgbuild/bin/ed_polarst_mod.f90 +ED/dbgbuild/bin/ed_xy_ll_mod.f90 +ED/dbgbuild/bin/ed_zen_mod.f90 +ED/dbgbuild/bin/eifun8_mod.f90 +ED/dbgbuild/bin/endian_mod.f90 +ED/dbgbuild/bin/errorfun_mod.f90 +ED/dbgbuild/bin/euler_integ_mod.f90 +ED/dbgbuild/bin/euler_timestep_mod.f90 +ED/dbgbuild/bin/event_fertilize_mod.f90 +ED/dbgbuild/bin/event_fire_mod.f90 +ED/dbgbuild/bin/event_harvest_mod.f90 +ED/dbgbuild/bin/event_irrigate_mod.f90 +ED/dbgbuild/bin/event_planting_mod.f90 +ED/dbgbuild/bin/event_till_mod.f90 +ED/dbgbuild/bin/expected_mod.f90 +ED/dbgbuild/bin/expmsq_mod.f90 +ED/dbgbuild/bin/exterminate_patches_except_mod.f90 +ED/dbgbuild/bin/fatal_error_mod.f90 +ED/dbgbuild/bin/fill_history_grid_mod.f90 +ED/dbgbuild/bin/fill_history_patch_mod.f90 +ED/dbgbuild/bin/fill_history_polygon_mod.f90 +ED/dbgbuild/bin/fill_history_site_mod.f90 +ED/dbgbuild/bin/fillvar_l_mod.f90 +ED/dbgbuild/bin/find_closing_comment_mod.f90 +ED/dbgbuild/bin/find_frqsum_mod.f90 +ED/dbgbuild/bin/findln_mod.f90 +ED/dbgbuild/bin/find_rank_mod.f90 +ED/dbgbuild/bin/fire_frequency_mod.f90 +ED/dbgbuild/bin/first_phenology_mod.f90 +ED/dbgbuild/bin/flag_stable_cohorts_mod.f90 +ED/dbgbuild/bin/getconfigint_mod.f90 +ED/dbgbuild/bin/getconfigreal_mod.f90 +ED/dbgbuild/bin/getconfigstring_mod.f90 +ED/dbgbuild/bin/get_errmax_mod.f90 +ED/dbgbuild/bin/get_file_indices_mod.f90 +ED/dbgbuild/bin/get_grid_mod.f90 +ED/dbgbuild/bin/geth5dims_mod.f90 +ED/dbgbuild/bin/getll_mod.f90 +ED/dbgbuild/bin/get_work_mod.f90 +ED/dbgbuild/bin/get_yscal_mod.f90 +ED/dbgbuild/bin/h5_output_mod.f90 +ED/dbgbuild/bin/harv_immat_patches_mod.f90 +ED/dbgbuild/bin/harv_mat_patches_mod.f90 +ED/dbgbuild/bin/hdf_getslab_d_mod.f90 +ED/dbgbuild/bin/hdf_getslab_i_mod.f90 +ED/dbgbuild/bin/hdf_getslab_r_mod.f90 +ED/dbgbuild/bin/heav_mod.f90 +ED/dbgbuild/bin/het_resp_weight_mod.f90 +ED/dbgbuild/bin/heun_integ_mod.f90 +ED/dbgbuild/bin/heun_stepper_mod.f90 +ED/dbgbuild/bin/heun_timestep_mod.f90 +ED/dbgbuild/bin/how_to_read_a_file_mod.f90 +ED/dbgbuild/bin/ibias_mod.f90 +ED/dbgbuild/bin/ibindec_mod.f90 +ED/dbgbuild/bin/ifirstchar_mod.f90 +ED/dbgbuild/bin/inc_rk4_patch_mod.f90 +ED/dbgbuild/bin/init_can_air_params_mod.f90 +ED/dbgbuild/bin/init_can_lyr_params_mod.f90 +ED/dbgbuild/bin/init_can_rad_params_mod.f90 +ED/dbgbuild/bin/init_cohorts_by_layers_mod.f90 +ED/dbgbuild/bin/init_decomp_params_mod.f90 +ED/dbgbuild/bin/init_disturb_params_mod.f90 +ED/dbgbuild/bin/init_ed_cohort_vars_mod.f90 +ED/dbgbuild/bin/init_ed_misc_coms_mod.f90 +ED/dbgbuild/bin/init_ed_patch_vars_mod.f90 +ED/dbgbuild/bin/init_ed_poly_vars_mod.f90 +ED/dbgbuild/bin/init_ed_site_vars_mod.f90 +ED/dbgbuild/bin/init_ff_coms_mod.f90 +ED/dbgbuild/bin/init_full_history_restart_mod.f90 +ED/dbgbuild/bin/init_hydro_coms_mod.f90 +ED/dbgbuild/bin/inithydrology_mod.f90 +ED/dbgbuild/bin/inithydrosubsurface_mod.f90 +ED/dbgbuild/bin/initialize_rk4patches_mod.f90 +ED/dbgbuild/bin/init_lapse_params_mod.f90 +ED/dbgbuild/bin/init_met_drivers_mod.f90 +ED/dbgbuild/bin/init_met_params_mod.f90 +ED/dbgbuild/bin/init_nbg_cohorts_mod.f90 +ED/dbgbuild/bin/init_pft_alloc_params_mod.f90 +ED/dbgbuild/bin/init_pft_derived_params_mod.f90 +ED/dbgbuild/bin/init_pft_leaf_params_mod.f90 +ED/dbgbuild/bin/init_pft_mort_params_mod.f90 +ED/dbgbuild/bin/init_pft_nitro_params_mod.f90 +ED/dbgbuild/bin/init_pft_photo_params_mod.f90 +ED/dbgbuild/bin/init_pft_repro_params_mod.f90 +ED/dbgbuild/bin/init_pft_resp_params_mod.f90 +ED/dbgbuild/bin/init_phen_coms_mod.f90 +ED/dbgbuild/bin/init_physiology_params_mod.f90 +ED/dbgbuild/bin/init_rk4_params_mod.f90 +ED/dbgbuild/bin/init_soil_coms_mod.f90 +ED/dbgbuild/bin/integrate_ed_daily_output_flux_mod.f90 +ED/dbgbuild/bin/integrate_ed_daily_output_state_mod.f90 +ED/dbgbuild/bin/integrate_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/integrate_patch_euler_mod.f90 +ED/dbgbuild/bin/integrate_patch_heun_mod.f90 +ED/dbgbuild/bin/int_met_avg_mod.f90 +ED/dbgbuild/bin/inventory_mat_forests_mod.f90 +ED/dbgbuild/bin/iprim_mod.f90 +ED/dbgbuild/bin/iran_recsize_mod.f90 +ED/dbgbuild/bin/is_finite8_mod.f90 +ED/dbgbuild/bin/is_finite_mod.f90 +ED/dbgbuild/bin/isleap_mod.f90 +ED/dbgbuild/bin/ismax_mod.f90 +ED/dbgbuild/bin/ismin_mod.f90 +ED/dbgbuild/bin/is_resolvable_mod.f90 +ED/dbgbuild/bin/ivalugp_mod.f90 +ED/dbgbuild/bin/izero2_mod.f90 +ED/dbgbuild/bin/izero3_mod.f90 +ED/dbgbuild/bin/izero4_mod.f90 +ED/dbgbuild/bin/izero5_mod.f90 +ED/dbgbuild/bin/izero_mod.f90 +ED/dbgbuild/bin/izerov_mod.f90 +ED/dbgbuild/bin/julday1000_mod.f90 +ED/dbgbuild/bin/julday_mod.f90 +ED/dbgbuild/bin/landuse_init_mod.f90 +ED/dbgbuild/bin/large_error_mod.f90 +ED/dbgbuild/bin/lastchar_mod.f90 +ED/dbgbuild/bin/lastmonthdate_mod.f90 +ED/dbgbuild/bin/lastslash_mod.f90 +ED/dbgbuild/bin/leaf_database_mod.f90 +ED/dbgbuild/bin/leaf_derivs_mod.f90 +ED/dbgbuild/bin/leaftw_derivs_mod.f90 +ED/dbgbuild/bin/libxml2f90__closeall_mod.f90 +ED/dbgbuild/bin/libxml2f90__closefile_mod.f90 +ED/dbgbuild/bin/libxml2f90_error_getline_mod.f90 +ED/dbgbuild/bin/libxml2f90__existid_mod.f90 +ED/dbgbuild/bin/libxml2f90_existid_mod.f90 +ED/dbgbuild/bin/libxml2f90__existpid_mod.f90 +ED/dbgbuild/bin/libxml2f90__findinchara_mod.f90 +ED/dbgbuild/bin/libxml2f90__flush_mod.f90 +ED/dbgbuild/bin/libxml2f90__get_fileunit_mod.f90 +ED/dbgbuild/bin/libxml2f90_getline_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafec8_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafei4_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafel4_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafer8_mod.f90 +ED/dbgbuild/bin/libxml2f90__getunit_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_addid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_add_list_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_add_list_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_addpid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addpid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addpureid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_closetag_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_closetag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_down_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_edit_id_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_edit_id_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_edit_pid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_edit_pid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_exist_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getc8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getc8_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getc8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getch_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getch_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getch_scal_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_geti4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_geti4_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_geti4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getl4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getl4_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getl4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpc8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpc8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpch_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpi4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpi4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpl4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpl4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpr8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpr8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpsize_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpstring__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpstring_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getr8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getr8_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getr8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getsize_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getsize_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getstring__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getstring_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getstring_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_initlist_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_inittag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_opentag_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_opentag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_report_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_report_rec_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_report_rec_wrap_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_selectlist_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_selecttag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_up_mod.f90 +ED/dbgbuild/bin/libxml2f90__openfile_mod.f90 +ED/dbgbuild/bin/libxml2f90_parse_file_mod.f90 +ED/dbgbuild/bin/libxml2f90_parse_find_char_mod.f90 +ED/dbgbuild/bin/libxml2f90__readin_file_mod.f90 +ED/dbgbuild/bin/libxml2f90_readin_file_mod.f90 +ED/dbgbuild/bin/libxml2f90__readin_nfil_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_casesensitive_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_default_ll_id_mod.f90 +ED/dbgbuild/bin/libxml2f90__setformat_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_paw_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_rmcomma_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_rmquotes_mod.f90 +ED/dbgbuild/bin/libxml2f90__settransform_exm_mod.f90 +ED/dbgbuild/bin/libxml2f90__setwrite_exm_mod.f90 +ED/dbgbuild/bin/libxml2f90_tostringa_mod.f90 +ED/dbgbuild/bin/libxml2f90_tostring_mod.f90 +ED/dbgbuild/bin/libxml2f90_transform_paw_mod.f90 +ED/dbgbuild/bin/lisys_solver8_mod.f90 +ED/dbgbuild/bin/lisys_solver_mod.f90 +ED/dbgbuild/bin/load_ecosystem_state_mod.f90 +ED/dbgbuild/bin/load_ed_ecosystem_params_mod.f90 +ED/dbgbuild/bin/lw_multiple_scatter_mod.f90 +ED/dbgbuild/bin/lw_twostream_mod.f90 +ED/dbgbuild/bin/makefnam_mod.f90 +ED/dbgbuild/bin/match_poly_grid_mod.f90 +ED/dbgbuild/bin/mat_forest_harv_rates_mod.f90 +ED/dbgbuild/bin/mean_daysecz_mod.f90 +ED/dbgbuild/bin/met_sanity_check_mod.f90 +ED/dbgbuild/bin/mk_2_buff_mod.f90 +ED/dbgbuild/bin/mk_2p_buff_mod.f90 +ED/dbgbuild/bin/mk_3_buff_mod.f90 +ED/dbgbuild/bin/mk_4_buff_mod.f90 +ED/dbgbuild/bin/mprove_mod.f90 +ED/dbgbuild/bin/near_bare_ground_init_mod.f90 +ED/dbgbuild/bin/new_patch_sfc_props_mod.f90 +ED/dbgbuild/bin/normalize_averaged_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_dailynpp_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_daily_output_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_daily_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/norm_harv_patch_mod.f90 +ED/dbgbuild/bin/num_days_mod.f90 +ED/dbgbuild/bin/odeint_mod.f90 +ED/dbgbuild/bin/opspec_fatal_mod.f90 +ED/dbgbuild/bin/overwrite_with_xml_config_mod.f90 +ED/dbgbuild/bin/parsefnam_mod.f90 +ED/dbgbuild/bin/parse_mod.f90 +ED/dbgbuild/bin/pheninit_balive_bstorage_mod.f90 +ED/dbgbuild/bin/phenology_driver_eq_0_mod.f90 +ED/dbgbuild/bin/phenology_driver_mod.f90 +ED/dbgbuild/bin/phenology_thresholds_mod.f90 +ED/dbgbuild/bin/plant_structural_allocation_mod.f90 +ED/dbgbuild/bin/prescribed_event_mod.f90 +ED/dbgbuild/bin/prescribed_leaf_state_mod.f90 +ED/dbgbuild/bin/print_c_and_n_budgets_mod.f90 +ED/dbgbuild/bin/print_csiteipa_mod.f90 +ED/dbgbuild/bin/print_errmax_mod.f90 +ED/dbgbuild/bin/print_fields_mod.f90 +ED/dbgbuild/bin/print_photo_details_mod.f90 +ED/dbgbuild/bin/print_rk4patch_mod.f90 +ED/dbgbuild/bin/print_rk4_state_mod.f90 +ED/dbgbuild/bin/print_soil_info_mod.f90 +ED/dbgbuild/bin/putconfigint_mod.f90 +ED/dbgbuild/bin/putconfigreal8_mod.f90 +ED/dbgbuild/bin/putconfigreal_mod.f90 +ED/dbgbuild/bin/putconfigstring_mod.f90 +ED/dbgbuild/bin/radiate_driver_mod.f90 +ED/dbgbuild/bin/rams_f_open_mod.f90 +ED/dbgbuild/bin/rank_down_mod.f90 +ED/dbgbuild/bin/rank_up_mod.f90 +ED/dbgbuild/bin/read_ed10_ed20_history_file_mod.f90 +ED/dbgbuild/bin/read_ed21_history_file_mod.f90 +ED/dbgbuild/bin/read_ed21_history_unstruct_mod.f90 +ED/dbgbuild/bin/read_ed_xml_config_mod.f90 +ED/dbgbuild/bin/read_events_xml_mod.f90 +ED/dbgbuild/bin/read_met_driver_head_mod.f90 +ED/dbgbuild/bin/read_met_drivers_init_mod.f90 +ED/dbgbuild/bin/read_met_drivers_mod.f90 +ED/dbgbuild/bin/read_nl_mod.f90 +ED/dbgbuild/bin/read_ol_file_mod.f90 +ED/dbgbuild/bin/read_plantation_fractions_mod.f90 +ED/dbgbuild/bin/read_site_file_mod.f90 +ED/dbgbuild/bin/read_soil_depth_mod.f90 +ED/dbgbuild/bin/read_soil_moist_temp_mod.f90 +ED/dbgbuild/bin/rearrange_mod.f90 +ED/dbgbuild/bin/reproduction_eq_0_mod.f90 +ED/dbgbuild/bin/reproduction_mod.f90 +ED/dbgbuild/bin/reset_averaged_vars_mod.f90 +ED/dbgbuild/bin/resp_f_decomp_mod.f90 +ED/dbgbuild/bin/resp_rh_mod.f90 +ED/dbgbuild/bin/root_resp_norm_mod.f90 +ED/dbgbuild/bin/scale_ed_radiation_mod.f90 +ED/dbgbuild/bin/seed_dispersal_mod.f90 +ED/dbgbuild/bin/setlapseparms_mod.f90 +ED/dbgbuild/bin/set_polygon_coordinates_mod.f90 +ED/dbgbuild/bin/set_site_defprops_mod.f90 +ED/dbgbuild/bin/sfcdata_ed_mod.f90 +ED/dbgbuild/bin/sfcrad_ed_mod.f90 +ED/dbgbuild/bin/short2diff_sib_mod.f90 +ED/dbgbuild/bin/short_bdown_weissnorman_mod.f90 +ED/dbgbuild/bin/sngloff_mod.f90 +ED/dbgbuild/bin/soil_depth_fill_mod.f90 +ED/dbgbuild/bin/soil_respiration_mod.f90 +ED/dbgbuild/bin/solar_radiation_breakdown_mod.f90 +ED/dbgbuild/bin/sort3_mod.f90 +ED/dbgbuild/bin/sort_down_mod.f90 +ED/dbgbuild/bin/sort_up_mod.f90 +ED/dbgbuild/bin/spatial_averages_mod.f90 +ED/dbgbuild/bin/ssum_mod.f90 +ED/dbgbuild/bin/stable_cohorts.f90 +ED/dbgbuild/bin/structural_growth_eq_0_mod.f90 +ED/dbgbuild/bin/structural_growth_mod.f90 +ED/dbgbuild/bin/sum_plant_cfluxes_mod.f90 +ED/dbgbuild/bin/sw_multiple_scatter_mod.f90 +ED/dbgbuild/bin/sw_twostream_clump_mod.f90 +ED/dbgbuild/bin/test_mod.f90 +ED/dbgbuild/bin/timing_mod.f90 +ED/dbgbuild/bin/tokenize1_mod.f90 +ED/dbgbuild/bin/tolower_mod.f90 +ED/dbgbuild/bin/transfer_ol_month_mod.f90 +ED/dbgbuild/bin/trid2_mod.f90 +ED/dbgbuild/bin/trid_mod.f90 +ED/dbgbuild/bin/ugetarg_mod.f90 +ED/dbgbuild/bin/unarrange_mod.f90 +ED/dbgbuild/bin/update_budget_mod.f90 +ED/dbgbuild/bin/update_c_and_n_pools_mod.f90 +ED/dbgbuild/bin/update_derived_cohort_props_mod.f90 +ED/dbgbuild/bin/update_derived_props_mod.f90 +ED/dbgbuild/bin/update_diagnostic_vars_mod.f90 +ED/dbgbuild/bin/update_ed_yearly_vars_mod.f90 +ED/dbgbuild/bin/updatehydroparms_mod.f90 +ED/dbgbuild/bin/update_met_drivers_mod.f90 +ED/dbgbuild/bin/update_model_time_dm_mod.f90 +ED/dbgbuild/bin/update_mod.f90 +ED/dbgbuild/bin/update_patch_derived_props_mod.f90 +ED/dbgbuild/bin/update_patch_thermo_props_mod.f90 +ED/dbgbuild/bin/update_phenology_mod.f90 +ED/dbgbuild/bin/update_polygon_derived_props_mod.f90 +ED/dbgbuild/bin/update_rad_avg_mod.f90 +ED/dbgbuild/bin/update_site_derived_props_mod.f90 +ED/dbgbuild/bin/update_thermal_sums_mod.f90 +ED/dbgbuild/bin/update_turnover_mod.f90 +ED/dbgbuild/bin/update_vital_rates_mod.f90 +ED/dbgbuild/bin/updatewatertableadd_mod.f90 +ED/dbgbuild/bin/updatewatertablebaseflow_mod.f90 +ED/dbgbuild/bin/updatewatertablesubtract_mod.f90 +ED/dbgbuild/bin/update_workload_mod.f90 +ED/dbgbuild/bin/valugp_mod.f90 +ED/dbgbuild/bin/vegetation_dynamics_eq_0_mod.f90 +ED/dbgbuild/bin/vegetation_dynamics_mod.f90 +ED/dbgbuild/bin/walltime_mod.f90 +ED/dbgbuild/bin/warning_mod.f90 +ED/dbgbuild/bin/write_ed_xml_config_mod.f90 +ED/dbgbuild/bin/writehydro_mod.f90 +ED/dbgbuild/bin/yesterday_mod.f90 +ED/dbgbuild/bin/zero_ed_daily_output_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_daily_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_yearly_vars_mod.f90 +ED/dbgbuild/bin/a3e0_mod.mod +ED/dbgbuild/bin/a3e1_mod.mod +ED/dbgbuild/bin/a3e2_mod.mod +ED/dbgbuild/bin/accum_mod.mod +ED/dbgbuild/bin/acnst_mod.mod +ED/dbgbuild/bin/adivb_mod.mod +ED/dbgbuild/bin/adjust_sfcw_properties_mod.mod +ED/dbgbuild/bin/adjust_topsoil_properties_mod.mod +ED/dbgbuild/bin/adjust_veg_properties_mod.mod +ED/dbgbuild/bin/ae0_mod.mod +ED/dbgbuild/bin/ae1m1_mod.mod +ED/dbgbuild/bin/ae1_mod.mod +ED/dbgbuild/bin/ae1p1_mod.mod +ED/dbgbuild/bin/ae1p1p1_mod.mod +ED/dbgbuild/bin/ae1t0_mod.mod +ED/dbgbuild/bin/ae1t0p1_mod.mod +ED/dbgbuild/bin/ae1t1_mod.mod +ED/dbgbuild/bin/ae1t1p1_mod.mod +ED/dbgbuild/bin/ae1tn1_mod.mod +ED/dbgbuild/bin/ae2_mod.mod +ED/dbgbuild/bin/ae3m3d0_mod.mod +ED/dbgbuild/bin/ae3m3_mod.mod +ED/dbgbuild/bin/ae3_mod.mod +ED/dbgbuild/bin/ae3p3_mod.mod +ED/dbgbuild/bin/ae3t0p3_mod.mod +ED/dbgbuild/bin/ae3t3_mod.mod +ED/dbgbuild/bin/ae3t3p3_mod.mod +ED/dbgbuild/bin/aen1_mod.mod +ED/dbgbuild/bin/aen3t0p3_mod.mod +ED/dbgbuild/bin/alebl_mod.mod +ED/dbgbuild/bin/allometry.mod +ED/dbgbuild/bin/angle_of_incid_mod.mod +ED/dbgbuild/bin/an_header.mod +ED/dbgbuild/bin/aone2_mod.mod +ED/dbgbuild/bin/aone3_mod.mod +ED/dbgbuild/bin/aone4_mod.mod +ED/dbgbuild/bin/aone5_mod.mod +ED/dbgbuild/bin/aone_mod.mod +ED/dbgbuild/bin/aonev_mod.mod +ED/dbgbuild/bin/apply_forestry_mod.mod +ED/dbgbuild/bin/assign_prescribed_phen_mod.mod +ED/dbgbuild/bin/atimb_mod.mod +ED/dbgbuild/bin/atob_log_mod.mod +ED/dbgbuild/bin/atob_mod.mod +ED/dbgbuild/bin/avg_ed_daily_output_pool_mod.mod +ED/dbgbuild/bin/azero2_mod.mod +ED/dbgbuild/bin/azero3_mod.mod +ED/dbgbuild/bin/azero4_mod.mod +ED/dbgbuild/bin/azero5_mod.mod +ED/dbgbuild/bin/azero_mod.mod +ED/dbgbuild/bin/azerov_mod.mod +ED/dbgbuild/bin/banbks_mod.mod +ED/dbgbuild/bin/bandec_mod.mod +ED/dbgbuild/bin/c34constants.mod +ED/dbgbuild/bin/calc_flow_routing_mod.mod +ED/dbgbuild/bin/calchydrosubsurface_mod.mod +ED/dbgbuild/bin/calchydrosurface_mod.mod +ED/dbgbuild/bin/calc_met_lapse_mod.mod +ED/dbgbuild/bin/calcwatertable_mod.mod +ED/dbgbuild/bin/canopy_air_coms.mod +ED/dbgbuild/bin/canopy_derivs_two_mod.mod +ED/dbgbuild/bin/canopy_layer_coms.mod +ED/dbgbuild/bin/canopy_photosynthesis_mod.mod +ED/dbgbuild/bin/canopy_radiation_coms.mod +ED/dbgbuild/bin/canopy_struct_dynamics.mod +ED/dbgbuild/bin/cbrt8_mod.mod +ED/dbgbuild/bin/cbrt_mod.mod +ED/dbgbuild/bin/cdf2normal_mod.mod +ED/dbgbuild/bin/cdf_mod.mod +ED/dbgbuild/bin/char_strip_var_mod.mod +ED/dbgbuild/bin/check_real_mod.mod +ED/dbgbuild/bin/compute_budget_mod.mod +ED/dbgbuild/bin/compute_c_and_n_storage_mod.mod +ED/dbgbuild/bin/compute_co2_storage_mod.mod +ED/dbgbuild/bin/compute_energy_storage_mod.mod +ED/dbgbuild/bin/compute_netrad_mod.mod +ED/dbgbuild/bin/compute_water_storage_mod.mod +ED/dbgbuild/bin/consts_coms.mod +ED/dbgbuild/bin/copy_met_2_rk4site_mod.mod +ED/dbgbuild/bin/copy_nl_mod.mod +ED/dbgbuild/bin/copy_patch_init_carbon_mod.mod +ED/dbgbuild/bin/copy_patch_init_mod.mod +ED/dbgbuild/bin/copy_path_from_grid_1_mod.mod +ED/dbgbuild/bin/copy_rk4_patch_mod.mod +ED/dbgbuild/bin/count_pft_xml_config_mod.mod +ED/dbgbuild/bin/cputime_mod.mod +ED/dbgbuild/bin/create_ed10_ed20_fname_mod.mod +ED/dbgbuild/bin/cumsum_mod.mod +ED/dbgbuild/bin/cvmgm_mod.mod +ED/dbgbuild/bin/cvmgn_mod.mod +ED/dbgbuild/bin/cvmgp_mod.mod +ED/dbgbuild/bin/cvmgz_mod.mod +ED/dbgbuild/bin/date_2_seconds_mod.mod +ED/dbgbuild/bin/date_abs_secs2_mod.mod +ED/dbgbuild/bin/date_add_to_mod.mod +ED/dbgbuild/bin/date_secs_ymdt_mod.mod +ED/dbgbuild/bin/date_unmake_big_mod.mod +ED/dbgbuild/bin/daylength_mod.mod +ED/dbgbuild/bin/dcvmgm_mod.mod +ED/dbgbuild/bin/dcvmgp_mod.mod +ED/dbgbuild/bin/dcw_swap16_mod.mod +ED/dbgbuild/bin/dcw_swap32_mod.mod +ED/dbgbuild/bin/dcw_swap64_mod.mod +ED/dbgbuild/bin/ddens_dt_effect_mod.mod +ED/dbgbuild/bin/deblank_mod.mod +ED/dbgbuild/bin/decomp_coms.mod +ED/dbgbuild/bin/detab_mod.mod +ED/dbgbuild/bin/diagon_mod.mod +ED/dbgbuild/bin/dist_gc_mod.mod +ED/dbgbuild/bin/disturbance_utils.mod +ED/dbgbuild/bin/disturb_coms.mod +ED/dbgbuild/bin/dmax2_mod.mod +ED/dbgbuild/bin/dmin2_mod.mod +ED/dbgbuild/bin/dssum_mod.mod +ED/dbgbuild/bin/dump_radinfo_mod.mod +ED/dbgbuild/bin/ed1_fileinfo_mod.mod +ED/dbgbuild/bin/ed_1st_master_mod.mod +ED/dbgbuild/bin/ed_1st_node_mod.mod +ED/dbgbuild/bin/ed21_fileinfo_mod.mod +ED/dbgbuild/bin/ed_datp_datq_mod.mod +ED/dbgbuild/bin/ed_datp_datsoil_mod.mod +ED/dbgbuild/bin/ed_driver_mod.mod +ED/dbgbuild/bin/ed_filelist_mod.mod +ED/dbgbuild/bin/ed_gridset_mod.mod +ED/dbgbuild/bin/ed_init_atm_mod.mod +ED/dbgbuild/bin/ed_ll_xy_mod.mod +ED/dbgbuild/bin/ed_load_work_from_history_mod.mod +ED/dbgbuild/bin/ed_masterput_met_header_mod.mod +ED/dbgbuild/bin/ed_masterput_nl_mod.mod +ED/dbgbuild/bin/ed_masterput_poly_dims_mod.mod +ED/dbgbuild/bin/ed_masterput_processid_mod.mod +ED/dbgbuild/bin/ed_masterput_worklist_info_mod.mod +ED/dbgbuild/bin/ed_max_dims.mod +ED/dbgbuild/bin/ed_mem_alloc_mod.mod +ED/dbgbuild/bin/ed_mem_grid_dim_defs.mod +ED/dbgbuild/bin/ed_misc_coms.mod +ED/dbgbuild/bin/ed_model_mod.mod +ED/dbgbuild/bin/ed_newgrid_mod.mod +ED/dbgbuild/bin/ed_node_coms.mod +ED/dbgbuild/bin/ed_node_decomp_mod.mod +ED/dbgbuild/bin/ed_nodeget_met_header_mod.mod +ED/dbgbuild/bin/ed_nodeget_nl_mod.mod +ED/dbgbuild/bin/ed_nodeget_poly_dims_mod.mod +ED/dbgbuild/bin/ed_nodeget_processid_mod.mod +ED/dbgbuild/bin/ed_nodeget_worklist_info_mod.mod +ED/dbgbuild/bin/ed_opspec_grid_mod.mod +ED/dbgbuild/bin/ed_opspec_misc_mod.mod +ED/dbgbuild/bin/ed_opspec_par_mod.mod +ED/dbgbuild/bin/ed_opspec_times_mod.mod +ED/dbgbuild/bin/ed_output_mod.mod +ED/dbgbuild/bin/ed_para_coms.mod +ED/dbgbuild/bin/ed_parvec_work_mod.mod +ED/dbgbuild/bin/ed_polarst_mod.mod +ED/dbgbuild/bin/ed_state_vars.mod +ED/dbgbuild/bin/ed_therm_lib.mod +ED/dbgbuild/bin/ed_var_tables.mod +ED/dbgbuild/bin/ed_work_vars.mod +ED/dbgbuild/bin/ed_xy_ll_mod.mod +ED/dbgbuild/bin/ed_zen_mod.mod +ED/dbgbuild/bin/eifun8_mod.mod +ED/dbgbuild/bin/ename_coms.mod +ED/dbgbuild/bin/endian_mod.mod +ED/dbgbuild/bin/errorfun_mod.mod +ED/dbgbuild/bin/euler_integ_mod.mod +ED/dbgbuild/bin/euler_timestep_mod.mod +ED/dbgbuild/bin/event_fertilize_mod.mod +ED/dbgbuild/bin/event_fire_mod.mod +ED/dbgbuild/bin/event_harvest_mod.mod +ED/dbgbuild/bin/event_irrigate_mod.mod +ED/dbgbuild/bin/event_planting_mod.mod +ED/dbgbuild/bin/event_till_mod.mod +ED/dbgbuild/bin/expected_mod.mod +ED/dbgbuild/bin/expmsq_mod.mod +ED/dbgbuild/bin/exterminate_patches_except_mod.mod +ED/dbgbuild/bin/farq_leuning.mod +ED/dbgbuild/bin/fatal_error_mod.mod +ED/dbgbuild/bin/fill_history_grid_mod.mod +ED/dbgbuild/bin/fill_history_patch_mod.mod +ED/dbgbuild/bin/fill_history_polygon_mod.mod +ED/dbgbuild/bin/fill_history_site_mod.mod +ED/dbgbuild/bin/fillvar_l_mod.mod +ED/dbgbuild/bin/find_closing_comment_mod.mod +ED/dbgbuild/bin/find_frqsum_mod.mod +ED/dbgbuild/bin/findln_mod.mod +ED/dbgbuild/bin/find_rank_mod.mod +ED/dbgbuild/bin/fire_frequency_mod.mod +ED/dbgbuild/bin/first_phenology_mod.mod +ED/dbgbuild/bin/flag_stable_cohorts_mod.mod +ED/dbgbuild/bin/fuse_fiss_utils.mod +ED/dbgbuild/bin/fusion_fission_coms.mod +ED/dbgbuild/bin/getconfigint_mod.mod +ED/dbgbuild/bin/getconfigreal_mod.mod +ED/dbgbuild/bin/getconfigstring_mod.mod +ED/dbgbuild/bin/get_errmax_mod.mod +ED/dbgbuild/bin/get_file_indices_mod.mod +ED/dbgbuild/bin/get_grid_mod.mod +ED/dbgbuild/bin/geth5dims_mod.mod +ED/dbgbuild/bin/getll_mod.mod +ED/dbgbuild/bin/get_work_mod.mod +ED/dbgbuild/bin/get_yscal_mod.mod +ED/dbgbuild/bin/grid_coms.mod +ED/dbgbuild/bin/growth_balive.mod +ED/dbgbuild/bin/h5_output_mod.mod +ED/dbgbuild/bin/harv_immat_patches_mod.mod +ED/dbgbuild/bin/harv_mat_patches_mod.mod +ED/dbgbuild/bin/hdf5_coms.mod +ED/dbgbuild/bin/hdf5_utils.mod +ED/dbgbuild/bin/hdf_getslab_d_mod.mod +ED/dbgbuild/bin/hdf_getslab_i_mod.mod +ED/dbgbuild/bin/hdf_getslab_r_mod.mod +ED/dbgbuild/bin/heav_mod.mod +ED/dbgbuild/bin/het_resp_weight_mod.mod +ED/dbgbuild/bin/heun_integ_mod.mod +ED/dbgbuild/bin/heun_stepper_mod.mod +ED/dbgbuild/bin/heun_timestep_mod.mod +ED/dbgbuild/bin/how_to_read_a_file_mod.mod +ED/dbgbuild/bin/hydrology_coms.mod +ED/dbgbuild/bin/hydrology_constants.mod +ED/dbgbuild/bin/ibias_mod.mod +ED/dbgbuild/bin/ibindec_mod.mod +ED/dbgbuild/bin/ifirstchar_mod.mod +ED/dbgbuild/bin/inc_rk4_patch_mod.mod +ED/dbgbuild/bin/init_can_air_params_mod.mod +ED/dbgbuild/bin/init_can_lyr_params_mod.mod +ED/dbgbuild/bin/init_can_rad_params_mod.mod +ED/dbgbuild/bin/init_cohorts_by_layers_mod.mod +ED/dbgbuild/bin/init_decomp_params_mod.mod +ED/dbgbuild/bin/init_disturb_params_mod.mod +ED/dbgbuild/bin/init_ed_cohort_vars_mod.mod +ED/dbgbuild/bin/init_ed_misc_coms_mod.mod +ED/dbgbuild/bin/init_ed_patch_vars_mod.mod +ED/dbgbuild/bin/init_ed_poly_vars_mod.mod +ED/dbgbuild/bin/init_ed_site_vars_mod.mod +ED/dbgbuild/bin/init_ff_coms_mod.mod +ED/dbgbuild/bin/init_full_history_restart_mod.mod +ED/dbgbuild/bin/init_hydro_coms_mod.mod +ED/dbgbuild/bin/inithydrology_mod.mod +ED/dbgbuild/bin/inithydrosubsurface_mod.mod +ED/dbgbuild/bin/initialize_rk4patches_mod.mod +ED/dbgbuild/bin/init_lapse_params_mod.mod +ED/dbgbuild/bin/init_met_drivers_mod.mod +ED/dbgbuild/bin/init_met_params_mod.mod +ED/dbgbuild/bin/init_nbg_cohorts_mod.mod +ED/dbgbuild/bin/init_pft_alloc_params_mod.mod +ED/dbgbuild/bin/init_pft_derived_params_mod.mod +ED/dbgbuild/bin/init_pft_leaf_params_mod.mod +ED/dbgbuild/bin/init_pft_mort_params_mod.mod +ED/dbgbuild/bin/init_pft_nitro_params_mod.mod +ED/dbgbuild/bin/init_pft_photo_params_mod.mod +ED/dbgbuild/bin/init_pft_repro_params_mod.mod +ED/dbgbuild/bin/init_pft_resp_params_mod.mod +ED/dbgbuild/bin/init_phen_coms_mod.mod +ED/dbgbuild/bin/init_physiology_params_mod.mod +ED/dbgbuild/bin/init_rk4_params_mod.mod +ED/dbgbuild/bin/init_soil_coms_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_flux_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_state_mod.mod +ED/dbgbuild/bin/integrate_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/integrate_patch_euler_mod.mod +ED/dbgbuild/bin/integrate_patch_heun_mod.mod +ED/dbgbuild/bin/int_met_avg_mod.mod +ED/dbgbuild/bin/inventory_mat_forests_mod.mod +ED/dbgbuild/bin/iprim_mod.mod +ED/dbgbuild/bin/iran_recsize_mod.mod +ED/dbgbuild/bin/is_finite8_mod.mod +ED/dbgbuild/bin/is_finite_mod.mod +ED/dbgbuild/bin/isleap_mod.mod +ED/dbgbuild/bin/ismax_mod.mod +ED/dbgbuild/bin/ismin_mod.mod +ED/dbgbuild/bin/is_resolvable_mod.mod +ED/dbgbuild/bin/ivalugp_mod.mod +ED/dbgbuild/bin/izero2_mod.mod +ED/dbgbuild/bin/izero3_mod.mod +ED/dbgbuild/bin/izero4_mod.mod +ED/dbgbuild/bin/izero5_mod.mod +ED/dbgbuild/bin/izero_mod.mod +ED/dbgbuild/bin/izerov_mod.mod +ED/dbgbuild/bin/julday1000_mod.mod +ED/dbgbuild/bin/julday_mod.mod +ED/dbgbuild/bin/landuse_init_mod.mod +ED/dbgbuild/bin/large_error_mod.mod +ED/dbgbuild/bin/lastchar_mod.mod +ED/dbgbuild/bin/lastmonthdate_mod.mod +ED/dbgbuild/bin/lastslash_mod.mod +ED/dbgbuild/bin/leaf_database_mod.mod +ED/dbgbuild/bin/leaf_derivs_mod.mod +ED/dbgbuild/bin/leaftw_derivs_mod.mod +ED/dbgbuild/bin/libxml2f90__closeall_mod.mod +ED/dbgbuild/bin/libxml2f90__closefile_mod.mod +ED/dbgbuild/bin/libxml2f90_error_getline_mod.mod +ED/dbgbuild/bin/libxml2f90__existid_mod.mod +ED/dbgbuild/bin/libxml2f90_existid_mod.mod +ED/dbgbuild/bin/libxml2f90__existpid_mod.mod +ED/dbgbuild/bin/libxml2f90__findinchara_mod.mod +ED/dbgbuild/bin/libxml2f90__flush_mod.mod +ED/dbgbuild/bin/libxml2f90__get_fileunit_mod.mod +ED/dbgbuild/bin/libxml2f90_getline_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafec8_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafei4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafel4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafer8_mod.mod +ED/dbgbuild/bin/libxml2f90__getunit_mod.mod +ED/dbgbuild/bin/libxml2f90_interface_module.mod +ED/dbgbuild/bin/libxml2f90__ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpureid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_down_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_exist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_scal_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_initlist_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_inittag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_report_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_wrap_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selectlist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selecttag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_up_mod.mod +ED/dbgbuild/bin/libxml2f90_module.mod +ED/dbgbuild/bin/libxml2f90__openfile_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_file_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_find_char_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90_readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_nfil_mod.mod +ED/dbgbuild/bin/libxml2f90__set_casesensitive_mod.mod +ED/dbgbuild/bin/libxml2f90__set_default_ll_id_mod.mod +ED/dbgbuild/bin/libxml2f90__setformat_mod.mod +ED/dbgbuild/bin/libxml2f90__set_paw_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmcomma_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmquotes_mod.mod +ED/dbgbuild/bin/libxml2f90__settransform_exm_mod.mod +ED/dbgbuild/bin/libxml2f90__setwrite_exm_mod.mod +ED/dbgbuild/bin/libxml2f90_strings_module.mod +ED/dbgbuild/bin/libxml2f90_tostringa_mod.mod +ED/dbgbuild/bin/libxml2f90_tostring_mod.mod +ED/dbgbuild/bin/libxml2f90_transform_paw_mod.mod +ED/dbgbuild/bin/lisys_solver8_mod.mod +ED/dbgbuild/bin/lisys_solver_mod.mod +ED/dbgbuild/bin/ll_module.mod +ED/dbgbuild/bin/load_ecosystem_state_mod.mod +ED/dbgbuild/bin/load_ed_ecosystem_params_mod.mod +ED/dbgbuild/bin/lw_multiple_scatter_mod.mod +ED/dbgbuild/bin/lw_twostream_mod.mod +ED/dbgbuild/bin/makefnam_mod.mod +ED/dbgbuild/bin/match_poly_grid_mod.mod +ED/dbgbuild/bin/mat_forest_harv_rates_mod.mod +ED/dbgbuild/bin/mean_daysecz_mod.mod +ED/dbgbuild/bin/mem_polygons.mod +ED/dbgbuild/bin/met_driver_coms.mod +ED/dbgbuild/bin/met_sanity_check_mod.mod +ED/dbgbuild/bin/mk_2_buff_mod.mod +ED/dbgbuild/bin/mk_2p_buff_mod.mod +ED/dbgbuild/bin/mk_3_buff_mod.mod +ED/dbgbuild/bin/mk_4_buff_mod.mod +ED/dbgbuild/bin/mortality.mod +ED/dbgbuild/bin/mprove_mod.mod +ED/dbgbuild/bin/near_bare_ground_init_mod.mod +ED/dbgbuild/bin/new_patch_sfc_props_mod.mod +ED/dbgbuild/bin/normalize_averaged_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_dailynpp_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/norm_harv_patch_mod.mod +ED/dbgbuild/bin/num_days_mod.mod +ED/dbgbuild/bin/odeint_mod.mod +ED/dbgbuild/bin/opspec_fatal_mod.mod +ED/dbgbuild/bin/optimiz_coms.mod +ED/dbgbuild/bin/overwrite_with_xml_config_mod.mod +ED/dbgbuild/bin/parsefnam_mod.mod +ED/dbgbuild/bin/parse_mod.mod +ED/dbgbuild/bin/pft_coms.mod +ED/dbgbuild/bin/pheninit_balive_bstorage_mod.mod +ED/dbgbuild/bin/phenology_coms.mod +ED/dbgbuild/bin/phenology_driver_eq_0_mod.mod +ED/dbgbuild/bin/phenology_driver_mod.mod +ED/dbgbuild/bin/phenology_startup.mod +ED/dbgbuild/bin/phenology_thresholds_mod.mod +ED/dbgbuild/bin/physiology_coms.mod +ED/dbgbuild/bin/plant_structural_allocation_mod.mod +ED/dbgbuild/bin/prescribed_event_mod.mod +ED/dbgbuild/bin/prescribed_leaf_state_mod.mod +ED/dbgbuild/bin/print_c_and_n_budgets_mod.mod +ED/dbgbuild/bin/print_csiteipa_mod.mod +ED/dbgbuild/bin/print_errmax_mod.mod +ED/dbgbuild/bin/print_fields_mod.mod +ED/dbgbuild/bin/print_photo_details_mod.mod +ED/dbgbuild/bin/print_rk4patch_mod.mod +ED/dbgbuild/bin/print_rk4_state_mod.mod +ED/dbgbuild/bin/print_soil_info_mod.mod +ED/dbgbuild/bin/putconfigint_mod.mod +ED/dbgbuild/bin/putconfigreal8_mod.mod +ED/dbgbuild/bin/putconfigreal_mod.mod +ED/dbgbuild/bin/putconfigstring_mod.mod +ED/dbgbuild/bin/radiate_driver_mod.mod +ED/dbgbuild/bin/rams_f_open_mod.mod +ED/dbgbuild/bin/rank_down_mod.mod +ED/dbgbuild/bin/rank_up_mod.mod +ED/dbgbuild/bin/read_ed10_ed20_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_unstruct_mod.mod +ED/dbgbuild/bin/read_ed_xml_config_mod.mod +ED/dbgbuild/bin/read_events_xml_mod.mod +ED/dbgbuild/bin/read_met_driver_head_mod.mod +ED/dbgbuild/bin/read_met_drivers_init_mod.mod +ED/dbgbuild/bin/read_met_drivers_mod.mod +ED/dbgbuild/bin/read_nl_mod.mod +ED/dbgbuild/bin/read_ol_file_mod.mod +ED/dbgbuild/bin/read_plantation_fractions_mod.mod +ED/dbgbuild/bin/read_site_file_mod.mod +ED/dbgbuild/bin/read_soil_depth_mod.mod +ED/dbgbuild/bin/read_soil_moist_temp_mod.mod +ED/dbgbuild/bin/rearrange_mod.mod +ED/dbgbuild/bin/reproduction_eq_0_mod.mod +ED/dbgbuild/bin/reproduction_mod.mod +ED/dbgbuild/bin/reset_averaged_vars_mod.mod +ED/dbgbuild/bin/resp_f_decomp_mod.mod +ED/dbgbuild/bin/resp_rh_mod.mod +ED/dbgbuild/bin/rk4_coms.mod +ED/dbgbuild/bin/rk4_driver.mod +ED/dbgbuild/bin/rk4_stepper.mod +ED/dbgbuild/bin/root_resp_norm_mod.mod +ED/dbgbuild/bin/scale_ed_radiation_mod.mod +ED/dbgbuild/bin/seed_dispersal_mod.mod +ED/dbgbuild/bin/setlapseparms_mod.mod +ED/dbgbuild/bin/set_polygon_coordinates_mod.mod +ED/dbgbuild/bin/set_site_defprops_mod.mod +ED/dbgbuild/bin/sfcdata_ed_mod.mod +ED/dbgbuild/bin/sfcrad_ed_mod.mod +ED/dbgbuild/bin/short2diff_sib_mod.mod +ED/dbgbuild/bin/short_bdown_weissnorman_mod.mod +ED/dbgbuild/bin/sngloff_mod.mod +ED/dbgbuild/bin/soil_coms.mod +ED/dbgbuild/bin/soil_depth_fill_mod.mod +ED/dbgbuild/bin/soil_respiration_mod.mod +ED/dbgbuild/bin/solar_radiation_breakdown_mod.mod +ED/dbgbuild/bin/sort3_mod.mod +ED/dbgbuild/bin/sort_down_mod.mod +ED/dbgbuild/bin/sort_up_mod.mod +ED/dbgbuild/bin/spatial_averages_mod.mod +ED/dbgbuild/bin/ssum_mod.mod +ED/dbgbuild/bin/structural_growth_eq_0_mod.mod +ED/dbgbuild/bin/structural_growth_mod.mod +ED/dbgbuild/bin/sum_plant_cfluxes_mod.mod +ED/dbgbuild/bin/sw_multiple_scatter_mod.mod +ED/dbgbuild/bin/sw_twostream_clump_mod.mod +ED/dbgbuild/bin/test_mod.mod +ED/dbgbuild/bin/therm_lib8.mod +ED/dbgbuild/bin/therm_lib.mod +ED/dbgbuild/bin/timing_mod.mod +ED/dbgbuild/bin/tokenize1_mod.mod +ED/dbgbuild/bin/tolower_mod.mod +ED/dbgbuild/bin/transfer_ol_month_mod.mod +ED/dbgbuild/bin/trid2_mod.mod +ED/dbgbuild/bin/trid_mod.mod +ED/dbgbuild/bin/ugetarg_mod.mod +ED/dbgbuild/bin/unarrange_mod.mod +ED/dbgbuild/bin/update_budget_mod.mod +ED/dbgbuild/bin/update_c_and_n_pools_mod.mod +ED/dbgbuild/bin/update_derived_cohort_props_mod.mod +ED/dbgbuild/bin/update_derived_props_mod.mod +ED/dbgbuild/bin/update_diagnostic_vars_mod.mod +ED/dbgbuild/bin/update_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/updatehydroparms_mod.mod +ED/dbgbuild/bin/update_met_drivers_mod.mod +ED/dbgbuild/bin/update_model_time_dm_mod.mod +ED/dbgbuild/bin/update_mod.mod +ED/dbgbuild/bin/update_patch_derived_props_mod.mod +ED/dbgbuild/bin/update_patch_thermo_props_mod.mod +ED/dbgbuild/bin/update_phenology_eq_0_mod.mod +ED/dbgbuild/bin/update_phenology_mod.mod +ED/dbgbuild/bin/update_polygon_derived_props_mod.mod +ED/dbgbuild/bin/update_rad_avg_mod.mod +ED/dbgbuild/bin/update_site_derived_props_mod.mod +ED/dbgbuild/bin/update_thermal_sums_mod.mod +ED/dbgbuild/bin/update_turnover_mod.mod +ED/dbgbuild/bin/update_vital_rates_mod.mod +ED/dbgbuild/bin/updatewatertableadd_mod.mod +ED/dbgbuild/bin/updatewatertablebaseflow_mod.mod +ED/dbgbuild/bin/updatewatertablesubtract_mod.mod +ED/dbgbuild/bin/update_workload_mod.mod +ED/dbgbuild/bin/valugp_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_eq_0_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_mod.mod +ED/dbgbuild/bin/walltime_mod.mod +ED/dbgbuild/bin/warning_mod.mod +ED/dbgbuild/bin/write_ed_xml_config_mod.mod +ED/dbgbuild/bin/writehydro_mod.mod +ED/dbgbuild/bin/yesterday_mod.mod +ED/dbgbuild/bin/zero_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_daily_vars_mod.mod +ED/dbgbuild/bin/zero_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/a3e0_mod.f90 +ED/dbgbuild/bin/a3e1_mod.f90 +ED/dbgbuild/bin/a3e2_mod.f90 +ED/dbgbuild/bin/accum_mod.f90 +ED/dbgbuild/bin/acnst_mod.f90 +ED/dbgbuild/bin/adivb_mod.f90 +ED/dbgbuild/bin/adjust_sfcw_properties_mod.f90 +ED/dbgbuild/bin/adjust_topsoil_properties_mod.f90 +ED/dbgbuild/bin/adjust_veg_properties_mod.f90 +ED/dbgbuild/bin/ae0_mod.f90 +ED/dbgbuild/bin/ae1m1_mod.f90 +ED/dbgbuild/bin/ae1_mod.f90 +ED/dbgbuild/bin/ae1p1_mod.f90 +ED/dbgbuild/bin/ae1p1p1_mod.f90 +ED/dbgbuild/bin/ae1t0_mod.f90 +ED/dbgbuild/bin/ae1t0p1_mod.f90 +ED/dbgbuild/bin/ae1t1_mod.f90 +ED/dbgbuild/bin/ae1t1p1_mod.f90 +ED/dbgbuild/bin/ae1tn1_mod.f90 +ED/dbgbuild/bin/ae2_mod.f90 +ED/dbgbuild/bin/ae3m3d0_mod.f90 +ED/dbgbuild/bin/ae3m3_mod.f90 +ED/dbgbuild/bin/ae3_mod.f90 +ED/dbgbuild/bin/ae3p3_mod.f90 +ED/dbgbuild/bin/ae3t0p3_mod.f90 +ED/dbgbuild/bin/ae3t3_mod.f90 +ED/dbgbuild/bin/ae3t3p3_mod.f90 +ED/dbgbuild/bin/aen1_mod.f90 +ED/dbgbuild/bin/aen3t0p3_mod.f90 +ED/dbgbuild/bin/alebl_mod.f90 +ED/dbgbuild/bin/allometry.f90 +ED/dbgbuild/bin/angle_of_incid_mod.f90 +ED/dbgbuild/bin/an_header.f90 +ED/dbgbuild/bin/aone2_mod.f90 +ED/dbgbuild/bin/aone3_mod.f90 +ED/dbgbuild/bin/aone4_mod.f90 +ED/dbgbuild/bin/aone5_mod.f90 +ED/dbgbuild/bin/aone_mod.f90 +ED/dbgbuild/bin/aonev_mod.f90 +ED/dbgbuild/bin/apply_forestry_mod.f90 +ED/dbgbuild/bin/assign_prescribed_phen_mod.f90 +ED/dbgbuild/bin/atimb_mod.f90 +ED/dbgbuild/bin/atob_log_mod.f90 +ED/dbgbuild/bin/atob_mod.f90 +ED/dbgbuild/bin/average_utils.f90 +ED/dbgbuild/bin/avg_ed_daily_output_pool_mod.f90 +ED/dbgbuild/bin/azero2_mod.f90 +ED/dbgbuild/bin/azero3_mod.f90 +ED/dbgbuild/bin/azero4_mod.f90 +ED/dbgbuild/bin/azero5_mod.f90 +ED/dbgbuild/bin/azero_mod.f90 +ED/dbgbuild/bin/azerov_mod.f90 +ED/dbgbuild/bin/banbks_mod.f90 +ED/dbgbuild/bin/bandec_mod.f90 +ED/dbgbuild/bin/budget_utils.f90 +ED/dbgbuild/bin/c34constants.f90 +ED/dbgbuild/bin/calc_flow_routing_mod.f90 +ED/dbgbuild/bin/calchydrosubsurface_mod.f90 +ED/dbgbuild/bin/calchydrosurface_mod.f90 +ED/dbgbuild/bin/calc_met_lapse_mod.f90 +ED/dbgbuild/bin/calcwatertable_mod.f90 +ED/dbgbuild/bin/canopy_air_coms.f90 +ED/dbgbuild/bin/canopy_derivs_two_mod.f90 +ED/dbgbuild/bin/canopy_layer_coms.f90 +ED/dbgbuild/bin/canopy_photosynthesis_mod.f90 +ED/dbgbuild/bin/canopy_radiation_coms.f90 +ED/dbgbuild/bin/canopy_struct_dynamics.f90 +ED/dbgbuild/bin/cbrt8_mod.f90 +ED/dbgbuild/bin/cbrt_mod.f90 +ED/dbgbuild/bin/cdf2normal_mod.f90 +ED/dbgbuild/bin/cdf_mod.f90 +ED/dbgbuild/bin/char_strip_var_mod.f90 +ED/dbgbuild/bin/charutils.f90 +ED/dbgbuild/bin/check_real_mod.f90 +ED/dbgbuild/bin/compute_budget_mod.f90 +ED/dbgbuild/bin/compute_c_and_n_storage_mod.f90 +ED/dbgbuild/bin/compute_co2_storage_mod.f90 +ED/dbgbuild/bin/compute_energy_storage_mod.f90 +ED/dbgbuild/bin/compute_netrad_mod.f90 +ED/dbgbuild/bin/compute_water_storage_mod.f90 +ED/dbgbuild/bin/copy_met_2_rk4site_mod.f90 +ED/dbgbuild/bin/copy_nl_mod.f90 +ED/dbgbuild/bin/copy_patch_init_carbon_mod.f90 +ED/dbgbuild/bin/copy_patch_init_mod.f90 +ED/dbgbuild/bin/copy_path_from_grid_1_mod.f90 +ED/dbgbuild/bin/copy_rk4_patch_mod.f90 +ED/dbgbuild/bin/count_pft_xml_config_mod.f90 +ED/dbgbuild/bin/cputime_mod.f90 +ED/dbgbuild/bin/create_ed10_ed20_fname_mod.f90 +ED/dbgbuild/bin/cumsum_mod.f90 +ED/dbgbuild/bin/cvmgm_mod.f90 +ED/dbgbuild/bin/cvmgn_mod.f90 +ED/dbgbuild/bin/cvmgp_mod.f90 +ED/dbgbuild/bin/cvmgz_mod.f90 +ED/dbgbuild/bin/date_2_seconds_mod.f90 +ED/dbgbuild/bin/date_abs_secs2_mod.f90 +ED/dbgbuild/bin/date_add_to_mod.f90 +ED/dbgbuild/bin/date_secs_ymdt_mod.f90 +ED/dbgbuild/bin/date_unmake_big_mod.f90 +ED/dbgbuild/bin/dateutils.f90 +ED/dbgbuild/bin/daylength_mod.f90 +ED/dbgbuild/bin/dcvmgm_mod.f90 +ED/dbgbuild/bin/dcvmgp_mod.f90 +ED/dbgbuild/bin/dcw_swap16_mod.f90 +ED/dbgbuild/bin/dcw_swap32_mod.f90 +ED/dbgbuild/bin/dcw_swap64_mod.f90 +ED/dbgbuild/bin/ddens_dt_effect_mod.f90 +ED/dbgbuild/bin/deblank_mod.f90 +ED/dbgbuild/bin/decomp_coms.f90 +ED/dbgbuild/bin/detab_mod.f90 +ED/dbgbuild/bin/diagon_mod.f90 +ED/dbgbuild/bin/dist_gc_mod.f90 +ED/dbgbuild/bin/disturbance.f90 +ED/dbgbuild/bin/disturb_coms.f90 +ED/dbgbuild/bin/dmax2_mod.f90 +ED/dbgbuild/bin/dmin2_mod.f90 +ED/dbgbuild/bin/dssum_mod.f90 +ED/dbgbuild/bin/dump_radinfo_mod.f90 +ED/dbgbuild/bin/ed1_fileinfo_mod.f90 +ED/dbgbuild/bin/ed_1st.f90 +ED/dbgbuild/bin/ed_1st_master_mod.f90 +ED/dbgbuild/bin/ed_1st_node_mod.f90 +ED/dbgbuild/bin/ed21_fileinfo_mod.f90 +ED/dbgbuild/bin/ed_datp_datq_mod.f90 +ED/dbgbuild/bin/ed_datp_datsoil_mod.f90 +ED/dbgbuild/bin/ed_driver.f90 +ED/dbgbuild/bin/ed_driver_mod.f90 +ED/dbgbuild/bin/ed_filelist_mod.f90 +ED/dbgbuild/bin/ed_grid.f90 +ED/dbgbuild/bin/ed_gridset_mod.f90 +ED/dbgbuild/bin/ed_init_atm_mod.f90 +ED/dbgbuild/bin/ed_init.f90 +ED/dbgbuild/bin/edio.f90 +ED/dbgbuild/bin/ed_ll_xy_mod.f90 +ED/dbgbuild/bin/ed_load_namelist.f90 +ED/dbgbuild/bin/ed_load_work_from_history_mod.f90 +ED/dbgbuild/bin/ed_masterput_met_header_mod.f90 +ED/dbgbuild/bin/ed_masterput_nl_mod.f90 +ED/dbgbuild/bin/ed_masterput_poly_dims_mod.f90 +ED/dbgbuild/bin/ed_masterput_processid_mod.f90 +ED/dbgbuild/bin/ed_masterput_worklist_info_mod.f90 +ED/dbgbuild/bin/ed_mem_alloc.f90 +ED/dbgbuild/bin/ed_mem_alloc_mod.f90 +ED/dbgbuild/bin/ed_mem_grid_dim_defs.f90 +ED/dbgbuild/bin/ed_met_driver.f90 +ED/dbgbuild/bin/ed_misc_coms.f90 +ED/dbgbuild/bin/ed_model.f90 +ED/dbgbuild/bin/ed_model_mod.f90 +ED/dbgbuild/bin/ed_mpass_init.f90 +ED/dbgbuild/bin/ed_nbg_init.f90 +ED/dbgbuild/bin/ed_newgrid_mod.f90 +ED/dbgbuild/bin/ed_node_coms.f90 +ED/dbgbuild/bin/ed_node_decomp_mod.f90 +ED/dbgbuild/bin/ed_nodeget_met_header_mod.f90 +ED/dbgbuild/bin/ed_nodeget_nl_mod.f90 +ED/dbgbuild/bin/ed_nodeget_poly_dims_mod.f90 +ED/dbgbuild/bin/ed_nodeget_processid_mod.f90 +ED/dbgbuild/bin/ed_nodeget_worklist_info_mod.f90 +ED/dbgbuild/bin/ed_opspec_grid_mod.f90 +ED/dbgbuild/bin/ed_opspec_misc_mod.f90 +ED/dbgbuild/bin/ed_opspec_par_mod.f90 +ED/dbgbuild/bin/ed_opspec_times_mod.f90 +ED/dbgbuild/bin/ed_output_mod.f90 +ED/dbgbuild/bin/ed_para_coms.f90 +ED/dbgbuild/bin/ed_params.f90 +ED/dbgbuild/bin/ed_parvec_work_mod.f90 +ED/dbgbuild/bin/ed_polarst_mod.f90 +ED/dbgbuild/bin/ed_print.f90 +ED/dbgbuild/bin/ed_read_ed10_20_history.f90 +ED/dbgbuild/bin/ed_state_vars.f90 +ED/dbgbuild/bin/ed_therm_lib.f90 +ED/dbgbuild/bin/ed_type_init.f90 +ED/dbgbuild/bin/ed_var_tables.f90 +ED/dbgbuild/bin/ed_work_vars.f90 +ED/dbgbuild/bin/ed_xml_config.f90 +ED/dbgbuild/bin/ed_xy_ll_mod.f90 +ED/dbgbuild/bin/ed_zen_mod.f90 +ED/dbgbuild/bin/eifun8_mod.f90 +ED/dbgbuild/bin/ename_coms.f90 +ED/dbgbuild/bin/endian_mod.f90 +ED/dbgbuild/bin/errorfun_mod.f90 +ED/dbgbuild/bin/euler_driver.f90 +ED/dbgbuild/bin/euler_integ_mod.f90 +ED/dbgbuild/bin/euler_timestep_mod.f90 +ED/dbgbuild/bin/event_fertilize_mod.f90 +ED/dbgbuild/bin/event_fire_mod.f90 +ED/dbgbuild/bin/event_harvest_mod.f90 +ED/dbgbuild/bin/event_irrigate_mod.f90 +ED/dbgbuild/bin/event_planting_mod.f90 +ED/dbgbuild/bin/events.f90 +ED/dbgbuild/bin/event_till_mod.f90 +ED/dbgbuild/bin/expected_mod.f90 +ED/dbgbuild/bin/expmsq_mod.f90 +ED/dbgbuild/bin/exterminate_patches_except_mod.f90 +ED/dbgbuild/bin/farq_leuning.f90 +ED/dbgbuild/bin/fatal_error.f90 +ED/dbgbuild/bin/fatal_error_mod.f90 +ED/dbgbuild/bin/fill_history_grid_mod.f90 +ED/dbgbuild/bin/fill_history_patch_mod.f90 +ED/dbgbuild/bin/fill_history_polygon_mod.f90 +ED/dbgbuild/bin/fill_history_site_mod.f90 +ED/dbgbuild/bin/fillvar_l_mod.f90 +ED/dbgbuild/bin/find_closing_comment_mod.f90 +ED/dbgbuild/bin/find_frqsum_mod.f90 +ED/dbgbuild/bin/findln_mod.f90 +ED/dbgbuild/bin/find_rank_mod.f90 +ED/dbgbuild/bin/fire.f90 +ED/dbgbuild/bin/fire_frequency_mod.f90 +ED/dbgbuild/bin/first_phenology_mod.f90 +ED/dbgbuild/bin/flag_stable_cohorts_mod.f90 +ED/dbgbuild/bin/forestry.f90 +ED/dbgbuild/bin/fuse_fiss_utils.f90 +ED/dbgbuild/bin/fusion_fission_coms.f90 +ED/dbgbuild/bin/getconfigint_mod.f90 +ED/dbgbuild/bin/getconfigreal_mod.f90 +ED/dbgbuild/bin/getconfigstring_mod.f90 +ED/dbgbuild/bin/get_errmax_mod.f90 +ED/dbgbuild/bin/get_file_indices_mod.f90 +ED/dbgbuild/bin/get_grid_mod.f90 +ED/dbgbuild/bin/geth5dims_mod.f90 +ED/dbgbuild/bin/getll_mod.f90 +ED/dbgbuild/bin/get_work_mod.f90 +ED/dbgbuild/bin/get_yscal_mod.f90 +ED/dbgbuild/bin/great_circle.f90 +ED/dbgbuild/bin/grid_coms.f90 +ED/dbgbuild/bin/growth_balive.f90 +ED/dbgbuild/bin/h5_output_mod.f90 +ED/dbgbuild/bin/harv_immat_patches_mod.f90 +ED/dbgbuild/bin/harv_mat_patches_mod.f90 +ED/dbgbuild/bin/hdf_getslab_d_mod.f90 +ED/dbgbuild/bin/hdf_getslab_i_mod.f90 +ED/dbgbuild/bin/hdf_getslab_r_mod.f90 +ED/dbgbuild/bin/heav_mod.f90 +ED/dbgbuild/bin/het_resp_weight_mod.f90 +ED/dbgbuild/bin/heun_driver.f90 +ED/dbgbuild/bin/heun_integ_mod.f90 +ED/dbgbuild/bin/heun_stepper_mod.f90 +ED/dbgbuild/bin/heun_timestep_mod.f90 +ED/dbgbuild/bin/how_to_read_a_file_mod.f90 +ED/dbgbuild/bin/hydrology_coms.f90 +ED/dbgbuild/bin/hydrology_constants.f90 +ED/dbgbuild/bin/ibias_mod.f90 +ED/dbgbuild/bin/ibindec_mod.f90 +ED/dbgbuild/bin/ifirstchar_mod.f90 +ED/dbgbuild/bin/inc_rk4_patch_mod.f90 +ED/dbgbuild/bin/init_can_air_params_mod.f90 +ED/dbgbuild/bin/init_can_lyr_params_mod.f90 +ED/dbgbuild/bin/init_can_rad_params_mod.f90 +ED/dbgbuild/bin/init_cohorts_by_layers_mod.f90 +ED/dbgbuild/bin/init_decomp_params_mod.f90 +ED/dbgbuild/bin/init_disturb_params_mod.f90 +ED/dbgbuild/bin/init_ed_cohort_vars_mod.f90 +ED/dbgbuild/bin/init_ed_misc_coms_mod.f90 +ED/dbgbuild/bin/init_ed_patch_vars_mod.f90 +ED/dbgbuild/bin/init_ed_poly_vars_mod.f90 +ED/dbgbuild/bin/init_ed_site_vars_mod.f90 +ED/dbgbuild/bin/init_ff_coms_mod.f90 +ED/dbgbuild/bin/init_full_history_restart_mod.f90 +ED/dbgbuild/bin/init_hydro_coms_mod.f90 +ED/dbgbuild/bin/inithydrology_mod.f90 +ED/dbgbuild/bin/init_hydro_sites.f90 +ED/dbgbuild/bin/inithydrosubsurface_mod.f90 +ED/dbgbuild/bin/initialize_rk4patches_mod.f90 +ED/dbgbuild/bin/init_lapse_params_mod.f90 +ED/dbgbuild/bin/init_met_drivers_mod.f90 +ED/dbgbuild/bin/init_met_params_mod.f90 +ED/dbgbuild/bin/init_nbg_cohorts_mod.f90 +ED/dbgbuild/bin/init_pft_alloc_params_mod.f90 +ED/dbgbuild/bin/init_pft_derived_params_mod.f90 +ED/dbgbuild/bin/init_pft_leaf_params_mod.f90 +ED/dbgbuild/bin/init_pft_mort_params_mod.f90 +ED/dbgbuild/bin/init_pft_nitro_params_mod.f90 +ED/dbgbuild/bin/init_pft_photo_params_mod.f90 +ED/dbgbuild/bin/init_pft_repro_params_mod.f90 +ED/dbgbuild/bin/init_pft_resp_params_mod.f90 +ED/dbgbuild/bin/init_phen_coms_mod.f90 +ED/dbgbuild/bin/init_physiology_params_mod.f90 +ED/dbgbuild/bin/init_rk4_params_mod.f90 +ED/dbgbuild/bin/init_soil_coms_mod.f90 +ED/dbgbuild/bin/integrate_ed_daily_output_flux_mod.f90 +ED/dbgbuild/bin/integrate_ed_daily_output_state_mod.f90 +ED/dbgbuild/bin/integrate_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/integrate_patch_euler_mod.f90 +ED/dbgbuild/bin/integrate_patch_heun_mod.f90 +ED/dbgbuild/bin/int_met_avg_mod.f90 +ED/dbgbuild/bin/inventory_mat_forests_mod.f90 +ED/dbgbuild/bin/invmondays.f90 +ED/dbgbuild/bin/iprim_mod.f90 +ED/dbgbuild/bin/iran_recsize_mod.f90 +ED/dbgbuild/bin/is_finite8_mod.f90 +ED/dbgbuild/bin/is_finite_mod.f90 +ED/dbgbuild/bin/isleap_mod.f90 +ED/dbgbuild/bin/ismax_mod.f90 +ED/dbgbuild/bin/ismin_mod.f90 +ED/dbgbuild/bin/is_resolvable_mod.f90 +ED/dbgbuild/bin/ivalugp_mod.f90 +ED/dbgbuild/bin/izero2_mod.f90 +ED/dbgbuild/bin/izero3_mod.f90 +ED/dbgbuild/bin/izero4_mod.f90 +ED/dbgbuild/bin/izero5_mod.f90 +ED/dbgbuild/bin/izero_mod.f90 +ED/dbgbuild/bin/izerov_mod.f90 +ED/dbgbuild/bin/julday1000_mod.f90 +ED/dbgbuild/bin/julday_mod.f90 +ED/dbgbuild/bin/landuse_init.f90 +ED/dbgbuild/bin/landuse_init_mod.f90 +ED/dbgbuild/bin/lapse.f90 +ED/dbgbuild/bin/large_error_mod.f90 +ED/dbgbuild/bin/lastchar_mod.f90 +ED/dbgbuild/bin/lastmonthdate_mod.f90 +ED/dbgbuild/bin/lastslash_mod.f90 +ED/dbgbuild/bin/leaf_database.f90 +ED/dbgbuild/bin/leaf_database_mod.f90 +ED/dbgbuild/bin/leaf_derivs_mod.f90 +ED/dbgbuild/bin/leaftw_derivs_mod.f90 +ED/dbgbuild/bin/libxml2f90__closeall_mod.f90 +ED/dbgbuild/bin/libxml2f90__closefile_mod.f90 +ED/dbgbuild/bin/libxml2f90_error_getline_mod.f90 +ED/dbgbuild/bin/libxml2f90__existid_mod.f90 +ED/dbgbuild/bin/libxml2f90_existid_mod.f90 +ED/dbgbuild/bin/libxml2f90__existpid_mod.f90 +ED/dbgbuild/bin/libxml2f90.f90_pp.f90 +ED/dbgbuild/bin/libxml2f90__findinchara_mod.f90 +ED/dbgbuild/bin/libxml2f90__flush_mod.f90 +ED/dbgbuild/bin/libxml2f90__get_fileunit_mod.f90 +ED/dbgbuild/bin/libxml2f90_getline_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafec8_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafei4_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafel4_mod.f90 +ED/dbgbuild/bin/libxml2f90_getsafer8_mod.f90 +ED/dbgbuild/bin/libxml2f90__getunit_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_addid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_add_list_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_add_list_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_addpid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addpid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_addpureid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_closetag_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_closetag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_down_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_edit_id_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_edit_id_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_edit_pid_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_edit_pid_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_exist_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getc8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getc8_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getc8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getch_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getch_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getch_scal_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_geti4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_geti4_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_geti4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getl4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getl4_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getl4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpc8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpc8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpch_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpi4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpi4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpl4__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpl4_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpr8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpr8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpsize_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpstring__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getpstring_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getr8__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getr8_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getr8_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getsize_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getsize_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getstring__mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_getstring_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_getstring_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_initlist_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_inittag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_opentag_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_opentag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_report_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_report_rec_mod.f90 +ED/dbgbuild/bin/libxml2f90_ll_report_rec_wrap_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_selectlist_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_selecttag_mod.f90 +ED/dbgbuild/bin/libxml2f90__ll_up_mod.f90 +ED/dbgbuild/bin/libxml2f90__openfile_mod.f90 +ED/dbgbuild/bin/libxml2f90_parse_file_mod.f90 +ED/dbgbuild/bin/libxml2f90_parse_find_char_mod.f90 +ED/dbgbuild/bin/libxml2f90__readin_file_mod.f90 +ED/dbgbuild/bin/libxml2f90_readin_file_mod.f90 +ED/dbgbuild/bin/libxml2f90__readin_nfil_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_casesensitive_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_default_ll_id_mod.f90 +ED/dbgbuild/bin/libxml2f90__setformat_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_paw_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_rmcomma_mod.f90 +ED/dbgbuild/bin/libxml2f90__set_rmquotes_mod.f90 +ED/dbgbuild/bin/libxml2f90__settransform_exm_mod.f90 +ED/dbgbuild/bin/libxml2f90__setwrite_exm_mod.f90 +ED/dbgbuild/bin/libxml2f90_tostringa_mod.f90 +ED/dbgbuild/bin/libxml2f90_tostring_mod.f90 +ED/dbgbuild/bin/libxml2f90_transform_paw_mod.f90 +ED/dbgbuild/bin/lisys_solver8_mod.f90 +ED/dbgbuild/bin/lisys_solver_mod.f90 +ED/dbgbuild/bin/load_ecosystem_state_mod.f90 +ED/dbgbuild/bin/load_ed_ecosystem_params_mod.f90 +ED/dbgbuild/bin/lsm_hyd.f90 +ED/dbgbuild/bin/lw_multiple_scatter_mod.f90 +ED/dbgbuild/bin/lw_twostream_mod.f90 +ED/dbgbuild/bin/makefnam_mod.f90 +ED/dbgbuild/bin/match_poly_grid_mod.f90 +ED/dbgbuild/bin/mat_forest_harv_rates_mod.f90 +ED/dbgbuild/bin/mean_daysecz_mod.f90 +ED/dbgbuild/bin/mem_polygons.f90 +ED/dbgbuild/bin/met_driver_coms.f90 +ED/dbgbuild/bin/met_sanity_check_mod.f90 +ED/dbgbuild/bin/mk_2_buff_mod.f90 +ED/dbgbuild/bin/mk_2p_buff_mod.f90 +ED/dbgbuild/bin/mk_3_buff_mod.f90 +ED/dbgbuild/bin/mk_4_buff_mod.f90 +ED/dbgbuild/bin/mortality.f90 +ED/dbgbuild/bin/mprove_mod.f90 +ED/dbgbuild/bin/multiple_scatter.f90 +ED/dbgbuild/bin/near_bare_ground_init_mod.f90 +ED/dbgbuild/bin/new_patch_sfc_props_mod.f90 +ED/dbgbuild/bin/normalize_averaged_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_dailynpp_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_daily_output_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_daily_vars_mod.f90 +ED/dbgbuild/bin/normalize_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/norm_harv_patch_mod.f90 +ED/dbgbuild/bin/num_days_mod.f90 +ED/dbgbuild/bin/numutils.f90 +ED/dbgbuild/bin/odeint_mod.f90 +ED/dbgbuild/bin/opspec_fatal_mod.f90 +ED/dbgbuild/bin/optimiz_coms.f90 +ED/dbgbuild/bin/overwrite_with_xml_config_mod.f90 +ED/dbgbuild/bin/parsefnam_mod.f90 +ED/dbgbuild/bin/parse_mod.f90 +ED/dbgbuild/bin/pft_coms.f90 +ED/dbgbuild/bin/pheninit_balive_bstorage_mod.f90 +ED/dbgbuild/bin/phenology_aux.f90 +ED/dbgbuild/bin/phenology_coms.f90 +ED/dbgbuild/bin/phenology_driver_eq_0_mod.f90 +ED/dbgbuild/bin/phenology_driver_mod.f90 +ED/dbgbuild/bin/phenology_driv.f90 +ED/dbgbuild/bin/phenology_startup.f90 +ED/dbgbuild/bin/phenology_thresholds_mod.f90 +ED/dbgbuild/bin/photosyn_driv.f90 +ED/dbgbuild/bin/physiology_coms.f90 +ED/dbgbuild/bin/plant_structural_allocation_mod.f90 +ED/dbgbuild/bin/prescribed_event_mod.f90 +ED/dbgbuild/bin/prescribed_leaf_state_mod.f90 +ED/dbgbuild/bin/print_c_and_n_budgets_mod.f90 +ED/dbgbuild/bin/print_csiteipa_mod.f90 +ED/dbgbuild/bin/print_errmax_mod.f90 +ED/dbgbuild/bin/print_fields_mod.f90 +ED/dbgbuild/bin/print_photo_details_mod.f90 +ED/dbgbuild/bin/print_rk4patch_mod.f90 +ED/dbgbuild/bin/print_rk4_state_mod.f90 +ED/dbgbuild/bin/print_soil_info_mod.f90 +ED/dbgbuild/bin/putconfigint_mod.f90 +ED/dbgbuild/bin/putconfigreal8_mod.f90 +ED/dbgbuild/bin/putconfigreal_mod.f90 +ED/dbgbuild/bin/putconfigstring_mod.f90 +ED/dbgbuild/bin/radiate_driver.f90 +ED/dbgbuild/bin/radiate_driver_mod.f90 +ED/dbgbuild/bin/radiate_utils.f90 +ED/dbgbuild/bin/rams_f_open_mod.f90 +ED/dbgbuild/bin/rank_down_mod.f90 +ED/dbgbuild/bin/rank_up_mod.f90 +ED/dbgbuild/bin/read_ed10_ed20_history_file_mod.f90 +ED/dbgbuild/bin/read_ed21_history_file_mod.f90 +ED/dbgbuild/bin/read_ed21_history_unstruct_mod.f90 +ED/dbgbuild/bin/read_ed_xml_config_mod.f90 +ED/dbgbuild/bin/read_events_xml_mod.f90 +ED/dbgbuild/bin/read_met_driver_head_mod.f90 +ED/dbgbuild/bin/read_met_drivers_init_mod.f90 +ED/dbgbuild/bin/read_met_drivers_mod.f90 +ED/dbgbuild/bin/read_nl_mod.f90 +ED/dbgbuild/bin/read_ol_file_mod.f90 +ED/dbgbuild/bin/read_plantation_fractions_mod.f90 +ED/dbgbuild/bin/read_site_file_mod.f90 +ED/dbgbuild/bin/read_soil_depth_mod.f90 +ED/dbgbuild/bin/read_soil_moist_temp_mod.f90 +ED/dbgbuild/bin/rearrange_mod.f90 +ED/dbgbuild/bin/reproduction_eq_0_mod.f90 +ED/dbgbuild/bin/reproduction.f90 +ED/dbgbuild/bin/reproduction_mod.f90 +ED/dbgbuild/bin/reset_averaged_vars_mod.f90 +ED/dbgbuild/bin/resp_f_decomp_mod.f90 +ED/dbgbuild/bin/resp_rh_mod.f90 +ED/dbgbuild/bin/rk4_coms.f90 +ED/dbgbuild/bin/rk4_integ_utils.f90 +ED/dbgbuild/bin/rk4_misc.f90 +ED/dbgbuild/bin/root_resp_norm_mod.f90 +ED/dbgbuild/bin/scale_ed_radiation_mod.f90 +ED/dbgbuild/bin/seed_dispersal_mod.f90 +ED/dbgbuild/bin/setlapseparms_mod.f90 +ED/dbgbuild/bin/set_polygon_coordinates_mod.f90 +ED/dbgbuild/bin/set_site_defprops_mod.f90 +ED/dbgbuild/bin/sfcdata_ed_mod.f90 +ED/dbgbuild/bin/sfcrad_ed_mod.f90 +ED/dbgbuild/bin/short2diff_sib_mod.f90 +ED/dbgbuild/bin/short_bdown_weissnorman_mod.f90 +ED/dbgbuild/bin/sngloff_mod.f90 +ED/dbgbuild/bin/soil_depth_fill_mod.f90 +ED/dbgbuild/bin/soil_respiration.f90 +ED/dbgbuild/bin/soil_respiration_mod.f90 +ED/dbgbuild/bin/solar_radiation_breakdown_mod.f90 +ED/dbgbuild/bin/sort3_mod.f90 +ED/dbgbuild/bin/sort_down_mod.f90 +ED/dbgbuild/bin/sort_up_mod.f90 +ED/dbgbuild/bin/spatial_averages_mod.f90 +ED/dbgbuild/bin/ssum_mod.f90 +ED/dbgbuild/bin/stable_cohorts.f90 +ED/dbgbuild/bin/structural_growth_eq_0_mod.f90 +ED/dbgbuild/bin/structural_growth.f90 +ED/dbgbuild/bin/structural_growth_mod.f90 +ED/dbgbuild/bin/sum_plant_cfluxes_mod.f90 +ED/dbgbuild/bin/sw_multiple_scatter_mod.f90 +ED/dbgbuild/bin/sw_twostream_clump_mod.f90 +ED/dbgbuild/bin/test_mod.f90 +ED/dbgbuild/bin/therm_lib8.f90 +ED/dbgbuild/bin/therm_lib.f90 +ED/dbgbuild/bin/timing_mod.f90 +ED/dbgbuild/bin/tokenize1_mod.f90 +ED/dbgbuild/bin/tolower_mod.f90 +ED/dbgbuild/bin/transfer_ol_month_mod.f90 +ED/dbgbuild/bin/trid2_mod.f90 +ED/dbgbuild/bin/trid_mod.f90 +ED/dbgbuild/bin/twostream_rad.f90 +ED/dbgbuild/bin/ugetarg_mod.f90 +ED/dbgbuild/bin/unarrange_mod.f90 +ED/dbgbuild/bin/update_budget_mod.f90 +ED/dbgbuild/bin/update_c_and_n_pools_mod.f90 +ED/dbgbuild/bin/update_derived_cohort_props_mod.f90 +ED/dbgbuild/bin/update_derived_props.f90 +ED/dbgbuild/bin/update_derived_props_mod.f90 +ED/dbgbuild/bin/update_diagnostic_vars_mod.f90 +ED/dbgbuild/bin/update_ed_yearly_vars_mod.f90 +ED/dbgbuild/bin/updatehydroparms_mod.f90 +ED/dbgbuild/bin/update_met_drivers_mod.f90 +ED/dbgbuild/bin/update_model_time_dm_mod.f90 +ED/dbgbuild/bin/update_mod.f90 +ED/dbgbuild/bin/update_patch_derived_props_mod.f90 +ED/dbgbuild/bin/update_patch_thermo_props_mod.f90 +ED/dbgbuild/bin/update_phenology_eq_0_mod.f90 +ED/dbgbuild/bin/update_phenology_mod.f90 +ED/dbgbuild/bin/update_polygon_derived_props_mod.f90 +ED/dbgbuild/bin/update_rad_avg_mod.f90 +ED/dbgbuild/bin/update_site_derived_props_mod.f90 +ED/dbgbuild/bin/update_thermal_sums_mod.f90 +ED/dbgbuild/bin/update_turnover_mod.f90 +ED/dbgbuild/bin/update_vital_rates_mod.f90 +ED/dbgbuild/bin/updatewatertableadd_mod.f90 +ED/dbgbuild/bin/updatewatertablebaseflow_mod.f90 +ED/dbgbuild/bin/updatewatertablesubtract_mod.f90 +ED/dbgbuild/bin/update_workload_mod.f90 +ED/dbgbuild/bin/utils_f.f90 +ED/dbgbuild/bin/valugp_mod.f90 +ED/dbgbuild/bin/vegetation_dynamics_eq_0_mod.f90 +ED/dbgbuild/bin/vegetation_dynamics.f90 +ED/dbgbuild/bin/vegetation_dynamics_mod.f90 +ED/dbgbuild/bin/walltime_mod.f90 +ED/dbgbuild/bin/warning_mod.f90 +ED/dbgbuild/bin/write_ed_xml_config_mod.f90 +ED/dbgbuild/bin/writehydro_mod.f90 +ED/dbgbuild/bin/yesterday_mod.f90 +ED/dbgbuild/bin/zero_ed_daily_output_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_daily_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_monthly_output_vars_mod.f90 +ED/dbgbuild/bin/zero_ed_yearly_vars_mod.f90 +ED/dbgbuild/bin/a3e0_mod.mod +ED/dbgbuild/bin/a3e1_mod.mod +ED/dbgbuild/bin/a3e2_mod.mod +ED/dbgbuild/bin/accum_mod.mod +ED/dbgbuild/bin/acnst_mod.mod +ED/dbgbuild/bin/adivb_mod.mod +ED/dbgbuild/bin/adjust_sfcw_properties_mod.mod +ED/dbgbuild/bin/adjust_topsoil_properties_mod.mod +ED/dbgbuild/bin/adjust_veg_properties_mod.mod +ED/dbgbuild/bin/ae0_mod.mod +ED/dbgbuild/bin/ae1m1_mod.mod +ED/dbgbuild/bin/ae1_mod.mod +ED/dbgbuild/bin/ae1p1_mod.mod +ED/dbgbuild/bin/ae1p1p1_mod.mod +ED/dbgbuild/bin/ae1t0_mod.mod +ED/dbgbuild/bin/ae1t0p1_mod.mod +ED/dbgbuild/bin/ae1t1_mod.mod +ED/dbgbuild/bin/ae1t1p1_mod.mod +ED/dbgbuild/bin/ae1tn1_mod.mod +ED/dbgbuild/bin/ae2_mod.mod +ED/dbgbuild/bin/ae3m3d0_mod.mod +ED/dbgbuild/bin/ae3m3_mod.mod +ED/dbgbuild/bin/ae3_mod.mod +ED/dbgbuild/bin/ae3p3_mod.mod +ED/dbgbuild/bin/ae3t0p3_mod.mod +ED/dbgbuild/bin/ae3t3_mod.mod +ED/dbgbuild/bin/ae3t3p3_mod.mod +ED/dbgbuild/bin/aen1_mod.mod +ED/dbgbuild/bin/aen3t0p3_mod.mod +ED/dbgbuild/bin/alebl_mod.mod +ED/dbgbuild/bin/allometry.mod +ED/dbgbuild/bin/angle_of_incid_mod.mod +ED/dbgbuild/bin/an_header.mod +ED/dbgbuild/bin/aone2_mod.mod +ED/dbgbuild/bin/aone3_mod.mod +ED/dbgbuild/bin/aone4_mod.mod +ED/dbgbuild/bin/aone5_mod.mod +ED/dbgbuild/bin/aone_mod.mod +ED/dbgbuild/bin/aonev_mod.mod +ED/dbgbuild/bin/apply_forestry_mod.mod +ED/dbgbuild/bin/assign_prescribed_phen_mod.mod +ED/dbgbuild/bin/atimb_mod.mod +ED/dbgbuild/bin/atob_log_mod.mod +ED/dbgbuild/bin/atob_mod.mod +ED/dbgbuild/bin/avg_ed_daily_output_pool_mod.mod +ED/dbgbuild/bin/azero2_mod.mod +ED/dbgbuild/bin/azero3_mod.mod +ED/dbgbuild/bin/azero4_mod.mod +ED/dbgbuild/bin/azero5_mod.mod +ED/dbgbuild/bin/azero_mod.mod +ED/dbgbuild/bin/azerov_mod.mod +ED/dbgbuild/bin/banbks_mod.mod +ED/dbgbuild/bin/bandec_mod.mod +ED/dbgbuild/bin/c34constants.mod +ED/dbgbuild/bin/calc_flow_routing_mod.mod +ED/dbgbuild/bin/calchydrosubsurface_mod.mod +ED/dbgbuild/bin/calchydrosurface_mod.mod +ED/dbgbuild/bin/calc_met_lapse_mod.mod +ED/dbgbuild/bin/calcwatertable_mod.mod +ED/dbgbuild/bin/canopy_air_coms.mod +ED/dbgbuild/bin/canopy_derivs_two_mod.mod +ED/dbgbuild/bin/canopy_layer_coms.mod +ED/dbgbuild/bin/canopy_photosynthesis_mod.mod +ED/dbgbuild/bin/canopy_radiation_coms.mod +ED/dbgbuild/bin/canopy_struct_dynamics.mod +ED/dbgbuild/bin/cbrt8_mod.mod +ED/dbgbuild/bin/cbrt_mod.mod +ED/dbgbuild/bin/cdf2normal_mod.mod +ED/dbgbuild/bin/cdf_mod.mod +ED/dbgbuild/bin/char_strip_var_mod.mod +ED/dbgbuild/bin/check_real_mod.mod +ED/dbgbuild/bin/compute_budget_mod.mod +ED/dbgbuild/bin/compute_c_and_n_storage_mod.mod +ED/dbgbuild/bin/compute_co2_storage_mod.mod +ED/dbgbuild/bin/compute_energy_storage_mod.mod +ED/dbgbuild/bin/compute_netrad_mod.mod +ED/dbgbuild/bin/compute_water_storage_mod.mod +ED/dbgbuild/bin/consts_coms.mod +ED/dbgbuild/bin/copy_met_2_rk4site_mod.mod +ED/dbgbuild/bin/copy_nl_mod.mod +ED/dbgbuild/bin/copy_patch_init_carbon_mod.mod +ED/dbgbuild/bin/copy_patch_init_mod.mod +ED/dbgbuild/bin/copy_path_from_grid_1_mod.mod +ED/dbgbuild/bin/copy_rk4_patch_mod.mod +ED/dbgbuild/bin/count_pft_xml_config_mod.mod +ED/dbgbuild/bin/cputime_mod.mod +ED/dbgbuild/bin/create_ed10_ed20_fname_mod.mod +ED/dbgbuild/bin/cumsum_mod.mod +ED/dbgbuild/bin/cvmgm_mod.mod +ED/dbgbuild/bin/cvmgn_mod.mod +ED/dbgbuild/bin/cvmgp_mod.mod +ED/dbgbuild/bin/cvmgz_mod.mod +ED/dbgbuild/bin/date_2_seconds_mod.mod +ED/dbgbuild/bin/date_abs_secs2_mod.mod +ED/dbgbuild/bin/date_add_to_mod.mod +ED/dbgbuild/bin/date_secs_ymdt_mod.mod +ED/dbgbuild/bin/date_unmake_big_mod.mod +ED/dbgbuild/bin/daylength_mod.mod +ED/dbgbuild/bin/dcvmgm_mod.mod +ED/dbgbuild/bin/dcvmgp_mod.mod +ED/dbgbuild/bin/dcw_swap16_mod.mod +ED/dbgbuild/bin/dcw_swap32_mod.mod +ED/dbgbuild/bin/dcw_swap64_mod.mod +ED/dbgbuild/bin/ddens_dt_effect_mod.mod +ED/dbgbuild/bin/deblank_mod.mod +ED/dbgbuild/bin/decomp_coms.mod +ED/dbgbuild/bin/detab_mod.mod +ED/dbgbuild/bin/diagon_mod.mod +ED/dbgbuild/bin/dist_gc_mod.mod +ED/dbgbuild/bin/disturbance_utils.mod +ED/dbgbuild/bin/disturb_coms.mod +ED/dbgbuild/bin/dmax2_mod.mod +ED/dbgbuild/bin/dmin2_mod.mod +ED/dbgbuild/bin/dssum_mod.mod +ED/dbgbuild/bin/dump_radinfo_mod.mod +ED/dbgbuild/bin/ed1_fileinfo_mod.mod +ED/dbgbuild/bin/ed_1st_master_mod.mod +ED/dbgbuild/bin/ed_1st_node_mod.mod +ED/dbgbuild/bin/ed21_fileinfo_mod.mod +ED/dbgbuild/bin/ed_datp_datq_mod.mod +ED/dbgbuild/bin/ed_datp_datsoil_mod.mod +ED/dbgbuild/bin/ed_driver_mod.mod +ED/dbgbuild/bin/ed_filelist_mod.mod +ED/dbgbuild/bin/ed_gridset_mod.mod +ED/dbgbuild/bin/ed_init_atm_mod.mod +ED/dbgbuild/bin/ed_ll_xy_mod.mod +ED/dbgbuild/bin/ed_load_work_from_history_mod.mod +ED/dbgbuild/bin/ed_masterput_met_header_mod.mod +ED/dbgbuild/bin/ed_masterput_nl_mod.mod +ED/dbgbuild/bin/ed_masterput_poly_dims_mod.mod +ED/dbgbuild/bin/ed_masterput_processid_mod.mod +ED/dbgbuild/bin/ed_masterput_worklist_info_mod.mod +ED/dbgbuild/bin/ed_max_dims.mod +ED/dbgbuild/bin/ed_mem_alloc_mod.mod +ED/dbgbuild/bin/ed_mem_grid_dim_defs.mod +ED/dbgbuild/bin/ed_misc_coms.mod +ED/dbgbuild/bin/ed_model_mod.mod +ED/dbgbuild/bin/ed_newgrid_mod.mod +ED/dbgbuild/bin/ed_node_coms.mod +ED/dbgbuild/bin/ed_node_decomp_mod.mod +ED/dbgbuild/bin/ed_nodeget_met_header_mod.mod +ED/dbgbuild/bin/ed_nodeget_nl_mod.mod +ED/dbgbuild/bin/ed_nodeget_poly_dims_mod.mod +ED/dbgbuild/bin/ed_nodeget_processid_mod.mod +ED/dbgbuild/bin/ed_nodeget_worklist_info_mod.mod +ED/dbgbuild/bin/ed_opspec_grid_mod.mod +ED/dbgbuild/bin/ed_opspec_misc_mod.mod +ED/dbgbuild/bin/ed_opspec_par_mod.mod +ED/dbgbuild/bin/ed_opspec_times_mod.mod +ED/dbgbuild/bin/ed_output_mod.mod +ED/dbgbuild/bin/ed_para_coms.mod +ED/dbgbuild/bin/ed_parvec_work_mod.mod +ED/dbgbuild/bin/ed_polarst_mod.mod +ED/dbgbuild/bin/ed_state_vars.mod +ED/dbgbuild/bin/ed_therm_lib.mod +ED/dbgbuild/bin/ed_var_tables.mod +ED/dbgbuild/bin/ed_work_vars.mod +ED/dbgbuild/bin/ed_xy_ll_mod.mod +ED/dbgbuild/bin/ed_zen_mod.mod +ED/dbgbuild/bin/eifun8_mod.mod +ED/dbgbuild/bin/ename_coms.mod +ED/dbgbuild/bin/endian_mod.mod +ED/dbgbuild/bin/errorfun_mod.mod +ED/dbgbuild/bin/euler_integ_mod.mod +ED/dbgbuild/bin/euler_timestep_mod.mod +ED/dbgbuild/bin/event_fertilize_mod.mod +ED/dbgbuild/bin/event_fire_mod.mod +ED/dbgbuild/bin/event_harvest_mod.mod +ED/dbgbuild/bin/event_irrigate_mod.mod +ED/dbgbuild/bin/event_planting_mod.mod +ED/dbgbuild/bin/event_till_mod.mod +ED/dbgbuild/bin/expected_mod.mod +ED/dbgbuild/bin/expmsq_mod.mod +ED/dbgbuild/bin/exterminate_patches_except_mod.mod +ED/dbgbuild/bin/farq_leuning.mod +ED/dbgbuild/bin/fatal_error_mod.mod +ED/dbgbuild/bin/fill_history_grid_mod.mod +ED/dbgbuild/bin/fill_history_patch_mod.mod +ED/dbgbuild/bin/fill_history_polygon_mod.mod +ED/dbgbuild/bin/fill_history_site_mod.mod +ED/dbgbuild/bin/fillvar_l_mod.mod +ED/dbgbuild/bin/find_closing_comment_mod.mod +ED/dbgbuild/bin/find_frqsum_mod.mod +ED/dbgbuild/bin/findln_mod.mod +ED/dbgbuild/bin/find_rank_mod.mod +ED/dbgbuild/bin/fire_frequency_mod.mod +ED/dbgbuild/bin/first_phenology_mod.mod +ED/dbgbuild/bin/flag_stable_cohorts_mod.mod +ED/dbgbuild/bin/fuse_fiss_utils.mod +ED/dbgbuild/bin/fusion_fission_coms.mod +ED/dbgbuild/bin/getconfigint_mod.mod +ED/dbgbuild/bin/getconfigreal_mod.mod +ED/dbgbuild/bin/getconfigstring_mod.mod +ED/dbgbuild/bin/get_errmax_mod.mod +ED/dbgbuild/bin/get_file_indices_mod.mod +ED/dbgbuild/bin/get_grid_mod.mod +ED/dbgbuild/bin/geth5dims_mod.mod +ED/dbgbuild/bin/getll_mod.mod +ED/dbgbuild/bin/get_work_mod.mod +ED/dbgbuild/bin/get_yscal_mod.mod +ED/dbgbuild/bin/grid_coms.mod +ED/dbgbuild/bin/growth_balive.mod +ED/dbgbuild/bin/h5_output_mod.mod +ED/dbgbuild/bin/harv_immat_patches_mod.mod +ED/dbgbuild/bin/harv_mat_patches_mod.mod +ED/dbgbuild/bin/hdf5_coms.mod +ED/dbgbuild/bin/hdf5_utils.mod +ED/dbgbuild/bin/hdf_getslab_d_mod.mod +ED/dbgbuild/bin/hdf_getslab_i_mod.mod +ED/dbgbuild/bin/hdf_getslab_r_mod.mod +ED/dbgbuild/bin/heav_mod.mod +ED/dbgbuild/bin/het_resp_weight_mod.mod +ED/dbgbuild/bin/heun_integ_mod.mod +ED/dbgbuild/bin/heun_stepper_mod.mod +ED/dbgbuild/bin/heun_timestep_mod.mod +ED/dbgbuild/bin/how_to_read_a_file_mod.mod +ED/dbgbuild/bin/hydrology_coms.mod +ED/dbgbuild/bin/hydrology_constants.mod +ED/dbgbuild/bin/ibias_mod.mod +ED/dbgbuild/bin/ibindec_mod.mod +ED/dbgbuild/bin/ifirstchar_mod.mod +ED/dbgbuild/bin/inc_rk4_patch_mod.mod +ED/dbgbuild/bin/init_can_air_params_mod.mod +ED/dbgbuild/bin/init_can_lyr_params_mod.mod +ED/dbgbuild/bin/init_can_rad_params_mod.mod +ED/dbgbuild/bin/init_cohorts_by_layers_mod.mod +ED/dbgbuild/bin/init_decomp_params_mod.mod +ED/dbgbuild/bin/init_disturb_params_mod.mod +ED/dbgbuild/bin/init_ed_cohort_vars_mod.mod +ED/dbgbuild/bin/init_ed_misc_coms_mod.mod +ED/dbgbuild/bin/init_ed_patch_vars_mod.mod +ED/dbgbuild/bin/init_ed_poly_vars_mod.mod +ED/dbgbuild/bin/init_ed_site_vars_mod.mod +ED/dbgbuild/bin/init_ff_coms_mod.mod +ED/dbgbuild/bin/init_full_history_restart_mod.mod +ED/dbgbuild/bin/init_hydro_coms_mod.mod +ED/dbgbuild/bin/inithydrology_mod.mod +ED/dbgbuild/bin/inithydrosubsurface_mod.mod +ED/dbgbuild/bin/initialize_rk4patches_mod.mod +ED/dbgbuild/bin/init_lapse_params_mod.mod +ED/dbgbuild/bin/init_met_drivers_mod.mod +ED/dbgbuild/bin/init_met_params_mod.mod +ED/dbgbuild/bin/init_nbg_cohorts_mod.mod +ED/dbgbuild/bin/init_pft_alloc_params_mod.mod +ED/dbgbuild/bin/init_pft_derived_params_mod.mod +ED/dbgbuild/bin/init_pft_leaf_params_mod.mod +ED/dbgbuild/bin/init_pft_mort_params_mod.mod +ED/dbgbuild/bin/init_pft_nitro_params_mod.mod +ED/dbgbuild/bin/init_pft_photo_params_mod.mod +ED/dbgbuild/bin/init_pft_repro_params_mod.mod +ED/dbgbuild/bin/init_pft_resp_params_mod.mod +ED/dbgbuild/bin/init_phen_coms_mod.mod +ED/dbgbuild/bin/init_physiology_params_mod.mod +ED/dbgbuild/bin/init_rk4_params_mod.mod +ED/dbgbuild/bin/init_soil_coms_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_flux_mod.mod +ED/dbgbuild/bin/integrate_ed_daily_output_state_mod.mod +ED/dbgbuild/bin/integrate_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/integrate_patch_euler_mod.mod +ED/dbgbuild/bin/integrate_patch_heun_mod.mod +ED/dbgbuild/bin/int_met_avg_mod.mod +ED/dbgbuild/bin/inventory_mat_forests_mod.mod +ED/dbgbuild/bin/iprim_mod.mod +ED/dbgbuild/bin/iran_recsize_mod.mod +ED/dbgbuild/bin/is_finite8_mod.mod +ED/dbgbuild/bin/is_finite_mod.mod +ED/dbgbuild/bin/isleap_mod.mod +ED/dbgbuild/bin/ismax_mod.mod +ED/dbgbuild/bin/ismin_mod.mod +ED/dbgbuild/bin/is_resolvable_mod.mod +ED/dbgbuild/bin/ivalugp_mod.mod +ED/dbgbuild/bin/izero2_mod.mod +ED/dbgbuild/bin/izero3_mod.mod +ED/dbgbuild/bin/izero4_mod.mod +ED/dbgbuild/bin/izero5_mod.mod +ED/dbgbuild/bin/izero_mod.mod +ED/dbgbuild/bin/izerov_mod.mod +ED/dbgbuild/bin/julday1000_mod.mod +ED/dbgbuild/bin/julday_mod.mod +ED/dbgbuild/bin/landuse_init_mod.mod +ED/dbgbuild/bin/large_error_mod.mod +ED/dbgbuild/bin/lastchar_mod.mod +ED/dbgbuild/bin/lastmonthdate_mod.mod +ED/dbgbuild/bin/lastslash_mod.mod +ED/dbgbuild/bin/leaf_database_mod.mod +ED/dbgbuild/bin/leaf_derivs_mod.mod +ED/dbgbuild/bin/leaftw_derivs_mod.mod +ED/dbgbuild/bin/libxml2f90__closeall_mod.mod +ED/dbgbuild/bin/libxml2f90__closefile_mod.mod +ED/dbgbuild/bin/libxml2f90_error_getline_mod.mod +ED/dbgbuild/bin/libxml2f90__existid_mod.mod +ED/dbgbuild/bin/libxml2f90_existid_mod.mod +ED/dbgbuild/bin/libxml2f90__existpid_mod.mod +ED/dbgbuild/bin/libxml2f90__findinchara_mod.mod +ED/dbgbuild/bin/libxml2f90__flush_mod.mod +ED/dbgbuild/bin/libxml2f90__get_fileunit_mod.mod +ED/dbgbuild/bin/libxml2f90_getline_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafec8_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafei4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafel4_mod.mod +ED/dbgbuild/bin/libxml2f90_getsafer8_mod.mod +ED/dbgbuild/bin/libxml2f90__getunit_mod.mod +ED/dbgbuild/bin/libxml2f90_interface_module.mod +ED/dbgbuild/bin/libxml2f90__ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_add_list_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_addpureid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_closetag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_down_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_id_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_edit_pid_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_exist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getch_scal_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_geti4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpc8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpch_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpi4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpl4_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getpstring_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getr8_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getsize_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring__mod.mod +ED/dbgbuild/bin/libxml2f90__ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_getstring_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_initlist_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_inittag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_opentag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_report_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_mod.mod +ED/dbgbuild/bin/libxml2f90_ll_report_rec_wrap_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selectlist_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_selecttag_mod.mod +ED/dbgbuild/bin/libxml2f90__ll_up_mod.mod +ED/dbgbuild/bin/libxml2f90_module.mod +ED/dbgbuild/bin/libxml2f90__openfile_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_file_mod.mod +ED/dbgbuild/bin/libxml2f90_parse_find_char_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90_readin_file_mod.mod +ED/dbgbuild/bin/libxml2f90__readin_nfil_mod.mod +ED/dbgbuild/bin/libxml2f90__set_casesensitive_mod.mod +ED/dbgbuild/bin/libxml2f90__set_default_ll_id_mod.mod +ED/dbgbuild/bin/libxml2f90__setformat_mod.mod +ED/dbgbuild/bin/libxml2f90__set_paw_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmcomma_mod.mod +ED/dbgbuild/bin/libxml2f90__set_rmquotes_mod.mod +ED/dbgbuild/bin/libxml2f90__settransform_exm_mod.mod +ED/dbgbuild/bin/libxml2f90__setwrite_exm_mod.mod +ED/dbgbuild/bin/libxml2f90_strings_module.mod +ED/dbgbuild/bin/libxml2f90_tostringa_mod.mod +ED/dbgbuild/bin/libxml2f90_tostring_mod.mod +ED/dbgbuild/bin/libxml2f90_transform_paw_mod.mod +ED/dbgbuild/bin/lisys_solver8_mod.mod +ED/dbgbuild/bin/lisys_solver_mod.mod +ED/dbgbuild/bin/ll_module.mod +ED/dbgbuild/bin/load_ecosystem_state_mod.mod +ED/dbgbuild/bin/load_ed_ecosystem_params_mod.mod +ED/dbgbuild/bin/lw_multiple_scatter_mod.mod +ED/dbgbuild/bin/lw_twostream_mod.mod +ED/dbgbuild/bin/makefnam_mod.mod +ED/dbgbuild/bin/match_poly_grid_mod.mod +ED/dbgbuild/bin/mat_forest_harv_rates_mod.mod +ED/dbgbuild/bin/mean_daysecz_mod.mod +ED/dbgbuild/bin/mem_polygons.mod +ED/dbgbuild/bin/met_driver_coms.mod +ED/dbgbuild/bin/met_sanity_check_mod.mod +ED/dbgbuild/bin/mk_2_buff_mod.mod +ED/dbgbuild/bin/mk_2p_buff_mod.mod +ED/dbgbuild/bin/mk_3_buff_mod.mod +ED/dbgbuild/bin/mk_4_buff_mod.mod +ED/dbgbuild/bin/mortality.mod +ED/dbgbuild/bin/mprove_mod.mod +ED/dbgbuild/bin/near_bare_ground_init_mod.mod +ED/dbgbuild/bin/new_patch_sfc_props_mod.mod +ED/dbgbuild/bin/normalize_averaged_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_dailynpp_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_daily_vars_mod.mod +ED/dbgbuild/bin/normalize_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/norm_harv_patch_mod.mod +ED/dbgbuild/bin/num_days_mod.mod +ED/dbgbuild/bin/odeint_mod.mod +ED/dbgbuild/bin/opspec_fatal_mod.mod +ED/dbgbuild/bin/optimiz_coms.mod +ED/dbgbuild/bin/overwrite_with_xml_config_mod.mod +ED/dbgbuild/bin/parsefnam_mod.mod +ED/dbgbuild/bin/parse_mod.mod +ED/dbgbuild/bin/pft_coms.mod +ED/dbgbuild/bin/pheninit_balive_bstorage_mod.mod +ED/dbgbuild/bin/phenology_coms.mod +ED/dbgbuild/bin/phenology_driver_eq_0_mod.mod +ED/dbgbuild/bin/phenology_driver_mod.mod +ED/dbgbuild/bin/phenology_startup.mod +ED/dbgbuild/bin/phenology_thresholds_mod.mod +ED/dbgbuild/bin/physiology_coms.mod +ED/dbgbuild/bin/plant_structural_allocation_mod.mod +ED/dbgbuild/bin/prescribed_event_mod.mod +ED/dbgbuild/bin/prescribed_leaf_state_mod.mod +ED/dbgbuild/bin/print_c_and_n_budgets_mod.mod +ED/dbgbuild/bin/print_csiteipa_mod.mod +ED/dbgbuild/bin/print_errmax_mod.mod +ED/dbgbuild/bin/print_fields_mod.mod +ED/dbgbuild/bin/print_photo_details_mod.mod +ED/dbgbuild/bin/print_rk4patch_mod.mod +ED/dbgbuild/bin/print_rk4_state_mod.mod +ED/dbgbuild/bin/print_soil_info_mod.mod +ED/dbgbuild/bin/putconfigint_mod.mod +ED/dbgbuild/bin/putconfigreal8_mod.mod +ED/dbgbuild/bin/putconfigreal_mod.mod +ED/dbgbuild/bin/putconfigstring_mod.mod +ED/dbgbuild/bin/radiate_driver_mod.mod +ED/dbgbuild/bin/rams_f_open_mod.mod +ED/dbgbuild/bin/rank_down_mod.mod +ED/dbgbuild/bin/rank_up_mod.mod +ED/dbgbuild/bin/read_ed10_ed20_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_file_mod.mod +ED/dbgbuild/bin/read_ed21_history_unstruct_mod.mod +ED/dbgbuild/bin/read_ed_xml_config_mod.mod +ED/dbgbuild/bin/read_events_xml_mod.mod +ED/dbgbuild/bin/read_met_driver_head_mod.mod +ED/dbgbuild/bin/read_met_drivers_init_mod.mod +ED/dbgbuild/bin/read_met_drivers_mod.mod +ED/dbgbuild/bin/read_nl_mod.mod +ED/dbgbuild/bin/read_ol_file_mod.mod +ED/dbgbuild/bin/read_plantation_fractions_mod.mod +ED/dbgbuild/bin/read_site_file_mod.mod +ED/dbgbuild/bin/read_soil_depth_mod.mod +ED/dbgbuild/bin/read_soil_moist_temp_mod.mod +ED/dbgbuild/bin/rearrange_mod.mod +ED/dbgbuild/bin/reproduction_eq_0_mod.mod +ED/dbgbuild/bin/reproduction_mod.mod +ED/dbgbuild/bin/reset_averaged_vars_mod.mod +ED/dbgbuild/bin/resp_f_decomp_mod.mod +ED/dbgbuild/bin/resp_rh_mod.mod +ED/dbgbuild/bin/rk4_coms.mod +ED/dbgbuild/bin/rk4_driver.mod +ED/dbgbuild/bin/rk4_stepper.mod +ED/dbgbuild/bin/root_resp_norm_mod.mod +ED/dbgbuild/bin/scale_ed_radiation_mod.mod +ED/dbgbuild/bin/seed_dispersal_mod.mod +ED/dbgbuild/bin/setlapseparms_mod.mod +ED/dbgbuild/bin/set_polygon_coordinates_mod.mod +ED/dbgbuild/bin/set_site_defprops_mod.mod +ED/dbgbuild/bin/sfcdata_ed_mod.mod +ED/dbgbuild/bin/sfcrad_ed_mod.mod +ED/dbgbuild/bin/short2diff_sib_mod.mod +ED/dbgbuild/bin/short_bdown_weissnorman_mod.mod +ED/dbgbuild/bin/sngloff_mod.mod +ED/dbgbuild/bin/soil_coms.mod +ED/dbgbuild/bin/soil_depth_fill_mod.mod +ED/dbgbuild/bin/soil_respiration_mod.mod +ED/dbgbuild/bin/solar_radiation_breakdown_mod.mod +ED/dbgbuild/bin/sort3_mod.mod +ED/dbgbuild/bin/sort_down_mod.mod +ED/dbgbuild/bin/sort_up_mod.mod +ED/dbgbuild/bin/spatial_averages_mod.mod +ED/dbgbuild/bin/ssum_mod.mod +ED/dbgbuild/bin/structural_growth_eq_0_mod.mod +ED/dbgbuild/bin/structural_growth_mod.mod +ED/dbgbuild/bin/sum_plant_cfluxes_mod.mod +ED/dbgbuild/bin/sw_multiple_scatter_mod.mod +ED/dbgbuild/bin/sw_twostream_clump_mod.mod +ED/dbgbuild/bin/test_mod.mod +ED/dbgbuild/bin/therm_lib8.mod +ED/dbgbuild/bin/therm_lib.mod +ED/dbgbuild/bin/timing_mod.mod +ED/dbgbuild/bin/tokenize1_mod.mod +ED/dbgbuild/bin/tolower_mod.mod +ED/dbgbuild/bin/transfer_ol_month_mod.mod +ED/dbgbuild/bin/trid2_mod.mod +ED/dbgbuild/bin/trid_mod.mod +ED/dbgbuild/bin/ugetarg_mod.mod +ED/dbgbuild/bin/unarrange_mod.mod +ED/dbgbuild/bin/update_budget_mod.mod +ED/dbgbuild/bin/update_c_and_n_pools_mod.mod +ED/dbgbuild/bin/update_derived_cohort_props_mod.mod +ED/dbgbuild/bin/update_derived_props_mod.mod +ED/dbgbuild/bin/update_diagnostic_vars_mod.mod +ED/dbgbuild/bin/update_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/updatehydroparms_mod.mod +ED/dbgbuild/bin/update_met_drivers_mod.mod +ED/dbgbuild/bin/update_model_time_dm_mod.mod +ED/dbgbuild/bin/update_mod.mod +ED/dbgbuild/bin/update_patch_derived_props_mod.mod +ED/dbgbuild/bin/update_patch_thermo_props_mod.mod +ED/dbgbuild/bin/update_phenology_eq_0_mod.mod +ED/dbgbuild/bin/update_phenology_mod.mod +ED/dbgbuild/bin/update_polygon_derived_props_mod.mod +ED/dbgbuild/bin/update_rad_avg_mod.mod +ED/dbgbuild/bin/update_site_derived_props_mod.mod +ED/dbgbuild/bin/update_thermal_sums_mod.mod +ED/dbgbuild/bin/update_turnover_mod.mod +ED/dbgbuild/bin/update_vital_rates_mod.mod +ED/dbgbuild/bin/updatewatertableadd_mod.mod +ED/dbgbuild/bin/updatewatertablebaseflow_mod.mod +ED/dbgbuild/bin/updatewatertablesubtract_mod.mod +ED/dbgbuild/bin/update_workload_mod.mod +ED/dbgbuild/bin/valugp_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_eq_0_mod.mod +ED/dbgbuild/bin/vegetation_dynamics_mod.mod +ED/dbgbuild/bin/walltime_mod.mod +ED/dbgbuild/bin/warning_mod.mod +ED/dbgbuild/bin/write_ed_xml_config_mod.mod +ED/dbgbuild/bin/writehydro_mod.mod +ED/dbgbuild/bin/yesterday_mod.mod +ED/dbgbuild/bin/zero_ed_daily_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_daily_vars_mod.mod +ED/dbgbuild/bin/zero_ed_monthly_output_vars_mod.mod +ED/dbgbuild/bin/zero_ed_yearly_vars_mod.mod +ED/dbgbuild/bin/utils_c.c +BRAMS/newbuild +ED/i10dbgbuild +new_regional diff --git a/BRAMS/Template/RAMSIN b/BRAMS/Template/RAMSIN index f43b675d9..2334ac12a 100644 --- a/BRAMS/Template/RAMSIN +++ b/BRAMS/Template/RAMSIN @@ -545,7 +545,7 @@ $END ! interpolate. ! !---------------------------------------------------------------------------------------! IF_CUINV = 0, - CU_PREFIX = '/myoutpath/cumul/mysimul-C-', + CU_PREFIX = 'myoutpath/cumul/mysimul-C-', TNUDCU = 900., WT_CU_GRID = 1., 1., .5, TCU_BEG = 0., @@ -889,7 +889,7 @@ $CUPARM_OPTIONS ! PS3: If NCLOUDS >= 3, then the middle ones will necessarily use Grell's ! ! parameterization. ! !---------------------------------------------------------------------------------------! - NCLOUDS = 2, + NCLOUDS = 2, !---------------------------------------------------------------------------------------! @@ -971,7 +971,7 @@ $CUPARM_OPTIONS !---------------------------------------------------------------------------------------! ! The following variables are scalars. ! !---------------------------------------------------------------------------------------! - CLD2PREC = 0.002, ! Ratio of conversion of condensates to precipitation. [ ---] + CLD2PREC = 0.001, ! Ratio of conversion of condensates to precipitation. [ ---] ZKBMAX = 4000., ! Maximum AGL height in which updrafts can originate. [ m] ZCUTDOWN = 3000., ! Maximum AGL height in which downdrafts can originate. [ m] Z_DETR = 1250., ! Top of the downdraft detrainment layer [ m] @@ -1233,18 +1233,17 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! ! ISTAR -- Similarity theory model. The model that computes u*, T*, etc... Used by ! ! both LEAF-3 and ED-2. ! - ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! - ! estimate the flux based on the bulk Richardson number ! - ! 2. Oncley and Dudhia (1995) model, based on MM5. It uses an empirical ! - ! relation between bulk Richardson number and z/L, then computes the flux ! - ! functions. ! - ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it finds z/L using a ! - ! root-finding method, and it has a different parametrisation for stable ! - ! layers that works better during night time. ! - ! 4. The parametrisation of Beljaars and Holtslag, but using z/L estimation as ! - ! in Oncley and Dudhia. ! - ! 5. The parametrisation of Oncley and Dudhia, but using z/L estimation as in ! - ! Beljaars and Holtslag. ! + ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! + ! estimate the flux based on the bulk Richardson number ! + ! ! + ! All models below use an interative method to find z/L, and the only change ! + ! is the functional form of the psi functions. ! + ! ! + ! 2. Oncley and Dudhia (1995) model, based on MM5. ! + ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it uses an alternative ! + ! method for the stable case that mixes more than the OD95. ! + ! 4. CLM (2004). Similar to 2 and 3, but they have special functions to deal with ! + ! very stable and very stable cases. ! !------------------------------------------------------------------------------------! ISTAR = 3, !------------------------------------------------------------------------------------! @@ -1261,6 +1260,7 @@ $MODEL_OPTIONS ! 2. Test # 2 of Mahfouf and Noilhan (1991) ! ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! ! 4. Test # 4 of Mahfouf and Noilhan (1991) ! + ! 5. Combination of test #1 (alpha) and test #2 (soil resistance). ! ! In all cases the beta term is modified so it approaches zero as soil moisture ! ! goes to dry air soil. ! !------------------------------------------------------------------------------------! @@ -1271,10 +1271,19 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! - ! USTMIN -- minimum friction velocity, u*, in m/s. ! - !------------------------------------------------------------------------------------! - USTMIN = 0.01, - !------------------------------------------------------------------------------------! + ! The following variables control the minimum values of various velocities in ! + ! the canopy. This is needed to avoid the air to be extremely still, or to avoid ! + ! singularities. When defining the values, keep in mind that ! + ! UBMIN >= UGBMIN >= USTMIN. ! + ! ! + ! UBMIN -- minimum wind speed at the top of the canopy air space [ m/s] ! + ! UGBMIN -- minimum wind speed at the leaf level [ m/s] ! + ! USTMIN -- minimum friction velocity, u*, in m/s. [ m/s] ! + !---------------------------------------------------------------------------------------! + UBMIN = 0.65, + UGBMIN = 0.25, + USTMIN = 0.05, + !---------------------------------------------------------------------------------------! @@ -1288,18 +1297,12 @@ $MODEL_OPTIONS ! Ignored when ISTAR = 1 ! ! TPRANDTL -- Turbulent Prandtl number ! ! Ignored when ISTAR = 1 ! - ! VH2VR -- Ratio between vegetation roughness and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! - ! VH2DH -- Ratio between 0-plane displacement height and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! ! RIBMAX -- maximum bulk Richardson number. ! !------------------------------------------------------------------------------------! GAMM = 13., GAMH = 13., TPRANDTL = 0.74, - VH2VR = 0.13, - VH2DH = 0.63, - RIBMAX = 1.00, + RIBMAX = 0.50, !------------------------------------------------------------------------------------! @@ -1328,7 +1331,7 @@ $MODEL_OPTIONS ! or 1, only the first value will be considered, and if ICO2=2, then ! ! provide one value per level. Unit here is ĩmol/mol. ! !------------------------------------------------------------------------------------! - ICO2 = 1, + ICO2 = 0, CO2CON = 380., !------------------------------------------------------------------------------------! @@ -1371,7 +1374,7 @@ $MODEL_OPTIONS ! 1 -- sand | 7 -- silty clay loam | 13 -- bedrock ! ! 2 -- loamy sand | 8 -- clayey loam | 14 -- silt ! ! 3 -- sandy loam | 9 -- sandy clay | 15 -- heavy clay ! - ! 4 -- silt loam | 10 -- silty clay | 16 -- clayey sand ! + ! 4 -- silty loam | 10 -- silty clay | 16 -- clayey sand ! ! 5 -- loam | 11 -- clay | 17 -- clayey silt ! ! 6 -- sandy clay loam | 12 -- peat ! !------------------------------------------------------------------------------------! @@ -1379,6 +1382,39 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! ISOILCOL -- LEAF-3 and ED-2 soil colour classes that the model will use when ! + ! ISOILFLG is set to 2. Soil classes are from 1 to 20 (1 = lightest; ! + ! 20 = darkest). The values are the same as CLM-4.0. The table is the ! + ! albedo for visible and near infra-red. ! + !------------------------------------------------------------------------------------! + ! ! + ! |-----------------------------------------------------------------------| ! + ! | | Dry soil | Saturated | | Dry soil | Saturated | ! + ! | Class |-------------+-------------| Class +-------------+-------------| ! + ! | | VIS | NIR | VIS | NIR | | VIS | NIR | VIS | NIR | ! + ! |-------+------+------+------+------+-------+------+------+------+------| ! + ! | 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | ! + ! | 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | ! + ! | 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | ! + ! | 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | ! + ! | 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | ! + ! | 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | ! + ! | 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | ! + ! | 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | ! + ! | 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | ! + ! | 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | ! + ! |-----------------------------------------------------------------------| ! + ! ! + ! Soil type 21 is a special case in which we use the albedo method that used to be ! + ! the default in BRAMS-4.0.6 and ED-2.1. ! + !------------------------------------------------------------------------------------! + ISOILCOL = 2, + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! ! ZROUGH -- constant roughness, in metres, if for all domain ! ! ALBEDO -- constant albedo (fraction) if not running soil model ! @@ -1466,21 +1502,6 @@ $MODEL_OPTIONS - !------------------------------------------------------------------------------------! - ! These variables were included for sensitivity analysis, they will be eventually ! - ! removed. They are currently used for both LEAF-3 and ED-2. ! - ! ! - ! BETAPOWER -- power to apply in the ground evaporation model (see IGRNDVAP ! - ! references). Default value is 1.0. ! - ! GGFACT -- factor to multiply the ground to canopy conductance. Default value ! - ! is 1.0. ! - !------------------------------------------------------------------------------------! - BETAPOWER = 1., - GGFACT = 1.0, - !------------------------------------------------------------------------------------! - - - !------------------------------------------------------------------------------------! ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Both ! @@ -1516,7 +1537,7 @@ $MODEL_OPTIONS ! 2. Soil conductivity decreases with depth even for constant soil ! ! moisture, otherwise it is the same as 1. ! !------------------------------------------------------------------------------------! - IPERCOL = 1, + IPERCOL = 0, !------------------------------------------------------------------------------------! @@ -1799,7 +1820,7 @@ $ED2_INFO ! If time is a problem, i.e., the runs are too slow, then try making it ! ! larger, but not much larger so to avoid problems... ! !---------------------------------------------------------------------------------------! - DTLSM = 600.0, + DTLSM = 240.0, !---------------------------------------------------------------------------------------! @@ -1835,7 +1856,7 @@ $ED2_INFO IQOUTPUT = 3, IYOUTPUT = 0, ITOUTPUT = 0, - ISOUTPUT = 0, + ISOUTPUT = 3, !---------------------------------------------------------------------------------------! @@ -1973,7 +1994,7 @@ $ED2_INFO SOIL_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/faoOLD/FAO_', LU_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/land_use/glu/glu-', PLANTATION_FILE = '', - LU_RESCALE_FILE = '', + LU_RESCALE_FILE = '/n/Moorcroft_Lab/Lab/data/ed2_data/21restart/rescale/SA1relative.lu.area-22km-2038.txt', THSUMS_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/ed_inputs/', !---------------------------------------------------------------------------------------! @@ -2010,6 +2031,20 @@ $ED2_INFO + !---------------------------------------------------------------------------------------! + ! IVEGT_DYNAMICS -- The vegetation dynamics scheme. ! + ! 0. No vegetation dynamics, the initial state will be preserved, ! + ! even though the model will compute the potential values. This ! + ! option is useful for theoretical simulations only. ! + ! 1. Normal ED vegetation dynamics (Moorcroft et al 2001). ! + ! The normal option for almost any simulation. ! + !---------------------------------------------------------------------------------------! + IVEGT_DYNAMICS = 1, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! INTEGRATION_SCHEME -- The biophysics integration scheme. ! ! 0. Euler step. The fastest, but it doesn't estimate ! @@ -2038,13 +2073,13 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! IBRANCH_THERMO -- This determines whether branches should be included in the ! - ! vegetation thermodynamics and radiation or not. This is under ! - ! development, not fully tested, so we suggest leaving it as 0. ! - ! Options are: ! - ! 0. No branches in energy/radiation; ! - ! 1. Use Conijn (1995) numbers; ! - ! 2. Use parameterization from Jarvela (2004); ! - ! 3. Use the same allometry as Ahrends et al. (2010) ! + ! vegetation thermodynamics and radiation or not. ! + ! 0. No branches in energy/radiation (ED-2.1 default); ! + ! 1. Branches are accounted in the energy and radiation. Branchwood ! + ! and leaf are treated separately in the canopy radiation scheme, ! + ! but solved as a single pool in the biophysics integration. ! + ! 2. Similar to 1, but branches are treated as separate pools in the ! + ! biophysics (thus doubling the number of prognostic variables). ! !---------------------------------------------------------------------------------------! IBRANCH_THERMO = 0, !---------------------------------------------------------------------------------------! @@ -2067,8 +2102,8 @@ $ED2_INFO ! coefficients for CO2 and O2, as in Farquhar et al. (1980) and in CLM. ! ! 2 -- Collatz et al. (1991). We use the power (Q10) equations, with Collatz et al. ! ! parameters for compensation point, and the Michaelis-Mentel coefficients. The ! - ! leaf respiration correction for high and low temperatures are the same as in ! - ! Moorcroft et al. (2001), but the correction for Vm is done like in Collatz. ! + ! correction for high and low temperatures are the same as in Moorcroft et al. ! + ! (2001). ! ! 3 -- Same as 2, except that we find Gamma* as in Farquhar et al. (1980) and in CLM. ! !---------------------------------------------------------------------------------------! IPHYSIOL = 2, @@ -2076,31 +2111,25 @@ $ED2_INFO - - !---------------------------------------------------------------------------------------! - ! ISTOMA_SCHEME -- This is the scheme used to compute stomatal conductance and ! - ! photosynthesis. ! - ! 0. Full, exact calculation each time. ! - ! 1. (defunct) 'small perturbation' scheme. ! - !---------------------------------------------------------------------------------------! - ISTOMA_SCHEME = 0, - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! IALLOM -- Which allometry to use (this affects tropical PFTs only) ! + ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs. Temperate PFTs ! + ! will use the new root allometry and the maximum crown area if IALLOM is set ! + ! to 1 or 2). ! ! 0. Original ED-2.1 ! - ! 1. Baker et al. (2004), equation 2, keeping the same balive:bdead ratio ! - ! 2. Baker et al. (2004), equation 2, keeping the same balive as in ED-2.1 ! - ! 3. Same as 2, but using a DBH-> Root depth equation based on ! - ! Kenzo et al. (2009) for a secondary forest in Malaysia. Roots will ! - ! be shallow, though... ! - ! 4. Same as 2, but with an experimental root depth that makes canopy trees ! - ! to have root depths of 5m and grasses/seedlings at 0.5 to have root ! - ! depth of 0.5 m. ! + ! 1. a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004), equation 2. Balive is the ! + ! default ED-2.1; ! + ! b. Experimental root depth that makes canopy trees to have root depths ! + ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! + ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! + ! crown area ! + ! 2. Similar to 1, but with a few extra changes. ! + ! a. Height -> DBH allometry as in Poorter et al. (2006) ! + ! b. Balive is retuned, using a few leaf biomass allometric equations for ! + ! a few genuses in Costa Rica. References: ! + ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! !---------------------------------------------------------------------------------------! - IALLOM = 4, + IALLOM = 2, !---------------------------------------------------------------------------------------! @@ -2189,28 +2218,51 @@ $ED2_INFO ! cohorts are stacked on the top of each other. ! ! 1. Dietze (2008) model. Cohorts have a finite radius, and cohorts are ! ! stacked on the top of each other. ! - ! 2. Cohorts have a finite radius with horizontal, but they are no longer ! - ! organised by cohort index. Instead, cohorts of the same height ! - ! compete for light as the radiation is solved layer by layer rather ! - ! than cohort by cohort. This is still under development, ideas are ! - ! welcome. ! !---------------------------------------------------------------------------------------! CROWN_MOD = 1, !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! ICAN_SWRAD -- This variable specifies which canopy radiation model to use for short- ! - ! wave radiation within the canopy: ! - ! 0. Beers law. Added back just for theroretical tests, don't use it if ! - ! you are unsure. This cannot be used with CROWN_MOD = 2. ! - ! 1. Two-stream model. The default and recommended method. ! + ! The following variables control the canopy radiation solver. ! ! ! - ! In either case longwave will be solved using two-stream model. ! + ! ICANRAD -- Specifies how canopy radiation is solved. This variable sets both ! + ! shortwave and longwave. ! + ! 0. Two-stream model (Medvigy 2006), with the possibility to apply ! + ! finite crown area to direct shortwave radiation. ! + ! 1. Multiple-scattering model (Zhao and Qualls 2005,2006), with the ! + ! possibility to apply finite crown area to all radiation fluxes. ! + ! LTRANS_VIS -- Leaf transmittance for tropical plants - Visible/PAR ! + ! LTRANS_NIR -- Leaf transmittance for tropical plants - Near Infrared ! + ! LREFLECT_VIS -- Leaf reflectance for tropical plants - Visible/PAR ! + ! LREFLECT_NIR -- Leaf reflectance for tropical plants - Near Infrared ! + ! ORIENT_TREE -- Leaf orientation factor for tropical trees. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! ORIENT_GRASS -- Leaf orientation factor for tropical grasses. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! CLUMP_TREE -- Clumping factor for tropical trees. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + ! CLUMP_GRASS -- Clumping factor for tropical grasses. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! !---------------------------------------------------------------------------------------! - ICAN_SWRAD = 1, + ICANRAD = 0, + LTRANS_VIS = 0.050, + LTRANS_NIR = 0.270, + LREFLECT_VIS = 0.100, + LREFLECT_NIR = 0.540, + ORIENT_TREE = 0.150, + ORIENT_GRASS = -0.050, + CLUMP_TREE = 1.000, + CLUMP_GRASS = 1.000, !---------------------------------------------------------------------------------------! @@ -2229,46 +2281,108 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! H2O_PLANT_LIM -- this determines whether plant photosynthesis can be limited by ! - ! soil moisture, the FSW term: ! - ! 0. No soil moisture limitation, FSW = 1 ! - ! 1. Original ED-1.0/ED-2.0 method, where ! - ! FSW = Supply / (Demand + Supply) ! - ! 2. Alternative and experimental method based on CLM. It checks ! - ! the water potential only, with all contribution of transpiration ! - ! accounted by gsw. It also ignores root biomass. ! + ! soil moisture, the FSW, defined as FSW = Supply / (Demand + Supply). ! + ! ! + ! Demand is always the transpiration rates in case soil moisture is ! + ! not limiting (the psi_0 term times LAI). The supply is determined ! + ! by Kw * nplant * Broot * Available_Water, and the definition of ! + ! available water changes depending on H2O_PLANT_LIM: ! + ! 0. Force FSW = 1 (effectively available water is infinity). ! + ! 1. Available water is the total soil water above wilting point, ! + ! integrated across all layers within the rooting zone. ! + ! 2. Available water is the soil water at field capacity minus ! + ! wilting point, scaled by the so-called wilting factor: ! + ! (psi(k) - (H - z(k)) - psi_wp) / (psi_fc - psi_wp) ! + ! where psi is the matric potentital at layer k, z is the layer ! + ! depth, H it the crown height and psi_fc and psi_wp are the ! + ! matric potentials at wilting point and field capacity. This is ! !---------------------------------------------------------------------------------------! H2O_PLANT_LIM = 1, !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! - ! These following variables are factors that multiply some of the ED-2.1 default ! - ! parameters. Setting them to 1.0 will make them the default. These are applied ! - ! mostly to tropical C3 plants. ! - ! ! - ! VMFACT -- Factor multiplying the default Vm0 ! - ! MFACT -- Factor multiplying the stomatal slope M. ! - ! KFACT -- Factor multiplying the water conductance Kw. This is used only when ! - ! H2O_PLANT_LIM = 1. ! - ! GAMFACT -- Factor multiplying the dark respiration factor (gamma) ! - ! D0FACT -- Factor multiplying the transpiration control in gsw (D0) ! - ! ALPHAFACT -- Factor for changing the quantum yield of C3 plants. This is only ! - ! applied when QUANTUM_EFFICIENCY_T = 0. ! - ! THETACRIT -- Leaf drought phenology threshold. This is the relative soil moisture ! - ! above the wilting point below which the drought-deciduous plants will ! - ! start shedding their leaves ! - ! LWFACT -- Factor for changing the leaf width (w) ! - ! THIOFF -- Offset to be added to the Vm_high_temp ! - !---------------------------------------------------------------------------------------! - VMFACT = 1.2, - MFACT = 1.125, - KFACT = 3.0, - GAMFACT = 0.75, - D0FACT = 1.50, - ALPHAFACT = 0.875, - THETACRIT = 0.20, - LWFACT = 1.0, - THIOFF = 0.0, + ! The following variables are factors that control photosynthesis and respiration. ! + ! Notice that some of them are relative values whereas others are absolute. ! + ! ! + ! VMFACT_C3 -- Factor multiplying the default Vm0 for C3 plants (1.0 = default). ! + ! VMFACT_C4 -- Factor multiplying the default Vm0 for C4 plants (1.0 = default). ! + ! MPHOTO_TRC3 -- Stomatal slope (M) for tropical C3 plants ! + ! MPHOTO_TEC3 -- Stomatal slope (M) for conifers and temperate C3 plants ! + ! MPHOTO_C4 -- Stomatal slope (M) for C4 plants. ! + ! BPHOTO_BLC3 -- cuticular conductance for broadleaf C3 plants [umol/m2/s] ! + ! BPHOTO_NLC3 -- cuticular conductance for needleleaf C3 plants [umol/m2/s] ! + ! BPHOTO_C4 -- cuticular conductance for C4 plants [umol/m2/s] ! + ! KW_GRASS -- Water conductance for trees, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! KW_TREE -- Water conductance for grasses, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! GAMMA_C3 -- The dark respiration factor (gamma) for C3 plants. Subtropical ! + ! conifers will be scaled by GAMMA_C3 * 0.028 / 0.02 ! + ! GAMMA_C4 -- The dark respiration factor (gamma) for C4 plants. ! + ! D0_GRASS -- The transpiration control in gsw (D0) for ALL grasses. ! + ! D0_TREE -- The transpiration control in gsw (D0) for ALL trees. ! + ! ALPHA_C3 -- Quantum yield of ALL C3 plants. This is only applied when ! + ! QUANTUM_EFFICIENCY_T = 0. ! + ! ALPHA_C4 -- Quantum yield of C4 plants. This is always applied. ! + ! KLOWCO2IN -- The coefficient that controls the PEP carboxylase limited rate of ! + ! carboxylation for C4 plants. ! + ! RRFFACT -- Factor multiplying the root respiration factor for ALL PFTs. ! + ! (1.0 = default). ! + ! GROWTHRESP -- The actual growth respiration factor (C3/C4 tropical PFTs only). ! + ! (1.0 = default). ! + ! LWIDTH_GRASS -- Leaf width for grasses, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). ! + ! LWIDTH_BLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to broadleaf trees ! + ! only. ! + ! LWIDTH_NLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to conifer trees ! + ! only. ! + ! Q10_C3 -- Q10 factor for C3 plants (used only if IPHYSIOL is set to 2 or 3). ! + ! Q10_C4 -- Q10 factor for C4 plants (used only if IPHYSIOL is set to 2 or 3). ! + !---------------------------------------------------------------------------------------! + VMFACT_C3 = 1.25, + VMFACT_C4 = 1.00, + MPHOTO_TRC3 = 9.0, + MPHOTO_TEC3 = 7.2, + MPHOTO_C4 = 5.0, + BPHOTO_BLC3 = 10000., + BPHOTO_NLC3 = 1000., + BPHOTO_C4 = 8000., + KW_GRASS = 300., + KW_TREE = 300., + GAMMA_C3 = 0.015, + GAMMA_C4 = 0.036, + D0_GRASS = 0.015, + D0_TREE = 0.015, + ALPHA_C3 = 0.080, + ALPHA_C4 = 0.053, + KLOWCO2IN = 4000., + RRFFACT = 1.000, + GROWTHRESP = 0.33333333333, + LWIDTH_GRASS = 0.05, + LWIDTH_BLTREE = 0.10, + LWIDTH_NLTREE = 0.05, + Q10_C3 = 2.4, + Q10_C4 = 2.4, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! THETACRIT -- Leaf drought phenology threshold. The sign matters here: ! + ! >= 0. -- This is the relative soil moisture above the wilting point ! + ! below which the drought-deciduous plants will start shedding ! + ! their leaves ! + ! < 0. -- This is the soil potential in MPa below which the drought- ! + ! -deciduous plants will start shedding their leaves. The wilt- ! + ! ing point is by definition -1.5MPa, so make sure that the value ! + ! is above -1.5. ! + !---------------------------------------------------------------------------------------! + THETACRIT = -1.20, !---------------------------------------------------------------------------------------! @@ -2316,12 +2430,16 @@ $ED2_INFO ! often will never allow fires. ! ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! - ! SM_FIRE -- Threshold to define the relative soil moisture above dry air of the ! - ! top 75cm that will trigger fires. Used only when include_fire is ! - ! set to 2. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2. The sign here matters. ! + ! >= 0. - Minimum relative soil moisture above dry air of the top 75cm ! + ! that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top 75 cm ! + ! that will prevent fires to happen. The dry air soil ! + ! potential is defined as -3.1 MPa, so make sure SM_FIRE is ! + ! greater than this value. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, - SM_FIRE = 0.11, + SM_FIRE = 0.07, !---------------------------------------------------------------------------------------! @@ -2332,40 +2450,27 @@ $ED2_INFO ! 0. no anthropogenic disturbance. ! ! 1. use anthropogenic disturbance dataset. ! !---------------------------------------------------------------------------------------! - IANTH_DISTURB = 0, + IANTH_DISTURB = 1, !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! ICANTURB -- This flag controls the canopy roughness. - ! 0. Based on Leuning et al. (1995), wind is computed using the similarity - ! theory for the top cohort, and they are extinguished with cumulative - ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average - ! by crown area. - ! 1. The default ED-2.1 scheme, except that it uses the zero-plane - ! displacement height. - ! 2. This uses the method of Massman (1997) using constant drag and no - ! sheltering factor. - ! 3. This is also based on Massman (1997), but with the option of varying - ! the drag and sheltering within the canopy. - !---------------------------------------------------------------------------------------! - ICANTURB = 3, - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! I_BLYR_CONDCT -- This flag controls the boundary layer conductance. This is for ! - ! tests only and should be removed soon, so unless you know what you ! - ! are doing, leave it as zero. ! - ! 0. The Nusselt number for forced convection is estimated using the ! - ! average winds, with no corrections ! - ! 1. The actual Nusselt number for forced convection is multiplied by ! - ! 2.5 as the Reynolds number gets close or greater than 10,000. ! - ! 2. The actual Nusselt number for forced convection is multiplied by ! - ! 10. as the Reynolds number gets close or greater than 10,000. ! + ! ICANTURB -- This flag controls the canopy roughness. ! + ! 0. Based on Leuning et al. (1995), wind is computed using the similarity ! + ! theory for the top cohort, and they are extinguished with cumulative ! + ! LAI. If using CROWN_MOD 1 or 2, this will use local LAI and average ! + ! by crown area. ! + ! 1. The default ED-2.1 scheme, except that it uses the zero-plane ! + ! displacement height. ! + ! 2. This uses the method of Massman (1997) using constant drag and no ! + ! sheltering factor. ! + ! 3. This is also based on Massman (1997), but with the option of varying ! + ! the drag and sheltering within the canopy. ! + ! 4. Same as 0, but if finds the ground conductance following CLM ! + ! technical note (equations 5.98-5.100). ! !---------------------------------------------------------------------------------------! - I_BLYR_CONDCT = 0, + ICANTURB = 4, !---------------------------------------------------------------------------------------! @@ -2391,7 +2496,7 @@ $ED2_INFO ! 7 - southern pines | 17 - "Araucaria" (non-optimised ! ! 8 - late conifers | Southern Pines). ! !---------------------------------------------------------------------------------------! - INCLUDE_THESE_PFT = 1,2,3,4,16,17 + INCLUDE_THESE_PFT = 1,2,3,4,16,17, AGRI_STOCK = 1, PLANTATION_STOCK = 3, !---------------------------------------------------------------------------------------! @@ -2426,8 +2531,8 @@ $ED2_INFO ! cohorts are too different, then the actual number of cohorts in a patch ! ! may exceed MAXCOHORT. ! !---------------------------------------------------------------------------------------! - MAXPATCH = 15, - MAXCOHORT = 100, + MAXPATCH = 10, + MAXCOHORT = 60, !---------------------------------------------------------------------------------------! diff --git a/BRAMS/Template/callopenmpi.sh b/BRAMS/Template/callopenmpi.sh index 0efa8190b..b0a52732b 100755 --- a/BRAMS/Template/callopenmpi.sh +++ b/BRAMS/Template/callopenmpi.sh @@ -18,40 +18,24 @@ mpirun='mpirun' #------------------------------------------------------------------------------------------# +#----- Find the number of cores. ----------------------------------------------------------# +nmach=`wc -l < ${LSB_DJOB_HOSTFILE}` -#----- Checking available spots -----------------------------------------------------------# -host=/odyssey/home/mlongo/.lsbatch/hosts.${LSB_JOBID} - - -/bin/cp ${LSB_DJOB_HOSTFILE} ${host} -let NPROC=0 -let NNODE=0 -let NCORE=0 -for machine in `cat ${LSB_DJOB_HOSTFILE}` -do - let NPROC=${NPROC}+1 - let NCORE=${NCORE}+1 - if [ ${NCORE} -eq 8 ] - then - let NCORE=0 - let NNODE=${NNODE}+1 - fi -done - -#----- Changing the output filename to change for different processors --------------------# -if [ ${NPROC} -lt 10 ] +#----- Change the output filename to change for different processors ----------------------# +if [ ${nmach} -lt 10 ] then - logfile=`dirname ${logfile}`'/00'${NPROC}'_'`basename ${logfile}` - errfile=`dirname ${errfile}`'/00'${NPROC}'_'`basename ${errfile}` -elif [ ${NPROC} -lt 100 ] + logfile=`dirname ${logfile}`'/00'${nmach}'_'`basename ${logfile}` + errfile=`dirname ${errfile}`'/00'${nmach}'_'`basename ${errfile}` +elif [ ${nmach} -lt 100 ] then - logfile=`dirname ${logfile}`'/0'${NPROC}'_'`basename ${logfile}` - errfile=`dirname ${errfile}`'/0'${NPROC}'_'`basename ${errfile}` + logfile=`dirname ${logfile}`'/0'${nmach}'_'`basename ${logfile}` + errfile=`dirname ${errfile}`'/0'${nmach}'_'`basename ${errfile}` else - logfile=`dirname ${logfile}`'/'${NPROC}'_'`basename ${logfile}` - errfile=`dirname ${errfile}`'/'${NPROC}'_'`basename ${errfile}` + logfile=`dirname ${logfile}`'/'${nmach}'_'`basename ${logfile}` + errfile=`dirname ${errfile}`'/'${nmach}'_'`basename ${errfile}` fi -#----- Erasing old logfiles and joblogs ---------------------------------------------------# + +#----- Erase old logfiles and joblogs -----------------------------------------------------# if [ -s ${logfile} ] then rm -fv ${logfile} @@ -61,10 +45,8 @@ then rm -fv ${errfile} fi -#----- Submitting the jobs to the nodes ---------------------------------------------------# -#${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} -mca btl_openib_ib_timeout 20 -mca btl openib,sm ${brams} 1> ${logfile} 2> ${errfile} -${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} ${brams} 1> ${logfile} 2> ${errfile} -#${mpirun} -np ${NPROC} --nooversubscribe -machinefile ${host} -mca btl_openib_ib_timeout 20 -mca btl self,tcp ${brams} 1> ${logfile} 2> ${errfile} - +#----- Submit--- the jobs to the nodes ----------------------------------------------------# +#${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} -mca btl_openib_ib_timeout 20 -mca btl openib,sm ${brams} 1> ${logfile} 2> ${errfile} +${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} ${brams} 1> ${logfile} 2> ${errfile} +#${mpirun} -np ${nmach} --nooversubscribe -machinefile ${LSB_DJOB_HOSTFILE} -mca btl_openib_ib_timeout 20 -mca btl self,tcp ${brams} 1> ${logfile} 2> ${errfile} -rm -f ${host} diff --git a/BRAMS/Template/setup.sh b/BRAMS/Template/setup.sh index 5276e608f..2859d0978 100755 --- a/BRAMS/Template/setup.sh +++ b/BRAMS/Template/setup.sh @@ -4,12 +4,13 @@ #------------------------------------------------------------------------------------------# # ADJUST SOME VARIABLES HERE! # #------------------------------------------------------------------------------------------# -locdisk='/n/Moorcroft_Lab/Users' # Local disk -remdisk='/n/moorcroftfs1' # Output directory -queue='moorcroft2c' # Queue to be used -whena='01-01-1999 00:00' # Initial time for simulation -whenz='03-01-1999 00:00' # Final time for simulation -isfcl=1 # 1 = LEAF-3 run, 5 = ED-2.2 run +here=`pwd` # Local disk +moi=`whoami` # User name +diskthere='/n/scratch2/moorcroft_lab' # Output directory +queue='camd' # Queue to be used +whena='08-01-2008 00:00' # Initial time for simulation +whenz='09-01-2008 00:00' # Final time for simulation +isfcl=5 # 1 = LEAF-3 run, 5 = ED-2.2 run #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# @@ -19,10 +20,58 @@ isfcl=1 # 1 = LEAF-3 run, 5 = ED-2.2 run # NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU'RE DEVELOPING THE SCRIPT! # #------------------------------------------------------------------------------------------# -#----- Define some paths and the name of this simulation. ---------------------------------# -here=`pwd` -there=`echo ${here} | sed s@${locdisk}@${remdisk}@g` +#----- Define the name of this simulation. ------------------------------------------------# thissim=`basename ${here}` +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Check the directories. # +#------------------------------------------------------------------------------------------# +basehere=`basename ${here}` +dirhere=`dirname ${here}` +while [ ${basehere} != ${moi} ] +do + basehere=`basename ${dirhere}` + dirhere=`dirname ${dirhere}` +done +diskhere=${dirhere} +echo '-------------------------------------------------------------------------------' +echo ' - Simulation control on disk: '${diskhere} +echo ' - Output on disk: '${diskthere} +echo '-------------------------------------------------------------------------------' +there=`echo ${here} | sed s@${diskhere}@${diskthere}@g` +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Make sure that the directory there exists, if not, create all parent directories # +# needed. # +#------------------------------------------------------------------------------------------# +while [ ! -s ${there} ] +do + namecheck=`basename ${there}` + dircheck=`dirname ${there}` + while [ ! -s ${dircheck} ] && [ ${namecheck} != '/' ] + do + namecheck=`basename ${dircheck}` + dircheck=`dirname ${dircheck}` + done + + if [ ${namecheck} == '/' ] + then + echo 'Invalid disk for variable there:' + echo ' DISK ='${diskhere} + exit 58 + else + echo 'Making directory: '${dircheck}/${namecheck} + mkdir ${dircheck}/${namecheck} + fi +done +#------------------------------------------------------------------------------------------# + #----- Extract the time from the whena and whenz variables. -------------------------------# @@ -38,6 +87,10 @@ yearz=`echo ${whenz} | awk '{print substr($1,7,4)}'` hourz=`echo ${whenz} | awk '{print substr($2,1,2)}'` minuz=`echo ${whenz} | awk '{print substr($2,4,2)}'` timez=${hourz}${minuz} +#------------------------------------------------------------------------------------------# + + + #------ Decide which soil moisture data set to use. ---------------------------------------# if [ ${yeara} -le 2004 ] @@ -49,6 +102,7 @@ fi #------------------------------------------------------------------------------------------# + #----- Decide the number of patches based on isfcl. ---------------------------------------# if [ ${isfcl} -eq 1 ] then @@ -62,6 +116,8 @@ else echo ' Invalid ISFCL -> '${isfcl}'...' exit 1 fi +#------------------------------------------------------------------------------------------# + echo 'I am going to set up the '${thissim}' simulation...' echo ' - Current directory: '${here} @@ -177,4 +233,6 @@ else mv tothere ${there} fi +#------------------------------------------------------------------------------------------# + diff --git a/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh b/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh index adbd0d5e4..e7cfc385e 100755 --- a/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh +++ b/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh @@ -21,6 +21,7 @@ title='EDBRAMS-1.4' # Title to appear in the header # (no practical relevance) deleteintctl='y' # Delete intermediate ctl [y/N] # (a template will be provided) +outshell='y' shellout='myoutpath/rpost/serial_out.out' # File for 1eachtime-sigma.sh output #------------------------------------------------------------------------------------------# @@ -30,7 +31,7 @@ shellout='myoutpath/rpost/serial_out.out' # File for 1eachtime-sigma.sh outpu #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# -# Defining the kind of compression was applied to the files. The default is no # +# Define the kind of compression was applied to the files. The default is no # # compression. # #------------------------------------------------------------------------------------------# case ${compression} in @@ -45,51 +46,84 @@ case ${compression} in * ) ending='' ;unzip='touch' ;; # I know that this is horrible, but hey, # it works ;-) esac +#------------------------------------------------------------------------------------------# + + -#----- Cleaning the timestrrary directory and the output file. ------------------------------# -rm -f ${tmpfolder}/* +#----- Clean the temporary directory. -----------------------------------------------------# +if [ ! -s ${tmpfolder} ] +then + mkdir ${tmpfolder} +else + rm -f ${tmpfolder}/* +fi +#------------------------------------------------------------------------------------------# + + +#----- Reset the shell output file in case we want one. -----------------------------------# rm -f ${shellout} -touch ${shellout} +if [ ${outshell} == 'y' -o ${outshell} == 'Y' ] +then + touch ${shellout} +fi +#------------------------------------------------------------------------------------------# + -#----- Checking whether ramspost.inp exists or not. ---------------------------------------# -if [ -s ramspost.inp ] +#----- Check whether ramspost.inp exists or not. ------------------------------------------# +if [ -s ramspost.inp-backup ] +then + rm -f ramspost.inp + cp ramspost.inp-backup ramspost.inp +elif [ -s ramspost.inp ] then - cp -f ramspost.inp ramspost.inp-salvaguarda + cp -f ramspost.inp ramspost.inp-backup else - echo 'There should be a file called ramspost.inp here. Exitting...' >> ${shellout} + if [ ${outshell} == 'y' -o ${outshell} == 'Y' ] + then + echo 'There should be a file called ramspost.inp here. Exitting...' >> ${shellout} + else + echo 'There should be a file called ramspost.inp here. Exitting...' + fi exit fi +#------------------------------------------------------------------------------------------# + -#----- Determining the analysis prefix from the list. -------------------------------------# + +#----- Determine the analysis prefix from the list. ---------------------------------------# fprefix=`grep -i FPREFIX ramspost.inp` fprefix=`echo ${fprefix} | sed s/" "/""/g |sed s/"'"/""/g` ext=`echo ${fprefix} |wc -c` p=0 -#----- Finding the comma position. --------------------------------------------------------# +#----- Find the comma position. -----------------------------------------------------------# while [ ${p} -lt ${ext} ] # Finding the comma position do p=`expr ${p} + 1` comma=`echo "${fprefix}" | awk '{print substr($1,'${p}',1)}'` - if [ y${comma} = 'y,' ]; then comma=${p}; p=${ext}; fi + if [ y${comma} == 'y,' ] + then + comma=${p} + p=${ext} + fi done ext=`expr ${comma} - 9` # 9 is the position after the comma fprefix=`echo ${fprefix} | awk '{print substr($1,9,'${ext}')}'` #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# -# Determining the output file prefix from the namelist. # +# Determine the output file prefix from the namelist. # #------------------------------------------------------------------------------------------# gprefix=`grep -i GPREFIX ramspost.inp` gprefix=`echo ${gprefix} | sed s/" "/""/g |sed s/"'"/""/g` ext=`echo ${gprefix} |wc -c` p=0 -#----- Finding the comma position. --------------------------------------------------------# +#----- Find the comma position. -----------------------------------------------------------# while [ ${p} -lt ${ext} ] do p=`expr ${p} + 1` comma=`echo "${gprefix}" | awk '{print substr($1,'${p}',1)}'` - if [ y${comma} = 'y,' ] + if [ y${comma} == 'y,' ] then comma=${p} p=${ext} @@ -102,53 +136,67 @@ gprefix=`echo ${gprefix} | awk '{print substr($1,9,'${ext}')}'` #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# -# Running for each time, provided that it hasn't been run yet. # +# Run for each time, provided that it hasn't been run yet. # #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# donecount=0 -#----- The list list is built in a way that doesn't crash when the list is too long. ------# +#----- The list mylist is built in a way that doesn't crash when the list is too long. ----# directory=`dirname ${fprefix}` myprefix=`basename ${fprefix}` mylist=`ls -1 ${directory}/ |grep ${myprefix} | grep head.txt${ending}` #----- Loop for each file. ----------------------------------------------------------------# for analysis in ${mylist} do -#----- Find the corresponding vfm file. ---------------------------------------------------# + #----- Find the corresponding vfm file. -------------------------------------------------# analysis=`basename ${analysis}` vfm=`basename ${analysis} head.txt${ending}`'g*.vfm'${ending} -#----- Rearrange the the prefix of both analysis and output for a given time... -----------# + #----- Rearrange the the prefix of both analysis and output for a given time... ---------# anapref=${tmpfolder}'/'`basename ${analysis} \-head.txt${ending}` ext=`echo ${anapref} | wc -c`;p0=`expr ${ext} - 17` timestr=`echo ${anapref} | awk '{print substr($1,'${p0}',15)}'` outpref=${gprefix}${timestr} -#----- Here we check whether the files already exist. -------------------------------------# + #----- Here we check whether the files already exist. -----------------------------------# if [ ! -s ${outpref}'_g1.gra' ] then #--------------------------------------------------------------------------------------# - # In case they don't, we copy the header and data files into a temporary folder # + # In case they don't, we copy the header and data files into a temporary folder # # and uncompress them... # #--------------------------------------------------------------------------------------# cp ${directory}'/'${analysis} ${directory}'/'${vfm} ${tmpfolder} ${nice} ${unzip} ${tmpfolder}'/'`basename ${analysis}` ${tmpfolder}'/'`basename ${vfm}` donecount=`expr ${donecount} + 1` - echo 'Running ramspost for time '${timestr}'...' >> ${shellout} + if [ ${outshell} == 'y' -o ${outshell} == 'Y' ] + then + echo 'Running ramspost for time '${timestr}'...' >> ${shellout} + else + echo 'Running ramspost for time '${timestr}'...' + fi + #--------------------------------------------------------------------------------------# # Switch the fprefix by the timestrrary folder, with the added restriction to the # # time. # #--------------------------------------------------------------------------------------# - cat ramspost.inp-salvaguarda | sed s@${fprefix}@${anapref}@g > ramspost.inp.tmp - cat ramspost.inp.tmp | sed s@${gprefix}@${outpref}@g > ramspost.inp - rm -f ramspost.inp.tmp + rm -f ramspost.inp + cp ramspost.inp-backup ramspost.inp + + sed -i s@${fprefix}@${anapref}@g ramspost.inp + sed -i s@${gprefix}@${outpref}@g ramspost.inp + ${nice} ${ramspost} > ${runoutput} - #----- Cleaning the timestrrary folder, so I save disk space. -------------------------# + #----- Clean the temporary folder, so I save disk space. ------------------------------# rm -f ${tmpfolder}/* else #--------------------------------------------------------------------------------------# # If the files exist, I skip this time # #--------------------------------------------------------------------------------------# skipmess='I will not run for time '${timestr}' because these files already exist...' - echo ${skipmess} >> ${shellout} + if [ ${outshell} == 'y' -o ${outshell} == 'Y' ] + then + echo ${skipmess} >> ${shellout} + else + echo ${skipmess} >> ${shellout} + fi fi done #------------------------------------------------------------------------------------------# @@ -175,7 +223,7 @@ ext=`echo ${gprefix} | wc -c` startpnt=`echo ${gprefix} | awk '{print substr($1,1,2)}'` rad=${gprefix} -if [ 'z'${startpnt} = 'z./' ] +if [ 'z'${startpnt} == 'z./' ] then ext=`expr ${ext} - 2` gprefix=`echo ${gprefix} |awk '{print substr($1,3,'${ext}')}'` @@ -189,82 +237,95 @@ fi #------------------------------------------------------------------------------------------# # Find the time interval in sec. # #------------------------------------------------------------------------------------------# -#----- Time of the first file. ------------------------------------------------------------# -first=`ls -1 ${fprefix}*txt${ending} | head -1` -cp ${first} './deleteme.txt'${ending} -#------------------------------------------------------------------------------------------# -# Uncompress into a scratch file. Though it may look inefficient, it's just a txt # -# file... # -#------------------------------------------------------------------------------------------# -${unzip} './deleteme.txt'${ending} -first='./deleteme.txt' -lmax=`cat ${first} | wc -l` -l=0 -#----- Get the time of the first analysis ------------------------------------------------ # -while [ ${l} -lt ${lmax} ] -do - l=`expr ${l} + 1` - thisline=`head -${l} ${first} | tail -1` - whichone=`echo ${thisline} | awk '{print $1}'` - if [ z$whichone = 'z__time' ] - then - l=`expr ${l} + 2` - thisline=`head -${l} ${first} | tail -1` - first=`echo ${thisline} | awk '{print $1}'` - l=${lmax} - fi -done -rm ./deleteme.txt -#----- Do the same thing for the second file... -------------------------------------------# -second=`ls -1 ${fprefix}*txt${ending} | head -2 | tail -1` -cp ${second} './deleteme.txt'${ending} -#------------------------------------------------------------------------------------------# -# Uncompress into a scratch file. Though it may look inefficient, it's just a txt # -# file... # -#------------------------------------------------------------------------------------------# -${unzip} './deleteme.txt'${ending} -second='./deleteme.txt' -#----- Determine how many lines are in the header file ------------------------------------# -lmax=`cat ${second} | wc -l` -l=0 -#----- Get the time of the second analysis. -----------------------------------------------# -while [ ${l} -lt ${lmax} ]; -do - l=`expr ${l} + 1` - thisline=`head -${l} ${second} | tail -1` - whichone=`echo ${thisline} | awk '{print $1}'` - if [ z$whichone = 'z__time' ] - then - l=`expr ${l} + 2` - thisline=`head -${l} ${second} | tail -1` - second=`echo ${thisline} | awk '{print $1}'` - l=${lmax} - fi -done -rm -f ./deleteme.txt - -#------------------------------------------------------------------------------------------# -# Find the interval between the first and the second time. We must switch E+ by 10^, # -# so bc will work. The time interval must be given in minutes or hours in the CTL file, # -# as GrADS doesn't accept seconds as units. # -#------------------------------------------------------------------------------------------# -first=`echo ${first} | sed s@'E+'@'*(10^'@g`')' -second=`echo ${second} | sed s@'E+'@'*(10^'@g`')' -deltat=`echo ${second}' - '${first}| bc` -#----- Delta-t is the time interval in seconds. -------------------------------------------# -deltat=`echo ${deltat} \/ 60 |bc` -#----- Decide whether to show the interval in minutes or hours. ---------------------------# -deltathour=`echo ${deltat} \/ 60 |bc` -wouldbeinteger=`echo ${deltathour} \* 60 |bc` -if [ ${deltat} -eq ${wouldbeinteger} ] - then deltat=${deltathour}'hr' - else deltat=${deltat}'mn' +txtpath=`dirname ${fprefix}` +txtbase=`basename ${fprefix}` +allheads=`ls -1 ${txtpath} | grep ${txtbase} | grep txt${ending}` +first=${txtpath}/`echo ${allheads}| awk '{print $1}'` +second=${txtpath}/`echo ${allheads}| awk '{print $2}'` +if [ ${second} == ${txtpath}/ ] +then + #----- Only one file exists, assign 1hr for time step. ---------------------------------# + deltat='1hr' +else + #---------------------------------------------------------------------------------------# + # Uncompress into a scratch file. Though it may look inefficient, it's just a txt # + # file... # + #---------------------------------------------------------------------------------------# + cp ${first} './deleteme.txt'${ending} + ${unzip} './deleteme.txt'${ending} + first='./deleteme.txt' + lmax=`cat ${first} | wc -l` + l=0 + #----- Get the time of the first analysis ----------------------------------------------# + while [ ${l} -lt ${lmax} ] + do + l=`expr ${l} + 1` + thisline=`head -${l} ${first} | tail -1` + whichone=`echo ${thisline} | awk '{print $1}'` + if [ z$whichone = 'z__time' ] + then + l=`expr ${l} + 2` + thisline=`head -${l} ${first} | tail -1` + first=`echo ${thisline} | awk '{print $1}'` + l=${lmax} + fi + done + rm -f ./deleteme.txt + #----- Do the same thing for the second file... ----------------------------------------# + cp ${second} './deleteme.txt'${ending} + #---------------------------------------------------------------------------------------# + # Uncompress into a scratch file. Though it may look inefficient, it's just a txt # + # file... # + #---------------------------------------------------------------------------------------# + ${unzip} './deleteme.txt'${ending} + second='./deleteme.txt' + #----- Determine how many lines are in the header file ---------------------------------# + lmax=`cat ${second} | wc -l` + l=0 + #----- Get the time of the second analysis. --------------------------------------------# + while [ ${l} -lt ${lmax} ]; + do + l=`expr ${l} + 1` + thisline=`head -${l} ${second} | tail -1` + whichone=`echo ${thisline} | awk '{print $1}'` + if [ z$whichone = 'z__time' ] + then + l=`expr ${l} + 2` + thisline=`head -${l} ${second} | tail -1` + second=`echo ${thisline} | awk '{print $1}'` + l=${lmax} + fi + done + rm -f ./deleteme.txt + + #---------------------------------------------------------------------------------------# + # Find the interval between the first and the second time. We must switch E+ by # + # 10^, so bc will work. The time interval must be given in minutes or hours in the CTL # + # file, as GrADS doesn't accept seconds as units. # + #---------------------------------------------------------------------------------------# + first=`echo ${first} | sed s@'E+'@'*(10^'@g`')' + second=`echo ${second} | sed s@'E+'@'*(10^'@g`')' + deltat=`echo ${second}' - '${first}| bc` + #----- Delta-t is the time interval in seconds. ----------------------------------------# + deltat=`echo ${deltat} \/ 60 |bc` + #----- Decide whether to show the interval in minutes or hours. ------------------------# + deltathour=`echo ${deltat} \/ 60 |bc` + wouldbeinteger=`echo ${deltathour} \* 60 |bc` + if [ ${deltat} -eq ${wouldbeinteger} ] + then + deltat=${deltathour}'hr' + else + deltat=${deltat}'mn' + fi + #------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# fi #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# # In case binary files were created, we generate a new template for each grid. # @@ -278,8 +339,15 @@ then ctl=${rad}'_g'${g}'.ctl' ctl=`basename ${ctl}` - #----- Take the first file as a "canvas"... -------------------------------------------# - ref=`ls -1 ${gprefix}????-??-??-????_?${g}'.ctl' |head -1` + binpath=`dirname ${gprefix}` + basepath=`basename ${gprefix}` + + #--------------------------------------------------------------------------------------# + # Take the first file as a "canvas"... To make sure we can find the ctl even # + # when there are too many files, we list the directory, and grep the files. # + #--------------------------------------------------------------------------------------# + ref=`ls -1 ${binpath} | grep ${basepath} | grep ${g}'.ctl'` + ref=${binpath}/`echo ${ref} | awk '{print $1}'` lmax=`cat ${ref} | wc -l` #--------------------------------------------------------------------------------------# @@ -293,20 +361,22 @@ then thisline=`head -${l} ${ref} | tail -1` whichone=`echo ${thisline} |awk '{print $1}'` - if [ z${whichone} = 'zdset' ] + if [ z${whichone} == 'zdset' ] then #----- Filename line. Switch it and also add the "template" line ------------------# - if [ 'z'`echo ${gprefix} | awk '{print substr($1,1,1)}'` = 'z/' ] - then echo 'dset '${gprefix}'%y4-%m2-%d2-%h2%n2_g'${g}'.gra' > ${ctl} - else echo 'dset ^'${gprefix}'%y4-%m2-%d2-%h2%n2_g'${g}'.gra' > ${ctl} + if [ 'z'`echo ${gprefix} | awk '{print substr($1,1,1)}'` == 'z/' ] + then + echo 'dset '${gprefix}'%y4-%m2-%d2-%h2%n2_g'${g}'.gra' > ${ctl} + else + echo 'dset ^'${gprefix}'%y4-%m2-%d2-%h2%n2_g'${g}'.gra' > ${ctl} fi echo 'options template' >> ${ctl} - elif [ z${whichone} = 'ztitle' ] + elif [ z${whichone} == 'ztitle' ] then #------ Not an important change, it just changes the title of this dataset. -------# echo 'title '${title} >> ${ctl} - elif [ z${whichone} = 'ztdef' ] + elif [ z${whichone} == 'ztdef' ] then #----- Time line, switch it by the total number of times. -------------------------# amax=`ls -1 ${gprefix}*${g}.gra |wc -l` @@ -322,7 +392,12 @@ then # Display the command line in the screen so we know when the shell script is done, # # and also allow lazy people to save time by copying the command with the mouse ;-). # #--------------------------------------------------------------------------------------# - echo "grads -cl 'open ${ctl}'" >> ${shellout} + if [ ${outshell} == 'y' -o ${outshell} == 'Y' ] + then + echo "grads -cl 'open ${ctl}'" >> ${shellout} + else + echo "grads -cl 'open ${ctl}'" + fi done fi @@ -338,13 +413,19 @@ then while [ ${g} -lt ${gmax} ] do g=`expr ${g} + 1` - howmany=`ls -1 ${gprefix}*????-??-??-????_g${g}.ctl 2> /dev/null | wc -l` + + binpath=`dirname ${gprefix}` + basepath=`basename ${gprefix}` + + howmany=`ls ${binpath} | grep ${basepath} | grep ${g}'.ctl' 2> /dev/null | wc -l` if [ ${howmany} -ge 1 ] then - howmany=`expr ${howmany} - 1` - files=`ls -1 ${gprefix}*????-??-??-????_g${g}.ctl | tail -${howmany}` - for file in ${files} + files=`ls ${binpath} | grep ${basepath} | grep ${g}'.ctl'` + n=1 + while [ ${n} -lt ${howmany} ] do + let n=${n}+1 + file=${binpath}/`echo ${files} | awk '{print $'${n}'}'` rm -f ${file} done #file in ${files} fi # [ ${howmany} -ge 1 ] @@ -358,6 +439,7 @@ fi #if [ ${deleteintclt}='y' -o ${deleteintctl}='Y' ] #------------------------------------------------------------------------------------------# # Return ramspost.inp to the original file # #------------------------------------------------------------------------------------------# -mv -f ramspost.inp-salvaguarda ramspost.inp +rm -f ramspost.inp +mv -f ramspost.inp-backup ramspost.inp #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# diff --git a/BRAMS/Template/tothere/rpost/ramspost.inp b/BRAMS/Template/tothere/rpost/ramspost.inp index c1fc94e7a..523f07a36 100644 --- a/BRAMS/Template/tothere/rpost/ramspost.inp +++ b/BRAMS/Template/tothere/rpost/ramspost.inp @@ -3,8 +3,8 @@ FPREFIX = 'myoutpath/analy/mysimul-A-', NVP = 75, - VP ='lon', - 'lat', + VP ='longitude', + 'latitude', 'press', 'tempc', 'theta', diff --git a/BRAMS/build/bin/2ndcomp.sh b/BRAMS/build/bin/2ndcomp.sh index c41bb7e12..a40849838 100755 --- a/BRAMS/build/bin/2ndcomp.sh +++ b/BRAMS/build/bin/2ndcomp.sh @@ -332,6 +332,7 @@ rm -fv lsm_hyd.o lsm_hyd.mod rm -fv mem_polygons.o mem_polygons.mod rm -fv met_driver_coms.o met_driver_coms.mod rm -fv mortality.o mortality.mod +rm -fv multiple_scatter.o multilple_scatter.mod rm -fv optimiz_coms.o optimiz_coms.mod rm -fv phenology_aux.o phenology_aux.mod rm -fv phenology_coms.o phenology_coms.mod diff --git a/BRAMS/build/bin/dependency.mk b/BRAMS/build/bin/dependency.mk index b5683098a..7e00c2d2a 100644 --- a/BRAMS/build/bin/dependency.mk +++ b/BRAMS/build/bin/dependency.mk @@ -1,4 +1,10 @@ # DO NOT DELETE THIS LINE - used by make depend +error_mod.o: grid_dims.mod +gridteste.o: boundarymod.mod gridmod.mod mapmod.mod processormod.mod +init_advect.o: advmessagemod.mod boundarymod.mod errormod.mod gridmod.mod +init_advect.o: mapmod.mod processormod.mod +radvc_mnt.o: adv_message_mod.mod mem_basic.mod mem_grid.mod mem_scratch.mod +radvc_mnt.o: node_mod.mod rconstants.mod therm_lib.mod var_tables.mod cyclic_mod.o: grid_dims.mod rbnd.o: catt_start.mod mem_basic.mod mem_grid.mod mem_scratch.mod mem_tend.mod rbnd.o: mem_turb.mod node_mod.mod ref_sounding.mod therm_lib.mod var_tables.mod @@ -6,7 +12,7 @@ rbnd_adap.o: mem_grid.mod ref_sounding.mod dry_dep.o: extras.mod leaf_coms.mod mem_basic.mod mem_grid.mod mem_leaf.mod dry_dep.o: mem_micro.mod mem_scalar.mod mem_scratch.mod mem_turb.mod dry_dep.o: rconstants.mod -emission_source_map.o: extras.mod mem_basic.mod mem_grid.mod +emission_source_map.o: extras.mod grid_dims.mod mem_basic.mod mem_grid.mod emission_source_map.o: mem_grid_dim_defs.mod mem_scalar.mod mem_scratch.mod extra.o: var_tables.mod plumerise_vector.o: extras.mod mem_basic.mod mem_grid.mod mem_scalar.mod @@ -25,6 +31,9 @@ raco.o: mem_basic.mod mem_grid.mod mem_scratch.mod mem_tend.mod node_mod.mod raco.o: rconstants.mod therm_lib.mod raco_adap.o: mem_grid.mod mem_scratch.mod node_mod.mod rconstants.mod radvc.o: mem_basic.mod mem_grid.mod mem_scratch.mod mem_tend.mod var_tables.mod +radvc_mnt.o: advmessagemod.mod mem_basic.mod mem_chem1.mod mem_grid.mod +radvc_mnt.o: mem_scratch.mod micphys.mod node_mod.mod rconstants.mod +radvc_mnt.o: var_tables.mod rams_master.o: catt_start.mod dtset.mod emission_source_map.mod grid_dims.mod rams_master.o: io_params.mod mem_cuparm.mod mem_emiss.mod mem_grid.mod rams_master.o: mem_leaf.mod mem_mass.mod mem_oda.mod mem_radiate.mod @@ -119,26 +128,30 @@ edcp_para_init.o: node_mod.mod soil_coms.mod lake_coms.o: consts_coms.mod mem_edcp.o: var_tables.mod cond_read.o: grid_dims.mod mem_grid.mod mem_varinit.mod -cond_update.o: an_header.mod grid_struct.mod mem_basic.mod mem_grid.mod -cond_update.o: mem_varinit.mod rconstants.mod var_tables.mod -mem_oda.o: var_tables.mod +cond_update.o: an_header.mod grid_dims.mod grid_struct.mod mem_basic.mod +cond_update.o: mem_grid.mod mem_varinit.mod rconstants.mod var_tables.mod +mem_oda.o: grid_dims.mod var_tables.mod nud_analysis.o: mem_basic.mod mem_grid.mod mem_scratch.mod mem_tend.mod nud_analysis.o: mem_varinit.mod node_mod.mod nud_read.o: grid_dims.mod mem_grid.mod mem_varinit.mod -nud_update.o: an_header.mod grid_struct.mod mem_aerad.mod mem_basic.mod -nud_update.o: mem_grid.mod mem_varinit.mod rconstants.mod var_tables.mod -oda_krig.o: mem_oda.mod +nud_update.o: an_header.mod grid_dims.mod grid_struct.mod mem_aerad.mod +nud_update.o: mem_basic.mod mem_grid.mod mem_varinit.mod rconstants.mod +nud_update.o: var_tables.mod +obs_input.o: grid_dims.mod +oda_krig.o: grid_dims.mod mem_oda.mod oda_nudge.o: io_params.mod mem_basic.mod mem_grid.mod mem_oda.mod oda_nudge.o: mem_scratch.mod mem_tend.mod node_mod.mod oda_proc_obs.o: mem_grid.mod mem_oda.mod rconstants.mod therm_lib.mod oda_read.o: grid_dims.mod mem_grid.mod mem_oda.mod oda_sta_count.o: mem_grid.mod mem_oda.mod obs_input.mod oda_sta_input.o: mem_grid.mod mem_oda.mod obs_input.mod -read_ralph.o: obs_input.mod rconstants.mod therm_lib.mod +read_ralph.o: grid_dims.mod obs_input.mod rconstants.mod therm_lib.mod varf_read.o: grid_dims.mod mem_grid.mod mem_varinit.mod -varf_update.o: mem_basic.mod mem_grid.mod mem_leaf.mod mem_scratch.mod -varf_update.o: mem_varinit.mod rconstants.mod ref_sounding.mod therm_lib.mod +varf_update.o: grid_dims.mod mem_basic.mod mem_grid.mod mem_leaf.mod +varf_update.o: mem_scratch.mod mem_varinit.mod rconstants.mod ref_sounding.mod +varf_update.o: therm_lib.mod adap_init.o: mem_leaf.mod +domain_decomp.o: grid_dims.mod gridset.o: grid_dims.mod mem_grid.mod rconstants.mod rams_grid.o: mem_grid.mod node_mod.mod rconstants.mod rdint.o: catt_start.mod domain_decomp.mod emission_source_map.mod grell_coms.mod @@ -163,11 +176,11 @@ opspec.o: catt_start.mod grell_coms.mod io_params.mod leaf_coms.mod opspec.o: mem_basic.mod mem_cuparm.mod mem_emiss.mod mem_grid.mod mem_leaf.mod opspec.o: mem_mass.mod mem_radiate.mod mem_turb.mod mem_varinit.mod micphys.mod opspec.o: teb_spm_start.mod therm_lib.mod -rams_read_header.o: an_header.mod +rams_read_header.o: an_header.mod grid_dims.mod ranlavg.o: io_params.mod mem_basic.mod mem_grid.mod mem_scratch.mod mem_turb.mod ranlavg.o: node_mod.mod var_tables.mod -rcio.o: grell_coms.mod leaf_coms.mod mem_all.mod mem_mass.mod therm_lib.mod -rcio.o: turb_coms.mod +rcio.o: grell_coms.mod grid_dims.mod leaf_coms.mod mem_all.mod mem_mass.mod +rcio.o: therm_lib.mod turb_coms.mod recycle.o: grid_dims.mod io_params.mod mem_aerad.mod mem_cuparm.mod mem_grid.mod recycle.o: mem_leaf.mod mem_scratch.mod var_tables.mod rhdf5.o: an_header.mod grid_dims.mod io_params.mod mem_aerad.mod @@ -182,21 +195,23 @@ rprnt.o: io_params.mod leaf_coms.mod mem_all.mod mem_basic.mod mem_grid.mod rprnt.o: mem_leaf.mod mem_scratch.mod mem_turb.mod rconstants.mod rprnt.o: ref_sounding.mod therm_lib.mod var_tables.mod aobj.o: isan_coms.mod rconstants.mod -asgen.o: io_params.mod isan_coms.mod mem_grid.mod +asgen.o: grid_dims.mod io_params.mod isan_coms.mod mem_grid.mod asnc.o: isan_coms.mod rconstants.mod asti.o: isan_coms.mod mem_grid.mod rconstants.mod therm_lib.mod -asti2.o: isan_coms.mod rconstants.mod therm_lib.mod +asti2.o: grid_dims.mod isan_coms.mod rconstants.mod therm_lib.mod astp.o: isan_coms.mod rconstants.mod therm_lib.mod avarf.o: isan_coms.mod mem_grid.mod rconstants.mod therm_lib.mod file_inv.o: grid_dims.mod isan_coms.mod -first_rams.o: an_header.mod isan_coms.mod mem_grid.mod mem_scratch.mod -first_rams.o: rconstants.mod therm_lib.mod +first_rams.o: an_header.mod grid_dims.mod isan_coms.mod mem_grid.mod +first_rams.o: mem_scratch.mod rconstants.mod therm_lib.mod +isan_coms.o: grid_dims.mod isan_io.o: isan_coms.mod refstate.o: rconstants.mod therm_lib.mod v_interps.o: isan_coms.mod rconstants.mod therm_lib.mod +charutils.o: grid_dims.mod dateutils.o: rconstants.mod filelist.o: grid_dims.mod -getvar.o: an_header.mod +getvar.o: an_header.mod grid_dims.mod great_circle.o: rconstants.mod hdf5_utils.o: hdf5_coms.mod map_proj.o: rconstants.mod @@ -205,6 +220,7 @@ polarst.o: rconstants.mod therm_lib.o: rconstants.mod therm_lib8.o: rconstants.mod therm_lib.mod varutils.o: mem_aerad.mod mem_cuparm.mod mem_grid.mod node_mod.mod +vformat.o: grid_dims.mod mem_mass.o: grid_dims.mod var_tables.mod rexev.o: mem_basic.mod mem_grid.mod mem_mass.mod mem_scratch.mod mem_tend.mod rexev.o: rconstants.mod therm_lib.mod @@ -238,15 +254,15 @@ rams_mem_alloc.o: mem_scratch2_grell_sh.mod mem_scratch3_grell.mod rams_mem_alloc.o: mem_scratch3_grell_sh.mod mem_scratch_grell.mod mem_teb.mod rams_mem_alloc.o: mem_teb_common.mod mem_turb_scalar.mod node_mod.mod rams_mem_alloc.o: teb_spm_start.mod teb_vars_const.mod turb_coms.mod -vtab_fill.o: io_params.mod var_tables.mod +vtab_fill.o: grid_dims.mod io_params.mod var_tables.mod mem_micro.o: micphys.mod therm_lib.mod var_tables.mod mic_coll.o: micphys.mod micro_coms.mod rconstants.mod therm_lib.mod mic_driv.o: grid_dims.mod mem_basic.mod mem_grid.mod mem_micro.mod mic_driv.o: mem_scratch.mod micphys.mod micro_coms.mod node_mod.mod mic_driv.o: rconstants.mod therm_lib.mod mic_gamma.o: rconstants.mod therm_lib.mod -mic_init.o: mem_grid.mod mem_radiate.mod micphys.mod micro_coms.mod node_mod.mod -mic_init.o: rconstants.mod therm_lib.mod +mic_init.o: grid_dims.mod mem_grid.mod mem_radiate.mod micphys.mod +mic_init.o: micro_coms.mod node_mod.mod rconstants.mod therm_lib.mod mic_misc.o: mem_basic.mod mem_grid.mod mem_micro.mod mem_scratch.mod micphys.mod mic_misc.o: micro_coms.mod rconstants.mod therm_lib.mod mic_nuc.o: micphys.mod micro_coms.mod rconstants.mod therm_lib.mod @@ -254,18 +270,19 @@ mic_tabs.o: micphys.mod micro_coms.mod rconstants.mod mic_vap.o: micphys.mod micro_coms.mod rconstants.mod therm_lib.mod micphys.o: grid_dims.mod micro_coms.o: micphys.mod rconstants.mod -geodat.o: io_params.mod mem_grid.mod mem_leaf.mod rconstants.mod +geodat.o: grid_dims.mod io_params.mod mem_grid.mod mem_leaf.mod rconstants.mod geodat.o: teb_spm_start.mod landuse_input.o: grid_dims.mod hdf5_utils.mod io_params.mod leaf_coms.mod landuse_input.o: mem_leaf.mod mem_mksfc.mod rconstants.mod -mem_mksfc.o: teb_spm_start.mod +mem_mksfc.o: grid_dims.mod teb_spm_start.mod mksfc_driver.o: io_params.mod mem_grid.mod mem_mksfc.mod teb_spm_start.mod -mksfc_fuso.o: io_params.mod mem_emiss.mod mem_gaspart.mod mem_grid.mod -mksfc_fuso.o: mem_mksfc.mod mem_teb.mod teb_vars_const.mod -mksfc_ndvi.o: io_params.mod mem_grid.mod mem_leaf.mod mem_mksfc.mod -mksfc_sfc.o: io_params.mod mem_grid.mod mem_leaf.mod mem_mksfc.mod -mksfc_sst.o: io_params.mod mem_grid.mod mem_leaf.mod mem_mksfc.mod -mksfc_top.o: io_params.mod mem_grid.mod mem_mksfc.mod +mksfc_fuso.o: grid_dims.mod io_params.mod mem_emiss.mod mem_gaspart.mod +mksfc_fuso.o: mem_grid.mod mem_mksfc.mod mem_teb.mod teb_vars_const.mod +mksfc_ndvi.o: grid_dims.mod io_params.mod mem_grid.mod mem_leaf.mod +mksfc_ndvi.o: mem_mksfc.mod +mksfc_sfc.o: grid_dims.mod io_params.mod mem_grid.mod mem_leaf.mod mem_mksfc.mod +mksfc_sst.o: grid_dims.mod io_params.mod mem_grid.mod mem_leaf.mod mem_mksfc.mod +mksfc_top.o: grid_dims.mod io_params.mod mem_grid.mod mem_mksfc.mod ndvi_read.o: grid_dims.mod io_params.mod mem_grid.mod mem_leaf.mod nest_geosst.o: io_params.mod leaf_coms.mod mem_basic.mod mem_grid.mod nest_geosst.o: mem_leaf.mod mem_mksfc.mod mem_radiate.mod mem_scratch.mod @@ -339,7 +356,7 @@ harr_radinit.o: harr_coms.mod mem_cuparm.mod mem_grid.mod mem_harr.mod harr_radinit.o: mem_radiate.mod micphys.mod mem_aerad.o: mem_grid_dim_defs.mod mem_carma.o: grid_dims.mod mem_aerad.mod mem_globrad.mod -mem_globaer.o: mem_aerad.mod +mem_globaer.o: grid_dims.mod mem_aerad.mod mem_globrad.o: mem_aerad.mod rconstants.mod mem_mclat.o: rconstants.mod mem_radiate.o: var_tables.mod @@ -354,9 +371,9 @@ rad_driv.o: mem_tend.mod micphys.mod rad_carma.mod rconstants.mod rad_driv.o: teb_spm_start.mod therm_lib.mod rad_mclat.o: harr_coms.mod mem_grid.mod mem_mclat.mod mem_radiate.mod rad_mclat.o: rconstants.mod -mem_soil_moisture.o: leaf_coms.mod -soil_moisture_init.o: io_params.mod leaf_coms.mod mem_grid.mod mem_leaf.mod -soil_moisture_init.o: mem_soil_moisture.mod rconstants.mod +mem_soil_moisture.o: grid_dims.mod leaf_coms.mod +soil_moisture_init.o: grid_dims.mod io_params.mod leaf_coms.mod mem_grid.mod +soil_moisture_init.o: mem_leaf.mod mem_soil_moisture.mod rconstants.mod leaf3.o: io_params.mod leaf_coms.mod mem_basic.mod mem_cuparm.mod mem_grid.mod leaf3.o: mem_leaf.mod mem_micro.mod mem_radiate.mod mem_scratch.mod mem_teb.mod leaf3.o: mem_teb_common.mod mem_turb.mod node_mod.mod rconstants.mod @@ -371,19 +388,21 @@ leaf3_ocean.o: rconstants.mod therm_lib.mod leaf3_teb.o: mem_emiss.mod rconstants.mod teb_vars_const.mod therm_lib.mod leaf3_tw.o: catt_start.mod leaf_coms.mod mem_grid.mod mem_leaf.mod leaf3_tw.o: mem_radiate.mod mem_scratch.mod rconstants.mod therm_lib.mod -leaf3_utils.o: catt_start.mod grid_dims.mod io_params.mod leaf_coms.mod -leaf3_utils.o: mem_grid.mod mem_leaf.mod mem_radiate.mod mem_scratch.mod -leaf3_utils.o: node_mod.mod rconstants.mod teb_spm_start.mod therm_lib.mod +leaf3_utils.o: catt_start.mod consts_coms.mod grid_dims.mod io_params.mod +leaf3_utils.o: leaf_coms.mod mem_grid.mod mem_leaf.mod mem_radiate.mod +leaf3_utils.o: mem_scratch.mod node_mod.mod rconstants.mod teb_spm_start.mod +leaf3_utils.o: therm_lib.mod leaf_coms.o: grid_dims.mod mem_leaf.mod rconstants.mod therm_lib.mod mem_leaf.o: grid_dims.mod io_params.mod var_tables.mod ruser.o: catt_start.mod io_params.mod leaf_coms.mod mem_grid.mod mem_leaf.mod ruser.o: rconstants.mod therm_lib.mod urban.o: teb_vars_const.mod therm_lib.mod -urban_canopy.o: mem_basic.mod mem_grid.mod mem_scratch.mod mem_tend.mod -urban_canopy.o: mem_turb.mod node_mod.mod +urban_canopy.o: grid_dims.mod mem_basic.mod mem_grid.mod mem_scratch.mod +urban_canopy.o: mem_tend.mod mem_turb.mod node_mod.mod gaspart.o: an_header.mod grid_dims.mod io_params.mod mem_basic.mod mem_emiss.mod gaspart.o: mem_gaspart.mod mem_grid.mod mem_leaf.mod mem_tend.mod rconstants.mod gaspart.o: ref_sounding.mod teb_vars_const.mod var_tables.mod +mem_emiss.o: grid_dims.mod mem_gaspart.o: mem_emiss.mod var_tables.mod mem_teb.o: var_tables.mod mem_teb_common.o: var_tables.mod @@ -413,16 +432,17 @@ ed_1st.o: ed_misc_coms.mod ed_para_coms.mod ed_state_vars.mod ed_driver.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod ed_driver.o: fuse_fiss_utils.mod grid_coms.mod soil_coms.mod ed_met_driver.o: canopy_air_coms.mod canopy_radiation_coms.mod consts_coms.mod -ed_met_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod -ed_met_driver.o: grid_coms.mod hdf5_utils.mod mem_polygons.mod +ed_met_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_met_driver.o: ed_state_vars.mod grid_coms.mod hdf5_utils.mod mem_polygons.mod ed_met_driver.o: met_driver_coms.mod pft_coms.mod therm_lib.mod ed_model.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_model.o: ed_state_vars.mod grid_coms.mod mem_polygons.mod rk4_coms.mod ed_model.o: rk4_driver.mod canopy_struct_dynamics.o: allometry.mod canopy_air_coms.mod canopy_struct_dynamics.o: canopy_layer_coms.mod consts_coms.mod -canopy_struct_dynamics.o: ed_state_vars.mod met_driver_coms.mod pft_coms.mod -canopy_struct_dynamics.o: physiology_coms.mod rk4_coms.mod soil_coms.mod +canopy_struct_dynamics.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod +canopy_struct_dynamics.o: pft_coms.mod physiology_coms.mod rk4_coms.mod +canopy_struct_dynamics.o: soil_coms.mod disturbance.o: allometry.mod consts_coms.mod decomp_coms.mod disturb_coms.mod disturbance.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod disturbance.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod @@ -436,14 +456,13 @@ events.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod events.o: fuse_fiss_utils.mod grid_coms.mod pft_coms.mod therm_lib.mod farq_leuning.o: c34constants.mod consts_coms.mod pft_coms.mod phenology_coms.mod farq_leuning.o: physiology_coms.mod rk4_coms.mod therm_lib8.mod -fire.o: allometry.mod consts_coms.mod disturb_coms.mod ed_state_vars.mod -fire.o: grid_coms.mod soil_coms.mod +fire.o: allometry.mod consts_coms.mod disturb_coms.mod ed_misc_coms.mod +fire.o: ed_state_vars.mod grid_coms.mod soil_coms.mod forestry.o: allometry.mod disturb_coms.mod disturbance_utils.mod ed_max_dims.mod forestry.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod growth_balive.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod growth_balive.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -growth_balive.o: grid_coms.mod mortality.mod pft_coms.mod phenology_coms.mod -growth_balive.o: physiology_coms.mod +growth_balive.o: grid_coms.mod mortality.mod pft_coms.mod physiology_coms.mod heun_driver.o: canopy_air_coms.mod canopy_struct_dynamics.mod consts_coms.mod heun_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod @@ -453,42 +472,47 @@ lsm_hyd.o: grid_coms.mod hydrology_coms.mod hydrology_constants.mod pft_coms.mod lsm_hyd.o: soil_coms.mod therm_lib.mod mortality.o: consts_coms.mod disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod mortality.o: ed_state_vars.mod pft_coms.mod -phenology_aux.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_state_vars.mod -phenology_aux.o: ed_therm_lib.mod grid_coms.mod pft_coms.mod phenology_coms.mod -phenology_aux.o: soil_coms.mod +multiple_scatter.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +multiple_scatter.o: rk4_coms.mod +phenology_aux.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +phenology_aux.o: ed_state_vars.mod ed_therm_lib.mod grid_coms.mod pft_coms.mod +phenology_aux.o: phenology_coms.mod soil_coms.mod phenology_driv.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod phenology_driv.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod phenology_driv.o: grid_coms.mod pft_coms.mod phenology_coms.mod soil_coms.mod -photosyn_driv.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +photosyn_driv.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod photosyn_driv.o: ed_state_vars.mod farq_leuning.mod met_driver_coms.mod -photosyn_driv.o: pft_coms.mod physiology_coms.mod soil_coms.mod +photosyn_driv.o: pft_coms.mod phenology_coms.mod physiology_coms.mod +photosyn_driv.o: soil_coms.mod radiate_driver.o: allometry.mod canopy_layer_coms.mod canopy_radiation_coms.mod radiate_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod -radiate_driver.o: ed_state_vars.mod grid_coms.mod pft_coms.mod soil_coms.mod +radiate_driver.o: ed_state_vars.mod grid_coms.mod soil_coms.mod reproduction.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod reproduction.o: ed_state_vars.mod ed_therm_lib.mod fuse_fiss_utils.mod reproduction.o: grid_coms.mod mem_polygons.mod pft_coms.mod phenology_coms.mod rk4_derivs.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod rk4_derivs.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod -rk4_derivs.o: rk4_coms.mod soil_coms.mod therm_lib8.mod -rk4_driver.o: canopy_air_coms.mod canopy_struct_dynamics.mod consts_coms.mod -rk4_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod -rk4_driver.o: met_driver_coms.mod rk4_coms.mod soil_coms.mod therm_lib.mod +rk4_derivs.o: physiology_coms.mod rk4_coms.mod soil_coms.mod therm_lib8.mod +rk4_driver.o: allometry.mod canopy_air_coms.mod canopy_struct_dynamics.mod +rk4_driver.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod +rk4_driver.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod +rk4_driver.o: phenology_coms.mod rk4_coms.mod soil_coms.mod therm_lib.mod rk4_integ_utils.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod rk4_integ_utils.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod rk4_integ_utils.o: hydrology_coms.mod rk4_coms.mod rk4_stepper.mod soil_coms.mod rk4_integ_utils.o: therm_lib8.mod -rk4_misc.o: canopy_air_coms.mod canopy_struct_dynamics.mod consts_coms.mod -rk4_misc.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod -rk4_misc.o: grid_coms.mod rk4_coms.mod soil_coms.mod therm_lib8.mod +rk4_misc.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod +rk4_misc.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod grid_coms.mod +rk4_misc.o: rk4_coms.mod soil_coms.mod therm_lib8.mod rk4_stepper.o: ed_state_vars.mod grid_coms.mod rk4_coms.mod soil_coms.mod soil_respiration.o: consts_coms.mod decomp_coms.mod ed_state_vars.mod -soil_respiration.o: pft_coms.mod soil_coms.mod +soil_respiration.o: farq_leuning.mod pft_coms.mod physiology_coms.mod +soil_respiration.o: rk4_coms.mod soil_coms.mod structural_growth.o: allometry.mod consts_coms.mod decomp_coms.mod structural_growth.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod -structural_growth.o: ed_therm_lib.mod pft_coms.mod phenology_coms.mod -twostream_rad.o: canopy_layer_coms.mod canopy_radiation_coms.mod consts_coms.mod -twostream_rad.o: ed_max_dims.mod pft_coms.mod rk4_coms.mod +structural_growth.o: ed_therm_lib.mod pft_coms.mod +twostream_rad.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +twostream_rad.o: rk4_coms.mod vegetation_dynamics.o: consts_coms.mod disturb_coms.mod disturbance_utils.mod vegetation_dynamics.o: ed_misc_coms.mod ed_state_vars.mod fuse_fiss_utils.mod vegetation_dynamics.o: grid_coms.mod growth_balive.mod mem_polygons.mod @@ -515,7 +539,7 @@ ed_type_init.o: soil_coms.mod therm_lib.mod init_hydro_sites.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod init_hydro_sites.o: grid_coms.mod mem_polygons.mod soil_coms.mod landuse_init.o: consts_coms.mod disturb_coms.mod ed_max_dims.mod -landuse_init.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod +landuse_init.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod phenology_startup.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod phenology_startup.o: grid_coms.mod phenology_coms.mod average_utils.o: allometry.mod canopy_radiation_coms.mod consts_coms.mod @@ -609,8 +633,9 @@ dateutils.o: consts_coms.mod ed_filelist.o: ed_max_dims.mod ed_grid.o: consts_coms.mod ed_max_dims.mod ed_node_coms.mod grid_coms.mod ed_therm_lib.o: allometry.mod canopy_air_coms.mod consts_coms.mod -ed_therm_lib.o: ed_max_dims.mod ed_state_vars.mod grid_coms.mod pft_coms.mod -ed_therm_lib.o: rk4_coms.mod soil_coms.mod therm_lib.mod therm_lib8.mod +ed_therm_lib.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +ed_therm_lib.o: pft_coms.mod rk4_coms.mod soil_coms.mod therm_lib.mod +ed_therm_lib.o: therm_lib8.mod fatal_error.o: ed_node_coms.mod fuse_fiss_utils.o: allometry.mod canopy_layer_coms.mod consts_coms.mod fuse_fiss_utils.o: decomp_coms.mod disturb_coms.mod ed_max_dims.mod @@ -622,8 +647,8 @@ hdf5_utils.o: hdf5_coms.mod invmondays.o: ed_misc_coms.mod lapse.o: consts_coms.mod ed_misc_coms.mod ed_state_vars.mod met_driver_coms.mod numutils.o: consts_coms.mod therm_lib.mod -radiate_utils.o: canopy_radiation_coms.mod consts_coms.mod ed_misc_coms.mod -radiate_utils.o: ed_state_vars.mod met_driver_coms.mod +radiate_utils.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +radiate_utils.o: ed_misc_coms.mod ed_state_vars.mod met_driver_coms.mod stable_cohorts.o: ed_max_dims.mod ed_state_vars.mod pft_coms.mod stable_cohorts.o: phenology_coms.mod therm_lib.o: consts_coms.mod @@ -632,9 +657,11 @@ update_derived_props.o: allometry.mod canopy_air_coms.mod consts_coms.mod update_derived_props.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod update_derived_props.o: fuse_fiss_utils.mod grid_coms.mod soil_coms.mod update_derived_props.o: therm_lib.mod +adv_message_mod.mod: adv_message_mod.o advect_kit.mod: mod_advect_kit.o allometry.mod: allometry.o an_header.mod: an_header.o +boundary_mod.mod: boundary_mod.o c34constants.mod: c34constants.o canopy_air_coms.mod: canopy_air_coms.o canopy_layer_coms.mod: canopy_layer_coms.o @@ -660,6 +687,7 @@ ed_var_tables.mod: ed_var_tables.o ed_work_vars.mod: ed_work_vars.o emission_source_map.mod: emission_source_map.o ename_coms.mod: ename_coms.o +error_mod.mod: error_mod.o extras.mod: extra.o farq_leuning.mod: farq_leuning.o fuse_fiss_utils.mod: fuse_fiss_utils.o @@ -667,6 +695,7 @@ fusion_fission_coms.mod: fusion_fission_coms.o grell_coms.mod: grell_coms.o grid_coms.mod: grid_coms.o grid_dims.mod: grid_dims.o +grid_mod.mod: grid_mod.o grid_struct.mod: grid_struct.o growth_balive.mod: growth_balive.o harr_coms.mod: harr_coms.o @@ -674,6 +703,7 @@ hdf5_coms.mod: hdf5_coms.o hdf5_utils.mod: hdf5_utils.o hydrology_coms.mod: hydrology_coms.o hydrology_constants.mod: hydrology_constants.o +init_advect.mod: init_advect.o io_params.mod: io_params.o isan_coms.mod: isan_coms.o ke_coms.mod: ke_coms.o @@ -684,6 +714,7 @@ libxml2f90_module.mod: libxml2f90.f90_pp.o libxml2f90_strings_module.mod: libxml2f90.f90_pp.o ll_module.mod: libxml2f90.f90_pp.o machine_arq.mod: machine_arq.o +mapmod.mod: MapMod.o mem_aerad.mod: mem_aerad.o mem_all.mod: mem_all.o mem_basic.mod: mem_basic.o @@ -731,6 +762,7 @@ micphys.mod: micphys.o micro_coms.mod: micro_coms.o mod_ghostblock.mod: mod_GhostBlock.o mod_ghostblockpartition.mod: mod_GhostBlockPartition.o +monotonic_adv.mod: radvc_mnt.o mortality.mod: mortality.o node_mod.mod: node_mod.o obs_input.mod: obs_input.o @@ -741,6 +773,7 @@ phenology_coms.mod: phenology_coms.o phenology_startup.mod: phenology_startup.o physiology_coms.mod: physiology_coms.o plume_utils.mod: plumerise_vector.o +processor_mod.mod: processor_mod.o rad_carma.mod: rad_carma.o rconstants.mod: rconstants.o ref_sounding.mod: ref_sounding.o diff --git a/BRAMS/build/bin/objects.mk b/BRAMS/build/bin/objects.mk index 64248ac72..8eb3de73c 100644 --- a/BRAMS/build/bin/objects.mk +++ b/BRAMS/build/bin/objects.mk @@ -336,6 +336,7 @@ OBJ_MODEL = \ mem_polygons.o \ met_driver_coms.o \ mortality.o \ + multiple_scatter.o \ optimiz_coms.o \ phenology_aux.o \ phenology_coms.o \ diff --git a/BRAMS/build/bin/rules.mk b/BRAMS/build/bin/rules.mk index 3bb72a648..7c78543c3 100644 --- a/BRAMS/build/bin/rules.mk +++ b/BRAMS/build/bin/rules.mk @@ -1659,6 +1659,11 @@ mortality.o : $(ED_DYNAMICS)/mortality.f90 $(F90_COMMAND) $(= 3, then the middle ones will necessarily use Grell's ! ! parameterization. ! !---------------------------------------------------------------------------------------! - NCLOUDS = 2, + NCLOUDS = 2, !---------------------------------------------------------------------------------------! @@ -957,7 +972,7 @@ $CUPARM_OPTIONS !---------------------------------------------------------------------------------------! ! The following variables are scalars. ! !---------------------------------------------------------------------------------------! - CLD2PREC = 0.002, ! Ratio of conversion of condensates to precipitation. [ ---] + CLD2PREC = 0.001, ! Ratio of conversion of condensates to precipitation. [ ---] ZKBMAX = 4000., ! Maximum AGL height in which updrafts can originate. [ m] ZCUTDOWN = 3000., ! Maximum AGL height in which downdrafts can originate. [ m] Z_DETR = 1250., ! Top of the downdraft detrainment layer [ m] @@ -1220,18 +1235,17 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! ! ISTAR -- Similarity theory model. The model that computes u*, T*, etc... Used by ! ! both LEAF-3 and ED-2. ! - ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! - ! estimate the flux based on the bulk Richardson number ! - ! 2. Oncley and Dudhia (1995) model, based on MM5. It uses an empirical ! - ! relation between bulk Richardson number and z/L, then computes the flux ! - ! functions. ! - ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it finds z/L using a ! - ! root-finding method, and it has a different parametrisation for stable ! - ! layers that works better during night time. ! - ! 4. The parametrisation of Beljaars and Holtslag, but using z/L estimation as ! - ! in Oncley and Dudhia. ! - ! 5. The parametrisation of Oncley and Dudhia, but using z/L estimation as in ! - ! Beljaars and Holtslag. ! + ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! + ! estimate the flux based on the bulk Richardson number ! + ! ! + ! All models below use an interative method to find z/L, and the only change ! + ! is the functional form of the psi functions. ! + ! ! + ! 2. Oncley and Dudhia (1995) model, based on MM5. ! + ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it uses an alternative ! + ! method for the stable case that mixes more than the OD95. ! + ! 4. CLM (2004). Similar to 2 and 3, but they have special functions to deal with ! + ! very stable and very stable cases. ! !------------------------------------------------------------------------------------! ISTAR = 3, !------------------------------------------------------------------------------------! @@ -1248,6 +1262,7 @@ $MODEL_OPTIONS ! 2. Test # 2 of Mahfouf and Noilhan (1991) ! ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! ! 4. Test # 4 of Mahfouf and Noilhan (1991) ! + ! 5. Combination of test #1 (alpha) and test #2 (soil resistance). ! ! In all cases the beta term is modified so it approaches zero as soil moisture ! ! goes to dry air soil. ! !------------------------------------------------------------------------------------! @@ -1258,10 +1273,19 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! - ! USTMIN -- minimum friction velocity, u*, in m/s. ! - !------------------------------------------------------------------------------------! - USTMIN = 0.01, - !------------------------------------------------------------------------------------! + ! The following variables control the minimum values of various velocities in ! + ! the canopy. This is needed to avoid the air to be extremely still, or to avoid ! + ! singularities. When defining the values, keep in mind that ! + ! UBMIN >= UGBMIN >= USTMIN. ! + ! ! + ! UBMIN -- minimum wind speed at the top of the canopy air space [ m/s] ! + ! UGBMIN -- minimum wind speed at the leaf level [ m/s] ! + ! USTMIN -- minimum friction velocity, u*, in m/s. [ m/s] ! + !---------------------------------------------------------------------------------------! + UBMIN = 0.65, + UGBMIN = 0.25, + USTMIN = 0.05, + !---------------------------------------------------------------------------------------! @@ -1275,18 +1299,12 @@ $MODEL_OPTIONS ! Ignored when ISTAR = 1 ! ! TPRANDTL -- Turbulent Prandtl number ! ! Ignored when ISTAR = 1 ! - ! VH2VR -- Ratio between vegetation roughness and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! - ! VH2DH -- Ratio between 0-plane displacement height and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! ! RIBMAX -- maximum bulk Richardson number. ! !------------------------------------------------------------------------------------! GAMM = 13., GAMH = 13., TPRANDTL = 0.74, - VH2VR = 0.13, - VH2DH = 0.63, - RIBMAX = 1.00, + RIBMAX = 0.50, !------------------------------------------------------------------------------------! @@ -1315,7 +1333,7 @@ $MODEL_OPTIONS ! or 1, only the first value will be considered, and if ICO2=2, then ! ! provide one value per level. Unit here is ĩmol/mol. ! !------------------------------------------------------------------------------------! - ICO2 = 1, + ICO2 = 0, CO2CON = 380., !------------------------------------------------------------------------------------! @@ -1352,20 +1370,53 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! - ! NSLCON -- LEAF-3 and ED-2 Soil classes that the model will use when ISOILFLG is ! - ! set to 2. Possible values are: ! + ! NSLCON -- LEAF-3 and ED-2 soil texture classes that the model will use when ! + ! ISOILFLG is set to 2. Possible values are: ! !------------------------------------------------------------------------------------! ! 1 -- sand | 7 -- silty clay loam | 13 -- bedrock ! ! 2 -- loamy sand | 8 -- clayey loam | 14 -- silt ! ! 3 -- sandy loam | 9 -- sandy clay | 15 -- heavy clay ! - ! 4 -- silt loam | 10 -- silty clay | 16 -- clayey sand ! + ! 4 -- silty loam | 10 -- silty clay | 16 -- clayey sand ! ! 5 -- loam | 11 -- clay | 17 -- clayey silt ! ! 6 -- sandy clay loam | 12 -- peat ! !------------------------------------------------------------------------------------! - NSLCON = 8, + NSLCON = 16, !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! ISOILCOL -- LEAF-3 and ED-2 soil colour classes that the model will use when ! + ! ISOILFLG is set to 2. Soil classes are from 1 to 20 (1 = lightest; ! + ! 20 = darkest). The values are the same as CLM-4.0. The table is the ! + ! albedo for visible and near infra-red. ! + !------------------------------------------------------------------------------------! + ! ! + ! |-----------------------------------------------------------------------| ! + ! | | Dry soil | Saturated | | Dry soil | Saturated | ! + ! | Class |-------------+-------------| Class +-------------+-------------| ! + ! | | VIS | NIR | VIS | NIR | | VIS | NIR | VIS | NIR | ! + ! |-------+------+------+------+------+-------+------+------+------+------| ! + ! | 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | ! + ! | 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | ! + ! | 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | ! + ! | 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | ! + ! | 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | ! + ! | 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | ! + ! | 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | ! + ! | 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | ! + ! | 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | ! + ! | 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | ! + ! |-----------------------------------------------------------------------| ! + ! ! + ! Soil type 21 is a special case in which we use the albedo method that used to be ! + ! the default in BRAMS-4.0.6 and ED-2.1. ! + !------------------------------------------------------------------------------------! + ISOILCOL = 2, + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! ! ZROUGH -- constant roughness, in metres, if for all domain ! ! ALBEDO -- constant albedo (fraction) if not running soil model ! @@ -1453,21 +1504,6 @@ $MODEL_OPTIONS - !------------------------------------------------------------------------------------! - ! These variables were included for sensitivity analysis, they will be eventually ! - ! removed. They are currently used for both LEAF-3 and ED-2. ! - ! ! - ! BETAPOWER -- power to apply in the ground evaporation model (see IGRNDVAP ! - ! references). Default value is 1.0. ! - ! GGFACT -- factor to multiply the ground to canopy conductance. Default value ! - ! is 1.0. ! - !------------------------------------------------------------------------------------! - BETAPOWER = 1., - GGFACT = 1.0, - !------------------------------------------------------------------------------------! - - - !------------------------------------------------------------------------------------! ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Both ! @@ -1503,7 +1539,7 @@ $MODEL_OPTIONS ! 2. Soil conductivity decreases with depth even for constant soil ! ! moisture, otherwise it is the same as 1. ! !------------------------------------------------------------------------------------! - IPERCOL = 1, + IPERCOL = 0, !------------------------------------------------------------------------------------! @@ -1796,7 +1832,7 @@ $ED2_INFO ! If time is a problem, i.e., the runs are too slow, then try making it ! ! larger, but not much larger so to avoid problems... ! !---------------------------------------------------------------------------------------! - DTLSM = 600.0, + DTLSM = 240.0, !---------------------------------------------------------------------------------------! @@ -1829,7 +1865,7 @@ $ED2_INFO IFOUTPUT = 0, IDOUTPUT = 0, IMOUTPUT = 0, - IQOUTPUT = 0, + IQOUTPUT = 3, IYOUTPUT = 0, ITOUTPUT = 0, ISOUTPUT = 0, @@ -1970,7 +2006,7 @@ $ED2_INFO SOIL_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/faoOLD/FAO_', LU_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/land_use/glu/glu-', PLANTATION_FILE = '', - LU_RESCALE_FILE = '', + LU_RESCALE_FILE = '/n/Moorcroft_Lab/Lab/data/ed2_data/21restart/rescale/SA1relative.lu.area-22km-2038.txt', THSUMS_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/ed_inputs/', !---------------------------------------------------------------------------------------! @@ -2007,6 +2043,20 @@ $ED2_INFO + !---------------------------------------------------------------------------------------! + ! IVEGT_DYNAMICS -- The vegetation dynamics scheme. ! + ! 0. No vegetation dynamics, the initial state will be preserved, ! + ! even though the model will compute the potential values. This ! + ! option is useful for theoretical simulations only. ! + ! 1. Normal ED vegetation dynamics (Moorcroft et al 2001). ! + ! The normal option for almost any simulation. ! + !---------------------------------------------------------------------------------------! + IVEGT_DYNAMICS = 1, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! INTEGRATION_SCHEME -- The biophysics integration scheme. ! ! 0. Euler step. The fastest, but it doesn't estimate ! @@ -2027,7 +2077,7 @@ $ED2_INFO ! between 1.e-7 and 1.e-1, but recommended values are between 1.e-4 ! ! and 1.e-2. ! !---------------------------------------------------------------------------------------! - RK4_TOLERANCE = 0.001, + RK4_TOLERANCE = 0.01, !---------------------------------------------------------------------------------------! @@ -2035,13 +2085,13 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! IBRANCH_THERMO -- This determines whether branches should be included in the ! - ! vegetation thermodynamics and radiation or not. This is under ! - ! development, not fully tested, so we suggest leaving it as 0. ! - ! Options are: ! - ! 0. No branches in energy/radiation; ! - ! 1. Use Conijn (1995) numbers; ! - ! 2. Use parameterization from Jarvela (2004); ! - ! 3. Use the same allometry as Ahrends et al. (2010) ! + ! vegetation thermodynamics and radiation or not. ! + ! 0. No branches in energy/radiation (ED-2.1 default); ! + ! 1. Branches are accounted in the energy and radiation. Branchwood ! + ! and leaf are treated separately in the canopy radiation scheme, ! + ! but solved as a single pool in the biophysics integration. ! + ! 2. Similar to 1, but branches are treated as separate pools in the ! + ! biophysics (thus doubling the number of prognostic variables). ! !---------------------------------------------------------------------------------------! IBRANCH_THERMO = 0, !---------------------------------------------------------------------------------------! @@ -2073,29 +2123,23 @@ $ED2_INFO - !---------------------------------------------------------------------------------------! - ! ISTOMA_SCHEME -- This is the scheme used to compute stomatal conductance and ! - ! photosynthesis. ! - ! 0. Full, exact calculation each time. ! - ! 1. (defunct) 'small perturbation' scheme. ! - !---------------------------------------------------------------------------------------! - ISTOMA_SCHEME = 0, - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! IALLOM -- Which allometry to use (this affects tropical PFTs only) ! + ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs. Temperate PFTs ! + ! will use the new root allometry and the maximum crown area if IALLOM is set ! + ! to 1 or 2). ! ! 0. Original ED-2.1 ! - ! 1. Baker et al. (2004), equation 2, keeping the same balive:bdead ratio ! - ! 2. Baker et al. (2004), equation 2, keeping the same balive as in ED-2.1 ! - ! 3. Same as 2, but using a DBH-> Root depth equation based on ! - ! Kenzo et al. (2009) for a secondary forest in Malaysia. Roots will ! - ! be shallow, though... ! - ! 4. Same as 2, but with an experimental root depth that makes canopy trees ! - ! to have root depths of 5m and grasses/seedlings at 0.5 to have root ! - ! depth of 0.5 m. ! + ! 1. a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004), equation 2. Balive is the ! + ! default ED-2.1; ! + ! b. Experimental root depth that makes canopy trees to have root depths ! + ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! + ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! + ! crown area ! + ! 2. Similar to 1, but with a few extra changes. ! + ! a. Height -> DBH allometry as in Poorter et al. (2006) ! + ! b. Balive is retuned, using a few leaf biomass allometric equations for ! + ! a few genuses in Costa Rica. References: ! + ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! !---------------------------------------------------------------------------------------! IALLOM = 2, !---------------------------------------------------------------------------------------! @@ -2186,28 +2230,51 @@ $ED2_INFO ! cohorts are stacked on the top of each other. ! ! 1. Dietze (2008) model. Cohorts have a finite radius, and cohorts are ! ! stacked on the top of each other. ! - ! 2. Cohorts have a finite radius with horizontal, but they are no longer ! - ! organised by cohort index. Instead, cohorts of the same height ! - ! compete for light as the radiation is solved layer by layer rather ! - ! than cohort by cohort. This is still under development, ideas are ! - ! welcome. ! !---------------------------------------------------------------------------------------! CROWN_MOD = 1, !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! ICAN_SWRAD -- This variable specifies which canopy radiation model to use for short- ! - ! wave radiation within the canopy: ! - ! 0. Beers law. Added back just for theroretical tests, don't use it if ! - ! you are unsure. This cannot be used with CROWN_MOD = 2. ! - ! 1. Two-stream model. The default and recommended method. ! + ! The following variables control the canopy radiation solver. ! ! ! - ! In either case longwave will be solved using two-stream model. ! + ! ICANRAD -- Specifies how canopy radiation is solved. This variable sets both ! + ! shortwave and longwave. ! + ! 0. Two-stream model (Medvigy 2006), with the possibility to apply ! + ! finite crown area to direct shortwave radiation. ! + ! 1. Multiple-scattering model (Zhao and Qualls 2005,2006), with the ! + ! possibility to apply finite crown area to all radiation fluxes. ! + ! LTRANS_VIS -- Leaf transmittance for tropical plants - Visible/PAR ! + ! LTRANS_NIR -- Leaf transmittance for tropical plants - Near Infrared ! + ! LREFLECT_VIS -- Leaf reflectance for tropical plants - Visible/PAR ! + ! LREFLECT_NIR -- Leaf reflectance for tropical plants - Near Infrared ! + ! ORIENT_TREE -- Leaf orientation factor for tropical trees. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! ORIENT_GRASS -- Leaf orientation factor for tropical grasses. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! CLUMP_TREE -- Clumping factor for tropical trees. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + ! CLUMP_GRASS -- Clumping factor for tropical grasses. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! !---------------------------------------------------------------------------------------! - ICAN_SWRAD = 1, + ICANRAD = 0, + LTRANS_VIS = 0.028, + LTRANS_NIR = 0.248, + LREFLECT_VIS = 0.062, + LREFLECT_NIR = 0.630, + ORIENT_TREE = 0.250, + ORIENT_GRASS = -0.300, + CLUMP_TREE = 1.000, + CLUMP_GRASS = 1.000, !---------------------------------------------------------------------------------------! @@ -2226,46 +2293,107 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! H2O_PLANT_LIM -- this determines whether plant photosynthesis can be limited by ! - ! soil moisture, the FSW term: ! - ! 0. No soil moisture limitation, FSW = 1 ! - ! 1. Original ED-1.0/ED-2.0 method, where ! - ! FSW = Supply / (Demand + Supply) ! + ! soil moisture, the FSW, defined as FSW = Supply / (Demand + Supply). ! + ! ! + ! Demand is always the transpiration rates in case soil moisture is ! + ! not limiting (the psi_0 term). The supply is determined differently ! + ! depending on the H2O_PLANT_LIM flag: ! + ! 0. Supply = Infinity (FSW = 1). ! + ! 1. Supply = Kw * ! ! 2. Alternative and experimental method based on CLM. It checks ! ! the water potential only, with all contribution of transpiration ! ! accounted by gsw. It also ignores root biomass. ! + ! 3. Tentative method. FSW = 1, but D0 decays exponentially with ! + ! soil potential. The decay coefficient is a function of the ! + ! ratio between leaves and root when on-allometry, so plants that ! + ! invest more in roots take advantage. ! !---------------------------------------------------------------------------------------! H2O_PLANT_LIM = 1, !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! - ! These following variables are factors that multiply some of the ED-2.1 default ! - ! parameters. Setting them to 1.0 will make them the default. These are applied ! - ! mostly to tropical C3 plants. ! - ! ! - ! VMFACT -- Factor multiplying the default Vm0 ! - ! MFACT -- Factor multiplying the stomatal slope M. ! - ! KFACT -- Factor multiplying the water conductance Kw. This is used only when ! - ! H2O_PLANT_LIM = 1. ! - ! GAMFACT -- Factor multiplying the dark respiration factor (gamma) ! - ! D0FACT -- Factor multiplying the transpiration control in gsw (D0) ! - ! ALPHAFACT -- Factor for changing the quantum yield of C3 plants. This is only ! - ! applied when QUANTUM_EFFICIENCY_T = 0. ! - ! THETACRIT -- Leaf drought phenology threshold. This is the relative soil moisture ! - ! above the wilting point below which the drought-deciduous plants will ! - ! start shedding their leaves ! - ! LWFACT -- Factor for changing the leaf width (w) ! - ! THIOFF -- Offset to be added to the Vm_high_temp ! - !---------------------------------------------------------------------------------------! - VMFACT = 1.6, - MFACT = 1.0, - KFACT = 3.0, - GAMFACT = 0.75, - D0FACT = 1.20, - ALPHAFACT = 0.875, - THETACRIT = 0.20, - LWFACT = 1.0, - THIOFF = 0.0, + ! The following variables are factors that control photosynthesis and respiration. ! + ! Notice that some of them are relative values whereas others are absolute. ! + ! ! + ! VMFACT_C3 -- Factor multiplying the default Vm0 for C3 plants (1.0 = default). ! + ! VMFACT_C4 -- Factor multiplying the default Vm0 for C4 plants (1.0 = default). ! + ! MPHOTO_TRC3 -- Stomatal slope (M) for tropical C3 plants ! + ! MPHOTO_TEC3 -- Stomatal slope (M) for conifers and temperate C3 plants ! + ! MPHOTO_C4 -- Stomatal slope (M) for C4 plants. ! + ! BPHOTO_BLC3 -- cuticular conductance for broadleaf C3 plants [umol/m2/s] ! + ! BPHOTO_NLC3 -- cuticular conductance for needleleaf C3 plants [umol/m2/s] ! + ! BPHOTO_C4 -- cuticular conductance for C4 plants [umol/m2/s] ! + ! KW_GRASS -- Water conductance for trees, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! KW_TREE -- Water conductance for grasses, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! GAMMA_C3 -- The dark respiration factor (gamma) for C3 plants. Subtropical ! + ! conifers will be scaled by GAMMA_C3 * 0.028 / 0.02 ! + ! GAMMA_C4 -- The dark respiration factor (gamma) for C4 plants. ! + ! D0_GRASS -- The transpiration control in gsw (D0) for ALL grasses. ! + ! D0_TREE -- The transpiration control in gsw (D0) for ALL trees. ! + ! ALPHA_C3 -- Quantum yield of ALL C3 plants. This is only applied when ! + ! QUANTUM_EFFICIENCY_T = 0. ! + ! ALPHA_C4 -- Quantum yield of C4 plants. This is always applied. ! + ! KLOWCO2IN -- The coefficient that controls the PEP carboxylase limited rate of ! + ! carboxylation for C4 plants. ! + ! RRFFACT -- Factor multiplying the root respiration factor for ALL PFTs. ! + ! (1.0 = default). ! + ! GROWTHRESP -- The actual growth respiration factor (C3/C4 tropical PFTs only). ! + ! (1.0 = default). ! + ! LWIDTH_GRASS -- Leaf width for grasses, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). ! + ! LWIDTH_BLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to broadleaf trees ! + ! only. ! + ! LWIDTH_NLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to conifer trees ! + ! only. ! + ! Q10_C3 -- Q10 factor for C3 plants (used only if IPHYSIOL is set to 2 or 3). ! + ! Q10_C4 -- Q10 factor for C4 plants (used only if IPHYSIOL is set to 2 or 3). ! + !---------------------------------------------------------------------------------------! + VMFACT_C3 = 1.25, + VMFACT_C4 = 1.00, + MPHOTO_TRC3 = 9.0, + MPHOTO_TEC3 = 7.2, + MPHOTO_C4 = 5.0, + BPHOTO_BLC3 = 10000., + BPHOTO_NLC3 = 1000., + BPHOTO_C4 = 8000., + KW_GRASS = 300., + KW_TREE = 300., + GAMMA_C3 = 0.015, + GAMMA_C4 = 0.036, + D0_GRASS = 0.015, + D0_TREE = 0.015, + ALPHA_C3 = 0.080, + ALPHA_C4 = 0.053, + KLOWCO2IN = 4000., + RRFFACT = 1.000, + GROWTHRESP = 0.33333333333, + LWIDTH_GRASS = 0.05, + LWIDTH_BLTREE = 0.10, + LWIDTH_NLTREE = 0.05, + Q10_C3 = 2.4, + Q10_C4 = 2.4, + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! THETACRIT -- Leaf drought phenology threshold. The sign matters here: ! + ! >= 0. -- This is the relative soil moisture above the wilting point ! + ! below which the drought-deciduous plants will start shedding ! + ! their leaves ! + ! < 0. -- This is the soil potential in MPa below which the drought- ! + ! -deciduous plants will start shedding their leaves. The wilt- ! + ! ing point is by definition -1.5MPa, so make sure that the value ! + ! is above -1.5. ! + !---------------------------------------------------------------------------------------! + THETACRIT = -0.75, !---------------------------------------------------------------------------------------! @@ -2313,12 +2441,16 @@ $ED2_INFO ! often will never allow fires. ! ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! - ! SM_FIRE -- Threshold to define the relative soil moisture above dry air of the ! - ! top 75cm that will trigger fires. Used only when include_fire is ! - ! set to 2. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2. The sign here matters. ! + ! >= 0. - Minimum relative soil moisture above dry air of the top 75cm ! + ! that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top 75 cm ! + ! that will prevent fires to happen. The dry air soil ! + ! potential is defined as -3.1 MPa, so make sure SM_FIRE is ! + ! greater than this value. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, - SM_FIRE = 0.11, + SM_FIRE = -1.40, !---------------------------------------------------------------------------------------! @@ -2346,23 +2478,10 @@ $ED2_INFO ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! ! the drag and sheltering within the canopy. ! + ! 4. Same as 0, but if finds the ground conductance following CLM ! + ! technical note (equations 5.98-5.100). ! !---------------------------------------------------------------------------------------! - ICANTURB = 3, - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! I_BLYR_CONDCT -- This flag controls the boundary layer conductance. This is for ! - ! tests only and should be removed soon, so unless you know what you ! - ! are doing, leave it as zero. ! - ! 0. The Nusselt number for forced convection is estimated using the ! - ! average winds, with no corrections ! - ! 1. The actual Nusselt number for forced convection is multiplied by ! - ! 2.5 as the Reynolds number gets close or greater than 10,000. ! - ! 2. The actual Nusselt number for forced convection is multiplied by ! - ! 10. as the Reynolds number gets close or greater than 10,000. ! - !---------------------------------------------------------------------------------------! - I_BLYR_CONDCT = 0, + ICANTURB = 2, !---------------------------------------------------------------------------------------! @@ -2388,7 +2507,7 @@ $ED2_INFO ! 7 - southern pines | 17 - "Araucaria" (non-optimised ! ! 8 - late conifers | Southern Pines). ! !---------------------------------------------------------------------------------------! - INCLUDE_THESE_PFT = 1,2,3,4,16,17 + INCLUDE_THESE_PFT = 1,2,3,4,16,17, AGRI_STOCK = 1, PLANTATION_STOCK = 3, !---------------------------------------------------------------------------------------! @@ -2423,7 +2542,7 @@ $ED2_INFO ! cohorts are too different, then the actual number of cohorts in a patch ! ! may exceed MAXCOHORT. ! !---------------------------------------------------------------------------------------! - MAXPATCH = 20, + MAXPATCH = 15, MAXCOHORT = 100, !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/catt/emission_source_map.f90 b/BRAMS/src/catt/emission_source_map.f90 index 636867d21..0fc3c2fe5 100644 --- a/BRAMS/src/catt/emission_source_map.f90 +++ b/BRAMS/src/catt/emission_source_map.f90 @@ -1,10 +1,10 @@ module emission_source_map - + use grid_dims, only : str_len integer :: nvar,nlat,nlon real :: lonW,latS,dlon,dlat - character(len=256) :: FIREMAPFN - character(len=256) :: TRACERSFN + character(len=str_len) :: FIREMAPFN + character(len=str_len) :: TRACERSFN integer, parameter :: nsources=3, ngases=4, nplumesource=12, nz_orig=50 character(LEN=10),dimension(ngases),parameter :: gas=(/'CO ', & @@ -44,12 +44,13 @@ subroutine read_emission_sources_map() use mem_grid_dim_defs, only: nmxp, nmyp, nmzp ! intent(in) use mem_scalar, only: scalar_g ! intent(inout) use extras, only: extra3d ! intent(inout) - + use grid_dims, only : str_len + implicit none ! Local Variables: !character(len=14), parameter :: define_proc='last_sources' - character(len=256) :: fname + character(len=str_len) :: fname character(len=2) :: cgrid character(len=10) :: tracer logical :: there @@ -358,6 +359,7 @@ end subroutine read_emission_sources_map !---------------------------------------------------------------------- subroutine read_sources_plume(plumerise, fname, plume, qsc_orig) + use grid_dims, only : str_len implicit none ! Arguments: @@ -367,9 +369,9 @@ subroutine read_sources_plume(plumerise, fname, plume, qsc_orig) real, pointer :: qsc_orig(:,:,:) ! Local Variables: - integer :: iunit, ifname, i - character(len=128) :: cmessage - character(len=9) :: date + integer :: iunit, ifname, i + character(len=str_len) :: cmessage + character(len=9) :: date iunit=2 IFname=len_trim(fname) diff --git a/BRAMS/src/cuparm/mem_cuparm.f90 b/BRAMS/src/cuparm/mem_cuparm.f90 index 06abe7760..fbd6c9443 100644 --- a/BRAMS/src/cuparm/mem_cuparm.f90 +++ b/BRAMS/src/cuparm/mem_cuparm.f90 @@ -108,17 +108,17 @@ module mem_cuparm ! Miscellaneous parameters ! !---------------------------------------------------------------------------------------! !----- Parameters for inverse cumulus --------------------------------------------------! - integer , parameter :: maxcufiles=100, maxcugrids=10 - integer :: if_cuinv - real(kind=8) :: tcu_beg,tcu_end - real :: cu_til,cu_tel,tnudcu - real , dimension(maxcugrids) :: wt_cu_grid - character(len=128) :: cu_prefix - character(len=128), dimension(maxcufiles) :: fnames_cu - character(len=14) , dimension(maxcufiles) :: itotdate_cu - real(kind=8) , dimension(maxcufiles) :: cu_times - integer :: ncufiles,ncufl - real(kind=8) :: cutime1,cutime2 + integer , parameter :: maxcufiles=100, maxcugrids=10 + integer :: if_cuinv + real(kind=8) :: tcu_beg,tcu_end + real :: cu_til,cu_tel,tnudcu + real , dimension(maxcugrids) :: wt_cu_grid + character(len=str_len) :: cu_prefix + character(len=str_len), dimension(maxcufiles) :: fnames_cu + character(len=14) , dimension(maxcufiles) :: itotdate_cu + real(kind=8) , dimension(maxcufiles) :: cu_times + integer :: ncufiles,ncufl + real(kind=8) :: cutime1,cutime2 !----- Parameter for Kuo parameterization ----------------------------------------------! real :: wcldbs ! Minimum vertical velocity trigger. !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/ed2/edcp_driver.f90 b/BRAMS/src/ed2/edcp_driver.f90 index fd7d244ba..399b01964 100644 --- a/BRAMS/src/ed2/edcp_driver.f90 +++ b/BRAMS/src/ed2/edcp_driver.f90 @@ -20,7 +20,6 @@ subroutine ed_coup_driver() , imoutput & ! intent(in) , iqoutput & ! intent(in) , iyoutput & ! intent(in) - , integration_scheme & ! intent(in) , runtype ! ! intent(in) use ed_work_vars , only : ed_dealloc_work & ! subroutine , work_e ! ! intent(inout) @@ -435,9 +434,20 @@ subroutine set_polygon_coordinates_edcp() !----- The polygon co-ordinates. -------------------------------------------------! cgrid%lon(ipy) = work_v(ifm)%glon(ipy) cgrid%lat(ipy) = work_v(ifm)%glat(ipy) + !---------------------------------------------------------------------------------! + + !----- Soil texture class. -------------------------------------------------------! cgrid%ntext_soil(1:nzg,ipy) = work_v(ifm)%ntext(1,ipy) + !---------------------------------------------------------------------------------! + + + + !----- Soil colour class. --------------------------------------------------------! + cgrid%ncol_soil(ipy) = work_v(ifm)%nscol(ipy) + !---------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------! @@ -450,6 +460,8 @@ subroutine set_polygon_coordinates_edcp() cgrid%ilat(ipy) = work_v(ifm)%yid(ipy) !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! ! xatm and yatm have the global indexing for diagnostics purposes. ! !---------------------------------------------------------------------------------! diff --git a/BRAMS/src/ed2/edcp_init.f90 b/BRAMS/src/ed2/edcp_init.f90 index 22724b1c8..c08638fa6 100644 --- a/BRAMS/src/ed2/edcp_init.f90 +++ b/BRAMS/src/ed2/edcp_init.f90 @@ -357,7 +357,8 @@ subroutine init_master_work(ipara) work_e(ifm)%work (il,jl) = 0. work_e(ifm)%land (il,jl) = .false. work_e(ifm)%landfrac(il,jl) = 0. - work_e(ifm)%ntext (:,il,jl) = 0. + work_e(ifm)%nscol (il,jl) = 0 + work_e(ifm)%ntext (:,il,jl) = 0 work_e(ifm)%soilfrac(:,il,jl) = 0. !---------------------------------------------------------------------------! end do iloop @@ -413,10 +414,12 @@ subroutine init_master_work(ipara) ,70,MPI_COMM_WORLD,ierr) call MPI_Send(work_e(ifm)%yatm , xmax*ymax,MPI_INTEGER,machnum(nm) & ,71,MPI_COMM_WORLD,ierr) - call MPI_Send(work_e(ifm)%ntext ,maxsite*xmax*ymax,MPI_INTEGER,machnum(nm) & + call MPI_Send(work_e(ifm)%nscol , xmax*ymax,MPI_INTEGER,machnum(nm) & ,72,MPI_COMM_WORLD,ierr) - call MPI_Send(work_e(ifm)%soilfrac,maxsite*xmax*ymax,MPI_REAL ,machnum(nm) & + call MPI_Send(work_e(ifm)%ntext ,maxsite*xmax*ymax,MPI_INTEGER,machnum(nm) & ,73,MPI_COMM_WORLD,ierr) + call MPI_Send(work_e(ifm)%soilfrac,maxsite*xmax*ymax,MPI_REAL ,machnum(nm) & + ,74,MPI_COMM_WORLD,ierr) !------------------------------------------------------------------------------! ! De-allocate the internal matrices, so we can re-allocate them for the ! @@ -551,10 +554,12 @@ subroutine init_node_work() ,mainnum,70,MPI_COMM_WORLD,status,ierr) call MPI_Recv(work_e(ifm)%yatm , mmxp(ifm)*mmyp(ifm),MPI_INTEGER & ,mainnum,71,MPI_COMM_WORLD,status,ierr) - call MPI_Recv(work_e(ifm)%ntext ,maxsite*mmxp(ifm)*mmyp(ifm),MPI_INTEGER & + call MPI_Recv(work_e(ifm)%nscol , mmxp(ifm)*mmyp(ifm),MPI_INTEGER & ,mainnum,72,MPI_COMM_WORLD,status,ierr) - call MPI_Recv(work_e(ifm)%soilfrac,maxsite*mmxp(ifm)*mmyp(ifm),MPI_REAL & + call MPI_Recv(work_e(ifm)%ntext ,maxsite*mmxp(ifm)*mmyp(ifm),MPI_INTEGER & ,mainnum,73,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_e(ifm)%soilfrac,maxsite*mmxp(ifm)*mmyp(ifm),MPI_REAL & + ,mainnum,74,MPI_COMM_WORLD,status,ierr) write(unit=*,fmt='(a)') ' - Matrices arrived here, thanks!' end if end do diff --git a/BRAMS/src/ed2/edcp_lake_driver.f90 b/BRAMS/src/ed2/edcp_lake_driver.f90 index be831b2af..d659a1fcf 100644 --- a/BRAMS/src/ed2/edcp_lake_driver.f90 +++ b/BRAMS/src/ed2/edcp_lake_driver.f90 @@ -597,13 +597,13 @@ subroutine copy_lake_brams(i,j,ifm,mzg,mzs,initp) ! Transfer model scalars back to global arrays. ! !---------------------------------------------------------------------------------------! !----- Stars. --------------------------------------------------------------------------! - ed_fluxf_g(ifm)%ustar (i,j,1) = sngloff(initp%ustar ,tiny_lakeoff) - ed_fluxf_g(ifm)%tstar (i,j,1) = sngloff(initp%tstar ,tiny_lakeoff) - ed_fluxf_g(ifm)%cstar (i,j,1) = sngloff(initp%cstar ,tiny_lakeoff) - ed_fluxf_g(ifm)%zeta (i,j,1) = sngloff(initp%zeta ,tiny_lakeoff) - ed_fluxf_g(ifm)%ribulk(i,j,1) = sngloff(initp%ribulk ,tiny_lakeoff) + ed_fluxf_g(ifm)%ustar (i,j,1) = sngloff(initp%avg_ustar,tiny_lakeoff) + ed_fluxf_g(ifm)%tstar (i,j,1) = sngloff(initp%avg_tstar,tiny_lakeoff) + ed_fluxf_g(ifm)%cstar (i,j,1) = sngloff(initp%avg_cstar,tiny_lakeoff) + ed_fluxf_g(ifm)%zeta (i,j,1) = sngloff(initp%zeta ,tiny_lakeoff) + ed_fluxf_g(ifm)%ribulk(i,j,1) = sngloff(initp%ribulk ,tiny_lakeoff) !----- Water vapour: we must convert specific humidity back to mixing ratio. ----------! - ed_fluxf_g(ifm)%rstar (i,j,1) = sngloff( initp%qstar & + ed_fluxf_g(ifm)%rstar (i,j,1) = sngloff( initp%avg_qstar & / ( (1.d0-lakemet%atm_shv) & * (1.d0 - initp%can_shv)) & , tiny_lakeoff) @@ -623,8 +623,10 @@ subroutine copy_lake_brams(i,j,ifm,mzg,mzs,initp) !----- Radiation-related variables. ----------------------------------------------------! - ed_fluxf_g(ifm)%albedt (i,j,1) = sngloff(initp%avg_albedt ,tiny_lakeoff) - ed_fluxf_g(ifm)%rlongup(i,j,1) = sngloff(initp%avg_rlongup ,tiny_lakeoff) + ed_fluxf_g(ifm)%albedt (i,j,1) = sngloff(initp%avg_albedt ,tiny_lakeoff) + ed_fluxf_g(ifm)%rlongup (i,j,1) = sngloff(initp%avg_rlongup ,tiny_lakeoff) + ed_fluxf_g(ifm)%rshort_gnd (i,j,1) = sngloff(initp%avg_rshort_gnd ,tiny_lakeoff) + ed_fluxf_g(ifm)%rlong_gnd (i,j,1) = 0.0 !---------------------------------------------------------------------------------------! @@ -697,6 +699,7 @@ subroutine copy_lake_brams(i,j,ifm,mzg,mzs,initp) leaf_g(ifm)%soil_energy (k,i,j,1) = leaf_g(ifm)%soil_energy (mzg,i,j,1) leaf_g(ifm)%soil_water (k,i,j,1) = leaf_g(ifm)%soil_water (mzg,i,j,1) end do + leaf_g(ifm)%psibar_10d (i,j,1) = 1.0 !---------------------------------------------------------------------------------------! return diff --git a/BRAMS/src/ed2/edcp_lake_misc.f90 b/BRAMS/src/ed2/edcp_lake_misc.f90 index 5715db31b..da0f980d7 100644 --- a/BRAMS/src/ed2/edcp_lake_misc.f90 +++ b/BRAMS/src/ed2/edcp_lake_misc.f90 @@ -20,8 +20,7 @@ subroutine copy_lake_init(i,j,ifm,initp) use leaf_coms , only : min_waterrough8 & ! intent(in) , z0fac_water8 & ! intent(in) , can_depth_min ! ! intent(in) - use canopy_air_coms , only : ustmin8 & ! intent(in) - , ggfact8 ! ! intent(in) + use canopy_air_coms , only : ustmin8 ! ! intent(in) use canopy_struct_dynamics, only : ed_stars8 & ! intent(in) , can_whcap8 ! ! intent(in) implicit none @@ -92,7 +91,6 @@ subroutine copy_lake_init(i,j,ifm,initp) ! Apply the conductance factor (should be removed soon). Also, update the rough- ! ! ness so next time we use we have the most up to date value. ! !---------------------------------------------------------------------------------------! - initp%gglake = ggfact8 * initp%gglake initp%lake_rough = max(z0fac_water8 * initp%ustar * initp%ustar, min_waterrough8) !---------------------------------------------------------------------------------------! @@ -156,8 +154,7 @@ subroutine lake_diagnostics(initp) use leaf_coms , only : min_waterrough8 & ! intent(in) , z0fac_water8 & ! intent(in) , can_depth_min ! ! intent(in) - use canopy_air_coms , only : ustmin8 & ! intent(in) - , ggfact8 ! ! intent(in) + use canopy_air_coms , only : ustmin8 ! ! intent(in) use canopy_struct_dynamics, only : ed_stars8 & ! intent(in) , can_whcap8 ! ! intent(in) implicit none @@ -244,6 +241,7 @@ subroutine lake_diagnostics(initp) write(unit=*,fmt='(a,1x,es12.5)') ' * Sensible_ac :',initp%avg_sensible_ac write(unit=*,fmt='(a,1x,es12.5)') ' * Carbon_gc :',initp%avg_carbon_gc write(unit=*,fmt='(a,1x,es12.5)') ' * Carbon_ac :',initp%avg_carbon_ac + write(unit=*,fmt='(a,1x,es12.5)') ' * Carbon_st :',initp%avg_carbon_st write(unit=*,fmt='(a,1x,es12.5)') ' * Sflux_u :',initp%avg_sflux_u write(unit=*,fmt='(a,1x,es12.5)') ' * Sflux_v :',initp%avg_sflux_u write(unit=*,fmt='(a,1x,es12.5)') ' * Sflux_w :',initp%avg_sflux_w @@ -252,6 +250,11 @@ subroutine lake_diagnostics(initp) write(unit=*,fmt='(a,1x,es12.5)') ' * Sflux_c :',initp%avg_sflux_c write(unit=*,fmt='(a,1x,es12.5)') ' * Albedt :',initp%avg_albedt write(unit=*,fmt='(a,1x,es12.5)') ' * Rlongup :',initp%avg_rlongup + write(unit=*,fmt='(a,1x,es12.5)') ' * Rshort_gnd :',initp%avg_rshort_gnd + write(unit=*,fmt='(a,1x,es12.5)') ' * Ustar :',initp%avg_ustar + write(unit=*,fmt='(a,1x,es12.5)') ' * Tstar :',initp%avg_tstar + write(unit=*,fmt='(a,1x,es12.5)') ' * Qstar :',initp%avg_qstar + write(unit=*,fmt='(a,1x,es12.5)') ' * Cstar :',initp%avg_cstar write(unit=*,fmt='(a)' ) ' ' write(unit=*,fmt='(a)' ) '-------------------------------------------------' call abort_run('Non-resolvable values','lake_diagnostics','edcp_lake_misc.f90') @@ -329,7 +332,6 @@ subroutine lake_diagnostics(initp) ! Apply the conductance factor (should be removed soon). Also, update the ! ! roughness so next time we use we have the most up to date value. ! !------------------------------------------------------------------------------------! - initp%gglake = ggfact8 * initp%gglake initp%lake_rough = max(z0fac_water8 * initp%ustar * initp%ustar,min_waterrough8) !------------------------------------------------------------------------------------! @@ -448,6 +450,7 @@ subroutine lake_derivs(initp,dinitp) dinitp%avg_sensible_ac = hflxac dinitp%avg_carbon_gc = cflxgc dinitp%avg_carbon_ac = cflxac + dinitp%avg_carbon_st = cflxgc + cflxac !---------------------------------------------------------------------------------------! @@ -467,8 +470,19 @@ subroutine lake_derivs(initp,dinitp) !---------------------------------------------------------------------------------------! ! Find the contribution of this time step to the longwave fluxes. ! !---------------------------------------------------------------------------------------! - dinitp%avg_albedt = min(max(albt_inter + albt_slope * lakemet%tanz,albt_min),albt_max) - dinitp%avg_rlongup = emiss_h2o * stefan8 * initp%lake_temp ** 4 + dinitp%avg_albedt = min(max(albt_inter + albt_slope*lakemet%tanz,albt_min),albt_max) + dinitp%avg_rlongup = emiss_h2o * stefan8 * initp%lake_temp ** 4 + dinitp%avg_rshort_gnd = dinitp%avg_albedt * lakemet%rshort + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Find the contribution of this time step to the stars. ! + !---------------------------------------------------------------------------------------! + dinitp%avg_ustar = initp%ustar + dinitp%avg_tstar = initp%tstar + dinitp%avg_qstar = initp%qstar + dinitp%avg_cstar = initp%cstar !---------------------------------------------------------------------------------------! return diff --git a/BRAMS/src/ed2/edcp_lake_stepper.f90 b/BRAMS/src/ed2/edcp_lake_stepper.f90 index cdf23d986..07f54f014 100644 --- a/BRAMS/src/ed2/edcp_lake_stepper.f90 +++ b/BRAMS/src/ed2/edcp_lake_stepper.f90 @@ -109,6 +109,7 @@ subroutine integrate_lake(dtfull,htryio) ! Integrate, then update and correct diagnostic variables to avoid overshoot- ! ! ing, provided that the overshooting is small. ! !------------------------------------------------------------------------------! + call clone_lakesite (lake_buff%y ,lake_buff%ytemp) call integ_lakesite (lake_buff%ytemp,lake_buff%dydx,h) call lake_diagnostics(lake_buff%ytemp) @@ -144,7 +145,7 @@ subroutine integrate_lake(dtfull,htryio) ! ly, so we assign a standard large error (10.0). ! !------------------------------------------------------------------------------! errmax = 1.d1 - elseif (integration_scheme == 1) then + elseif (integration_scheme == 0 .or. integration_scheme == 3) then !------ Euler scheme, we can't estimate the error, assume it's fine. ----------! errmax = 1.d-1 else diff --git a/BRAMS/src/ed2/edcp_load_namelist.f90 b/BRAMS/src/ed2/edcp_load_namelist.f90 index 73477f930..2bb233123 100644 --- a/BRAMS/src/ed2/edcp_load_namelist.f90 +++ b/BRAMS/src/ed2/edcp_load_namelist.f90 @@ -43,18 +43,33 @@ subroutine read_ednl(iunit,filename) , maxpatch & ! intent(out) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) - , istoma_scheme & ! intent(out) + , quantum_efficiency_t & ! intent(out) , h2o_plant_lim & ! intent(out) , n_plant_lim & ! intent(out) - , vmfact & ! intent(out) - , mfact & ! intent(out) - , kfact & ! intent(out) - , gamfact & ! intent(out) - , d0fact & ! intent(out) - , alphafact & ! intent(out) - , lwfact & ! intent(out) - , thioff & ! intent(out) - , quantum_efficiency_t ! ! intent(out) + , vmfact_c3 & ! intent(out) + , vmfact_c4 & ! intent(out) + , mphoto_trc3 & ! intent(out) + , mphoto_tec3 & ! intent(out) + , mphoto_c4 & ! intent(out) + , bphoto_blc3 & ! intent(out) + , bphoto_nlc3 & ! intent(out) + , bphoto_c4 & ! intent(out) + , kw_grass & ! intent(out) + , kw_tree & ! intent(out) + , gamma_c3 & ! intent(out) + , gamma_c4 & ! intent(out) + , d0_grass & ! intent(out) + , d0_tree & ! intent(out) + , alpha_c3 & ! intent(out) + , alpha_c4 & ! intent(out) + , klowco2in & ! intent(out) + , rrffact & ! intent(out) + , growthresp & ! intent(out) + , lwidth_grass & ! intent(out) + , lwidth_bltree & ! intent(out) + , lwidth_nltree & ! intent(out) + , q10_c3 & ! intent(out) + , q10_c4 ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , repro_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -97,6 +112,7 @@ subroutine read_ednl(iunit,filename) , current_time & ! intent(out) , thsums_database & ! intent(out) , end_time & ! intent(out) + , ivegt_dynamics & ! intent(out) , integration_scheme & ! intent(out) , ffilout & ! intent(out) , dtlsm & ! intent(out) @@ -116,15 +132,22 @@ subroutine read_ednl(iunit,filename) , min_site_area ! ! intent(out) use canopy_air_coms , only : icanturb & ! intent(out) , isfclyrm & ! intent(out) - , ied_grndvap & ! intent(out) - , i_blyr_condct ! ! intent(out) + , ied_grndvap ! ! intent(out) use grid_coms , only : timmax & ! intent(out) , time ! ! intent(out) use optimiz_coms , only : ioptinpt ! ! intent(out) use rk4_coms , only : rk4_tolerance & ! intent(out) , ibranch_thermo ! ! intent(out) use canopy_layer_coms , only : crown_mod ! ! intent(out) - use canopy_radiation_coms, only : ican_swrad ! ! intent(out) + use canopy_radiation_coms, only : icanrad & ! intent(out) + , ltrans_vis & ! intent(out) + , ltrans_nir & ! intent(out) + , lreflect_vis & ! intent(out) + , lreflect_nir & ! intent(out) + , orient_tree & ! intent(out) + , orient_grass & ! intent(out) + , clump_tree & ! intent(out) + , clump_grass ! ! intent(out) !----- Coupled ED-BRAMS modules. -------------------------------------------------------! use mem_edcp , only : co2_offset ! ! intent(out) !----- BRAMS modules. ------------------------------------------------------------------! @@ -162,6 +185,7 @@ subroutine read_ednl(iunit,filename) , imonthh & ! intent(in) , isoilflg ! ! intent(in) use mem_leaf , only : nslcon & ! intent(in) + , isoilcol & ! intent(in) , slz & ! intent(in) , stgoff & ! intent(in) , slmstr & ! intent(in) @@ -170,17 +194,15 @@ subroutine read_ednl(iunit,filename) , istar & ! intent(in) , igrndvap & ! intent(in) , leaf_zrough => zrough & ! intent(in) - , leaf_bpower => betapower & ! intent(in) , leaf_isoilbc => isoilbc & ! intent(in) , leaf_ipercol => ipercol & ! intent(in) , leaf_runoff_time => runoff_time ! ! intent(in) - use leaf_coms , only : leaf_ustmin => ustmin & ! intent(in) - , leaf_ggfact => ggfact & ! intent(in) + use leaf_coms , only : leaf_ubmin => ubmin & ! intent(in) + , leaf_ugbmin => ugbmin & ! intent(in) + , leaf_ustmin => ustmin & ! intent(in) , leaf_gamm => gamm & ! intent(in) , leaf_gamh => gamh & ! intent(in) , leaf_tprandtl => tprandtl & ! intent(in) - , leaf_vh2vr => vh2vr & ! intent(in) - , leaf_vh2dh => vh2dh & ! intent(in) , leaf_ribmax => ribmax & ! intent(in) , leaf_leaf_maxwhc => leaf_maxwhc & ! intent(in) , leaf_min_patch_area => min_patch_area ! ! intent(in) @@ -201,17 +223,22 @@ subroutine read_ednl(iunit,filename) ,itoutput,isoutput,attach_metadata,outfast,outstate,ffilout,sfilout & ,ied_init_mode,edres,sfilin,veg_database,soil_database,lu_database & ,plantation_file,lu_rescale_file,thsums_database,soilstate_db & - ,soildepth_db,isoilstateinit,isoildepthflg,integration_scheme & - ,rk4_tolerance,ibranch_thermo,iphysiol,istoma_scheme,iallom & + ,soildepth_db,isoilstateinit,isoildepthflg,ivegt_dynamics & + ,integration_scheme,rk4_tolerance,ibranch_thermo,iphysiol,iallom & ,iphen_scheme,radint,radslp,repro_scheme,lapse_scheme,crown_mod & - ,ican_swrad,decomp_scheme,h2o_plant_lim,vmfact,mfact,kfact,gamfact & - ,d0fact,alphafact,thetacrit,lwfact,thioff,quantum_efficiency_t & + ,icanrad,ltrans_vis,ltrans_nir,lreflect_vis,lreflect_nir & + ,orient_tree,orient_grass,clump_tree,clump_grass,decomp_scheme & + ,h2o_plant_lim,vmfact_c3,vmfact_c4,mphoto_trc3,mphoto_tec3 & + ,mphoto_c4,bphoto_blc3,bphoto_nlc3,bphoto_nlc4,kw_grass & + ,kw_tree,gamma_c3,gamma_c4,d0_grass,d0_tree,alpha_c3 & + ,alpha_c4,klowco2in,rrffact,growthresp,lwidth_grass,lwidth_bltree & + ,lwidth_nltree,q10_c3,q10_c4,thetacrit,quantum_efficiency_t & ,n_plant_lim,n_decomp_lim,include_fire,sm_fire,ianth_disturb & - ,icanturb,i_blyr_condct,include_these_pft,agri_stock & - ,plantation_stock,pft_1st_check,maxpatch,maxcohort & - ,treefall_disturbance_rate,time2canopy,iprintpolys,npvars,printvars & - ,pfmtstr,ipmin,ipmax,imetrad,iphenys1,iphenysf,iphenyf1,iphenyff & - ,iedcnfgf,event_file,phenpath + ,icanturb,include_these_pft,agri_stock,plantation_stock & + ,pft_1st_check,maxpatch,maxcohort,treefall_disturbance_rate & + ,time2canopy,iprintpolys,npvars,printvars,pfmtstr,ipmin,ipmax & + ,imetrad,iphenys1,iphenysf,iphenyf1,iphenyff,iedcnfgf,event_file & + ,phenpath !----- Initialise some database variables with a non-sense path. -----------------------! soil_database (:) = undef_path @@ -270,11 +297,11 @@ subroutine read_ednl(iunit,filename) write (unit=*,fmt=*) ' soildepth_db =',trim(soildepth_db) write (unit=*,fmt=*) ' isoilstateinit =',isoilstateinit write (unit=*,fmt=*) ' isoildepthflg =',isoildepthflg + write (unit=*,fmt=*) ' ivegt_dynamics =',ivegt_dynamics write (unit=*,fmt=*) ' integration_scheme =',integration_scheme write (unit=*,fmt=*) ' rk4_tolerance =',rk4_tolerance write (unit=*,fmt=*) ' ibranch_thermo =',ibranch_thermo write (unit=*,fmt=*) ' iphysiol =',iphysiol - write (unit=*,fmt=*) ' istoma_scheme =',istoma_scheme write (unit=*,fmt=*) ' iallom =',iallom write (unit=*,fmt=*) ' iphen_scheme =',iphen_scheme write (unit=*,fmt=*) ' radint =',radint @@ -282,18 +309,42 @@ subroutine read_ednl(iunit,filename) write (unit=*,fmt=*) ' repro_scheme =',repro_scheme write (unit=*,fmt=*) ' lapse_scheme =',lapse_scheme write (unit=*,fmt=*) ' crown_mod =',crown_mod - write (unit=*,fmt=*) ' ican_swrad =',ican_swrad + write (unit=*,fmt=*) ' icanrad =',icanrad + write (unit=*,fmt=*) ' ltrans_vis =',ltrans_vis + write (unit=*,fmt=*) ' ltrans_nir =',ltrans_nir + write (unit=*,fmt=*) ' lreflect_vis =',lreflect_vis + write (unit=*,fmt=*) ' lreflect_nir =',lreflect_nir + write (unit=*,fmt=*) ' orient_tree =',orient_tree + write (unit=*,fmt=*) ' orient_grass =',orient_grass + write (unit=*,fmt=*) ' clump_tree =',clump_tree + write (unit=*,fmt=*) ' clump_grass =',clump_grass write (unit=*,fmt=*) ' decomp_scheme =',decomp_scheme write (unit=*,fmt=*) ' h2o_plant_lim =',h2o_plant_lim - write (unit=*,fmt=*) ' vmfact =',vmfact - write (unit=*,fmt=*) ' mfact =',mfact - write (unit=*,fmt=*) ' kfact =',kfact - write (unit=*,fmt=*) ' gamfact =',gamfact - write (unit=*,fmt=*) ' d0fact =',d0fact - write (unit=*,fmt=*) ' alphafact =',alphafact + write (unit=*,fmt=*) ' vmfact_c3 =',vmfact_c3 + write (unit=*,fmt=*) ' vmfact_c4 =',vmfact_c4 + write (unit=*,fmt=*) ' mphoto_trc3 =',mphoto_trc3 + write (unit=*,fmt=*) ' mphoto_tec3 =',mphoto_tec3 + write (unit=*,fmt=*) ' mphoto_c4 =',mphoto_c4 + write (unit=*,fmt=*) ' bphoto_blc3 =',bphoto_blc3 + write (unit=*,fmt=*) ' bphoto_nlc3 =',bphoto_nlc3 + write (unit=*,fmt=*) ' bphoto_c4 =',bphoto_c4 + write (unit=*,fmt=*) ' kw_grass =',kw_grass + write (unit=*,fmt=*) ' kw_tree =',kw_tree + write (unit=*,fmt=*) ' gamma_c3 =',gamma_c3 + write (unit=*,fmt=*) ' gamma_c4 =',gamma_c4 + write (unit=*,fmt=*) ' d0_grass =',d0_grass + write (unit=*,fmt=*) ' d0_tree =',d0_tree + write (unit=*,fmt=*) ' alpha_c3 =',alpha_c3 + write (unit=*,fmt=*) ' alpha_c4 =',alpha_c4 + write (unit=*,fmt=*) ' klowco2in =',klowco2in + write (unit=*,fmt=*) ' rrffact =',rrffact + write (unit=*,fmt=*) ' growthresp =',growthresp + write (unit=*,fmt=*) ' lwidth_grass =',lwidth_grass + write (unit=*,fmt=*) ' lwidth_bltree =',lwidth_bltree + write (unit=*,fmt=*) ' lwidth_nltree =',lwidth_nltree + write (unit=*,fmt=*) ' q10_c3 =',q10_c3 + write (unit=*,fmt=*) ' q10_c4 =',q10_c4 write (unit=*,fmt=*) ' thetacrit =',thetacrit - write (unit=*,fmt=*) ' lwfact =',lwfact - write (unit=*,fmt=*) ' thioff =',thioff write (unit=*,fmt=*) ' quantum_efficiency_t =',quantum_efficiency_t write (unit=*,fmt=*) ' n_plant_lim =',n_plant_lim write (unit=*,fmt=*) ' n_decomp_lim =',n_decomp_lim @@ -301,7 +352,6 @@ subroutine read_ednl(iunit,filename) write (unit=*,fmt=*) ' sm_fire =',sm_fire write (unit=*,fmt=*) ' ianth_disturb =',ianth_disturb write (unit=*,fmt=*) ' icanturb =',icanturb - write (unit=*,fmt=*) ' i_blyr_condct =',i_blyr_condct write (unit=*,fmt=*) ' include_these_pft =',include_these_pft write (unit=*,fmt=*) ' agri_stock =',agri_stock write (unit=*,fmt=*) ' plantation_stock =',plantation_stock @@ -345,10 +395,11 @@ subroutine read_ednl(iunit,filename) call copy_in_bramsnl(expnme,runtype,itimez,idatez,imonthz,iyearz,itimea,idatea,imontha & ,iyeara,itimeh,idateh,imonthh,iyearh,radfrq,nnxp,nnyp,deltax & ,deltay,polelat,polelon,centlat,centlon,nstratx,nstraty,iclobber & - ,nzg,nzs,isoilflg,nslcon,slz,slmstr,stgoff,leaf_zrough,ngrids & - ,leaf_bpower,leaf_ustmin,leaf_ggfact,leaf_isoilbc,leaf_ipercol & - ,leaf_runoff_time,leaf_gamm,leaf_gamh,leaf_tprandtl,leaf_vh2vr & - ,leaf_vh2dh,leaf_ribmax,leaf_leaf_maxwhc) + ,nzg,nzs,isoilflg,nslcon,isoilcol,slz,slmstr,stgoff,leaf_zrough & + ,ngrids,leaf_ubmin,leaf_ugbmin,leaf_ustmin,leaf_isoilbc & + ,leaf_ipercol,leaf_runoff_time,leaf_gamm,leaf_gamh,leaf_tprandtl & + ,leaf_ribmax,leaf_leaf_maxwhc) + !---------------------------------------------------------------------------------------! ! The following variables can be defined in the regular ED2IN file for stand-alone ! ! runs, but they cannot be changed in the coupled simulation (or they are never used ! @@ -495,11 +546,10 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz ,itimea_b,idatea_b,imontha_b,iyeara_b,itimeh_b,idateh_b & ,imonthh_b,iyearh_b,radfrq_b,nnxp_b,nnyp_b,deltax_b,deltay_b & ,polelat_b,polelon_b,centlat_b,centlon_b,nstratx_b,nstraty_b & - ,iclobber_b,nzg_b,nzs_b,isoilflg_b,nslcon_b,slz_b,slmstr_b & - ,stgoff_b,zrough_b,ngrids_b,betapower_b,ustmin_b,ggfact_b & + ,iclobber_b,nzg_b,nzs_b,isoilflg_b,nslcon_b,isoilcol_b,slz_b & + ,slmstr_b,stgoff_b,zrough_b,ngrids_b,ubmin_b,ugbmin_b,ustmin_b & ,isoilbc_b,ipercol_b,runoff_time_b,gamm_b,gamh_b,tprandtl_b & - ,vh2vr_b,vh2dh_b,ribmax_b,leaf_maxwhc_b) - use consts_coms , only : vonk ! ! intent(in) + ,ribmax_b,leaf_maxwhc_b) use ed_misc_coms , only : expnme & ! intent(out) , runtype & ! intent(out) , itimez & ! intent(out) @@ -533,23 +583,21 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz , nzs ! ! intent(out) use soil_coms , only : isoilflg & ! intent(out) , nslcon & ! intent(out) + , isoilcol & ! intent(out) , slmstr & ! intent(out) , zrough & ! intent(out) , slz & ! intent(out) , stgoff & ! intent(out) - , betapower & ! intent(out) , isoilbc & ! intent(in) , runoff_time ! ! intent(in) use grid_dims , only : maxgrds & ! intent(out) , nzgmax ! ! intent(out) - use canopy_air_coms, only : ustmin & ! intent(out) - , ggfact & ! intent(out) + use canopy_air_coms, only : ubmin & ! intent(out) + , ugbmin & ! intent(out) + , ustmin & ! intent(out) , gamm & ! intent(out) , gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc ! ! intent(out) use rk4_coms , only : ipercol ! ! intent(out) @@ -590,22 +638,22 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz integer,dimension(maxgrds), intent(in) :: isoilflg_b ! Method to initialise soil type integer , intent(in) :: nslcon_b ! Soil type if constant for ! all grids + integer , intent(in) :: isoilcol_b ! Soil colour if constant for + ! all grids real , intent(in) :: zrough_b ! Soil roughness if constant... real, dimension(nzgmax) , intent(in) :: slmstr_b ! Initial soil moist. if const. real, dimension(nzgmax) , intent(in) :: stgoff_b ! Initial soil temp. offset real, dimension(nzgmax) , intent(in) :: slz_b ! Soil layers - real , intent(in) :: betapower_b ! Power for the gnd evaporation + real , intent(in) :: ubmin_b ! Minimum u + real , intent(in) :: ugbmin_b ! Minimum u at leaf level real , intent(in) :: ustmin_b ! Minimum u* - real , intent(in) :: ggfact_b ! Ground conductance factor integer , intent(in) :: isoilbc_b ! Bottom soil boundary condition integer , intent(in) :: ipercol_b ! Percolation scheme. real , intent(in) :: runoff_time_b ! Runoff time scale. + real , intent(in) :: ribmax_b ! Maximum bulk Richardson number real , intent(in) :: gamm_b ! Sfc. lyr. Gamma for momentum real , intent(in) :: gamh_b ! Sfc. lyr. Gamma for heat real , intent(in) :: tprandtl_b ! Turbulent Prandtl number - real , intent(in) :: vh2vr_b ! Veg. Height => Veg. Roughness - real , intent(in) :: vh2dh_b ! Veg. Height => Displacement h. - real , intent(in) :: ribmax_b ! Maximum bulk Richardson number real , intent(in) :: leaf_maxwhc_b ! Leaf max. water holding cap. !---------------------------------------------------------------------------------------! @@ -653,12 +701,11 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz zrough = zrough_b isoilflg = isoilflg_b - - betapower = betapower_b - + + + ubmin = ubmin_b + ugbmin = ugbmin_b ustmin = ustmin_b - ggfact = ggfact_b - isoilbc = isoilbc_b ipercol = ipercol_b runoff_time = runoff_time_b @@ -666,13 +713,10 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz gamm = gamm_b gamh = gamh_b tprandtl = tprandtl_b - vkopr = vonk / tprandtl - - vh2vr = vh2vr_b - vh2dh = vh2dh_b ribmax = ribmax_b leaf_maxwhc = leaf_maxwhc_b + isoilcol = isoilcol_b !---------------------------------------------------------------------------------------! return diff --git a/BRAMS/src/ed2/edcp_met.f90 b/BRAMS/src/ed2/edcp_met.f90 index 682cc96ee..eb5bc03b6 100644 --- a/BRAMS/src/ed2/edcp_met.f90 +++ b/BRAMS/src/ed2/edcp_met.f90 @@ -692,21 +692,23 @@ subroutine copy_fluxes_future_2_past(ifm) !---------------------------------------------------------------------------------------! !----- Simple copy of fluxes over land. ------------------------------------------------! - ed_fluxp_g(ifm)%ustar = ed_fluxf_g(ifm)%ustar - ed_fluxp_g(ifm)%tstar = ed_fluxf_g(ifm)%tstar - ed_fluxp_g(ifm)%rstar = ed_fluxf_g(ifm)%rstar - ed_fluxp_g(ifm)%cstar = ed_fluxf_g(ifm)%cstar - ed_fluxp_g(ifm)%zeta = ed_fluxf_g(ifm)%zeta - ed_fluxp_g(ifm)%ribulk = ed_fluxf_g(ifm)%ribulk - ed_fluxp_g(ifm)%albedt = ed_fluxf_g(ifm)%albedt - ed_fluxp_g(ifm)%rlongup = ed_fluxf_g(ifm)%rlongup - ed_fluxp_g(ifm)%sflux_u = ed_fluxf_g(ifm)%sflux_u - ed_fluxp_g(ifm)%sflux_v = ed_fluxf_g(ifm)%sflux_v - ed_fluxp_g(ifm)%sflux_w = ed_fluxf_g(ifm)%sflux_w - ed_fluxp_g(ifm)%sflux_t = ed_fluxf_g(ifm)%sflux_t - ed_fluxp_g(ifm)%sflux_r = ed_fluxf_g(ifm)%sflux_r - ed_fluxp_g(ifm)%sflux_c = ed_fluxf_g(ifm)%sflux_c - ed_fluxp_g(ifm)%rk4step = ed_fluxf_g(ifm)%rk4step + ed_fluxp_g(ifm)%ustar = ed_fluxf_g(ifm)%ustar + ed_fluxp_g(ifm)%tstar = ed_fluxf_g(ifm)%tstar + ed_fluxp_g(ifm)%rstar = ed_fluxf_g(ifm)%rstar + ed_fluxp_g(ifm)%cstar = ed_fluxf_g(ifm)%cstar + ed_fluxp_g(ifm)%zeta = ed_fluxf_g(ifm)%zeta + ed_fluxp_g(ifm)%ribulk = ed_fluxf_g(ifm)%ribulk + ed_fluxp_g(ifm)%rshort_gnd = ed_fluxf_g(ifm)%rshort_gnd + ed_fluxp_g(ifm)%rlong_gnd = ed_fluxf_g(ifm)%rlong_gnd + ed_fluxp_g(ifm)%albedt = ed_fluxf_g(ifm)%albedt + ed_fluxp_g(ifm)%rlongup = ed_fluxf_g(ifm)%rlongup + ed_fluxp_g(ifm)%sflux_u = ed_fluxf_g(ifm)%sflux_u + ed_fluxp_g(ifm)%sflux_v = ed_fluxf_g(ifm)%sflux_v + ed_fluxp_g(ifm)%sflux_w = ed_fluxf_g(ifm)%sflux_w + ed_fluxp_g(ifm)%sflux_t = ed_fluxf_g(ifm)%sflux_t + ed_fluxp_g(ifm)%sflux_r = ed_fluxf_g(ifm)%sflux_r + ed_fluxp_g(ifm)%sflux_c = ed_fluxf_g(ifm)%sflux_c + ed_fluxp_g(ifm)%rk4step = ed_fluxf_g(ifm)%rk4step return end subroutine copy_fluxes_future_2_past @@ -730,6 +732,7 @@ subroutine copy_fluxes_lsm2atm(ifm) , sitetype ! ! structure use mem_edcp , only : ed_fluxf_g & ! structure , ed_flux ! ! structure + use soil_coms , only : nzs ! ! intent(in) use mem_grid , only : zt & ! intent(in) , grid_g & ! structure , dzt & ! intent(in) @@ -753,6 +756,7 @@ subroutine copy_fluxes_lsm2atm(ifm) integer :: ix integer :: iy integer :: ilp + integer :: k integer :: k2u integer :: k3u integer :: k2u_1 @@ -901,6 +905,21 @@ subroutine copy_fluxes_lsm2atm(ifm) !---------------------------------------------------------------------------------! fluxp%albedt(ix,iy,ilp) = sum(csite%area * csite%albedo) * site_area_i !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Total albedo is the average between albedo for direct (beam) and diffuse. ! + !---------------------------------------------------------------------------------! + fluxp%rshort_gnd (ix,iy,ilp) = sum(csite%area * csite%rshort_g) * site_area_i + do k=1,nzs + fluxp%rshort_gnd (ix,iy,ilp) = fluxp%rshort_gnd(ix,iy,ilp) & + + sum(csite%area * csite%rshort_s(k,:)) & + * site_area_i + end do + fluxp%rlong_gnd (ix,iy,ilp) = sum(csite%area * ( csite%rlong_g & + + csite%rlong_s )) & + * site_area_i + !---------------------------------------------------------------------------------! end do end do @@ -1612,6 +1631,8 @@ subroutine copy_avgvars_to_leaf(ifm) leaf_g(ifm)%soil_energy(k,ix,iy,ilp) = cpoly%avg_soil_energy(k,isi) leaf_g(ifm)%soil_water (k,ix,iy,ilp) = cpoly%avg_soil_water (k,isi) end do + leaf_g(ifm)%psibar_10d (ix,iy,ilp) = 1.0 + leaf_g(ifm)%soil_color(ix,iy,ilp) = real(cpoly%ncol_soil(isi)) !---------------------------------------------------------------------------------! @@ -1680,8 +1701,7 @@ subroutine copy_avgvars_to_leaf(ifm) leaf_g(ifm)%sensible_gc(ix,iy,ilp) = cpoly%avg_sensible_gc(isi) leaf_g(ifm)%sensible_vc(ix,iy,ilp) = ( cpoly%avg_sensible_lc(isi) & + cpoly%avg_sensible_wc(isi) ) - leaf_g(ifm)%evap_gc (ix,iy,ilp) = ( cpoly%avg_vapor_gc(isi) & - - cpoly%avg_dew_cg(isi)) * alvl + leaf_g(ifm)%evap_gc (ix,iy,ilp) = cpoly%avg_vapor_gc(isi) * alvl leaf_g(ifm)%evap_vc (ix,iy,ilp) = ( cpoly%avg_vapor_lc(isi) & + cpoly%avg_vapor_wc(isi) ) * alvl leaf_g(ifm)%transp (ix,iy,ilp) = cpoly%avg_transp(isi) * alvl diff --git a/BRAMS/src/ed2/edcp_model.f90 b/BRAMS/src/ed2/edcp_model.f90 index 6dd36d3d6..cfa918ea1 100644 --- a/BRAMS/src/ed2/edcp_model.f90 +++ b/BRAMS/src/ed2/edcp_model.f90 @@ -128,7 +128,8 @@ end subroutine ed_timestep !------------------------------------------------------------------------------------------! subroutine ed_coup_model(ifm) use ed_max_dims , only : maxgrds ! ! intent(in) - use ed_misc_coms , only : integration_scheme & ! intent(in) + use ed_misc_coms , only : ivegt_dynamics & ! intent(in) + , integration_scheme & ! intent(in) , simtime & ! variable type , current_time & ! intent(inout) , frqfast & ! intent(in) @@ -365,9 +366,33 @@ subroutine ed_coup_model(ifm) ! this part of the code when all grids have reached this point. ! !------------------------------------------------------------------------------------! if (new_day) then - - !----- Do phenology, growth, mortality, recruitment, disturbance. ----------------! - call vegetation_dynamics(new_month,new_year) + + !---------------------------------------------------------------------------------! + ! Compute phenology, growth, mortality, recruitment, disturbance, and check ! + ! whether we will apply them to the ecosystem or not. ! + !---------------------------------------------------------------------------------! + select case (ivegt_dynamics) + case (0) + !------------------------------------------------------------------------------! + ! Dummy vegetation dynamics, we compute the tendencies but we don't really ! + ! apply to the vegetation, so they will remain constant throughout the entire ! + ! simulation. ! + !------------------------------------------------------------------------------! + call vegetation_dynamics_eq_0(new_month,new_year) + !------------------------------------------------------------------------------! + + case (1) + !------------------------------------------------------------------------------! + ! Actual vegetation dynamics, we compute the tendencies and apply to the ! + ! vegetation. ! + !------------------------------------------------------------------------------! + call vegetation_dynamics(new_month,new_year) + !------------------------------------------------------------------------------! + + end select + !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! ! First day of a month. On the monthly timestep we have performed various ! diff --git a/BRAMS/src/ed2/edcp_mpiutils.f90 b/BRAMS/src/ed2/edcp_mpiutils.f90 index 1e9a4ec1e..ad4a1ede7 100644 --- a/BRAMS/src/ed2/edcp_mpiutils.f90 +++ b/BRAMS/src/ed2/edcp_mpiutils.f90 @@ -37,6 +37,7 @@ subroutine masterput_ednl(mainnum) , ffilout & ! intent(in) , ied_init_mode & ! intent(in) , thsums_database & ! intent(in) + , ivegt_dynamics & ! intent(in) , integration_scheme & ! intent(in) , end_time & ! intent(in) , current_time & ! intent(in) @@ -71,6 +72,7 @@ subroutine masterput_ednl(mainnum) , timmax ! ! intent(in) use soil_coms , only : isoilflg & ! intent(in) , nslcon & ! intent(in) + , isoilcol & ! intent(in) , slxclay & ! intent(in) , slxsand & ! intent(in) , slz & ! intent(in) @@ -84,8 +86,7 @@ subroutine masterput_ednl(mainnum) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) , runoff_time & ! intent(in) - , zrough & ! intent(in) - , betapower ! ! intent(in) + , zrough ! ! intent(in) use met_driver_coms , only : lapse_scheme & ! intent(in) , imetrad ! ! intent(in) use mem_polygons , only : edres & ! intent(in) @@ -93,18 +94,33 @@ subroutine masterput_ednl(mainnum) , maxpatch & ! intent(in) , maxcohort ! ! intent(in) use physiology_coms , only : iphysiol & ! intent(in) - , istoma_scheme & ! intent(in) , h2o_plant_lim & ! intent(in) , n_plant_lim & ! intent(in) - , vmfact & ! intent(in) - , mfact & ! intent(in) - , kfact & ! intent(in) - , gamfact & ! intent(in) - , d0fact & ! intent(in) - , alphafact & ! intent(in) - , lwfact & ! intent(in) - , thioff & ! intent(in) - , quantum_efficiency_t ! ! intent(in) + , vmfact_c3 & ! intent(in) + , vmfact_c4 & ! intent(in) + , mphoto_trc3 & ! intent(in) + , mphoto_tec3 & ! intent(in) + , mphoto_c4 & ! intent(in) + , bphoto_blc3 & ! intent(in) + , bphoto_nlc3 & ! intent(in) + , bphoto_c4 & ! intent(in) + , kw_grass & ! intent(in) + , kw_tree & ! intent(in) + , gamma_c3 & ! intent(in) + , gamma_c4 & ! intent(in) + , d0_grass & ! intent(in) + , d0_tree & ! intent(in) + , alpha_c3 & ! intent(in) + , alpha_c4 & ! intent(in) + , klowco2in & ! intent(in) + , rrffact & ! intent(in) + , growthresp & ! intent(in) + , quantum_efficiency_t & ! intent(in) + , lwidth_grass & ! intent(in) + , lwidth_bltree & ! intent(in) + , lwidth_nltree & ! intent(in) + , q10_c3 & ! intent(in) + , q10_c4 ! ! intent(in) use phenology_coms , only : iphen_scheme & ! intent(in) , repro_scheme & ! intent(in) , iphenys1 & ! intent(in) @@ -131,22 +147,27 @@ subroutine masterput_ednl(mainnum) , sm_fire ! ! intent(in) use optimiz_coms , only : ioptinpt ! ! intent(in) use canopy_layer_coms , only : crown_mod ! ! intent(in) - use canopy_radiation_coms, only : ican_swrad ! ! intent(in) + use canopy_radiation_coms, only : icanrad & ! intent(in) + , ltrans_vis & ! intent(in) + , ltrans_nir & ! intent(in) + , lreflect_vis & ! intent(in) + , lreflect_nir & ! intent(in) + , orient_tree & ! intent(in) + , orient_grass & ! intent(in) + , clump_tree & ! intent(in) + , clump_grass ! ! intent(in) use rk4_coms , only : rk4_tolerance & ! intent(in) , ibranch_thermo & ! intent(in) , ipercol ! ! intent(in) use canopy_air_coms , only : icanturb & ! intent(in) , isfclyrm & ! intent(in) , ied_grndvap & ! intent(in) - , i_blyr_condct & ! intent(in) + , ubmin & ! intent(in) + , ugbmin & ! intent(in) , ustmin & ! intent(in) - , ggfact & ! intent(in) , gamm & ! intent(in) , gamh & ! intent(in) , tprandtl & ! intent(in) - , vkopr & ! intent(in) - , vh2vr & ! intent(in) - , vh2dh & ! intent(in) , ribmax & ! intent(in) , leaf_maxwhc ! ! intent(in) use mem_edcp , only : co2_offset ! ! intent(in) @@ -211,11 +232,11 @@ subroutine masterput_ednl(mainnum) call MPI_Bcast(isoilstateinit,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoildepthflg,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoilbc,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(rk4_tolerance,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ibranch_thermo,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphysiol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(istoma_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iallom,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphen_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(radint,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -223,18 +244,42 @@ subroutine masterput_ednl(mainnum) call MPI_Bcast(repro_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(lapse_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(crown_mod,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ican_swrad,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(icanrad,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_vis,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_nir,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_vis,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_nir,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(LloydTaylor,1,MPI_LOGICAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vmfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(mfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(kfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(gamfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(d0fact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(alphafact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_trc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_tec3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_blc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_nlc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(klowco2in,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(rrffact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(growthresp,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_bltree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_nltree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(thetacrit,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(lwfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(thioff,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(quantum_efficiency_t,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_plant_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_decomp_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -242,7 +287,6 @@ subroutine masterput_ednl(mainnum) call MPI_Bcast(sm_fire,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ianth_disturb,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(icanturb,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(i_blyr_condct,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ipercol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(include_these_pft,n_pft,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(agri_stock,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -313,25 +357,23 @@ subroutine masterput_ednl(mainnum) call MPI_Bcast(nzs,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(nslcon,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(isoilcol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxclay,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxsand,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slz,nzgmax,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slmstr,nzgmax,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(stgoff,nzgmax,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(betapower,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ubmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ugbmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ustmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ggfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(zrough,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(co2_offset,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - + call MPI_Bcast(gamm,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(tprandtl,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vkopr,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2vr,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2dh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ribmax,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(leaf_maxwhc,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -382,6 +424,7 @@ subroutine nodeget_ednl(master_num) , ffilout & ! intent(out) , ied_init_mode & ! intent(out) , thsums_database & ! intent(out) + , ivegt_dynamics & ! intent(out) , integration_scheme & ! intent(out) , end_time & ! intent(out) , current_time & ! intent(out) @@ -416,6 +459,7 @@ subroutine nodeget_ednl(master_num) , timmax ! ! intent(out) use soil_coms , only : isoilflg & ! intent(out) , nslcon & ! intent(out) + , isoilcol & ! intent(out) , slxclay & ! intent(out) , slxsand & ! intent(out) , slz & ! intent(out) @@ -429,8 +473,7 @@ subroutine nodeget_ednl(master_num) , isoildepthflg & ! intent(out) , isoilbc & ! intent(out) , runoff_time & ! intent(out) - , zrough & ! intent(out) - , betapower ! ! intent(out) + , zrough ! ! intent(out) use met_driver_coms , only : lapse_scheme & ! intent(out) , imetrad ! ! intent(out) use mem_polygons , only : edres & ! intent(out) @@ -438,18 +481,33 @@ subroutine nodeget_ednl(master_num) , maxpatch & ! intent(out) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) - , istoma_scheme & ! intent(out) , h2o_plant_lim & ! intent(out) , n_plant_lim & ! intent(out) - , vmfact & ! intent(out) - , mfact & ! intent(out) - , kfact & ! intent(out) - , gamfact & ! intent(out) - , d0fact & ! intent(out) - , alphafact & ! intent(out) - , lwfact & ! intent(out) - , thioff & ! intent(out) - , quantum_efficiency_t ! ! intent(out) + , vmfact_c3 & ! intent(out) + , vmfact_c4 & ! intent(out) + , mphoto_trc3 & ! intent(out) + , mphoto_tec3 & ! intent(out) + , mphoto_c4 & ! intent(out) + , bphoto_blc3 & ! intent(out) + , bphoto_nlc3 & ! intent(out) + , bphoto_c4 & ! intent(out) + , kw_grass & ! intent(out) + , kw_tree & ! intent(out) + , gamma_c3 & ! intent(out) + , gamma_c4 & ! intent(out) + , d0_grass & ! intent(out) + , d0_tree & ! intent(out) + , alpha_c3 & ! intent(out) + , alpha_c4 & ! intent(out) + , klowco2in & ! intent(out) + , rrffact & ! intent(out) + , growthresp & ! intent(out) + , quantum_efficiency_t & ! intent(out) + , lwidth_grass & ! intent(out) + , lwidth_bltree & ! intent(out) + , lwidth_nltree & ! intent(out) + , q10_c3 & ! intent(out) + , q10_c4 ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , repro_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -476,22 +534,27 @@ subroutine nodeget_ednl(master_num) , sm_fire ! ! intent(out) use optimiz_coms , only : ioptinpt ! ! intent(out) use canopy_layer_coms , only : crown_mod ! ! intent(out) - use canopy_radiation_coms, only : ican_swrad ! ! intent(out) + use canopy_radiation_coms, only : icanrad & ! intent(out) + , ltrans_vis & ! intent(out) + , ltrans_nir & ! intent(out) + , lreflect_vis & ! intent(out) + , lreflect_nir & ! intent(out) + , orient_tree & ! intent(out) + , orient_grass & ! intent(out) + , clump_tree & ! intent(out) + , clump_grass ! ! intent(out) use rk4_coms , only : rk4_tolerance & ! intent(out) , ibranch_thermo & ! intent(out) , ipercol ! ! intent(out) use canopy_air_coms , only : icanturb & ! intent(out) , isfclyrm & ! intent(out) , ied_grndvap & ! intent(out) - , i_blyr_condct & ! intent(out) + , ubmin & ! intent(out) + , ugbmin & ! intent(out) , ustmin & ! intent(out) - , ggfact & ! intent(out) , gamm & ! intent(out) , gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc ! ! intent(out) use mem_edcp , only : co2_offset ! ! intent(out) @@ -559,11 +622,11 @@ subroutine nodeget_ednl(master_num) call MPI_Bcast(isoilstateinit,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoildepthflg,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoilbc,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(rk4_tolerance,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ibranch_thermo,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphysiol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(istoma_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iallom,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphen_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(radint,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) @@ -571,18 +634,42 @@ subroutine nodeget_ednl(master_num) call MPI_Bcast(repro_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(lapse_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(crown_mod,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ican_swrad,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(icanrad,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_vis,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_nir,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_vis,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_nir,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(LloydTaylor,1,MPI_LOGICAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vmfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(mfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(kfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(gamfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(d0fact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(alphafact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_trc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_tec3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_blc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_nlc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(klowco2in,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(rrffact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(growthresp,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_bltree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_nltree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(thetacrit,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(lwfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(thioff,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(quantum_efficiency_t,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_plant_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_decomp_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -590,7 +677,6 @@ subroutine nodeget_ednl(master_num) call MPI_Bcast(sm_fire,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ianth_disturb,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(icanturb,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(i_blyr_condct,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ipercol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(include_these_pft,n_pft,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(agri_stock,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -661,25 +747,23 @@ subroutine nodeget_ednl(master_num) call MPI_Bcast(nzs,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(nslcon,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(isoilcol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxclay,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxsand,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slz,nzgmax,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slmstr,nzgmax,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(stgoff,nzgmax,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(betapower,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ubmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ugbmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ustmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ggfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(zrough,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(co2_offset,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - + call MPI_Bcast(gamm,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(tprandtl,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vkopr,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2vr,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2dh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ribmax,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(leaf_maxwhc,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) diff --git a/BRAMS/src/ed2/edcp_para_init.f90 b/BRAMS/src/ed2/edcp_para_init.f90 index 39adf2fc5..823724da6 100644 --- a/BRAMS/src/ed2/edcp_para_init.f90 +++ b/BRAMS/src/ed2/edcp_para_init.f90 @@ -23,7 +23,8 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) use ed_work_vars, only : work_e ! ! intent(inout) use soil_coms , only : veg_database & ! intent(in) , soil_database & ! intent(in) - , nslcon ! ! intent(in) + , nslcon & ! intent(in) + , isoilcol ! ! intent(in) use io_params , only : b_isoilflg => isoilflg & ! intent(in) , b_ivegtflg => ivegtflg ! ! intent(in) use mem_polygons, only : n_poi & ! intent(in) @@ -49,6 +50,7 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) real , dimension(:,:), allocatable :: lon_list integer, dimension(:,:), allocatable :: leaf_class_list integer, dimension(:,:), allocatable :: ntext_soil_list + integer, dimension(:,:), allocatable :: ncol_soil_list real , dimension(:,:), allocatable :: ipcent_land real , dimension(:,:), allocatable :: ipcent_soil integer :: npoly @@ -74,6 +76,7 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) allocate(lon_list ( 3,npoly)) allocate(leaf_class_list(maxsite,npoly)) allocate(ntext_soil_list(maxsite,npoly)) + allocate(ncol_soil_list (maxsite,npoly)) allocate(ipcent_land (maxsite,npoly)) allocate(ipcent_soil (maxsite,npoly)) @@ -225,6 +228,15 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) call leaf_database(trim(soil_database(ifm)),maxsite,npoly,'soil_text' & ,lat_list,lon_list,ntext_soil_list,ipcent_soil) end select + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! For the time being, soil colour is constant. Only if results look promising we ! + ! will attempt to read a map. ! + !---------------------------------------------------------------------------------------! + ncol_soil_list (:,:) = isoilcol + !---------------------------------------------------------------------------------------! write(unit=*,fmt='(a)') ' + Successfully obtain land/sea mask and soil type.' @@ -251,11 +263,13 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) work_e(ifm)%soilfrac(itext,i,j) = ipcent_soil (itext,ipy) work_e(ifm)%ntext (itext,i,j) = ntext_soil_list (itext,ipy) end do + work_e(ifm)%nscol (i,j) = ncol_soil_list (1,ipy) maxwork = max(maxwork,work_e(ifm)%work(i,j)) else !----- Making this grid point 100% water --------------------------------------! work_e(ifm)%landfrac (i,j) = 0. work_e(ifm)%work (i,j) = epsilon(0.0) + work_e(ifm)%nscol (i,j) = 0 work_e(ifm)%ntext (:,i,j) = 0 work_e(ifm)%soilfrac(:,i,j) = 0 end if @@ -280,7 +294,8 @@ subroutine edcp_get_work(ifm,nxp,nyp,inode,mxp,myp,ia,iz,i0,ja,jz,j0) deallocate(lat_list ) deallocate(lon_list ) deallocate(leaf_class_list ) - deallocate (ntext_soil_list) + deallocate(ntext_soil_list ) + deallocate(ncol_soil_list ) deallocate(ipcent_land ) deallocate(ipcent_soil ) !---------------------------------------------------------------------------------------! @@ -311,6 +326,7 @@ subroutine edcp_parvec_work(ifm,nxp,nyp,ia,iz,i0,ja,jz,j0) use mem_leaf , only : leaf_g ! ! intent(inout) use ed_node_coms, only : mynum ! ! intent(in) use mem_polygons, only : maxsite ! ! intent(in) + use soil_coms , only : isoilcol ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! integer , intent(in) :: ifm @@ -349,6 +365,7 @@ subroutine edcp_parvec_work(ifm,nxp,nyp,ia,iz,i0,ja,jz,j0) work_v(ifm)%landfrac (poly) = work_e(ifm)%landfrac(i,j) work_v(ifm)%xid (poly) = work_e(ifm)%xatm (i,j) work_v(ifm)%yid (poly) = work_e(ifm)%yatm (i,j) + work_v(ifm)%nscol (poly) = work_e(ifm)%nscol (i,j) do itext=1,maxsite work_v(ifm)%ntext (itext,poly) = work_e(ifm)%ntext (itext,i,j) diff --git a/BRAMS/src/ed2/lake_coms.f90 b/BRAMS/src/ed2/lake_coms.f90 index 71830f3b5..de299b35c 100644 --- a/BRAMS/src/ed2/lake_coms.f90 +++ b/BRAMS/src/ed2/lake_coms.f90 @@ -79,14 +79,20 @@ module lake_coms real(kind=8) :: avg_sensible_ac real(kind=8) :: avg_carbon_gc real(kind=8) :: avg_carbon_ac + real(kind=8) :: avg_carbon_st real(kind=8) :: avg_sflux_u real(kind=8) :: avg_sflux_w real(kind=8) :: avg_sflux_v real(kind=8) :: avg_sflux_t real(kind=8) :: avg_sflux_r real(kind=8) :: avg_sflux_c + real(kind=8) :: avg_rshort_gnd real(kind=8) :: avg_albedt real(kind=8) :: avg_rlongup + real(kind=8) :: avg_ustar + real(kind=8) :: avg_tstar + real(kind=8) :: avg_qstar + real(kind=8) :: avg_cstar end type lakesitetype !---------------------------------------------------------------------------------------! @@ -249,14 +255,20 @@ subroutine zero_lakesite(lake) lake%avg_sensible_ac = 0.d0 lake%avg_carbon_gc = 0.d0 lake%avg_carbon_ac = 0.d0 + lake%avg_carbon_st = 0.d0 lake%avg_sflux_u = 0.d0 lake%avg_sflux_w = 0.d0 lake%avg_sflux_v = 0.d0 lake%avg_sflux_t = 0.d0 lake%avg_sflux_r = 0.d0 lake%avg_sflux_c = 0.d0 + lake%avg_rshort_gnd = 0.d0 lake%avg_albedt = 0.d0 lake%avg_rlongup = 0.d0 + lake%avg_ustar = 0.d0 + lake%avg_tstar = 0.d0 + lake%avg_qstar = 0.d0 + lake%avg_cstar = 0.d0 !------------------------------------------------------------------------------------! return @@ -315,14 +327,20 @@ subroutine clone_lakesite(lakein,lakeout) lakeout%avg_sensible_ac = lakein%avg_sensible_ac lakeout%avg_carbon_gc = lakein%avg_carbon_gc lakeout%avg_carbon_ac = lakein%avg_carbon_ac + lakeout%avg_carbon_st = lakein%avg_carbon_st lakeout%avg_sflux_u = lakein%avg_sflux_u lakeout%avg_sflux_w = lakein%avg_sflux_w lakeout%avg_sflux_v = lakein%avg_sflux_v lakeout%avg_sflux_t = lakein%avg_sflux_t lakeout%avg_sflux_r = lakein%avg_sflux_r lakeout%avg_sflux_c = lakein%avg_sflux_c + lakeout%avg_rshort_gnd = lakein%avg_rshort_gnd lakeout%avg_albedt = lakein%avg_albedt lakeout%avg_rlongup = lakein%avg_rlongup + lakeout%avg_ustar = lakein%avg_ustar + lakeout%avg_tstar = lakein%avg_tstar + lakeout%avg_qstar = lakein%avg_qstar + lakeout%avg_cstar = lakein%avg_cstar !------------------------------------------------------------------------------------! return @@ -360,14 +378,20 @@ subroutine integ_lakesite(lake,dlakedt,dtim) lake%avg_sensible_ac = lake%avg_sensible_ac + dtim * dlakedt%avg_sensible_ac lake%avg_carbon_gc = lake%avg_carbon_gc + dtim * dlakedt%avg_carbon_gc lake%avg_carbon_ac = lake%avg_carbon_ac + dtim * dlakedt%avg_carbon_ac + lake%avg_carbon_st = lake%avg_carbon_st + dtim * dlakedt%avg_carbon_st lake%avg_sflux_u = lake%avg_sflux_u + dtim * dlakedt%avg_sflux_u lake%avg_sflux_w = lake%avg_sflux_w + dtim * dlakedt%avg_sflux_w lake%avg_sflux_v = lake%avg_sflux_v + dtim * dlakedt%avg_sflux_v lake%avg_sflux_t = lake%avg_sflux_t + dtim * dlakedt%avg_sflux_t lake%avg_sflux_r = lake%avg_sflux_r + dtim * dlakedt%avg_sflux_r lake%avg_sflux_c = lake%avg_sflux_c + dtim * dlakedt%avg_sflux_c + lake%avg_rshort_gnd = lake%avg_rshort_gnd + dtim * dlakedt%avg_rshort_gnd lake%avg_albedt = lake%avg_albedt + dtim * dlakedt%avg_albedt lake%avg_rlongup = lake%avg_rlongup + dtim * dlakedt%avg_rlongup + lake%avg_ustar = lake%avg_ustar + dtim * dlakedt%avg_ustar + lake%avg_tstar = lake%avg_tstar + dtim * dlakedt%avg_tstar + lake%avg_qstar = lake%avg_qstar + dtim * dlakedt%avg_qstar + lake%avg_cstar = lake%avg_cstar + dtim * dlakedt%avg_cstar !------------------------------------------------------------------------------------! return @@ -407,15 +431,20 @@ subroutine normal_lakesite(lake,dttot) lake%avg_sensible_gc = lake%avg_sensible_gc * dttoti lake%avg_sensible_ac = lake%avg_sensible_ac * dttoti lake%avg_carbon_gc = lake%avg_carbon_gc * dttoti - lake%avg_carbon_ac = lake%avg_carbon_ac * dttoti + lake%avg_carbon_st = lake%avg_carbon_st * dttoti lake%avg_sflux_u = lake%avg_sflux_u * dttoti lake%avg_sflux_w = lake%avg_sflux_w * dttoti lake%avg_sflux_v = lake%avg_sflux_v * dttoti lake%avg_sflux_t = lake%avg_sflux_t * dttoti lake%avg_sflux_r = lake%avg_sflux_r * dttoti lake%avg_sflux_c = lake%avg_sflux_c * dttoti + lake%avg_rshort_gnd = lake%avg_rshort_gnd * dttoti lake%avg_albedt = lake%avg_albedt * dttoti lake%avg_rlongup = lake%avg_rlongup * dttoti + lake%avg_ustar = lake%avg_ustar * dttoti + lake%avg_tstar = lake%avg_tstar * dttoti + lake%avg_qstar = lake%avg_qstar * dttoti + lake%avg_cstar = lake%avg_cstar * dttoti !------------------------------------------------------------------------------------! return diff --git a/BRAMS/src/ed2/mem_edcp.f90 b/BRAMS/src/ed2/mem_edcp.f90 index f623ec189..439a61611 100644 --- a/BRAMS/src/ed2/mem_edcp.f90 +++ b/BRAMS/src/ed2/mem_edcp.f90 @@ -44,6 +44,8 @@ module mem_edcp real(kind=4), dimension (:,:,:), pointer :: sflux_r real(kind=4), dimension (:,:,:), pointer :: sflux_c real(kind=4), dimension (:,:,:), pointer :: sflux_w + real(kind=4), dimension (:,:,:), pointer :: rshort_gnd + real(kind=4), dimension (:,:,:), pointer :: rlong_gnd real(kind=4), dimension (:,:,:), pointer :: albedt real(kind=4), dimension (:,:,:), pointer :: rlongup real(kind=4), dimension (:,:,:), pointer :: rk4step @@ -116,6 +118,8 @@ subroutine alloc_edflux(edflux,nxm,nym,nsite) allocate(edflux%sflux_c (nxm,nym,nsite) ) allocate(edflux%sflux_t (nxm,nym,nsite) ) allocate(edflux%sflux_w (nxm,nym,nsite) ) + allocate(edflux%rshort_gnd(nxm,nym,nsite) ) + allocate(edflux%rlong_gnd (nxm,nym,nsite) ) allocate(edflux%albedt (nxm,nym,nsite) ) allocate(edflux%rlongup (nxm,nym,nsite) ) allocate(edflux%rk4step (nxm,nym,nsite) ) @@ -141,21 +145,23 @@ subroutine nullify_edflux(edflux) type(ed_flux), intent(inout) :: edflux !------------------------------------------------------------------------------------! - if (associated(edflux%ustar )) nullify(edflux%ustar ) - if (associated(edflux%tstar )) nullify(edflux%tstar ) - if (associated(edflux%rstar )) nullify(edflux%rstar ) - if (associated(edflux%cstar )) nullify(edflux%cstar ) - if (associated(edflux%zeta )) nullify(edflux%zeta ) - if (associated(edflux%ribulk )) nullify(edflux%ribulk ) - if (associated(edflux%sflux_u )) nullify(edflux%sflux_u ) - if (associated(edflux%sflux_v )) nullify(edflux%sflux_v ) - if (associated(edflux%sflux_r )) nullify(edflux%sflux_r ) - if (associated(edflux%sflux_t )) nullify(edflux%sflux_t ) - if (associated(edflux%sflux_c )) nullify(edflux%sflux_c ) - if (associated(edflux%sflux_w )) nullify(edflux%sflux_w ) - if (associated(edflux%albedt )) nullify(edflux%albedt ) - if (associated(edflux%rlongup )) nullify(edflux%rlongup ) - if (associated(edflux%rk4step )) nullify(edflux%rk4step ) + if (associated(edflux%ustar )) nullify(edflux%ustar ) + if (associated(edflux%tstar )) nullify(edflux%tstar ) + if (associated(edflux%rstar )) nullify(edflux%rstar ) + if (associated(edflux%cstar )) nullify(edflux%cstar ) + if (associated(edflux%zeta )) nullify(edflux%zeta ) + if (associated(edflux%ribulk )) nullify(edflux%ribulk ) + if (associated(edflux%sflux_u )) nullify(edflux%sflux_u ) + if (associated(edflux%sflux_v )) nullify(edflux%sflux_v ) + if (associated(edflux%sflux_r )) nullify(edflux%sflux_r ) + if (associated(edflux%sflux_t )) nullify(edflux%sflux_t ) + if (associated(edflux%sflux_c )) nullify(edflux%sflux_c ) + if (associated(edflux%sflux_w )) nullify(edflux%sflux_w ) + if (associated(edflux%rshort_gnd )) nullify(edflux%rshort_gnd ) + if (associated(edflux%rlong_gnd )) nullify(edflux%rlong_gnd ) + if (associated(edflux%albedt )) nullify(edflux%albedt ) + if (associated(edflux%rlongup )) nullify(edflux%rlongup ) + if (associated(edflux%rk4step )) nullify(edflux%rk4step ) return end subroutine nullify_edflux @@ -180,21 +186,23 @@ subroutine zero_edflux(edflux,ust0,dtref) real , intent(in) :: dtref !------------------------------------------------------------------------------------! - if (associated(edflux%ustar )) edflux%ustar = ust0 - if (associated(edflux%tstar )) edflux%tstar = 0.0 - if (associated(edflux%rstar )) edflux%rstar = 0.0 - if (associated(edflux%cstar )) edflux%cstar = 0.0 - if (associated(edflux%zeta )) edflux%zeta = 0.0 - if (associated(edflux%ribulk )) edflux%ribulk = 0.0 - if (associated(edflux%sflux_u )) edflux%sflux_u = 0.0 - if (associated(edflux%sflux_v )) edflux%sflux_v = 0.0 - if (associated(edflux%sflux_r )) edflux%sflux_r = 0.0 - if (associated(edflux%sflux_t )) edflux%sflux_t = 0.0 - if (associated(edflux%sflux_c )) edflux%sflux_c = 0.0 - if (associated(edflux%sflux_w )) edflux%sflux_w = 0.0 - if (associated(edflux%albedt )) edflux%albedt = 0.0 - if (associated(edflux%rlongup )) edflux%rlongup = 0.0 - if (associated(edflux%rk4step )) edflux%rk4step = dtref + if (associated(edflux%ustar )) edflux%ustar = ust0 + if (associated(edflux%tstar )) edflux%tstar = 0.0 + if (associated(edflux%rstar )) edflux%rstar = 0.0 + if (associated(edflux%cstar )) edflux%cstar = 0.0 + if (associated(edflux%zeta )) edflux%zeta = 0.0 + if (associated(edflux%ribulk )) edflux%ribulk = 0.0 + if (associated(edflux%sflux_u )) edflux%sflux_u = 0.0 + if (associated(edflux%sflux_v )) edflux%sflux_v = 0.0 + if (associated(edflux%sflux_r )) edflux%sflux_r = 0.0 + if (associated(edflux%sflux_t )) edflux%sflux_t = 0.0 + if (associated(edflux%sflux_c )) edflux%sflux_c = 0.0 + if (associated(edflux%sflux_w )) edflux%sflux_w = 0.0 + if (associated(edflux%rshort_gnd )) edflux%rshort_gnd = 0.0 + if (associated(edflux%rlong_gnd )) edflux%rlong_gnd = 0.0 + if (associated(edflux%albedt )) edflux%albedt = 0.0 + if (associated(edflux%rlongup )) edflux%rlongup = 0.0 + if (associated(edflux%rk4step )) edflux%rk4step = dtref return end subroutine zero_edflux @@ -218,21 +226,23 @@ subroutine dealloc_edflux(edflux) type(ed_flux), intent(inout) :: edflux !------------------------------------------------------------------------------------! - if (associated(edflux%ustar )) deallocate(edflux%ustar ) - if (associated(edflux%tstar )) deallocate(edflux%tstar ) - if (associated(edflux%rstar )) deallocate(edflux%rstar ) - if (associated(edflux%cstar )) deallocate(edflux%cstar ) - if (associated(edflux%zeta )) deallocate(edflux%zeta ) - if (associated(edflux%ribulk )) deallocate(edflux%ribulk ) - if (associated(edflux%sflux_u )) deallocate(edflux%sflux_u ) - if (associated(edflux%sflux_v )) deallocate(edflux%sflux_v ) - if (associated(edflux%sflux_r )) deallocate(edflux%sflux_r ) - if (associated(edflux%sflux_c )) deallocate(edflux%sflux_c ) - if (associated(edflux%sflux_t )) deallocate(edflux%sflux_t ) - if (associated(edflux%sflux_w )) deallocate(edflux%sflux_w ) - if (associated(edflux%albedt )) deallocate(edflux%albedt ) - if (associated(edflux%rlongup )) deallocate(edflux%rlongup ) - if (associated(edflux%rk4step )) deallocate(edflux%rk4step ) + if (associated(edflux%ustar )) deallocate(edflux%ustar ) + if (associated(edflux%tstar )) deallocate(edflux%tstar ) + if (associated(edflux%rstar )) deallocate(edflux%rstar ) + if (associated(edflux%cstar )) deallocate(edflux%cstar ) + if (associated(edflux%zeta )) deallocate(edflux%zeta ) + if (associated(edflux%ribulk )) deallocate(edflux%ribulk ) + if (associated(edflux%sflux_u )) deallocate(edflux%sflux_u ) + if (associated(edflux%sflux_v )) deallocate(edflux%sflux_v ) + if (associated(edflux%sflux_r )) deallocate(edflux%sflux_r ) + if (associated(edflux%sflux_c )) deallocate(edflux%sflux_c ) + if (associated(edflux%sflux_t )) deallocate(edflux%sflux_t ) + if (associated(edflux%sflux_w )) deallocate(edflux%sflux_w ) + if (associated(edflux%rshort_gnd )) deallocate(edflux%rshort_gnd ) + if (associated(edflux%rlong_gnd )) deallocate(edflux%rlong_gnd ) + if (associated(edflux%albedt )) deallocate(edflux%albedt ) + if (associated(edflux%rlongup )) deallocate(edflux%rlongup ) + if (associated(edflux%rk4step )) deallocate(edflux%rk4step ) return end subroutine dealloc_edflux diff --git a/BRAMS/src/fdda/cond_update.f90 b/BRAMS/src/fdda/cond_update.f90 index d969422d7..ec484f159 100644 --- a/BRAMS/src/fdda/cond_update.f90 +++ b/BRAMS/src/fdda/cond_update.f90 @@ -15,7 +15,7 @@ subroutine cond_update(iswap,ncond) use mem_varinit use grid_struct use rconstants - +use grid_dims, only : str_len implicit none integer :: iswap,ncond @@ -29,7 +29,7 @@ subroutine cond_update(iswap,ncond) real(kind=8) :: time1 integer :: iyr,imn,idy,itm,ie,maxarr,maxarr2,ngr,maxx1,maxy1,maxz1 -character (len=80) :: hnameinh,prefix +character (len=str_len) :: hnameinh,prefix character (len=2) :: cng integer, external :: cio_i,cio_f,cio_f8_sca,cio_i_sca,cio_f_sca integer,save :: iunhd=11,inhunt=10 diff --git a/BRAMS/src/fdda/mem_oda.f90 b/BRAMS/src/fdda/mem_oda.f90 index 1901311f0..eb441efb5 100644 --- a/BRAMS/src/fdda/mem_oda.f90 +++ b/BRAMS/src/fdda/mem_oda.f90 @@ -8,7 +8,7 @@ module mem_oda - + use grid_dims, only : str_len type oda_vars @@ -25,7 +25,7 @@ module mem_oda integer, parameter :: maxodafiles=1000, maxodasta=2000, maxodagrids=10 integer, parameter :: maxodanzp=200, maxodatimes=3*maxodafiles - character(len=128), dimension(maxodafiles) :: fnames_upa, fnames_sfc + character(len=str_len), dimension(maxodafiles) :: fnames_upa, fnames_sfc character(len=14) , dimension(maxodafiles) :: itotdate_upa,itotdate_sfc character(len=8) , dimension(maxodasta) :: staid_sfc, staid_upa integer, dimension(maxodasta) :: ntimes_sfc, ntimes_upa @@ -33,7 +33,7 @@ module mem_oda ! Namelist inputs - character(len=128) :: oda_upaprefix,oda_sfcprefix + character(len=str_len) :: oda_upaprefix,oda_sfcprefix integer :: if_oda real :: frqoda,todabeg,todaend,tnudoda,wt_oda_grid(maxodagrids) & ,oda_sfc_til,oda_sfc_tel,oda_upa_til,oda_upa_tel & diff --git a/BRAMS/src/fdda/nud_update.f90 b/BRAMS/src/fdda/nud_update.f90 index b5116e619..6003bed97 100644 --- a/BRAMS/src/fdda/nud_update.f90 +++ b/BRAMS/src/fdda/nud_update.f90 @@ -13,71 +13,73 @@ subroutine nud_update(iswap,nnud) use mem_varinit use grid_struct use rconstants - use mem_aerad , only: nwave ! ! intent(in) + use mem_aerad , only : nwave ! ! intent(in) + use grid_dims , only : str_len implicit none !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: iswap - integer , intent(in) :: nnud + integer , intent(in) :: iswap + integer , intent(in) :: nnud !----- Local variables. ----------------------------------------------------------------! - character (len=256) :: hnameinh,prefix - character (len=2) :: cng - integer , dimension(:) , allocatable :: nnxp1 - integer , dimension(:) , allocatable :: nnyp1 - integer , dimension(:) , allocatable :: nnzp1 - integer :: ngrids1 - integer :: ioutput1 - integer :: nzg1 - integer :: nzs1 - integer :: npatch1 - integer :: nclouds1 - integer :: iyr - integer :: imn - integer :: idy - integer :: itm - integer :: ie - integer :: maxarr - integer :: maxarr2 - integer :: ngr - integer :: maxx1 - integer :: maxy1 - integer :: maxz1 - integer :: npts - integer :: nptsh - integer :: nv - integer :: nvh - integer :: i - integer :: k - integer :: nzpg1 - integer :: nc - integer :: ierr - integer :: ng - integer :: ng_start - real , dimension(:) , allocatable :: platn1 - real , dimension(:) , allocatable :: plonn1 - real , dimension(:) , allocatable :: deltaxn1 - real , dimension(:) , allocatable :: deltayn1 - real , dimension(:) , allocatable :: scr - real , dimension(:,:), allocatable :: xmn1 - real , dimension(:,:), allocatable :: xtn1 - real , dimension(:,:), allocatable :: ymn1 - real , dimension(:,:), allocatable :: ytn1 - real , dimension(:,:), allocatable :: zmn1 - real , dimension(:,:), allocatable :: ztn1 - real , dimension(:,:), allocatable :: topt1 - real(kind=8) :: time1 - type(grid_def) , dimension(:) , allocatable :: grdefh - type(grid_def) , dimension(:) , allocatable :: grdefn - real :: ztop1 + character (len=str_len) :: hnameinh + character (len=str_len) :: prefix + character (len=2) :: cng + integer , dimension(:) , allocatable :: nnxp1 + integer , dimension(:) , allocatable :: nnyp1 + integer , dimension(:) , allocatable :: nnzp1 + integer :: ngrids1 + integer :: ioutput1 + integer :: nzg1 + integer :: nzs1 + integer :: npatch1 + integer :: nclouds1 + integer :: iyr + integer :: imn + integer :: idy + integer :: itm + integer :: ie + integer :: maxarr + integer :: maxarr2 + integer :: ngr + integer :: maxx1 + integer :: maxy1 + integer :: maxz1 + integer :: npts + integer :: nptsh + integer :: nv + integer :: nvh + integer :: i + integer :: k + integer :: nzpg1 + integer :: nc + integer :: ierr + integer :: ng + integer :: ng_start + real , dimension(:) , allocatable :: platn1 + real , dimension(:) , allocatable :: plonn1 + real , dimension(:) , allocatable :: deltaxn1 + real , dimension(:) , allocatable :: deltayn1 + real , dimension(:) , allocatable :: scr + real , dimension(:,:), allocatable :: xmn1 + real , dimension(:,:), allocatable :: xtn1 + real , dimension(:,:), allocatable :: ymn1 + real , dimension(:,:), allocatable :: ytn1 + real , dimension(:,:), allocatable :: zmn1 + real , dimension(:,:), allocatable :: ztn1 + real , dimension(:,:), allocatable :: topt1 + real(kind=8) :: time1 + type(grid_def) , dimension(:) , allocatable :: grdefh + type(grid_def) , dimension(:) , allocatable :: grdefn + real :: ztop1 !----- Locally saved variables. --------------------------------------------------------! - type(head_table), dimension(:) , allocatable, save :: hr_table - integer , save :: iunhd = 11 - integer , save :: inhunt = 10 + type(head_table) , dimension(:) , allocatable , save :: hr_table + integer , save :: iunhd = 11 + integer , save :: inhunt = 10 !----- External functions. -------------------------------------------------------------! - integer , external :: cio_i - integer , external :: cio_f - integer , external :: cio_i_sca - integer , external :: cio_f_sca - integer , external :: cio_f8_sca + integer , external :: cio_i + integer , external :: cio_f + integer , external :: cio_i_sca + integer , external :: cio_f_sca + integer , external :: cio_f8_sca !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/fdda/obs_input.f90 b/BRAMS/src/fdda/obs_input.f90 index 7176beed1..59180a502 100644 --- a/BRAMS/src/fdda/obs_input.f90 +++ b/BRAMS/src/fdda/obs_input.f90 @@ -8,6 +8,7 @@ module obs_input +use grid_dims, only : str_len ! Surface variables @@ -43,7 +44,7 @@ module obs_input integer, parameter :: max_head_vars=10 type obs_header - character(len=80) :: head_string(max_head_vars),sfc_string(max_sfc_vars) & + character(len=str_len) :: head_string(max_head_vars),sfc_string(max_sfc_vars) & ,therm_string(max_upa_vars),wind_string(max_upa_vars) & ,sfc_units(max_sfc_vars) integer :: iun,iver,nhead,nvsfc,nvtherm,nvwind diff --git a/BRAMS/src/fdda/oda_krig.f90 b/BRAMS/src/fdda/oda_krig.f90 index a1d93b6fa..2a5881032 100644 --- a/BRAMS/src/fdda/oda_krig.f90 +++ b/BRAMS/src/fdda/oda_krig.f90 @@ -9,6 +9,7 @@ subroutine krig(n1,n2,n3,x,y,z,ndata,xd,yd,zd,ed,dvar,ngrid & ,nnanzp,topt,var,varkrg,cazmod) use mem_oda +use grid_dims, only : str_len implicit none @@ -22,7 +23,7 @@ subroutine krig(n1,n2,n3,x,y,z,ndata,xd,yd,zd,ed,dvar,ngrid & real, dimension(maxobs) :: xkp,ykp,zkp,dkp,c20,szg real(kind=8), dimension(maxobs) :: alph,c2 real(kind=8), dimension(maxobs2) :: c1 -character(len=80) :: label +character(len=str_len) :: label integer :: p0,p1,p2,p3 real :: sx,sy,sz,szgm,r,dmean diff --git a/BRAMS/src/fdda/read_ralph.f90 b/BRAMS/src/fdda/read_ralph.f90 index d54bc95cf..4f8a0c3d6 100644 --- a/BRAMS/src/fdda/read_ralph.f90 +++ b/BRAMS/src/fdda/read_ralph.f90 @@ -58,6 +58,7 @@ subroutine rr_upa_obs (ifile,qcheck,ierr) ! need to detect if there is an additional header use obs_input +use grid_dims, only : str_len implicit none @@ -65,9 +66,9 @@ subroutine rr_upa_obs (ifile,qcheck,ierr) character(len=*) :: qcheck integer :: ntok,iqfl(5) -character(len=80) :: var_string +character(len=str_len) :: var_string character(len=16) :: cflags,tokens(100) -character(len=256) :: line +character(len=str_len) :: line integer :: jd,n,i,j,iq,iqf,kl ierr=0 @@ -299,9 +300,9 @@ subroutine rr_sfc_obs(ifile,qcheck,ierr) character(len=*) :: qcheck integer :: ntok,iqfl(5) -character(len=80) :: var_string +character(len=str_len) :: var_string character(len=16) :: cflags,tokens(100) -character(len=256) :: line +character(len=str_len) :: line integer :: jd,nvar,nv,ic,k,iq,iqf,nh,nt ierr=0 diff --git a/BRAMS/src/fdda/varf_update.f90 b/BRAMS/src/fdda/varf_update.f90 index 6328be261..80f2b1c8b 100644 --- a/BRAMS/src/fdda/varf_update.f90 +++ b/BRAMS/src/fdda/varf_update.f90 @@ -13,36 +13,37 @@ subroutine varf_update(iswap,initflag,ifileok) use mem_scratch use therm_lib , only : level use rconstants , only : toodry + use grid_dims , only : str_len implicit none !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: initflag - integer , intent(in) :: iswap - logical , intent(out) :: ifileok + integer , intent(in) :: initflag + integer , intent(in) :: iswap + logical , intent(out) :: ifileok !----- Local variables. ----------------------------------------------------------------! - character(len=128) :: flnm - character(len=7) :: cgrid - integer :: iver_var - integer :: nc - integer :: iyearx - integer :: imonthx - integer :: idatex - integer :: ihourx - integer :: nxpx - integer :: nypx - integer :: nzpx - integer :: imarker - integer :: i - integer :: j - integer :: k - real :: rlatx - real :: wlon1x - real :: deltaxx - real :: deltayx - real :: deltazx - real :: dzratx - real :: dzmaxx + character(len=str_len) :: flnm + character(len=7) :: cgrid + integer :: iver_var + integer :: nc + integer :: iyearx + integer :: imonthx + integer :: idatex + integer :: ihourx + integer :: nxpx + integer :: nypx + integer :: nzpx + integer :: imarker + integer :: i + integer :: j + integer :: k + real :: rlatx + real :: wlon1x + real :: deltaxx + real :: deltayx + real :: deltazx + real :: dzratx + real :: dzmaxx !----- Local constants. ----------------------------------------------------------------! - integer , parameter :: iun = 22 + integer , parameter :: iun = 22 !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/init/domain_decomp.f90 b/BRAMS/src/init/domain_decomp.f90 index 48005fbf3..387d20e72 100644 --- a/BRAMS/src/init/domain_decomp.f90 +++ b/BRAMS/src/init/domain_decomp.f90 @@ -1,7 +1,7 @@ module domain_decomp - + use grid_dims, only : str_len implicit none - character(len=256) :: domain_fname + character(len=str_len) :: domain_fname end module domain_decomp diff --git a/BRAMS/src/init/rdint.f90 b/BRAMS/src/init/rdint.f90 index c6b546fd8..600b29427 100644 --- a/BRAMS/src/init/rdint.f90 +++ b/BRAMS/src/init/rdint.f90 @@ -439,7 +439,8 @@ subroutine initlz (name_name) ,leaf_g(ifm)%can_theta,leaf_g(ifm)%can_prss & ,grid_g(ifm)%glat,grid_g(ifm)%glon & ,leaf_g(ifm)%soil_water,leaf_g(ifm)%soil_energy & - ,leaf_g(ifm)%soil_text) + ,leaf_g(ifm)%soil_text,leaf_g(ifm)%psibar_10d & + ,leaf_g(ifm)%leaf_class) end do end select !------------------------------------------------------------------------------------! @@ -488,7 +489,8 @@ subroutine initlz (name_name) ,leaf_g(ifm)%can_theta ,leaf_g(ifm)%can_prss & ,grid_g(ifm)%glat ,grid_g(ifm)%glon & ,leaf_g(ifm)%soil_water ,leaf_g(ifm)%soil_energy & - ,leaf_g(ifm)%soil_text ) + ,leaf_g(ifm)%soil_text ,leaf_g(ifm)%psibar_10d & + ,leaf_g(ifm)%leaf_class ) end select !------------------------------------------------------------------------------! @@ -855,6 +857,7 @@ subroutine read_nl(filename) , istar & ! intent(out) , igrndvap & ! intent(out) , nslcon & ! intent(out) + , isoilcol & ! intent(out) , nvegpat & ! intent(out) , nvgcon & ! intent(out) , pctlcon & ! intent(out) @@ -863,18 +866,15 @@ subroutine read_nl(filename) , slz & ! intent(out) , stgoff & ! intent(out) , zrough & ! intent(out) - , betapower & ! intent(out) , isoilbc & ! intent(out) , ipercol & ! intent(out) , runoff_time ! ! intent(out) - use leaf_coms , only : ustmin & ! intent(out) - , ggfact & ! intent(out) + use leaf_coms , only : ubmin & ! intent(out) + , ugbmin & ! intent(out) + , ustmin & ! intent(out) , gamm & ! intent(out) , gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc & ! intent(out) , min_patch_area ! ! intent(out) @@ -1113,14 +1113,14 @@ subroutine read_nl(filename) namelist /MODEL_OPTIONS/ naddsc,icorflg,iexev,imassflx,ibnd,jbnd,cphas,lsflg,nfpt & ,distim,iswrtyp,ilwrtyp,icumfdbk,radfrq,lonrad,npatch & - ,nvegpat,min_patch_area,isfcl,dtleaf,istar,igrndvap & - ,ustmin,gamm,gamh,tprandtl,vh2vr,vh2dh,ribmax,leaf_maxwhc & - ,ico2,co2con,nvgcon,pctlcon,nslcon,drtcon,zrough,albedo & - ,seatmp,dthcon,soil_moist,soil_moist_fail,usdata_in & - ,usmodel_in,slz,slmstr,stgoff,betapower,ggfact,isoilbc & - ,ipercol,runoff_time,if_urban_canopy,idiffk,ibruvais & - ,ibotflx,ihorgrad,csx,csz,xkhkm,zkhkm,nna,nnb,nnc,akmin & - ,akmax,hgtmin,hgtmax,level,icloud,irain,ipris,isnow,iaggr & + ,nvegpat,min_patch_area,isfcl,dtleaf,istar,igrndvap,ubmin & + ,ugbmin,ustmin,gamm,gamh,tprandtl,ribmax,leaf_maxwhc,ico2 & + ,co2con,nvgcon,pctlcon,nslcon,isoilcol,drtcon,zrough & + ,albedo,seatmp,dthcon,soil_moist,soil_moist_fail & + ,usdata_in,usmodel_in,slz,slmstr,stgoff,isoilbc,ipercol & + ,runoff_time,if_urban_canopy,idiffk,ibruvais,ibotflx & + ,ihorgrad,csx,csz,xkhkm,zkhkm,nna,nnb,nnc,akmin,akmax & + ,hgtmin,hgtmax,level,icloud,irain,ipris,isnow,iaggr & ,igraup,ihail,cparm,rparm,pparm,sparm,aparm,gparm,hparm & ,gnu @@ -1776,12 +1776,12 @@ subroutine read_nl(filename) write (unit=*,fmt=*) ' dtleaf =',dtleaf write (unit=*,fmt=*) ' istar =',istar write (unit=*,fmt=*) ' igrndvap =',igrndvap + write (unit=*,fmt=*) ' ubmin =',ubmin + write (unit=*,fmt=*) ' ugbmin =',ugbmin write (unit=*,fmt=*) ' ustmin =',ustmin write (unit=*,fmt=*) ' gamm =',gamm write (unit=*,fmt=*) ' gamh =',gamh write (unit=*,fmt=*) ' tprandtl =',tprandtl - write (unit=*,fmt=*) ' vh2vr =',vh2vr - write (unit=*,fmt=*) ' vh2dh =',vh2dh write (unit=*,fmt=*) ' ribmax =',ribmax write (unit=*,fmt=*) ' leaf_maxwhc =',leaf_maxwhc write (unit=*,fmt=*) ' ico2 =',ico2 @@ -1789,6 +1789,7 @@ subroutine read_nl(filename) write (unit=*,fmt=*) ' nvgcon =',nvgcon write (unit=*,fmt=*) ' pctlcon =',pctlcon write (unit=*,fmt=*) ' nslcon =',nslcon + write (unit=*,fmt=*) ' isoilcol =',isoilcol write (unit=*,fmt=*) ' drtcon =',drtcon write (unit=*,fmt=*) ' zrough =',zrough write (unit=*,fmt=*) ' albedo =',albedo @@ -1801,8 +1802,6 @@ subroutine read_nl(filename) write (unit=*,fmt=*) ' slz =',slz write (unit=*,fmt=*) ' slmstr =',slmstr write (unit=*,fmt=*) ' stgoff =',stgoff - write (unit=*,fmt=*) ' betapower =',betapower - write (unit=*,fmt=*) ' ggfact =',ggfact write (unit=*,fmt=*) ' isoilbc =',isoilbc write (unit=*,fmt=*) ' ipercol =',ipercol write (unit=*,fmt=*) ' runoff_time =',runoff_time @@ -2040,19 +2039,6 @@ subroutine read_nl(filename) co2_on = ico2 > 0 !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Find the vonk/Tprandt constant based on the given tprandtl. ! - !---------------------------------------------------------------------------------------! - if (tprandtl /= 0.0) then - vkopr = vonk / tprandtl - else - vkopr = 0.0 - end if - !---------------------------------------------------------------------------------------! - return end subroutine read_nl !==========================================================================================! diff --git a/BRAMS/src/io/inithis.f90 b/BRAMS/src/io/inithis.f90 index 418fdd4f9..cbcf80850 100644 --- a/BRAMS/src/io/inithis.f90 +++ b/BRAMS/src/io/inithis.f90 @@ -29,15 +29,18 @@ subroutine inithis() use ref_sounding use io_params use mem_scratch - use mem_aerad , only : nwave - use grid_dims , only : maxgrds - use mem_cuparm, only : nclouds,nnqparm - use therm_lib , only : virtt,vapour_on + use mem_aerad , only : nwave ! ! intent(in) + use grid_dims , only : maxgrds & ! intent(in) + , str_len ! ! intent(in) + use mem_cuparm, only : nclouds & ! intent(in) + , nnqparm ! ! intent(in) + use therm_lib , only : virtt & ! intent(in) + , vapour_on ! ! intent(in) implicit none !----- Local variables -----------------------------------------------------------------! - character (len=256) :: hnamel, hnamelh + character (len=str_len) :: hnamel, hnamelh character (len=2) :: cng integer :: ngrids1,ioutput1,nzg1,nzs1 integer :: npatch1,nclouds1 @@ -280,7 +283,8 @@ subroutine inithis() !----- 3D variables (nzp,nxp,npatch) that can be interpolated -----------------! elseif (vtab_r(nv,1)%idim_type == 6 .and. hr_table(nvh)%string /= 'LEAF_CLASS' & - .and. hr_table(nvh)%string /= 'PATCH_AREA' ) then + .and. hr_table(nvh)%string /= 'PATCH_AREA' & + .and. hr_table(nvh)%string /= 'SOIL_COLOR' ) then call hi_interp(1,nnxp1(ngr),nnyp1(ngr),1,scr,xmn1(:,ngr),xtn1(:,ngr) & ,ymn1(:,ngr),ytn1(:,ngr),zmn1(:,ngr),ztn1(:,ngr) & @@ -482,21 +486,22 @@ subroutine sfcinit_hstart() ,leaf_g(ifm)%veg_albedo (i,j,ipat) & ,leaf_g(ifm)%veg_ndvip (i,j,ipat) & ,leaf_g(ifm)%veg_ndvic (i,j,ipat) & - ,leaf_g(ifm)%veg_ndvif (i,j,ipat) ) + ,leaf_g(ifm)%veg_ndvif (i,j,ipat) & + ,leaf_g(ifm)%psibar_10d (i,j,ipat) ) end if !----- Find the surface saturation mixing ratio. ---------------------------! - call leaf_grndvap(leaf_g(ifm)%soil_energy (nzg,i,j,ipat) & - ,leaf_g(ifm)%soil_water (nzg,i,j,ipat) & - ,leaf_g(ifm)%soil_text (nzg,i,j,ipat) & - ,leaf_g(ifm)%sfcwater_energy (nzs,i,j,ipat) & - ,leaf_g(ifm)%sfcwater_nlev (i,j,ipat) & - ,leaf_g(ifm)%can_rvap (i,j,ipat) & - ,leaf_g(ifm)%can_prss (i,j,ipat) & - ,leaf_g(ifm)%ground_rsat (i,j,ipat) & - ,leaf_g(ifm)%ground_rvap (i,j,ipat) & - ,leaf_g(ifm)%ground_temp (i,j,ipat) & - ,leaf_g(ifm)%ground_fliq (i,j,ipat) ) + call leaf3_grndvap(leaf_g(ifm)%soil_energy (nzg,i,j,ipat) & + ,leaf_g(ifm)%soil_water (nzg,i,j,ipat) & + ,leaf_g(ifm)%soil_text (nzg,i,j,ipat) & + ,leaf_g(ifm)%sfcwater_energy (nzs,i,j,ipat) & + ,leaf_g(ifm)%sfcwater_nlev (i,j,ipat) & + ,leaf_g(ifm)%can_rvap (i,j,ipat) & + ,leaf_g(ifm)%can_prss (i,j,ipat) & + ,leaf_g(ifm)%ground_rsat (i,j,ipat) & + ,leaf_g(ifm)%ground_rvap (i,j,ipat) & + ,leaf_g(ifm)%ground_temp (i,j,ipat) & + ,leaf_g(ifm)%ground_fliq (i,j,ipat) ) end do patchloop end do iloop diff --git a/BRAMS/src/io/io_params.f90 b/BRAMS/src/io/io_params.f90 index 93d075d84..67ad73f5e 100644 --- a/BRAMS/src/io/io_params.f90 +++ b/BRAMS/src/io/io_params.f90 @@ -15,9 +15,9 @@ module io_params character(len=32) :: lite_vars(maxlite) - character(len=80) :: afilin + character(len=str_len) :: afilin - character(len=256) :: hfilout, afilout, pastfn, hfilin + character(len=str_len) :: hfilout, afilout, pastfn, hfilin ! Modif. by ALF character(len=20) :: xlite,ylite,zlite @@ -42,21 +42,21 @@ module io_params integer :: ntopsmth,izflat real, dimension(maxgrds) :: z0max,toptenh,toptwvl !---------------------------------------------------------------------------- - character(len=256), dimension(maxgrds) :: itoptfn,isstfn,ivegtfn,isoilfn & + character(len=str_len), dimension(maxgrds) :: itoptfn,isstfn,ivegtfn,isoilfn & ,ndvifn ! TEB - character(len=256), dimension(maxgrds) :: ifusfn + character(len=str_len), dimension(maxgrds) :: ifusfn ! Modif.by ALF !---------------------------------------------------------------------------- integer, parameter :: maxsstfiles=2000 - character(len=256) :: sstfpfx, sfcfiles, & + character(len=str_len) :: sstfpfx, sfcfiles, & topfiles ! TEB - character(len=256) :: fusfiles + character(len=str_len) :: fusfiles ! Modif.by ALF - character(len=256),dimension(maxsstfiles,maxgrds) :: fnames_sst + character(len=str_len),dimension(maxsstfiles,maxgrds) :: fnames_sst ! Modif.by ALF character(len=14),dimension(maxsstfiles,maxgrds) :: itotdate_sst ! Created by ALF @@ -68,9 +68,9 @@ module io_params real(kind=8),dimension(maxgrds) :: ssttime1,ssttime2 !---------------------------------------------------------------------------- integer, parameter :: maxndvifiles=2000 - character(len=256) :: ndvifpfx + character(len=str_len) :: ndvifpfx ! Modif.by ALF - character(len=256), dimension(maxndvifiles,maxgrds) :: fnames_ndvi + character(len=str_len), dimension(maxndvifiles,maxgrds) :: fnames_ndvi ! Modif.by ALF character(len=14), dimension(maxndvifiles,maxgrds) :: itotdate_ndvi !---------------------------------------------------------------------------- diff --git a/BRAMS/src/io/opspec.f90 b/BRAMS/src/io/opspec.f90 index 2abec47d3..b71507622 100644 --- a/BRAMS/src/io/opspec.f90 +++ b/BRAMS/src/io/opspec.f90 @@ -584,13 +584,12 @@ subroutine opspec3 use mem_turb use mem_leaf use leaf_coms, only : & + ubmin, & ! intent(in) + ugbmin, & ! intent(in) ustmin, & ! intent(in) - ggfact, & ! intent(in) lc_gamm => gamm, & ! intent(in) lc_gamh => gamh, & ! intent(in) tprandtl, & ! intent(in) - vh2vr, & ! intent(in) - vh2dh, & ! intent(in) ribmax, & ! intent(in) leaf_maxwhc, & ! intent(in) min_patch_area, & ! intent(in) @@ -984,20 +983,25 @@ subroutine opspec3 end select endif - if (betapower < 0.0 .or. betapower > 10.0) then - print *, 'FATAL - BETAPOWER must be between 0.0 and 10.0' + + if (ubmin < 1.e-4 .or. ubmin > 1.0) then + print *, 'FATAL - UBMIN must be between 0.0001 and 1.0' ifaterr = ifaterr + 1 end if - + if (ustmin < 1.e-4 .or. ustmin > 1.0) then print *, 'FATAL - USTMIN must be between 0.0001 and 1.0' ifaterr = ifaterr + 1 + elseif (ustmin > ubmin) then + print *, 'FATAL - USTMIN must be less than UBMIN. Check your namelist' end if - - if (ggfact < 0.0 .or. ggfact > 100.0) then - print *, 'FATAL - GGFACT must be between 0.0 and 100.0' + + if (ugbmin < ustmin .or. ugbmin > ubmin) then + print *, 'FATAL - UGBMIN must be between USTMIN and UBMIN' ifaterr = ifaterr + 1 end if + + if (lc_gamm < 0.1 .or. lc_gamm > 100.0) then print *, 'FATAL - GAMM must be between 0.1 and 100.' @@ -1014,18 +1018,6 @@ subroutine opspec3 ifaterr = ifaterr + 1 end if - if (vh2vr < 0.001 .or. vh2vr > 0.99) then - print *, 'FATAL - VH2VR must be between 0.001 and 0.99' - print *, vh2vr - ifaterr = ifaterr + 1 - end if - - if (vh2dh <= vh2vr .or. vh2dh > 0.99) then - print *, 'FATAL - VH2DH must be greater than VH2VR and less than 0.99' - print *, vh2dh - ifaterr = ifaterr + 1 - end if - if (ribmax < 0.01 .or. ribmax > 20.0) then print *, 'FATAL - RIBMAX must be greater than 0.01 and less than 20.' print *, ribmax @@ -1127,14 +1119,14 @@ subroutine opspec3 end select ! Check whether the surface layer exchange scheme the user chose is okay. - if (isfcl /= 0 .and. (istar < 1 .or. istar > 5)) then - print *, 'fatal - ISTAR must be between 1 and 5, and yours is set to ',istar,'...' + if (isfcl /= 0 .and. (istar < 1 .or. istar > 4)) then + print *, 'fatal - ISTAR must be between 1 and 4, and yours is set to ',istar,'...' ifaterr=ifaterr+1 end if ! Check whether the ground vapour method scheme the user chose is fine or not. - if (isfcl /= 0 .and. (igrndvap < 0 .or. igrndvap > 4)) then - print *, 'fatal - IGRNDVAP must be between 0 and 4, and yours is set to ' & + if (isfcl /= 0 .and. (igrndvap < 0 .or. igrndvap > 5)) then + print *, 'fatal - IGRNDVAP must be between 0 and 5, and yours is set to ' & ,igrndvap,'...' ifaterr=ifaterr+1 end if diff --git a/BRAMS/src/io/rams_read_header.f90 b/BRAMS/src/io/rams_read_header.f90 index 057a81c42..b9113385d 100644 --- a/BRAMS/src/io/rams_read_header.f90 +++ b/BRAMS/src/io/rams_read_header.f90 @@ -7,13 +7,13 @@ !########################################################################### subroutine rams_read_header(flnm) - +use grid_dims, only : str_len use an_header implicit none character*(*) flnm -character(len=128) :: flnm2 +character(len=str_len) :: flnm2 integer lenf,nv diff --git a/BRAMS/src/io/rcio.f90 b/BRAMS/src/io/rcio.f90 index f850c2b1a..3a1573824 100644 --- a/BRAMS/src/io/rcio.f90 +++ b/BRAMS/src/io/rcio.f90 @@ -11,13 +11,12 @@ subroutine commio (cfile,io,iun) use mem_all use therm_lib, only: level use mem_mass, only: imassflx, iexev - use leaf_coms, only : ustmin & ! intent(inout) - , ggfact & ! intent(inout) + use leaf_coms, only : ubmin & ! intent(inout) + , ugbmin & ! intent(inout) + , ustmin & ! intent(inout) , leaf_gamm => gamm & ! intent(inout) , leaf_gamh => gamh & ! intent(inout) , tprandtl & ! intent(inout) - , vh2vr & ! intent(inout) - , vh2dh & ! intent(inout) , ribmax & ! intent(inout) , leaf_maxwhc & ! intent(inout) , min_patch_area & ! intent(inout) @@ -209,12 +208,12 @@ subroutine commio (cfile,io,iun) ie=cio_i_sca(iun,irw,'isfcl',isfcl,1) ie=cio_i_sca(iun,irw,'istar',istar,1) ie=cio_i_sca(iun,irw,'igrndvap',igrndvap,1) + ie=cio_f_sca(iun,irw,'ubmin',ubmin,1) + ie=cio_f_sca(iun,irw,'ugbmin',ugbmin,1) ie=cio_f_sca(iun,irw,'ustmin',ustmin,1) ie=cio_f_sca(iun,irw,'gamm',leaf_gamm,1) ie=cio_f_sca(iun,irw,'gamh',leaf_gamh,1) ie=cio_f_sca(iun,irw,'tprandtl',tprandtl,1) - ie=cio_f_sca(iun,irw,'vh2vr',vh2vr,1) - ie=cio_f_sca(iun,irw,'vh2dh',vh2dh,1) ie=cio_f_sca(iun,irw,'ribmax',ribmax,1) ie=cio_f_sca(iun,irw,'leaf_maxwhc',leaf_maxwhc,1) ie=cio_f_sca(iun,irw,'min_patch_area',min_patch_area,1) @@ -299,10 +298,11 @@ end subroutine commio !--------------------------------------------------------- subroutine cio_pos_file(iun,cstr,ierr) +use grid_dims, only : str_len implicit none integer :: iun,ierr character(len=*) :: cstr -character(len=256) :: line,csearch +character(len=str_len) :: line,csearch integer :: nl,nc,iend,ilen @@ -340,11 +340,12 @@ subroutine cio_pos_file(iun,cstr,ierr) !--------------------------------------------------------- integer function cio_i(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n integer ia(*) character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (irw.eq.1) then @@ -367,11 +368,12 @@ end function cio_i !--------------------------------------------------------- integer function cio_f(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n real ia(*) character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (irw.eq.1) then @@ -394,11 +396,12 @@ end function cio_f !--------------------------------------------------------- integer function cio_f8(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n real(kind=8) :: ia(*) character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (irw.eq.1) then @@ -421,11 +424,12 @@ end function cio_f8 !--------------------------------------------------------- integer function cio_c(iun,irw,cstr,ia,n) + use grid_dims, only : str_len implicit none integer :: iun,irw,n character(len=*) :: ia(*) character(len=*) :: cstr - character(len=256) :: string + character(len=str_len) :: string integer :: nn,i if (irw.eq.1) then @@ -449,11 +453,12 @@ end function cio_c integer function cio_i_sca(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n integer ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -487,11 +492,12 @@ end function cio_i_sca !--------------------------------------------------------- integer function cio_f_sca(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n real ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -525,11 +531,12 @@ end function cio_f_sca !--------------------------------------------------------- integer function cio_f8_sca(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n real(kind=8) :: ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -563,11 +570,12 @@ end function cio_f8_sca !--------------------------------------------------------- integer function cio_c_sca(iun,irw,cstr,ia,n) +use grid_dims, only : str_len implicit none integer :: iun,irw,n character(len=*) :: ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then diff --git a/BRAMS/src/io/rio.f90 b/BRAMS/src/io/rio.f90 index 2f03342ab..c03f77676 100644 --- a/BRAMS/src/io/rio.f90 +++ b/BRAMS/src/io/rio.f90 @@ -35,7 +35,7 @@ subroutine history_start(name_name) !----- Arguments -----------------------------------------------------------------------! character(len=*) , intent(in) :: name_name !----- Local variables -----------------------------------------------------------------! - character (len=256) :: hnamel, hnamelh + character (len=str_len) :: hnamel, hnamelh character (len=2) :: cng integer , save :: iunhd=11 integer :: ngrids1,ioutput1,nzg1,nzs1,npatch1,nclouds1 @@ -214,6 +214,7 @@ subroutine hiswrt(restart) use mem_scratch use mem_grid use io_params + use grid_dims implicit none @@ -223,8 +224,8 @@ subroutine hiswrt(restart) character (len=*) , intent(in) :: restart !----- Local variables -----------------------------------------------------------------! character(len=10) :: c0, c1 - character(len=128) , save :: hnameold,hnameoldh - character(len=256) :: hnamel,hnamelh + character(len=str_len) , save :: hnameold,hnameoldh + character(len=str_len) :: hnamel,hnamelh logical :: hereitis integer :: nv,nwordh,ngr,nvcnt integer , save :: iohunt=10, ncall=0 diff --git a/BRAMS/src/io/rname.f90 b/BRAMS/src/io/rname.f90 index 3e950d78c..5e85dd9d7 100644 --- a/BRAMS/src/io/rname.f90 +++ b/BRAMS/src/io/rname.f90 @@ -117,7 +117,7 @@ subroutine NAMEOUT print*, ' ' write(6,201)NGRIDS,NESTZ1,NESTZ2,INITIAL,IOUTPUT,NUDLAT,if_adap write(6,202)INITFLD,IHTRAN,NACOUST,NTOPSMTH,KWRITE - write(6,203)IUPDSST,IZFLAT,IMPL,ICORFLG,NSLCON,IBND + write(6,203)IUPDSST,IZFLAT,IMPL,ICORFLG,NSLCON,ISOILCOL,IBND write(6,204)JBND,LSFLG,NFPT,IDELTAT,ISWRTYP,ILWRTYP,ICUMFDBK ![MLO - Adding ED2 and mass variables: @@ -140,7 +140,7 @@ subroutine NAMEOUT 202 format(' INITFLD=',I4,' IHTRAN=',I4 & ,' NACOUST=',I4,' NTOPSMTH=',I4,' KWRITE=',I4) 203 format(' IUPDSST=',I4,' IZFLAT=',I4,' IMPL=',I4 & - ,' ICORFLG=',I4,' NSLCON=',I4,' IBND=',I4) + ,' ICORFLG=',I4,' NSLCON=',I4,' ISOILCOL=',I4,' IBND=',I4) 204 format(' JBND=',I4,' LSFLG=',I4,' NFPT=',I4 & ,' IDELTAT=',I4,' ISWRTYP=',I4,' ILWRTYP=',I4,' ICUMFDBK=',I4) 205 format(' LONRAD=',I4,' IMONTHA=',I4,' IDATEA=',I4 & diff --git a/BRAMS/src/io/rprnt.f90 b/BRAMS/src/io/rprnt.f90 index 2f8836ded..2ca82c002 100644 --- a/BRAMS/src/io/rprnt.f90 +++ b/BRAMS/src/io/rprnt.f90 @@ -230,6 +230,10 @@ subroutine sfcprt(n2,n3,mzg,mzs,npat,leaf,vnam,lprt) elseif (vnam == 'sfcwater_depth' ) then vnam2 = '[sfcwater_depth (m)] ' k2 = nzs +elseif (vnam == 'soil_color' ) then + vnam2 = '[Soil colour] ' +elseif (vnam == 'psibar_10d' ) then + vnam2 = '[Psibar_10d (m3/m3)] ' elseif (vnam == 'ustar' ) then vnam2 = '[ustar (m/s)] ' elseif (vnam == 'tstar' ) then @@ -375,6 +379,14 @@ subroutine sfcprt(n2,n3,mzg,mzs,npat,leaf,vnam,lprt) call plin(nc,j,ipat,3,1. & ,leaf%sfcwater_depth(k,i1:i2,j,ipat) & ,leaf%patch_area(i1:i2,j,ipat)) + elseif (vnam == 'soil_color' ) then + call plin(nc,j,ipat,3,1. & + ,leaf%soil_color(i1:i2,j,ipat) & + ,leaf%patch_area(i1:i2,j,ipat)) + elseif (vnam == 'psibar_10d' ) then + call plin(nc,j,ipat,3,1. & + ,leaf%psibar_10d(i1:i2,j,ipat) & + ,leaf%patch_area(i1:i2,j,ipat)) elseif (vnam == 'ustar' ) then call plin(nc,j,ipat,3,1. & ,leaf%ustar(i1:i2,j,ipat) & diff --git a/BRAMS/src/isan/asgen.f90 b/BRAMS/src/isan/asgen.f90 index 1deddd8b7..b650882dd 100644 --- a/BRAMS/src/isan/asgen.f90 +++ b/BRAMS/src/isan/asgen.f90 @@ -11,16 +11,16 @@ SUBROUTINE isan_driver (name_name) use isan_coms use mem_grid use io_params - + use grid_dims, only : str_len implicit none character(len=*) :: name_name character :: csuff*3 !,locfn*80,locfna*80 - character(len=256) :: locfn, locfna + character(len=str_len) :: locfn, locfna ! fnames dimensioned by a max number of files possible - character(len=128) :: fnames(maxisfiles) + character(len=str_len) :: fnames(maxisfiles) integer, dimension(maxgrds) :: itoptn,iglatn,iglonn integer :: ifm,icm,ng,i,k,ifileok diff --git a/BRAMS/src/isan/asti2.f90 b/BRAMS/src/isan/asti2.f90 index da5fe3113..2663cc981 100644 --- a/BRAMS/src/isan/asti2.f90 +++ b/BRAMS/src/isan/asti2.f90 @@ -10,11 +10,11 @@ SUBROUTINE input_rawi (olat1,olat2,olon1,olon2) use isan_coms use rconstants - +use grid_dims, only : str_len implicit none real :: olat1,olat2,olon1,olon2 -character(len=256) :: line,line2 +character(len=str_len) :: line,line2 character(len=32) :: cflags,tokens(40) real, dimension(maxlev) :: p,t,z,h,d,f,pp,zp,tp,hp,vz,uz,zz,rp,dz,fz diff --git a/BRAMS/src/isan/first_rams.f90 b/BRAMS/src/isan/first_rams.f90 index 24babbe1f..fb11ea24b 100644 --- a/BRAMS/src/isan/first_rams.f90 +++ b/BRAMS/src/isan/first_rams.f90 @@ -11,6 +11,7 @@ subroutine first_RAMS(np1,np2,np3,ui2,vi2,pi2,ti2,ri2) use an_header use isan_coms use mem_grid +use grid_dims, only : str_len implicit none @@ -22,7 +23,7 @@ subroutine first_RAMS(np1,np2,np3,ui2,vi2,pi2,ti2,ri2) ,ninestx,njnestx,nknestx integer :: lenf,nv,irw,iun,ierr,ng,ngridsx,icm,ifm,k -character(len=80) :: flnma +character(len=str_len) :: flnma character(len=1) :: cgrid character(len=2) :: cng diff --git a/BRAMS/src/isan/isan_coms.f90 b/BRAMS/src/isan/isan_coms.f90 index 39ee8e11d..018d29cdf 100644 --- a/BRAMS/src/isan/isan_coms.f90 +++ b/BRAMS/src/isan/isan_coms.f90 @@ -8,6 +8,7 @@ Module isan_coms + use grid_dims, only : str_len !--------------------------------------------------------------------------- ! Configuration COMMON blocks for RAMS isentropic data analysis package. @@ -37,9 +38,9 @@ Module isan_coms integer :: ioflgisz,ioflgvar,natime,iszstage,ivrstage,iyear,imonth,idate & ,ihour,isan_inc,i1st_flg,iupa_flg,isfc_flg !--------------------------------------------------------------------------- - character(len=256) :: innpr,inrawi,insrfce + character(len=str_len) :: innpr,inrawi,insrfce - character(len=256) :: varpfx, iapr, iarawi, iasrfce + character(len=str_len) :: varpfx, iapr, iarawi, iasrfce ! Modif. by ALF character(len=8) :: pdata,guess1st diff --git a/BRAMS/src/lib/charutils.f90 b/BRAMS/src/lib/charutils.f90 index a566967ad..cad7ac819 100644 --- a/BRAMS/src/lib/charutils.f90 +++ b/BRAMS/src/lib/charutils.f90 @@ -243,12 +243,13 @@ subroutine parse(str,tokens,ntok) !*************************************************************************** subroutine tokenize(str1,tokens,ntok,toksep,nsep) +use grid_dims, only : str_len implicit none integer :: nsep,ntok character(len=*) :: str1,tokens(*) character(len=1) :: toksep(nsep) -character(len=256) :: str +character(len=str_len) :: str integer :: npt,nch,nc,ns ! this routine "parses" character string str into different pieces @@ -284,12 +285,13 @@ subroutine tokenize(str1,tokens,ntok,toksep,nsep) !*************************************************************************** subroutine tokenize1(str1,tokens,ntok,toksep) +use grid_dims, only : str_len implicit none integer :: ntok character(len=*) :: str1,tokens(*) character(len=1), intent(in) :: toksep -character(len=256) :: str +character(len=str_len) :: str integer :: nch,ist,npt,nc ! this routine "parses" character string str into different pieces @@ -348,11 +350,12 @@ subroutine tokfind(toks,ntok,str,iff) !*************************************************************************** subroutine rams_intsort(ni,nums,cstr) +use grid_dims, only : str_len implicit none integer :: nums(*),ni character(len=*) :: cstr(*) -character(len=200) :: cscr +character(len=str_len) :: cscr integer :: n,mini,nm,nmm,nscr ! sort an array of character strings by an associated integer field @@ -379,12 +382,13 @@ subroutine rams_intsort(ni,nums,cstr) !*************************************************************************** subroutine rams_fltsort(ni,xnums,cstr) +use grid_dims, only : str_len implicit none integer :: ni real :: xnums(*) character(len=*) :: cstr(*) -character(len=200) :: cscr +character(len=str_len) :: cscr integer :: n,nm,nmm real :: xmini,xnscr @@ -557,6 +561,7 @@ end subroutine tolower ! These subroutines were in dateutils, but they fit better in this file... ! !------------------------------------------------------------------------------------------! subroutine RAMS_dintsort(ni,chnums,cstr) + use grid_dims, only : str_len implicit none integer :: ni character(len=14) :: chnums(*) @@ -564,7 +569,7 @@ subroutine RAMS_dintsort(ni,chnums,cstr) ! sort an array of character strings by an associated character field - character(len=200) :: cscr + character(len=str_len) :: cscr character(len=14) :: mini,nscr integer :: n,nm,nmm diff --git a/BRAMS/src/lib/getvar.f90 b/BRAMS/src/lib/getvar.f90 index 85406e757..02d8f33c7 100644 --- a/BRAMS/src/lib/getvar.f90 +++ b/BRAMS/src/lib/getvar.f90 @@ -7,7 +7,7 @@ !########################################################################### integer function RAMS_getvar (string,ngrd,a,b,flnm) - + use grid_dims, only : str_len use an_header implicit none @@ -18,7 +18,7 @@ integer function RAMS_getvar (string,ngrd,a,b,flnm) integer :: itype,ngrd,rams_c_pos character(len=*) :: flnm,string character(len=1) :: cgrid - character(len=128) :: flng + character(len=str_len) :: flng logical :: there integer :: ni,npts,iword diff --git a/BRAMS/src/lib/numutils.f90 b/BRAMS/src/lib/numutils.f90 index 8258debd6..334cfa37e 100644 --- a/BRAMS/src/lib/numutils.f90 +++ b/BRAMS/src/lib/numutils.f90 @@ -1889,32 +1889,37 @@ end function check_real + !==========================================================================================! !==========================================================================================! ! This subroutine will solve the linear system AA . X = Y for given AA and Y, using ! ! the Gaussian elimination method with partial pivoting and back-substitution. ! +! This subroutine is based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press. ! !------------------------------------------------------------------------------------------! subroutine lisys_solver(nsiz,AA,Y,X,sing) implicit none !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: nsiz ! matrix and vector size - real , dimension(nsiz,nsiz), intent(in) :: AA ! matrix - real , dimension(nsiz) , intent(in) :: Y ! right-hand side vector - real , dimension(nsiz) , intent(out) :: X ! unknown vector - logical , intent(out) :: sing ! The matrix was singular [T|F] + integer , intent(in) :: nsiz ! matrix and vector size + real(kind=4), dimension(nsiz,nsiz), intent(in) :: AA ! matrix + real(kind=4), dimension(nsiz) , intent(in) :: Y ! right-hand side vector + real(kind=4), dimension(nsiz) , intent(out) :: X ! unknown vector + logical , intent(out) :: sing ! The matrix is singular [T|F] !----- Local variables. ----------------------------------------------------------------! - real , dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. - real , dimension(nsiz) :: Z ! Copy of Y, for scaling - real , dimension(nsiz) :: dumvec ! Dummy vector, for row swapping - real :: pivot ! The pivot - real :: multip ! Multiplier - integer :: r ! Row index - integer :: b ! Row below index - integer :: c ! Column index - integer :: p ! Pivot index - real :: dumsca ! Dummy scalar, for row swapping + real(kind=4), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. + real(kind=4), dimension(nsiz) :: Z ! Copy of Y, for scaling + real(kind=4), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) + real(kind=4) :: pivot ! The pivot + real(kind=4) :: multip ! Multiplier + integer :: r ! Row index + integer :: b ! Row below index + integer :: c ! Column index + integer :: p ! Pivot index + real(kind=4) :: dumsca ! Dummy scalar (row swapping) !----- Local parameters. ---------------------------------------------------------------! - real , parameter :: tinyoff=1.e-20 + real(kind=4) , parameter :: tinyoff=1.e-20 !---------------------------------------------------------------------------------------! !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! @@ -1997,6 +2002,120 @@ end subroutine lisys_solver + +!==========================================================================================! +!==========================================================================================! +! This subroutine is the double precision version of the linear system solver above. ! +! It will solve the linear system AA . X = Y for given AA and Y, using the Gaussian ! +! elimination method with partial pivoting and back-substitution. This subroutine is ! +! based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press. ! +!------------------------------------------------------------------------------------------! +subroutine lisys_solver8(nsiz,AA,Y,X,sing) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: nsiz ! matrix and vector size + real(kind=8), dimension(nsiz,nsiz), intent(in) :: AA ! matrix + real(kind=8), dimension(nsiz) , intent(in) :: Y ! right-hand side vector + real(kind=8), dimension(nsiz) , intent(out) :: X ! unknown vector + logical , intent(out) :: sing ! The matrix was singular [T|F] + !----- Local variables. ----------------------------------------------------------------! + real(kind=8), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. + real(kind=8), dimension(nsiz) :: Z ! Copy of Y, for scaling + real(kind=8), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) + real(kind=8) :: pivot ! The pivot + real(kind=8) :: multip ! Multiplier + integer :: r ! Row index + integer :: b ! Row below index + integer :: c ! Column index + integer :: p ! Pivot index + real(kind=8) :: dumsca ! Dummy scalar (row swapping) + !----- Local parameters. ---------------------------------------------------------------! + real(kind=8) , parameter :: tinyoff=1.d-20 + !---------------------------------------------------------------------------------------! + + !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! + EE(:,:) = AA(:,:) + Z (:) = Y (:) + dumvec = 0.d0 + dumsca = 0.d0 + !---------------------------------------------------------------------------------------! + ! We initialise X with a huge, non-sense value, which will become the answer when ! + ! the matrix is singular. ! + !---------------------------------------------------------------------------------------! + X (:) = -huge(1.d0) + !----- We first assume that everything will be fine. -----------------------------------! + sing = .false. + + !---------------------------------------------------------------------------------------! + ! 1. Main elimination loop, done row by row. ! + !---------------------------------------------------------------------------------------! + elimloop: do r = 1, nsiz-1 + !------ 1a. Finding the largest element, which will become our pivot ----------------! + p = (r-1) + maxloc(abs(EE(r:nsiz,r)),dim=1) + + pivot = maxval(abs(EE(r:nsiz,r))) + !------------------------------------------------------------------------------------! + ! 1b. Check the pivot and make sure it is a good one. If not, then this matrix is ! + ! singular or almost singular, and we cannot solve it, so we switch the flag and ! + ! return. ! + !------------------------------------------------------------------------------------! + if (pivot < tinyoff) then + sing = .true. + return + end if + + !----- 1c. If the best pivot is not the current row, we must swap them. -------------! + if (p /= r) then + dumvec(r:nsiz) = EE(r,r:nsiz) + dumsca = Z(r) + EE(r,r:nsiz) = EE(p,r:nsiz) + Z(r) = Z(p) + EE(p,r:nsiz) = dumvec(r:nsiz) + Z(p) = dumsca + end if + + !------------------------------------------------------------------------------------! + ! 1d. Eliminate rows below, everything to the left of the (,r) column will become ! + ! zero (we won't compute that, but they will be.). ! + !------------------------------------------------------------------------------------! + belowloop: do b=r+1,nsiz + multip = EE(b,r)/EE(r,r) + EE(b,r:nsiz) = EE(b,r:nsiz) - multip * EE(r,r:nsiz) + Z(b) = Z(b) - multip * Z(r) + end do belowloop + end do elimloop + + !---------------------------------------------------------------------------------------! + ! 2. We may be unlucky and discover that the matrix is singular at the last line, so we ! + ! check the last pivot too. ! + !---------------------------------------------------------------------------------------! + if (abs(EE(nsiz,nsiz)) < tinyoff) then + sing = .true. + return + end if + + !---------------------------------------------------------------------------------------! + ! 3. We now perform the back-substitution, to find the solution. ! + !---------------------------------------------------------------------------------------! + X(nsiz) = Z(nsiz) / EE(nsiz,nsiz) + backsubloop: do r=nsiz-1,1,-1 + b = r+1 + X(r) = (Z(r) - sum(EE(r,b:nsiz)*x(b:nsiz))) / EE(r,r) + end do backsubloop + + return +end subroutine lisys_solver8 +!==========================================================================================! +!==========================================================================================! + + + + + + !==========================================================================================! !==========================================================================================! ! This function checks whether a number is finite or not. This test will return true ! @@ -2063,3 +2182,117 @@ subroutine diagon(nsiz,mat,vec) end subroutine diagon !==========================================================================================! !==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! EIFUN8 -- This function computes the exponential integral function, defined by ! +! ! +! x_ ! +! | exp(t) ! +! Ei(x) = | -------- dt ! +! _| t ! +! 0 ! +! ! +! This function is based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press, section 6.3 p. 215-219. ! +! ! +! with the difference that we also solve for negative numbers. Zero cannot be solved, so ! +! if this happens, or if the sought number would lead to infinity, we stop the model. ! +!------------------------------------------------------------------------------------------! +real(kind=8) function eifun8(x) + use rconstants, only : euler_gam8 & ! intent(in) + , lnexp_min8 & ! intent(in) + , lnexp_max8 & ! intent(in) + , tiny_num8 ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + real(kind=8), intent(in) :: x + !----- Local variables. ----------------------------------------------------------------! + real(kind=8) :: sum + real(kind=8) :: term + real(kind=8) :: fact + real(kind=8) :: prev + real(kind=8) :: diter + integer :: iter + !----- Local constants. ----------------------------------------------------------------! + real(kind=8), parameter :: powerlim = 1.5d+01 + real(kind=8), parameter :: converge = 1.0d-7 + integer , parameter :: maxiter = 100 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Check what to do depending on the value of x. ! + !---------------------------------------------------------------------------------------! + if (x == 0.d0) then + !------------------------------------------------------------------------------------! + ! Zero. This is a singularity and the user should never call it in this case. ! + ! That's sad, but we ought to quit this run and tell the user why the run crashed. ! + !------------------------------------------------------------------------------------! + call abort_run('Exponential integral cannot be solved for x = 0.' & + ,'eifun8','numutils.f90') + elseif (x >= lnexp_max8) then + !----- Huge value, crash because this is iminent over-flow. -------------------------! + write(unit=*,fmt='(a,1x,es12.5)') 'Attempted X = ',x + write(unit=*,fmt='(a,1x,es12.5)') 'Maximum acceptable X =',lnexp_max8 + call abort_run('Exponential integral cannot be solved for x = 0.' & + ,'eifun8','numutils.f90') + elseif (abs(x) <= lnexp_min8) then + !----- Huge negative number, the result can be rounded to zero. ---------------------! + eifun8 = 0.d0 + elseif (abs(x) <= tiny_num8) then + !----- The number is too close to zero, bypass iterative methods. -------------------! + eifun8 = euler_gam8 + log(abs(x)) + elseif (abs(x) <= powerlim) then + !------------------------------------------------------------------------------------! + ! Input x is small, so we use the power method. ! + !------------------------------------------------------------------------------------! + fact = 1.d0 + sum = 0.d0 + powerloop: do iter=1,maxiter + diter = dble(iter) + fact = fact * x / diter + term = fact / diter + sum = sum + term + !----- If the term is tiny, we have reached convergence, quit the loop. ----------! + if (abs(term) < converge * abs(sum)) exit powerloop + end do powerloop + eifun8 = euler_gam8 + log(abs(x)) + sum + else + !------------------------------------------------------------------------------------! + ! Input x is large, so we use the asymptotic approximation. ! + !------------------------------------------------------------------------------------! + sum = 0.d0 + term = 1.d0 + asymploop: do iter=1,maxiter + diter = dble(iter) + prev = term + term = term * diter / x + if (abs(term) < converge) then + !----- The term is tiny, we have reached convergence, quit the loop. ----------! + exit asymploop + elseif (abs(term) >= abs(prev)) then + !------------------------------------------------------------------------------! + ! Series is diverging, we are probably reaching round-off errors, we better ! + ! stop now. ! + !------------------------------------------------------------------------------! + sum = sum - prev + exit asymploop + else + sum = sum + term + end if + end do asymploop + eifun8 = exp(x) * (1.d0 + sum) / x + end if + + return +end function eifun8 +!==========================================================================================! +!==========================================================================================! diff --git a/BRAMS/src/lib/rconstants.f90 b/BRAMS/src/lib/rconstants.f90 index ff51fe582..a0374808d 100644 --- a/BRAMS/src/lib/rconstants.f90 +++ b/BRAMS/src/lib/rconstants.f90 @@ -25,6 +25,7 @@ Module rconstants real, parameter :: sqrtpii = 0.564189583547756 ! 1/(pi**0.5) [ ---] real, parameter :: sqrthalfpi = 1.2533141373155 ! (pi/2)**0.5 [ ---] real, parameter :: sqrttwopi = 2. * sqrthalfpi ! (2*pi)**0.5 [ ---] + real, parameter :: euler_gam = 0.577215664901533 ! Euler's constant [ ---] !---------------------------------------------------------------------------------------! @@ -160,10 +161,12 @@ Module rconstants real, parameter :: rocv = rdry / cv ! Ra/Cv [ ----] real, parameter :: cpocv = cp / cv ! Cp/Cv [ ----] real, parameter :: cpor = cp / rdry ! Cp/Ra [ ----] + real, parameter :: cvor = cv / rdry ! Cp/Ra [ ----] real, parameter :: gocp = grav / cp ! g/Cp, dry adiabatic lapse rate [ K/m] real, parameter :: gordry = grav / rdry ! g/Ra [ K/m] real, parameter :: cpi = 1. / cp ! 1/Cp [ kg K/J] real, parameter :: cpi4 = 4. * cpi ! 4/Cp [ kg K/J] + real, parameter :: p00or = p00 / rdry ! p0 ** (Ra/Cp) [ Pa^2/7] real, parameter :: p00k = 26.8269579527 ! p0 ** (Ra/Cp) [ Pa^2/7] real, parameter :: p00ki = 1. / p00k ! p0 ** (-Ra/Cp) [ Pa^-2/7] !---------------------------------------------------------------------------------------! @@ -437,6 +440,7 @@ Module rconstants real(kind=8), parameter :: lnexp_max8 = dble(lnexp_max ) real(kind=8), parameter :: huge_num8 = dble(huge_num ) real(kind=8), parameter :: tiny_num8 = dble(tiny_num ) + real(kind=8), parameter :: euler_gam8 = dble(euler_gam ) !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/lib/vformat.f90 b/BRAMS/src/lib/vformat.f90 index 41c2a646c..b0fedff51 100644 --- a/BRAMS/src/lib/vformat.f90 +++ b/BRAMS/src/lib/vformat.f90 @@ -134,6 +134,7 @@ subroutine vforec(iunit,a,n,nbits,scr,type) !-------------------------------------------------------- subroutine vwrt(iunit,a,n,bias,fact,nbits,scr,type) +use grid_dims, only : str_len implicit none integer :: iunit,n,nbits real :: a(n),scr(n) @@ -142,7 +143,8 @@ subroutine vwrt(iunit,a,n,bias,fact,nbits,scr,type) character(len=1) :: vc common/vform/vc(0:63) -character :: line*80,form*5 +character(len=str_len) :: line +character(len=5) :: form integer :: i,nvalline,nchs,ic,ii,isval,iii,iscr real :: scfct @@ -184,6 +186,7 @@ subroutine vwrt(iunit,a,n,bias,fact,nbits,scr,type) !-------------------------------------------------------- subroutine vfirec(iunit,a,n,type) +use grid_dims, only : str_len implicit none integer :: iunit,n real :: a(n) @@ -191,7 +194,8 @@ subroutine vfirec(iunit,a,n,type) character(len=1) :: vc common/vform/vc(0:63) -character :: line*80, cs*1 +character(len=str_len) :: line +character(len=1) :: cs integer :: ich0,ich9,ichcz,ichca,ichla,ichlz integer :: i,nvalline,nchs,ic,ii,isval,iii,ics,nn,nbits,nc real :: bias,fact,facti,scfct @@ -318,6 +322,7 @@ subroutine viorec(iunit,ia,n,nbits,scr) !-------------------------------------------------------- subroutine vwrti(iunit,ia,n,bias,fact,nbits,iscr) +use grid_dims, only : str_len implicit none integer :: iunit,n,nbits integer :: ia(n),iscr(n) @@ -326,7 +331,8 @@ subroutine vwrti(iunit,ia,n,bias,fact,nbits,iscr) character(len=1) :: vc common/vform/vc(0:63) -character line*80,form*5 +character(len=str_len) :: line +character(len=5) :: form do 10 i=1,n iscr(i)=(ia(i)+bias)*fact+.001 @@ -358,13 +364,15 @@ subroutine vwrti(iunit,ia,n,bias,fact,nbits,iscr) !-------------------------------------------------------- subroutine viirec(iunit,ia,n) +use grid_dims, only : str_len implicit none integer :: n,iunit integer :: ia(n) character(len=1) :: vc common/vform/vc(0:63) -character line*80, cs*1 +character(len=str_len) :: line +character(len=1) :: cs integer :: ich0,ich9,ichcz,ichca,ichla,ichlz integer :: nn,nbits,nvalline,nchs,i,ic,ii,isval,iii,ics,nc diff --git a/BRAMS/src/memory/grid_dims.f90 b/BRAMS/src/memory/grid_dims.f90 index 30103e699..93cf9141b 100644 --- a/BRAMS/src/memory/grid_dims.f90 +++ b/BRAMS/src/memory/grid_dims.f90 @@ -45,7 +45,7 @@ module grid_dims integer, parameter :: nxpmax = 600 integer, parameter :: nypmax = 600 integer, parameter :: nzpmax = 132 - integer, parameter :: nzgmax = 20 + integer, parameter :: nzgmax = 100 integer, parameter :: maxsclr = 150 integer, parameter :: maxhp = 1000 integer, parameter :: maxdim = max(nxpmax,nypmax,nzpmax+10,nzgmax) diff --git a/BRAMS/src/memory/mem_varinit.f90 b/BRAMS/src/memory/mem_varinit.f90 index 1a5f03c54..2e617214d 100644 --- a/BRAMS/src/memory/mem_varinit.f90 +++ b/BRAMS/src/memory/mem_varinit.f90 @@ -31,10 +31,10 @@ module mem_varinit integer :: nud_type, nnudfiles, nnudfl, nudlat - character(len=128), dimension(maxnudfiles) :: fnames_nud + character(len=str_len), dimension(maxnudfiles) :: fnames_nud character(len=14) , dimension(maxnudfiles) :: itotdate_nud real(kind=8), dimension(maxnudfiles) :: nud_times - character(len=128) :: nud_hfile + character(len=str_len) :: nud_hfile real :: tnudlat,tnudcent,tnudtop,znudtop real :: wt_nudge_uv,wt_nudge_th,wt_nudge_pi,wt_nudge_rt,wt_nudge_co2 real :: wt_nudge_grid(maxgrds) @@ -44,20 +44,20 @@ module mem_varinit !---------------------------------------------------------------------------- integer :: nud_cond, ncondfiles, ncondfl - character(len=128), dimension(maxnudfiles) :: fnames_cond + character(len=str_len), dimension(maxnudfiles) :: fnames_cond character(len=14) , dimension(maxnudfiles) :: itotdate_cond real(kind=8), dimension(maxnudfiles) :: cond_times - character(len=128) :: cond_hfile + character(len=str_len) :: cond_hfile real :: tcond_beg, tcond_end, wt_nudgec_grid(maxgrds),t_nudge_rc real(kind=8) :: condtime1, condtime2 !---------------------------------------------------------------------------- - character(len=128), dimension(maxnudfiles) :: fnames_varf + character(len=str_len), dimension(maxnudfiles) :: fnames_varf character(len=14) , dimension(maxnudfiles) :: itotdate_varf real(kind=8), dimension(maxnudfiles) :: varf_times - character(len=256) :: varfpfx + character(len=str_len) :: varfpfx ! Modif. by ALF real(kind=8) :: vtime1,vtime2 diff --git a/BRAMS/src/memory/rams_mem_alloc.f90 b/BRAMS/src/memory/rams_mem_alloc.f90 index f42c6fdc6..e29f44dbe 100644 --- a/BRAMS/src/memory/rams_mem_alloc.f90 +++ b/BRAMS/src/memory/rams_mem_alloc.f90 @@ -11,7 +11,8 @@ subroutine rams_mem_alloc(proc_type) use mem_all use node_mod - use leaf_coms , only : alloc_leafcol ! ! sub-routine + use leaf_coms , only : alloc_leafcol & ! sub-routine + , sfclyr_init_params ! ! sub-routine use io_params , only : maxlite & ! intent(in) , lite_vars & ! intent(in) , nlite_vars & ! intent(in) @@ -278,6 +279,8 @@ subroutine rams_mem_alloc(proc_type) ! Bob (1/10/2002) added the following line. Is this the right place for the long term?? ! !---------------------------------------------------------------------------------------! call alloc_leafcol(nzg,nzs) + !----- Initialise some of the parameters for the CLM-based similarity theory model. ----! + call sfclyr_init_params() !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/memory/vtab_fill.f90 b/BRAMS/src/memory/vtab_fill.f90 index c60678d8e..3fb5884cc 100644 --- a/BRAMS/src/memory/vtab_fill.f90 +++ b/BRAMS/src/memory/vtab_fill.f90 @@ -6,7 +6,7 @@ ! Regional Atmospheric Modeling System - RAMS ! !==========================================================================================! subroutine vtables2(var,varm,ng,npts,imean,tabstr) - + use grid_dims, only : str_len use var_tables implicit none @@ -14,7 +14,7 @@ subroutine vtables2(var,varm,ng,npts,imean,tabstr) real, dimension (npts), target :: var,varm character (len=*), intent(in) :: tabstr - character (len=80) ::line + character (len=str_len) ::line character (len=1) ::toksep=':', cdimen,ctype character (len=32) ::tokens(10) character (len=8) :: cname,ctab @@ -141,7 +141,7 @@ end subroutine lite_varset !------------------------------------------------------------------------- subroutine vtables_scalar(npts,varp,vart,ng,tabstr) - + use grid_dims, only : str_len use var_tables implicit none @@ -150,7 +150,7 @@ subroutine vtables_scalar(npts,varp,vart,ng,tabstr) integer, intent(in) :: ng character (len=*), intent(in) :: tabstr - character (len=80) ::line + character (len=str_len) ::line character (len=1) ::toksep=':' character (len=32) ::tokens(10) character (len=16) :: cname,ctab @@ -202,14 +202,14 @@ subroutine vtables_scalar(npts,varp,vart,ng,tabstr) subroutine vtables_scalar_new(varp,vart,ng,tabstr,elements) use var_tables - + use grid_dims, only : str_len implicit none integer :: elements !ALF real, target :: varp(elements), vart(elements) integer, intent(in) :: ng character (len=*), intent(in) :: tabstr - character (len=80) ::line + character (len=str_len) ::line character (len=1) ::toksep=':' character (len=32) ::tokens(10) character (len=16) :: cname,ctab diff --git a/BRAMS/src/micro/mic_init.f90 b/BRAMS/src/micro/mic_init.f90 index aab3801df..7ac3921f6 100644 --- a/BRAMS/src/micro/mic_init.f90 +++ b/BRAMS/src/micro/mic_init.f90 @@ -72,55 +72,50 @@ end subroutine micro_1st !==========================================================================================! !==========================================================================================! subroutine micro_master(dn01dntop) - - use therm_lib , only : & - bulk_on ! ! intent(in) - - use micphys , only : & - cparm & !intent(in) - ,rparm & !intent(in) - ,pparm & !intent(in) - ,sparm & !intent(in) - ,aparm & !intent(in) - ,gparm & !intent(in) - ,hparm & !intent(in) - ,icloud & !intent(in) - ,irain & !intent(in) - ,ipris & !intent(in) - ,isnow & !intent(in) - ,iaggr & !intent(in) - ,igraup & !intent(in) - ,ihail & !intent(in) - ,parm & !intent(out) - ,nhcat & !intent(in) - ,cfmas & !intent(out) - ,pwmas & !intent(out) - ,cfvt & !intent(out) - ,pwvt & !intent(out) - ,ipairc & !intent(out) - ,ipairr & !intent(out) - ,ncat & !intent(in) - ,emb0 & !intent(out) - ,emb1 & !intent(out) - ,emb2 & !intent(out) - ,rxmin & !intent(in) - ,cxmin & !intent(out) - ,mkcoltab & !intent(in) - ,coltabfn & !intent(in) - ,gnu & !intent(inout) - ,npairc & !intent(in) - ,coltabc & !intent(inout) - ,nembc & !intent(inout) - ,npairr & !intent(in) - ,coltabr & !intent(inout) - ,progncat & !intent(in) - ,shapefac ! !intent(out) - - use micro_coms, only : & - dstprms & ! intent(in) - ,lcat_lhcat & ! intent(in) - ,jpairr & ! intent(in) - ,jpairc ! ! intent(in) + use grid_dims , only : str_len ! ! intent(in) + use therm_lib , only : bulk_on ! ! intent(in) + use micphys , only : cparm & ! intent(in) + , rparm & ! intent(in) + , pparm & ! intent(in) + , sparm & ! intent(in) + , aparm & ! intent(in) + , gparm & ! intent(in) + , hparm & ! intent(in) + , icloud & ! intent(in) + , irain & ! intent(in) + , ipris & ! intent(in) + , isnow & ! intent(in) + , iaggr & ! intent(in) + , igraup & ! intent(in) + , ihail & ! intent(in) + , parm & ! intent(out) + , nhcat & ! intent(in) + , cfmas & ! intent(out) + , pwmas & ! intent(out) + , cfvt & ! intent(out) + , pwvt & ! intent(out) + , ipairc & ! intent(out) + , ipairr & ! intent(out) + , ncat & ! intent(in) + , emb0 & ! intent(out) + , emb1 & ! intent(out) + , emb2 & ! intent(out) + , rxmin & ! intent(in) + , cxmin & ! intent(out) + , mkcoltab & ! intent(in) + , coltabfn & ! intent(in) + , gnu & ! intent(inout) + , npairc & ! intent(in) + , coltabc & ! intent(inout) + , nembc & ! intent(inout) + , npairr & ! intent(in) + , coltabr & ! intent(inout) + , progncat & ! intent(in) + , shapefac ! ! intent(out) + use micro_coms, only : dstprms & ! intent(in) + , lcat_lhcat & ! intent(in) + , jpairr & ! intent(in) + , jpairc ! ! intent(in) implicit none @@ -128,7 +123,7 @@ subroutine micro_master(dn01dntop) real , intent(in) :: dn01dntop !----- Local variables -----------------------------------------------------------------! integer :: lhcat,khcat,lcat,nd1,nd2,nip,ilcat,ilhcat,idum - character(len=80) :: dataline,cname + character(len=str_len) :: dataline,cname real :: pwen0_tmp, glg, glgm, cfen0_tmp !----- Functions -----------------------------------------------------------------------! real, external :: gammln diff --git a/BRAMS/src/micro/micphys.f90 b/BRAMS/src/micro/micphys.f90 index 170997de1..28cb017b3 100644 --- a/BRAMS/src/micro/micphys.f90 +++ b/BRAMS/src/micro/micphys.f90 @@ -8,7 +8,7 @@ !==========================================================================================! module micphys - use grid_dims, only: nzpmax, maxgrds + use grid_dims, only: nzpmax, maxgrds, str_len !---------------------------------------------------------------------------------------! ! The product [(nthz-1) * dthz ] must equal 25.0. ! @@ -137,7 +137,7 @@ module micphys real, dimension(nd1cr,nr2cr,nd2cr) :: r1tabcr,c1tabcr real, dimension(nr2rr,nd2rr) :: c2tabrr - character(len=256) :: coltabfn + character(len=str_len) :: coltabfn end module micphys diff --git a/BRAMS/src/mksfc/geodat.f90 b/BRAMS/src/mksfc/geodat.f90 index 3419848a2..224528ac6 100644 --- a/BRAMS/src/mksfc/geodat.f90 +++ b/BRAMS/src/mksfc/geodat.f90 @@ -11,11 +11,12 @@ subroutine geodat(n2,n3,datr,hfn,ofn,vt2da,vt2db,ngr,vnam) use mem_grid use io_params use rconstants, only: spcon +use grid_dims, only : str_len implicit none integer :: n2,n3,ngr real :: vt2da(*),vt2db(*),datr(n2,n3) -character(len=80) :: hfn,ofn,title +character(len=str_len) :: hfn,ofn,title character(len=3) :: vnam integer :: lb,iblksizo,no,isbego,iwbego,iodim,mof,niq,njq,np @@ -103,6 +104,7 @@ subroutine sfcopqr(no,mof,np,niq,njq,n2,n3,xt,yt,platn,plonn & ,ofn,offlat,offlon,vnam,ngr,itopsflg,iz0flg) use teb_spm_start, only: TEB_SPM +use grid_dims, only : str_len implicit none integer :: no,mof,np,niq,njq,n2,n3,iblksizo,isbego,iwbego,ngr & @@ -110,12 +112,12 @@ subroutine sfcopqr(no,mof,np,niq,njq,n2,n3,xt,yt,platn,plonn & real :: dato(no,no,mof),datp(np,np),datq(niq,njq),datr(n2,n3) & ,xt(n2),yt(n3) real :: erad,deltallo,deltaxp,deltayp,deltaxq,deltayq,offlat,offlon -character(len=80) :: ofn,title3 +character(len=str_len) :: ofn,title3 character(len=3) :: title1,vnam character(len=4) :: title2 logical l1,l2 integer,parameter :: maxmiss=1000 -character(len=80) :: fnmiss(maxmiss) +character(len=str_len) :: fnmiss(maxmiss) real, allocatable :: sdq(:,:),shaq(:,:),sdr(:,:),datre(:,:) real, allocatable :: iso(:),iwo(:) @@ -523,17 +525,18 @@ SUBROUTINE ZOQ(NIQ,NJQ,DATQ,SDQ,NGR) !********************************************************************** subroutine dted(no,pathname,lat,lon,dato) +use grid_dims, only : str_len implicit none integer :: no,lat,lon real :: dato(no,no) -character(len=80) :: pathname +character(len=str_len) :: pathname ! Let's try and bypass all the bookeeping and just read the file ! Note that the latitude bands are 5 degrees less than those ! specified in the original code from Sarma since we are not ! considering the max latitude but rather the start latitude. -character(len=80) :: fname +character(len=str_len) :: fname integer :: ifact,notfnd ifact = 6 @@ -557,6 +560,7 @@ subroutine dted(no,pathname,lat,lon,dato) ! ---------------------------------------------------------------------- subroutine dtedint(no,iwres,lon,lat,notfnd,pathname,dato) +use grid_dims, only : str_len implicit none integer :: no,iwres,lon,lat,notfnd real :: dato(no,no) @@ -572,11 +576,11 @@ subroutine dtedint(no,iwres,lon,lat,notfnd,pathname,dato) ! new input data holding arrays: real readin2(360000) -character*16 newname1*80,fmtstr*5,newne*6 +character*16 newname1*str_len,fmtstr*5,newne*6 character*3 degns,degew character*12 dtedfile character*4 subdir -character*80 extdted,callname +character(len=str_len) :: extdted,callname real :: dtedwk(600,600) integer :: no_blanks,i,num_chrs,ifile,lc,isave,ndtx,ndty,ik,jk,ibtre,j,id real :: rvaln,wt diff --git a/BRAMS/src/mksfc/landuse_input.F90 b/BRAMS/src/mksfc/landuse_input.F90 index ae5ff6755..0d6de2332 100644 --- a/BRAMS/src/mksfc/landuse_input.F90 +++ b/BRAMS/src/mksfc/landuse_input.F90 @@ -8,12 +8,12 @@ subroutine patch_array_size(npq,deltax & ,ivegtflg,ivegtfn,isoilflg,isoilfn,ndviflg,ndvifn) use rconstants, only : spcon - + use grid_dims, only : str_len implicit none integer :: npq,ivegtflg,isoilflg,ndviflg character(len=*) :: ivegtfn,isoilfn,ndvifn - character(len=256) :: h5name + character(len=str_len) :: h5name real :: deltax integer :: iblksiz,no,isbeg,iwbeg @@ -31,7 +31,7 @@ subroutine patch_array_size(npq,deltax & if (isoilflg == 1) then call read_header(isoilfn,iblksiz,no,isbeg & - ,iwbeg,offlat,offlon,deltall,'soil',h5name) + ,iwbeg,offlat,offlon,deltall,'soil_text',h5name) deltallo_min = min(deltallo_min,deltall) endif @@ -110,15 +110,17 @@ end subroutine patch_latlon ! average value for each landuse-class-defined patch is assigned to that patch. ! !------------------------------------------------------------------------------------------! subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn & - ,ndviflg,ndvifn,cndvifil,iaction,platn,plonn,soil_text,patch_area & - ,leaf_class,veg_ndvif) + ,ndviflg,ndvifn,cndvifil,iaction,platn,plonn,soil_color,soil_text & + ,patch_area,leaf_class,veg_ndvif) use mem_mksfc use rconstants use mem_leaf , only : nslcon & ! intent(in) + , isoilcol & ! intent(in) , isfcl ! ! intent(in) use leaf_coms, only : min_patch_area & ! intent(in) , nstyp & ! intent(in) + , nscol & ! intent(in) , nvtyp & ! intent(in) , nvtyp_teb ! ! intent(in) use io_params, only : iuselai ! ! intent(in) @@ -145,14 +147,15 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn real, dimension(mzg,n2,n3,npat) , intent(inout) :: soil_text real, dimension(n2,n3,npat) , intent(inout) :: patch_area real, dimension(n2,n3,npat) , intent(inout) :: leaf_class + real, dimension(n2,n3,npat) , intent(inout) :: soil_color real, dimension(n2,n3,npat) , intent(inout) :: veg_ndvif !----- Local variables. ----------------------------------------------------------------! character(len=str_len), dimension(maxndvidata) :: fnmiss character(len=str_len) :: h5name integer , dimension(0:maxdatq) :: sumpix integer , dimension(0:maxdatq,2) :: ngrdpix - integer , dimension(0:maxdatq,nstyp) :: datq_soil - integer , dimension(0:maxdatq,nstyp) :: soil_tab + integer , dimension(0:maxdatq,0:nstyp) :: datq_soil + integer , dimension(0:maxdatq,0:nscol) :: datq_scol real , dimension(0:maxdatq) :: datq_ndvi real , dimension(0:maxdatq) :: sumndvi integer :: ing_prt @@ -340,14 +343,14 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn end do jvegloop !------------------------------------------------------------------------------------! - case ('soil') + case ('soil_text') !------------------------------------------------------------------------------------! ! Read in the header and data files. ! !------------------------------------------------------------------------------------! call read_header(isoilfn,iblksizo_soil,no_soil,isbego_soil,iwbego_soil,offlat_soil & - ,offlon_soil,deltallo_soil,'soil',h5name) + ,offlon_soil,deltallo_soil,'soil_text',h5name) call fill_datp(n2,n3,no_soil,iblksizo_soil,isbego_soil,iwbego_soil,platn,plonn & ,offlat_soil,offlon_soil,deltallo_soil,isoilfn,iaction,nmiss,fnmiss & @@ -369,7 +372,7 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn do idatq = 0,maxdatq ngrdpix(idatq,1) = 0 ! Initialise counter for datq pixels ngrdpix(idatq,2) = idatq ! Initialise array of consecutive datq values - do isoil = 1,nstyp + do isoil = 0,nstyp datq_soil(idatq,isoil) = 0 ! Initialise counter for datq pixels end do end do @@ -389,9 +392,7 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn ! and fill ngrdpix as a primary criterion if running ED. ! !---------------------------------------------------------------------! datsoil = nint(datp(ip,jp,ir,jr)) - datq_pat = datq_patch(ip,jp,ir,jr) - datq_soil(datq_pat,datsoil) = datq_soil(datq_pat,datsoil) + 1 ngrdpix(datsoil,1) = ngrdpix(datsoil,1) + 1 end do @@ -422,6 +423,7 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn ! maximum. ! !------------------------------------------------------------------! soil_count = 0 + jsoil = 0 do isoil = 1,nstyp if (datq_soil(datq_pat,isoil) > soil_count) then soil_count = datq_soil(datq_pat,isoil) @@ -565,6 +567,113 @@ subroutine landuse_opqr(n2,n3,mzg,npat,nvegpat,ivegtflg,ivegtfn,isoilflg,isoilfn end do isoilloop end do jsoilloop + case ('soil_col') + + + !------------------------------------------------------------------------------------! + ! Read in the header and data files. ! + !------------------------------------------------------------------------------------! + call read_header(isoilfn,iblksizo_soil,no_soil,isbego_soil,iwbego_soil,offlat_soil & + ,offlon_soil,deltallo_soil,'soil_col',h5name) + + call fill_datp(n2,n3,no_soil,iblksizo_soil,isbego_soil,iwbego_soil,platn,plonn & + ,offlat_soil,offlon_soil,deltallo_soil,isoilfn,iaction,nmiss,fnmiss & + ,h5name) + !------------------------------------------------------------------------------------! + + + + + !------------------------------------------------------------------------------------! + jsoilloop2: do jr = 1,n3 + isoilloop2: do ir = 1,n2 + if (patch_area(ir,jr,1) < 1.0) then + + !---------------------------------------------------------------------------! + ! Here we initialise both ngrdpix and datq_soil, because we will assign ! + ! patches differently depending on the surface model (LEAF or ED). ! + !---------------------------------------------------------------------------! + do idatq = 0,maxdatq + ngrdpix(idatq,1) = 0 ! Initialise counter for datq pixels + ngrdpix(idatq,2) = idatq ! Initialise array of consecutive datq values + do isoil = 1,nscol + datq_scol(idatq,isoil) = 0 ! Initialise counter for datq pixels + end do + end do + !---------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------! + ! Count the pixels for this grid point. ! + !---------------------------------------------------------------------------! + do jp = 1,npq + do ip = 1,npq + + !---------------------------------------------------------------------! + ! Fill datq_soil values as secondary criterion. ! + !---------------------------------------------------------------------! + datsoil = nint(datp(ip,jp,ir,jr)) + + datq_pat = datq_patch(ip,jp,ir,jr) + datq_scol(datq_pat,datsoil) = datq_scol(datq_pat,datsoil) + 1 + end do + end do + !---------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------! + ! Select the commonest soil colour class for each vegetation (LEAF-3) ! + ! or soil texture type (ED-2), as they may be correlated. ! + !---------------------------------------------------------------------------! + do ipat = 2,nvegpat+1 + + if (patch_area(ir,jr,ipat) >= min_patch_area) then + + select case (isfcl) + case (1,2) + datq_pat = nint(leaf_class(ir,jr,ipat)) + case (5) + datq_pat = nint(soil_text(mzg,ir,jr,ipat)) + end select + + !---------------------------------------------------------------------! + ! Find isoil value for which datq_soil(datq_pat,isoil) is a ! + ! maximum. ! + !---------------------------------------------------------------------! + soil_count = 0 + do isoil = 1,nscol + if (datq_scol(datq_pat,isoil) > soil_count) then + soil_count = datq_scol(datq_pat,isoil) + jsoil = isoil + end if + end do + + checksum = checksum + float(jsoil) + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! For now, assume single level of input soil data (e.g., FAO) ! + ! and fill all soil levels with this value. ! + !---------------------------------------------------------------------! + if (jsoil /= 0) then + soil_color(ir,jr,ipat) = float(jsoil) + else + soil_color(ir,jr,ipat) = float(isoilcol) + end if + !---------------------------------------------------------------------! + end if + end do + !---------------------------------------------------------------------------! + end if + end do isoilloop2 + end do jsoilloop2 + case ('ndvi') @@ -659,11 +768,11 @@ end subroutine landuse_opqr !==========================================================================================! subroutine read_header(ofn,iblksizo,no,isbego,iwbego,offlat,offlon,deltallo & ,ifield,h5name) - +use grid_dims, only : str_len implicit none integer :: iblksizo,no,isbego,iwbego,lb real :: offlat,offlon,deltallo -character :: ofn*(*),title*256,ifield*(*) +character :: ofn*(*),title*str_len,ifield*(*) character :: h5name*(*) @@ -706,7 +815,8 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & use mem_mksfc use io_params, only : iuselai - +use leaf_coms, only : nstyp +use grid_dims, only : str_len #if USE_HDF5 use hdf5_utils #endif @@ -719,14 +829,14 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & integer :: n2,n3,no,iblksizo,isbego,iwbego,isoc,iwoc,iofr & ,isocpt,isocpo,iwocph,iwocpt,iwocpo,lb,io,jo & ,ir,jr,ip,jp,ind,nc3,nc2,j3d,j2d,j1d,ind1,ind2,io1,jo1 & - ,ifile_max,jfile_max,ifile,jfile,missing,ptab,ptab0,idatp,nn + ,ifile_max,jfile_max,ifile,jfile,ptab,ptab0,idatp,nn real :: rio,rjo,rno,platn,plonn,offlat,offlon & ,glatp1,glonp1,deltallo,wio2,wjo2,wio1,wjo1 -character :: title1*3,title2*4,title3*256 +character :: title1*3,title2*4,title3*str_len -logical l1,l2,h5 +logical l1,l2,h5,missing integer :: ndims,idims(4),ii,jj include 'interface.h' @@ -833,6 +943,7 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & enddo ! Read files and extract data +datp(:,:,:,:) = 0. do jfile = 1,jfile_max do ifile = 1,ifile_max @@ -903,10 +1014,10 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & h5 = l1 end if #endif -! Read file or set missing flag to 1 +! Read file or set missing flag to .true. if (l1) then - missing = 0 + missing = .false. !print*, 'getting file ',title3(1:lb),ir,jr,ip,jp print*, 'getting file ',trim(title3) @@ -963,7 +1074,7 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & nmiss=nmiss+1 fnmiss(nmiss)=title3(1:lb) 302 continue - missing = 1 + missing = .true. endif @@ -1018,24 +1129,23 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & stop 45 endif - if (missing .eq. 0) then + if (.not. missing) then - if (iaction .eq. 'veg' .or. iaction .eq. 'soil') then + select case (trim(iaction)) + case ('veg') io = nint(rio) jo = nint(rjo) idatp = ichar(cdato(io,jo)) - datp(ip,jp,ir,jr) = float(mod(idatp+256,256)) - !if(datp(ip,jp,ir,jr)> 94) then - ! print*,'big:',ip,jp,ir,jr,io,jo,datp(ip,jp,ir,jr) - ! datp(ip,jp,ir,jr)=94 - ! endif - - !write(6,207) ind,ptab,ip,jp,ir,jr,datp(ip,jp,ir,jr),io,jo,ichar(cdato(io,jo)) & - ! ,title3(1:lb) - !207 format('datp405',6i5,f7.2,3i5,a40) + datp(ip,jp,ir,jr) = float(mod(idatp+str_len,str_len)) + case ('soil_text') + io = nint(rio) + jo = nint(rjo) + idatp = ichar(cdato(io,jo)) + + datp(ip,jp,ir,jr) = float(mod(idatp+str_len,str_len)) - elseif (iaction .eq. 'ndvi') then + case ('ndvi') io1 = max(1,min(int(rio),no-1)) jo1 = max(1,min(int(rjo),no-1)) wio2 = rio - float(io1) @@ -1054,7 +1164,7 @@ subroutine fill_datp(n2,n3,no,iblksizo,isbego,iwbego & + wjo2 * dato(io1 ,jo1+1)) & + wio2 * (wjo1 * dato(io1+1,jo1 ) & + wjo2 * dato(io1+1,jo1+1)) - endif + end select else diff --git a/BRAMS/src/mksfc/mem_mksfc.f90 b/BRAMS/src/mksfc/mem_mksfc.f90 index a38dc98d8..9e7f5fd18 100644 --- a/BRAMS/src/mksfc/mem_mksfc.f90 +++ b/BRAMS/src/mksfc/mem_mksfc.f90 @@ -8,7 +8,7 @@ Module mem_mksfc - + use grid_dims, only : str_len Type sfcfile_vars @@ -16,7 +16,7 @@ Module mem_mksfc real, pointer, dimension(:,:,:,:) :: soil_text !(nxp,nyp,npatch) - real, pointer, dimension(:,:,:) :: patch_area,leaf_class,veg_ndvif + real, pointer, dimension(:,:,:) :: patch_area,leaf_class,veg_ndvif,soil_color !(nxp,nyp) real, pointer, dimension(:,:) :: topt, seatf, topzo @@ -64,13 +64,13 @@ Module mem_mksfc integer, parameter :: maxsstdata=6666 integer, dimension(maxsstdata,maxsfcgrids):: iyearvs,imonthvs,idatevs,ihourvs integer,dimension(maxsfcgrids) :: nvsstf - character(len=128), dimension(maxsstdata,maxsfcgrids) :: vsstfil + character(len=str_len), dimension(maxsstdata,maxsfcgrids) :: vsstfil ! NDVI file creation variables integer, parameter :: maxndvidata=6666 integer, dimension(maxndvidata,maxsfcgrids):: iyearvn,imonthvn,idatevn,ihourvn integer,dimension(maxsfcgrids) :: nvndvif - character(len=128), dimension(maxndvidata,maxsfcgrids) :: vndvifil + character(len=str_len), dimension(maxndvidata,maxsfcgrids) :: vndvifil Contains @@ -85,8 +85,9 @@ subroutine alloc_sfcfile(sfcfile,nx,ny,nzg,npat) allocate (sfcfile%soil_text (nzg,nx,ny,npat)) + allocate (sfcfile%soil_color (nx,ny,npat)) allocate (sfcfile%patch_area (nx,ny,npat)) - allocate (sfcfile%leaf_class (nx,ny,npat)) + allocate (sfcfile%leaf_class (nx,ny,npat)) allocate (sfcfile%veg_ndvif (nx,ny,npat)) allocate (sfcfile%topt (nx,ny)) @@ -110,6 +111,7 @@ subroutine dealloc_sfcfile(sfcfile) type (sfcfile_vars) :: sfcfile deallocate (sfcfile%soil_text) + deallocate (sfcfile%soil_color) deallocate (sfcfile%patch_area) deallocate (sfcfile%leaf_class) diff --git a/BRAMS/src/mksfc/mksfc_fuso.f90 b/BRAMS/src/mksfc/mksfc_fuso.f90 index 9405962cf..eaa9b2038 100644 --- a/BRAMS/src/mksfc/mksfc_fuso.f90 +++ b/BRAMS/src/mksfc/mksfc_fuso.f90 @@ -13,6 +13,7 @@ subroutine fuso_read(ifm) use mem_teb use mem_gaspart use io_params +use grid_dims, only : str_len USE teb_vars_const, only: iteb USE mem_emiss, only : ichemi,isource !for gas emission @@ -20,7 +21,7 @@ subroutine fuso_read(ifm) integer :: ifm,i,j -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid character(len=1) :: dummy logical :: there @@ -67,6 +68,7 @@ subroutine fuso_check(ifm,ierr) use mem_grid use io_params +use grid_dims, only : str_len ! This subroutine checks for the existence of a surface file for ! grid number ifm, and if it exists, also checks for agreement of @@ -83,7 +85,7 @@ subroutine fuso_check(ifm,ierr) ,nsifusoflg real :: sfdx,sfdy,sfplat,sfplon,sflat,sflon,glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid logical there @@ -174,12 +176,13 @@ subroutine fuso_write(ifm) use mem_mksfc use mem_grid use io_params +use grid_dims, only : str_len implicit none integer :: ifm,ip,k,i,j real :: glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid ! write surface characteristics, one file for each grid diff --git a/BRAMS/src/mksfc/mksfc_ndvi.f90 b/BRAMS/src/mksfc/mksfc_ndvi.f90 index 89258eb16..e6bb4642e 100644 --- a/BRAMS/src/mksfc/mksfc_ndvi.f90 +++ b/BRAMS/src/mksfc/mksfc_ndvi.f90 @@ -11,12 +11,13 @@ subroutine ndvi_read_dataheader(ifm) use mem_mksfc use io_params +use grid_dims, only : str_len implicit none integer :: ifm integer :: itime,nc -character(len=256) :: flnm,line,line2 +character(len=str_len) :: flnm,line,line2 character(len=1) :: dummy logical :: there integer, external :: lastslash @@ -127,6 +128,7 @@ subroutine ndvinest(ifm,ivtime) ,ivegtflg(ifm),ivegtfn(ifm),isoilflg(ifm),isoilfn(ifm) & ,ndviflg(ifm),ndvifn(ifm),vndvifil(ivtime,ifm) & ,'ndvi',platn(ifm),plonn(ifm) & + ,sfcfile_p(ifm)%soil_color & ,sfcfile_p(ifm)%soil_text & ,sfcfile_p(ifm)%patch_area & ,sfcfile_p(ifm)%leaf_class & @@ -181,12 +183,12 @@ subroutine ndvi_write(ifm,ivt) use mem_mksfc use mem_grid use io_params - +use grid_dims, only : str_len implicit none integer :: ifm,ivt,ip real :: glatr,glonr -character(len=256) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid real(kind=8) :: zero diff --git a/BRAMS/src/mksfc/mksfc_sfc.f90 b/BRAMS/src/mksfc/mksfc_sfc.f90 index 8533deb58..28d0e6053 100644 --- a/BRAMS/src/mksfc/mksfc_sfc.f90 +++ b/BRAMS/src/mksfc/mksfc_sfc.f90 @@ -12,13 +12,14 @@ subroutine sfc_read(ifm) use mem_grid use mem_leaf use io_params +use grid_dims, only : str_len implicit none integer :: ifm,ifileok,ipat,k,i,j logical :: there -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid character(len=1) :: dummy @@ -53,6 +54,10 @@ subroutine sfc_read(ifm) call vfirec(25,leaf_g(ifm)%leaf_class(:,:,ipat),nnxp(ifm)*nnyp(ifm),'LIN') enddo +do ipat = 1,npatch + call vfirec(25,leaf_g(ifm)%soil_color(:,:,ipat),nnxp(ifm)*nnyp(ifm),'LIN') +enddo + do ipat = 1,npatch call vfirec(25,leaf_g(ifm)%soil_text(:,:,:,ipat),nzg*nnxp(ifm)*nnyp(ifm),'LIN') enddo @@ -68,6 +73,7 @@ subroutine sfc_check(ifm,ierr) use mem_grid use io_params +use grid_dims, only : str_len ! This subroutine checks for the existence of a surface file for ! grid number ifm, and if it exists, also checks for agreement of @@ -84,7 +90,7 @@ subroutine sfc_check(ifm,ierr) ,nsivegtflg,nsisoilflg,nsnofilflg,nspatch real :: sfdx,sfdy,sfplat,sfplon,sflat,sflon,glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid logical there @@ -162,12 +168,13 @@ subroutine sfc_write(ifm) use mem_mksfc use mem_grid use io_params +use grid_dims, only : str_len implicit none integer :: ifm,ip,k,i,j real :: glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid ! write surface characteristics, one file for each grid @@ -202,6 +209,10 @@ subroutine sfc_write(ifm) call vforec(25,sfcfile_p(ifm)%leaf_class(:,:,ip),nnxyp(ifm),24,scrx,'LIN') enddo +do ip = 1,npatch + call vforec(25,sfcfile_p(ifm)%soil_color(:,:,ip),nnxyp(ifm),24,scrx,'LIN') +enddo + do ip = 1,npatch call vforec(25,sfcfile_p(ifm)%soil_text(:,:,:,ip),nzg*nnxyp(ifm),24,scrx,'LIN') enddo diff --git a/BRAMS/src/mksfc/mksfc_sst.f90 b/BRAMS/src/mksfc/mksfc_sst.f90 index f179a869b..a732bdfcb 100644 --- a/BRAMS/src/mksfc/mksfc_sst.f90 +++ b/BRAMS/src/mksfc/mksfc_sst.f90 @@ -11,12 +11,13 @@ subroutine sst_read_dataheader(ifm) use mem_mksfc use io_params +use grid_dims, only : str_len implicit none integer :: ifm integer :: itime,nc -character(len=256) :: flnm,line,line2 +character(len=str_len) :: flnm,line,line2 character(len=1) :: dummy logical :: there integer, external :: lastslash @@ -162,12 +163,12 @@ subroutine sst_write(ifm,ivt) use mem_mksfc use mem_grid use io_params - +use grid_dims, only : str_len implicit none integer :: ifm,ivt,i,j real :: glatr,glonr -character(len=256) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid real(kind=8) :: zero diff --git a/BRAMS/src/mksfc/mksfc_top.f90 b/BRAMS/src/mksfc/mksfc_top.f90 index 6984e52c3..58ec13db2 100644 --- a/BRAMS/src/mksfc/mksfc_top.f90 +++ b/BRAMS/src/mksfc/mksfc_top.f90 @@ -10,12 +10,12 @@ subroutine top_read(ifm) use mem_grid use io_params - +use grid_dims, only : str_len implicit none integer :: ifm,i,j -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid character(len=1) :: dummy logical :: there @@ -57,6 +57,7 @@ subroutine top_check(ifm,ierr) use mem_grid use io_params +use grid_dims, only : str_len ! This subroutine checks for the existence of a surface file for ! grid number ifm, and if it exists, also checks for agreement of @@ -74,7 +75,7 @@ subroutine top_check(ifm,ierr) real :: sfdx,sfdy,sfplat,sfplon,sflat,sflon,stoptenh,stoptwvl & ,sz0max,sz0fact,glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid logical there @@ -179,12 +180,13 @@ subroutine top_write(ifm) use mem_mksfc use mem_grid use io_params +use grid_dims, only : str_len implicit none integer :: ifm,ip,k,i,j real :: glatr,glonr -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=2) :: cgrid ! write surface characteristics, one file for each grid diff --git a/BRAMS/src/mksfc/ndvi_read.f90 b/BRAMS/src/mksfc/ndvi_read.f90 index 24000b63a..79c561b7c 100644 --- a/BRAMS/src/mksfc/ndvi_read.f90 +++ b/BRAMS/src/mksfc/ndvi_read.f90 @@ -40,6 +40,7 @@ subroutine ndvi_read(runflag,ifm,ierr) ! Find init and start date call date_make_big(iyeara,imontha,idatea,itimea*100 & ,totdate_init) + if (runtype == 'HISTORY') then call date_add_to_big(totdate_init,time,'s',totdate_start) @@ -314,24 +315,25 @@ subroutine ndvi_file_inv (ndvifilin,ierr) ! start printing section !-------------------------------------------------------------- - print*,' ' - print*,' ' - print*,' ' - print*,'-------------------------------------------------------------' - print*,'----------- NDVI Input File Inventory: Grid '//cgrid - print*,'-------------------------------------------------------------' + write(unit=*,fmt='(a)') ' ' + write(unit=*,fmt='(a)') ' ' + write(unit=*,fmt='(a)') ' ' + write(unit=*,fmt='(a)') ' ' + write(unit=*,fmt='(a)') '-------------------------------------------------------------' + write(unit=*,fmt='(10x,a,i5)') 'NDVI Input File Inventory: Grid ',ng + write(unit=*,fmt='(a)') '-------------------------------------------------------------' do nf=1,nndvifiles(ng) - print*, itotdate_ndvi(nf,ng),' ',trim(fnames_ndvi(nf,ng)) - enddo - print*,'------------------------------------------------------' + write(unit=*,fmt='(a14,3x,a)') itotdate_ndvi(nf,ng),trim(fnames_ndvi(nf,ng)) + end do + write(unit=*,fmt='(a)') '-------------------------------------------------------------' -enddo +end do ! Check the cyclic condition. Only relevant if we are updating in time. ! WE ARE ONLY ALLOWING CYCLIC ON ALL GRIDS if(indvicycdata > 0) then if(indvicycdata /= sum(nndvifiles(1:ngrids))) then - print*, 'All ndvi surface files do not have year 0000' + print*, 'None of the NDVI surface files has year 0000' print*, 'This confuses the gods and can not occur.' stop 'ndvi_inv' endif @@ -355,6 +357,7 @@ subroutine ndvi_update(iswap,nfile) use mem_leaf use mem_grid use io_params +use grid_dims, only : str_len implicit none @@ -364,7 +367,7 @@ subroutine ndvi_update(iswap,nfile) integer :: ng,nc,ip character(len=1) :: cgrid -character(len=128) :: flnm +character(len=str_len) :: flnm character(len=1) :: dummy @@ -389,6 +392,8 @@ subroutine ndvi_update(iswap,nfile) nc=len_trim(flnm)-4 flnm(nc:nc)=cgrid + + call rams_f_open(iun,flnm,'FORMATTED','OLD','READ',0) ! Skip header lines read(iun,*) dummy diff --git a/BRAMS/src/mksfc/nest_geosst.f90 b/BRAMS/src/mksfc/nest_geosst.f90 index f50dd4e72..97de3cdfd 100644 --- a/BRAMS/src/mksfc/nest_geosst.f90 +++ b/BRAMS/src/mksfc/nest_geosst.f90 @@ -194,7 +194,8 @@ subroutine geonest_file(ifm) write (unit=*,fmt='(a)') '-----------------------------------------------------' write (unit=*,fmt='(a)') ' ' call sfcinit_file(nnxp(ifm),nnyp(ifm),nzg,npatch,ifm,sfcfile_p(ifm)%patch_area & - ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%soil_text) + ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%soil_color & + ,sfcfile_p(ifm)%soil_text) !---------------------------------------------------------------------------------------! @@ -226,8 +227,9 @@ subroutine geonest_file(ifm) call landuse_opqr(nnxp(ifm),nnyp(ifm),nzg,npatch,nvegpat,ivegtflg(ifm),ivegtfn(ifm) & ,isoilflg(ifm),isoilfn(ifm),ndviflg(ifm),ndvifn(ifm) & ,vndvifil(1,ifm),'veg',platn(ifm),plonn(ifm) & - ,sfcfile_p(ifm)%soil_text,sfcfile_p(ifm)%patch_area & - ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%veg_ndvif) + ,sfcfile_p(ifm)%soil_color,sfcfile_p(ifm)%soil_text & + ,sfcfile_p(ifm)%patch_area,sfcfile_p(ifm)%leaf_class & + ,sfcfile_p(ifm)%veg_ndvif) !------------------------------------------------------------------------------------! end if @@ -259,9 +261,10 @@ subroutine geonest_file(ifm) !----- Assign soil texture class from standard dataset. -----------------------------! call landuse_opqr(nnxp(ifm),nnyp(ifm),nzg,npatch,nvegpat,ivegtflg(ifm),ivegtfn(ifm) & ,isoilflg(ifm),isoilfn(ifm),ndviflg(ifm),ndvifn(ifm) & - ,vndvifil(1,ifm),'soil',platn(ifm),plonn(ifm) & - ,sfcfile_p(ifm)%soil_text,sfcfile_p(ifm)%patch_area & - ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%veg_ndvif) + ,vndvifil(1,ifm),'soil_text',platn(ifm),plonn(ifm) & + ,sfcfile_p(ifm)%soil_color,sfcfile_p(ifm)%soil_text & + ,sfcfile_p(ifm)%patch_area,sfcfile_p(ifm)%leaf_class & + ,sfcfile_p(ifm)%veg_ndvif) !------------------------------------------------------------------------------------! end if !---------------------------------------------------------------------------------------! @@ -274,7 +277,8 @@ subroutine geonest_file(ifm) ! class, and NDVI in ruser.f90 subroutines. ! !---------------------------------------------------------------------------------------! call sfcinit_file_user(nnxp(ifm),nnyp(ifm),nzg,npatch,ifm,sfcfile_p(ifm)%patch_area & - ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%soil_text) + ,sfcfile_p(ifm)%leaf_class,sfcfile_p(ifm)%soil_color & + ,sfcfile_p(ifm)%soil_text) !---------------------------------------------------------------------------------------! @@ -378,7 +382,8 @@ subroutine geonest_nofile(ngra,ngrb) , basic_g(ifm)%pp , basic_g(ifm)%rv & , scratch%vt3do , leaf_g(ifm)%seatp & , leaf_g(ifm)%seatf , leaf_g(ifm)%soil_water & - , leaf_g(ifm)%soil_energy , leaf_g(ifm)%soil_text & + , leaf_g(ifm)%soil_energy , leaf_g(ifm)%psibar_10d & + , leaf_g(ifm)%soil_color , leaf_g(ifm)%soil_text & , leaf_g(ifm)%sfcwater_mass , leaf_g(ifm)%sfcwater_energy & , leaf_g(ifm)%sfcwater_depth , leaf_g(ifm)%ustar & , leaf_g(ifm)%tstar , leaf_g(ifm)%rstar & @@ -403,7 +408,8 @@ subroutine geonest_nofile(ngra,ngrb) , leaf_g(ifm)%plresp , leaf_g(ifm)%resphet & , leaf_g(ifm)%veg_ndvip , leaf_g(ifm)%veg_ndvic & , leaf_g(ifm)%veg_ndvif , leaf_g(ifm)%snow_mass & - , leaf_g(ifm)%snow_depth , scratch%vt2dq & + , leaf_g(ifm)%snow_depth , leaf_g(ifm)%rshort_gnd & + , leaf_g(ifm)%rlong_gnd , scratch%vt2dq & , scratch%vt2dr , scratch%vt2ds & , scratch%vt2da , scratch%vt2db & , scratch%vt2dc , scratch%vt2dd & @@ -459,7 +465,8 @@ subroutine geonest_nofile(ngra,ngrb) ,leaf_g(ifm)%can_theta ,leaf_g(ifm)%can_prss & ,grid_g(ifm)%glat ,grid_g(ifm)%glon & ,leaf_g(ifm)%soil_water ,leaf_g(ifm)%soil_energy & - ,leaf_g(ifm)%soil_text ) + ,leaf_g(ifm)%soil_text ,leaf_g(ifm)%psibar_10d & + ,leaf_g(ifm)%leaf_class) end select !------------------------------------------------------------------------------------! @@ -489,7 +496,8 @@ subroutine geonest_nofile(ngra,ngrb) ! , basic_g(ifm)%theta , basic_g(ifm)%pi0 & ! , basic_g(ifm)%pp , basic_g(ifm)%rv & ! , scratch%vt3do , leaf_g(ifm)%soil_water & - ! , leaf_g(ifm)%soil_energy , leaf_g(ifm)%soil_text & + ! , leaf_g(ifm)%soil_energy , leaf_g(ifm)%psibar_10d & + ! , leaf_g(ifm)%soil_color , leaf_g(ifm)%soil_text & ! , leaf_g(ifm)%sfcwater_mass , leaf_g(ifm)%sfcwater_energy & ! , leaf_g(ifm)%sfcwater_depth , leaf_g(ifm)%ustar & ! , leaf_g(ifm)%tstar , leaf_g(ifm)%rstar & @@ -514,7 +522,8 @@ subroutine geonest_nofile(ngra,ngrb) ! , leaf_g(ifm)%plresp , leaf_g(ifm)%resphet & ! , leaf_g(ifm)%veg_ndvip , leaf_g(ifm)%veg_ndvic & ! , leaf_g(ifm)%veg_ndvif , leaf_g(ifm)%snow_mass & - ! , leaf_g(ifm)%snow_depth , scratch%vt2dq & + ! , leaf_g(ifm)%snow_depth , leaf_g(ifm)%rshort_gnd & + ! , leaf_g(ifm)%rlong_gnd , scratch%vt2dq & ! , scratch%vt2dr , scratch%vt2ds & ! , scratch%vt2da , scratch%vt2db & ! , scratch%vt2dc , scratch%vt2dd & diff --git a/BRAMS/src/mksfc/nest_init_aux.f90 b/BRAMS/src/mksfc/nest_init_aux.f90 index 93602a8ef..fb26c049a 100644 --- a/BRAMS/src/mksfc/nest_init_aux.f90 +++ b/BRAMS/src/mksfc/nest_init_aux.f90 @@ -146,6 +146,10 @@ subroutine patch_interp_driver(icm,ifm) ,leaf_g(icm)%ribulk,leaf_g(ifm)%ribulk,leaf_g(icm)%patch_area & ,leaf_g(icm)%patch_area,scratch%vt3da,scratch%vt3db,scratch%vt2da & ,scratch%vt2db ) + call patch_interp(icm,ifm,1,nnxp(icm),nnyp(icm),npatch,1,nnxp(ifm),nnyp(ifm),npatch & + ,leaf_g(icm)%psibar_10d,leaf_g(ifm)%psibar_10d,leaf_g(icm)%patch_area & + ,leaf_g(icm)%patch_area,scratch%vt3da,scratch%vt3db,scratch%vt2da & + ,scratch%vt2db ) return end subroutine patch_interp_driver @@ -211,6 +215,7 @@ subroutine coarse2fine_driver(icm,ifm) ,leaf_g(ifm)%evap_gc , leaf_g(icm)%evap_gc & ,leaf_g(ifm)%evap_vc , leaf_g(icm)%evap_vc & ,leaf_g(ifm)%transp , leaf_g(icm)%transp & + ,leaf_g(ifm)%psibar_10d , leaf_g(icm)%psibar_10d & ,leaf_g(ifm)%gpp , leaf_g(icm)%gpp & ,leaf_g(ifm)%plresp , leaf_g(icm)%plresp & ,leaf_g(ifm)%resphet , leaf_g(icm)%resphet ) @@ -245,8 +250,8 @@ subroutine coarse2fine(ifm,mxpf,mypf,icm,mxpc,mypc,mzg,mzs,mpat ,f_veg_ndvic , c_veg_ndvic ,f_sensible_gc , c_sensible_gc & ,f_sensible_vc , c_sensible_vc ,f_evap_gc , c_evap_gc & ,f_evap_vc , c_evap_vc ,f_transp , c_transp & - ,f_gpp , c_gpp ,f_plresp , c_plresp & - ,f_resphet , c_resphet ) + ,f_psibar_10d , c_psibar_10d ,f_gpp , c_gpp & + ,f_plresp , c_plresp ,f_resphet , c_resphet ) use mem_grid, only : ipm & ! intent(in) , jpm ! ! intent(in) implicit none @@ -296,6 +301,7 @@ subroutine coarse2fine(ifm,mxpf,mypf,icm,mxpc,mypc,mzg,mzs,mpat real, dimension( mxpc,mypc,mpat), intent(in) :: c_evap_gc real, dimension( mxpc,mypc,mpat), intent(in) :: c_evap_vc real, dimension( mxpc,mypc,mpat), intent(in) :: c_transp + real, dimension( mxpc,mypc,mpat), intent(in) :: c_psibar_10d real, dimension( mxpc,mypc,mpat), intent(in) :: c_gpp real, dimension( mxpc,mypc,mpat), intent(in) :: c_plresp real, dimension( mxpc,mypc,mpat), intent(in) :: c_resphet @@ -335,6 +341,7 @@ subroutine coarse2fine(ifm,mxpf,mypf,icm,mxpc,mypc,mzg,mzs,mpat real, dimension( mxpf,mypf,mpat), intent(out) :: f_evap_gc real, dimension( mxpf,mypf,mpat), intent(out) :: f_evap_vc real, dimension( mxpf,mypf,mpat), intent(out) :: f_transp + real, dimension( mxpf,mypf,mpat), intent(out) :: f_psibar_10d real, dimension( mxpf,mypf,mpat), intent(out) :: f_gpp real, dimension( mxpf,mypf,mpat), intent(out) :: f_plresp real, dimension( mxpf,mypf,mpat), intent(out) :: f_resphet @@ -396,6 +403,7 @@ subroutine coarse2fine(ifm,mxpf,mypf,icm,mxpc,mypc,mzg,mzs,mpat f_evap_gc (i,j,ipat) = c_evap_gc (ic,jc,ipat) f_evap_vc (i,j,ipat) = c_evap_vc (ic,jc,ipat) f_transp (i,j,ipat) = c_transp (ic,jc,ipat) + f_psibar_10d (i,j,ipat) = c_psibar_10d (ic,jc,ipat) f_gpp (i,j,ipat) = c_gpp (ic,jc,ipat) f_plresp (i,j,ipat) = c_plresp (ic,jc,ipat) f_resphet (i,j,ipat) = c_resphet (ic,jc,ipat) diff --git a/BRAMS/src/mpi/mpass_init.f90 b/BRAMS/src/mpi/mpass_init.f90 index ece649318..c041afb62 100644 --- a/BRAMS/src/mpi/mpass_init.f90 +++ b/BRAMS/src/mpi/mpass_init.f90 @@ -70,6 +70,7 @@ end subroutine masterput_processid subroutine masterput_nl(master_num) use mem_all + use grid_dims , only : str_len ! ! intent(in) use rpara use therm_lib , only : level & ! intent(in) ,vapour_on & ! intent(in) @@ -129,14 +130,12 @@ subroutine masterput_nl(master_num) use turb_coms , only : nna & ! intent(in) , nnb & ! intent(in) , nnc ! ! intent(in) - use leaf_coms , only : ustmin & ! intent(in) - , ggfact & ! intent(in) + use leaf_coms , only : ubmin & ! intent(in) + , ugbmin & ! intent(in) + , ustmin & ! intent(in) , lc_gamm => gamm & ! intent(in) , lc_gamh => gamh & ! intent(in) , tprandtl & ! intent(in) - , vkopr & ! intent(in) - , vh2vr & ! intent(in) - , vh2dh & ! intent(in) , ribmax & ! intent(in) , leaf_maxwhc & ! intent(in) , min_patch_area ! ! intent(in) @@ -290,18 +289,15 @@ subroutine masterput_nl(master_num) call MPI_Bcast(SLZ,NZGMAX,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(STGOFF,NZGMAX,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(SLMSTR,NZGMAX,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(BETAPOWER,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(UBMIN,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(UGBMIN,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(USTMIN,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(LC_GAMM,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(LC_GAMH,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(TPRANDTL,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VKOPR,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VH2VR,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VH2DH,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(RIBMAX,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(LEAF_MAXWHC,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(MIN_PATCH_AREA,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(GGFACT,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ISOILBC,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(IPERCOL,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(RUNOFF_TIME,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -358,7 +354,7 @@ subroutine masterput_nl(master_num) call MPI_Bcast(ICHEMI,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ICHEMI_IN,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(CHEMDATA_IN(1:80),80,MPI_CHARACTER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(CHEMDATA_IN,str_len,MPI_CHARACTER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ISOURCE,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(WEEKDAYIN(1:3),3,MPI_CHARACTER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(EFSAT,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -400,6 +396,7 @@ subroutine masterput_nl(master_num) call MPI_Bcast(SEATMP,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(PCTLCON,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(NSLCON,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ISOILCOL,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(NVGCON,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(RADFRQ,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -888,6 +885,7 @@ subroutine nodeget_nl use mem_all use node_mod + use grid_dims , only : str_len ! ! intent(in) use therm_lib , only : level & ! intent(out) ,vapour_on & ! intent(out) ,cloud_on & ! intent(out) @@ -946,14 +944,12 @@ subroutine nodeget_nl use turb_coms , only : nna & ! intent(out) , nnb & ! intent(out) , nnc ! ! intent(out) - use leaf_coms , only : ustmin & ! intent(out) - , ggfact & ! intent(out) + use leaf_coms , only : ubmin & ! intent(out) + , ugbmin & ! intent(out) + , ustmin & ! intent(out) , lc_gamm => gamm & ! intent(out) , lc_gamh => gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc & ! intent(out) , min_patch_area ! ! intent(out) @@ -1102,18 +1098,15 @@ subroutine nodeget_nl call MPI_Bcast(SLZ,NZGMAX,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(STGOFF,NZGMAX,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(SLMSTR,NZGMAX,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(BETAPOWER,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(UBMIN,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(UGBMIN,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(USTMIN,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(LC_GAMM,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(LC_GAMH,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(TPRANDTL,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VKOPR,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VH2VR,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(VH2DH,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(RIBMAX,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(LEAF_MAXWHC,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(MIN_PATCH_AREA,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(GGFACT,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ISOILBC,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(IPERCOL,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(RUNOFF_TIME,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) @@ -1170,7 +1163,7 @@ subroutine nodeget_nl call MPI_Bcast(ICHEMI,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ICHEMI_IN,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(CHEMDATA_IN(1:80),80,MPI_CHARACTER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(CHEMDATA_IN,str_len,MPI_CHARACTER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ISOURCE,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(WEEKDAYIN(1:3),3,MPI_CHARACTER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(EFSAT,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) @@ -1212,6 +1205,7 @@ subroutine nodeget_nl call MPI_Bcast(SEATMP,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(PCTLCON,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(NSLCON,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ISOILCOL,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(NVGCON,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(RADFRQ,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) diff --git a/BRAMS/src/radiate/harr_rad.F90 b/BRAMS/src/radiate/harr_rad.F90 index eff4bdb27..5ce017d84 100644 --- a/BRAMS/src/radiate/harr_rad.F90 +++ b/BRAMS/src/radiate/harr_rad.F90 @@ -382,7 +382,7 @@ subroutine harr_swrad(nz,alb,amu0,time,mynum) case default !----- Not going to happen -------------------------------------------------------! - write(unit=*,fmt='(a)') 'ŧŧŧ ERROR ŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦŦ' + write(unit=*,fmt='(a)') '=== ERROR ====================================' write(unit=*,fmt='(a)') 'Three is the maximum amount of overlapping' write(unit=*,fmt='(a)') 'gasses allowed: if you really want to have ' write(unit=*,fmt='(a)') 'more gasses overlap, they better have few' diff --git a/BRAMS/src/radiate/mem_globaer.f90 b/BRAMS/src/radiate/mem_globaer.f90 index 7157dce65..1d51c57f9 100644 --- a/BRAMS/src/radiate/mem_globaer.f90 +++ b/BRAMS/src/radiate/mem_globaer.f90 @@ -5,7 +5,7 @@ module mem_globaer ngroup, & !INTENT(IN) ngas, & !INTENT(IN) nsolute !INTENT(IN) - + use grid_dims, only : str_len implicit none ! @(#) globaer.h McKie Oct-1995 ! This is the global include file for the Ames Aerosol model. @@ -270,7 +270,7 @@ module mem_globaer ! gridname Text description of horiz & vert grid coord system {initatm} ! iaer1 Safety marker for common block aer1 - character (LEN=80) :: gridname + character (LEN=str_len) :: gridname character (LEN=5) :: caer1s real :: dom_llx real :: dom_lly @@ -427,7 +427,7 @@ module mem_globaer !!logical, allocatable :: if_nuc(:,:) logical :: do_netcdf logical :: do_parcel - character (LEN=80) :: simtitle + character (LEN=str_len) :: simtitle real,parameter,dimension(nelem) :: & rhocore=(/1.85/) diff --git a/BRAMS/src/radiate/mem_radiate.f90 b/BRAMS/src/radiate/mem_radiate.f90 index 718552421..8b2e4d806 100644 --- a/BRAMS/src/radiate/mem_radiate.f90 +++ b/BRAMS/src/radiate/mem_radiate.f90 @@ -40,7 +40,7 @@ module mem_radiate real :: prsnz real :: prsnzp integer :: ncrad ! Number of clouds that affect radiation - real , parameter :: rad_cosz_min = 0.0009 + real , parameter :: rad_cosz_min = 0.01745241 real , parameter :: rad_rshort_min = 0.50 !----- These are used for adding extra levels at the top with the Mclatchy soundings. --! integer, parameter :: maxadd_rad = 10 ! max allowed # of added rad levels diff --git a/BRAMS/src/soil_moisture/mem_soil_moisture.f90 b/BRAMS/src/soil_moisture/mem_soil_moisture.f90 index af5d07228..11fc0ab12 100644 --- a/BRAMS/src/soil_moisture/mem_soil_moisture.f90 +++ b/BRAMS/src/soil_moisture/mem_soil_moisture.f90 @@ -6,11 +6,12 @@ !------------------------------------------------------------------------------------------! module mem_soil_moisture use leaf_coms, only : nstyp + use grid_dims, only : str_len implicit none - character (len=1) :: soil_moist - character (len=1) :: soil_moist_fail - character (len=256) :: usdata_in - character (len=256) :: usmodel_in + character (len=1) :: soil_moist + character (len=1) :: soil_moist_fail + character (len=str_len) :: usdata_in + character (len=str_len) :: usmodel_in real, dimension(nstyp), parameter :: oxsand = (/ .970, .920, .800, .570, .600, .650 & , .350, .480, .500, .300, .250, .200 & diff --git a/BRAMS/src/soil_moisture/soil_moisture_init.f90 b/BRAMS/src/soil_moisture/soil_moisture_init.f90 index c35f2202f..4325c3767 100644 --- a/BRAMS/src/soil_moisture/soil_moisture_init.f90 +++ b/BRAMS/src/soil_moisture/soil_moisture_init.f90 @@ -8,7 +8,7 @@ ! metodologia e validacao. Rev. Bras. Meteo., volume especial do LBA, 2007. ! !------------------------------------------------------------------------------------------! subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon & - ,soil_water,soil_energy,soil_text) + ,soil_water,soil_energy,soil_text,psibar_10d,leaf_class) use mem_grid , only : runtype & ! intent(in) , iyeara & ! intent(in) , imontha & ! intent(in) @@ -33,10 +33,18 @@ subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon , day_sec ! ! intent(in) use leaf_coms , only : soilcp & ! intent(in) , slmsts & ! intent(in) - , slcpd ! ! intent(in) + , slcpd & ! intent(in) + , slpots & ! intent(in) + , slbs & ! intent(in) + , phenology & ! intent(in) + , kroot & ! intent(in) + , psild & ! intent(in) + , psiwp & ! intent(in) + , dslz ! ! intent(in) use mem_leaf , only : stgoff & ! intent(in) , slmstr & ! intent(in) , slz ! ! intent(in) + use grid_dims , only : str_len ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! integer , intent(in) :: n1 @@ -51,8 +59,10 @@ subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon real , dimension(mzg,n2,n3,npat), intent(inout) :: soil_water real , dimension(mzg,n2,n3,npat), intent(inout) :: soil_energy real , dimension(mzg,n2,n3,npat), intent(inout) :: soil_text + real , dimension( n2,n3,npat), intent(inout) :: psibar_10d + real , dimension( n2,n3,npat), intent(in) :: leaf_class !----- Local variables. ----------------------------------------------------------------! - character (len=256) :: usdata, usmodel + character (len=str_len) :: usdata, usmodel character (len=20) :: pref character (len=2) :: cidate,cimon character (len=1) :: cgrid @@ -72,13 +82,15 @@ subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon real, dimension( :) , allocatable :: slz_us,usdum real, dimension(:,:,:) , allocatable :: api_us real, dimension( :,:) , allocatable :: prlat,prlon - real :: can_temp,tsoil + real :: can_temp,soil_temp,soil_fliq real :: latni,latnf,lonni,lonnf real :: ilatn,ilonn,ilats,ilons real :: latn,lonn,lats,lons real :: dlatr,dlonr real :: slmrel real :: swat_new + real :: available_water + real :: psi_layer integer :: size_usmodel integer :: size_expected !----- External functions. -------------------------------------------------------------! @@ -223,24 +235,49 @@ subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon write(unit=*,fmt='(a)') '|---------------------------------------------|' hoploop: do ipat= 2,npat + hojloop: do j = 1,n3 hoiloop: do i = 1,n2 + nveg = nint(leaf_class(i,j,ipat)) + !----- Finding canopy temperature for this patch. --------------------------! can_temp = can_theta(i,j,ipat) * (p00i * can_prss(i,j,ipat)) ** rocp + available_water = 0.0 hokloop: do k = 1,mzg nsoil = nint(soil_text(k,i,j,ipat)) soil_water(k,i,j,ipat) = soil_idx2water(slmstr(k),nsoil) - tsoil = can_temp + stgoff(k) - if (tsoil >= t3ple) then - soil_energy(k,i,j,ipat) = slcpd(nsoil) * tsoil & + soil_temp = can_temp + stgoff(k) + if (soil_temp >= t3ple) then + soil_energy(k,i,j,ipat) = slcpd(nsoil) * soil_temp & + soil_water(k,i,j,ipat) * cliqvlme & - * (tsoil-tsupercool) + * (soil_temp-tsupercool) + soil_fliq = 1.0 else - soil_energy(k,i,j,ipat) = tsoil * ( slcpd(nsoil) & - + soil_water(k,i,j,ipat)*cicevlme) + soil_energy(k,i,j,ipat) = soil_temp * ( slcpd(nsoil) & + + soil_water(k,i,j,ipat)*cicevlme) + soil_fliq = 0.0 + end if + + !------ Integrate the relative potential. -------------------------------! + if (k >= kroot(nveg) .and. nsoil /= 13) then + psi_layer = slpots(nsoil) & + / (soil_water(k,i,j,ipat) / slmsts(nsoil)) & + ** slbs(nsoil) + available_water = available_water & + + max(0., (psi_layer - psiwp(nsoil)) & + / (psild(nsoil) - psiwp(nsoil)) ) & + * soil_fliq * (slz(k+1)-slz(k)) end if + !------------------------------------------------------------------------! + end do hokloop + + !----- Normalise the available water. --------------------------------------! + available_water = available_water / abs(slz(kroot(nveg))) + psibar_10d(i,j,ipat) = available_water + !---------------------------------------------------------------------------! + end do hoiloop end do hojloop end do hoploop @@ -480,28 +517,49 @@ subroutine soil_moisture_init(n1,n2,n3,mzg,npat,ifm,can_theta,can_prss,glat,glon heploop: do ipat= 2,npat + hejloop: do j = 1,n3 heiloop: do i = 1,n2 + nveg = nint(leaf_class(i,j,ipat)) !----- Find the canopy temperature for this patch. ----------------------------! can_temp = can_theta(i,j,ipat) * (p00i * can_prss(i,j,ipat)) ** rocp - + available_water = 0.0 hekloop: do k = 1,mzg nsoil = nint(soil_text(k,i,j,ipat)) !----- Make sure that the soil moisture is bounded... ----------------------! soil_water(k,i,j,npat) = max(soilcp(nsoil) & ,min(soil_water(k,i,j,ipat), slmsts(nsoil))) - tsoil = can_temp + stgoff(k) + soil_temp = can_temp + stgoff(k) - if (tsoil >= t3ple) then - soil_energy(k,i,j,ipat) = slcpd(nsoil) * tsoil & + if (soil_temp >= t3ple) then + soil_energy(k,i,j,ipat) = slcpd(nsoil) * soil_temp & + soil_water(k,i,j,ipat) * cliqvlme & - * (tsoil-tsupercool) + * (soil_temp-tsupercool) + soil_fliq = 1.0 else - soil_energy(k,i,j,ipat) = tsoil * ( slcpd(nsoil) & - + soil_water(k,i,j,ipat) * cicevlme) + soil_energy(k,i,j,ipat) = soil_temp * ( slcpd(nsoil) & + + soil_water(k,i,j,ipat) * cicevlme) + soil_fliq = 0.0 + end if + + + !------ Integrate the relative potential. ----------------------------------! + if (k >= kroot(nveg) .and. nsoil /= 13) then + psi_layer = slpots(nsoil) & + / (soil_water(k,i,j,ipat) / slmsts(nsoil)) ** slbs(nsoil) + available_water = available_water & + + max(0., (psi_layer - psiwp(nsoil)) & + / (psild(nsoil) - psiwp(nsoil)) ) & + * soil_fliq * (slz(k+1)-slz(k)) end if + !---------------------------------------------------------------------------! end do hekloop + + !----- Normalise the available water. -----------------------------------------! + available_water = available_water / abs(slz(kroot(nveg))) + psibar_10d(i,j,ipat) = available_water + !------------------------------------------------------------------------------! end do heiloop end do hejloop end do heploop diff --git a/BRAMS/src/surface/leaf3.f90 b/BRAMS/src/surface/leaf3.f90 index 59fd5243d..a4e1add43 100644 --- a/BRAMS/src/surface/leaf3.f90 +++ b/BRAMS/src/surface/leaf3.f90 @@ -251,6 +251,8 @@ subroutine leaf3_timestep() call azero(mxp*myp*npatch,leaf_g(ngrid)%gpp ) call azero(mxp*myp*npatch,leaf_g(ngrid)%plresp ) call azero(mxp*myp*npatch,leaf_g(ngrid)%resphet ) + call azero(mxp*myp*npatch,leaf_g(ngrid)%rshort_gnd ) + call azero(mxp*myp*npatch,leaf_g(ngrid)%rlong_gnd ) if (iswrtyp > 0 .or. ilwrtyp > 0) then call azero(mxp*myp,radiate_g(ngrid)%albedt) call azero(mxp*myp,radiate_g(ngrid)%rlongup) @@ -276,10 +278,10 @@ subroutine leaf3_timestep() !----- Copy the surface variables to single column values. -----------------------! - call leaf_atmo1d(mxp,myp,i,j,scratch%vt2da,scratch%vt2db,scratch%vt2dc & - ,scratch%vt2dd,scratch%vt2de,scratch%vt2df,scratch%vt2dg & - ,scratch%vt2dh,scratch%vt2di, scratch%vt2dj,scratch%vt2dk & - ,scratch%vt2dl,scratch%vt2dm) + call leaf3_atmo1d(mxp,myp,i,j,scratch%vt2da,scratch%vt2db,scratch%vt2dc & + ,scratch%vt2dd,scratch%vt2de,scratch%vt2df,scratch%vt2dg & + ,scratch%vt2dh,scratch%vt2di, scratch%vt2dj,scratch%vt2dk & + ,scratch%vt2dl,scratch%vt2dm) !---------------------------------------------------------------------------------! @@ -320,10 +322,10 @@ subroutine leaf3_timestep() !----- Update time-dependent SST, vegetation LAI and fractional coverage ------! if (ip == 1) then - call leaf_ocean_diag(ngrid,nzg & - ,leaf_g(ngrid)%seatp (i,j) & - ,leaf_g(ngrid)%seatf (i,j) & - ,leaf_g(ngrid)%soil_energy(:,i,j,1)) + call leaf3_ocean_diag(ngrid,nzg & + ,leaf_g(ngrid)%seatp (i,j) & + ,leaf_g(ngrid)%seatf (i,j) & + ,leaf_g(ngrid)%soil_energy(:,i,j,1)) elseif (isfcl >= 1) then call vegndvi( ngrid & , leaf_g(ngrid)%patch_area (i,j,ip) & @@ -337,7 +339,8 @@ subroutine leaf3_timestep() , leaf_g(ngrid)%veg_albedo (i,j,ip) & , leaf_g(ngrid)%veg_ndvip (i,j,ip) & , leaf_g(ngrid)%veg_ndvic (i,j,ip) & - , leaf_g(ngrid)%veg_ndvif (i,j,ip) ) + , leaf_g(ngrid)%veg_ndvif (i,j,ip) & + , leaf_g(ngrid)%psibar_10d (i,j,ip) ) end if !------------------------------------------------------------------------------! @@ -347,47 +350,47 @@ subroutine leaf3_timestep() ! Initialise various canopy air space and temporary surface water vari- ! ! ables. ! !------------------------------------------------------------------------------! - call leaf_soilsfcw_diag(ip,nzg,nzs,leaf_g(ngrid)%soil_energy (:,i,j,ip) & - ,leaf_g(ngrid)%soil_water (:,i,j,ip) & - ,leaf_g(ngrid)%soil_text (:,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_energy (:,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_mass (:,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & - ,.true.) - - call leaf_solve_veg(ip,nzs,leaf_g(ngrid)%leaf_class ( i,j,ip) & - ,leaf_g(ngrid)%veg_height ( i,j,ip) & - ,leaf_g(ngrid)%patch_area ( i,j,ip) & - ,leaf_g(ngrid)%veg_fracarea ( i,j,ip) & - ,leaf_g(ngrid)%veg_tai ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & - ,.true.) - - call leaf_can_diag(ip ,leaf_g(ngrid)%can_theta (i,j,ip) & + call leaf3_soilsfcw_diag(ip,nzg,nzs,leaf_g(ngrid)%soil_energy (:,i,j,ip) & + ,leaf_g(ngrid)%soil_water (:,i,j,ip) & + ,leaf_g(ngrid)%soil_text (:,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_energy (:,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_mass (:,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & + ,.true.) + + call leaf3_solve_veg(ip,nzs,leaf_g(ngrid)%leaf_class ( i,j,ip) & + ,leaf_g(ngrid)%veg_height ( i,j,ip) & + ,leaf_g(ngrid)%patch_area ( i,j,ip) & + ,leaf_g(ngrid)%veg_fracarea ( i,j,ip) & + ,leaf_g(ngrid)%veg_tai ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & + ,.true.) + + call leaf3_can_diag(ip ,leaf_g(ngrid)%can_theta (i,j,ip) & ,leaf_g(ngrid)%can_theiv (i,j,ip) & ,leaf_g(ngrid)%can_rvap (i,j,ip) & ,leaf_g(ngrid)%leaf_class (i,j,ip) & ,leaf_g(ngrid)%can_prss (i,j,ip) & ,.true. ) - call leaf_veg_diag(leaf_g(ngrid)%veg_energy (i,j,ip) & - ,leaf_g(ngrid)%veg_water (i,j,ip) & - ,leaf_g(ngrid)%veg_hcap (i,j,ip) ) + call leaf3_veg_diag(leaf_g(ngrid)%veg_energy (i,j,ip) & + ,leaf_g(ngrid)%veg_water (i,j,ip) & + ,leaf_g(ngrid)%veg_hcap (i,j,ip) ) if (ip /= 1) then - call leaf_grndvap(leaf_g(ngrid)%soil_energy (nzg,i,j,ip) & - ,leaf_g(ngrid)%soil_water (nzg,i,j,ip) & - ,leaf_g(ngrid)%soil_text (nzg,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_energy ( 1,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%can_rvap ( i,j,ip) & - ,leaf_g(ngrid)%can_prss ( i,j,ip) & - ,leaf_g(ngrid)%ground_rsat ( i,j,ip) & - ,leaf_g(ngrid)%ground_rvap ( i,j,ip) & - ,leaf_g(ngrid)%ground_temp ( i,j,ip) & - ,leaf_g(ngrid)%ground_fliq ( i,j,ip) ) + call leaf3_grndvap(leaf_g(ngrid)%soil_energy (nzg,i,j,ip) & + ,leaf_g(ngrid)%soil_water (nzg,i,j,ip) & + ,leaf_g(ngrid)%soil_text (nzg,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_energy ( 1,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%can_rvap ( i,j,ip) & + ,leaf_g(ngrid)%can_prss ( i,j,ip) & + ,leaf_g(ngrid)%ground_rsat ( i,j,ip) & + ,leaf_g(ngrid)%ground_rvap ( i,j,ip) & + ,leaf_g(ngrid)%ground_temp ( i,j,ip) & + ,leaf_g(ngrid)%ground_fliq ( i,j,ip) ) end if !------------------------------------------------------------------------------! @@ -414,20 +417,23 @@ subroutine leaf3_timestep() ! Other snowcover properties are also computed here. ! !---------------------------------------------------------------------------! if (iswrtyp > 0 .or. ilwrtyp > 0) then - call sfcrad(nzg,nzs,ip & - ,leaf_g(ngrid)%soil_water (:,i,j,ip) & - ,leaf_g(ngrid)%soil_text (:,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & - ,leaf_g(ngrid)%patch_area ( i,j,ip) & - ,leaf_g(ngrid)%veg_fracarea ( i,j,ip) & - ,leaf_g(ngrid)%leaf_class ( i,j,ip) & - ,leaf_g(ngrid)%veg_albedo ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,radiate_g(ngrid)%rshort ( i,j ) & - ,radiate_g(ngrid)%rlong ( i,j ) & - ,radiate_g(ngrid)%albedt ( i,j ) & - ,radiate_g(ngrid)%rlongup ( i,j ) & - ,radiate_g(ngrid)%cosz ( i,j ) ) + call leaf3_sfcrad(nzg,nzs,ip & + ,leaf_g(ngrid)%soil_water (:,i,j,ip) & + ,leaf_g(ngrid)%soil_color ( i,j,ip) & + ,leaf_g(ngrid)%soil_text (:,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_depth (:,i,j,ip) & + ,leaf_g(ngrid)%patch_area ( i,j,ip) & + ,leaf_g(ngrid)%veg_fracarea ( i,j,ip) & + ,leaf_g(ngrid)%leaf_class ( i,j,ip) & + ,leaf_g(ngrid)%veg_albedo ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,radiate_g(ngrid)%rshort ( i,j ) & + ,radiate_g(ngrid)%rlong ( i,j ) & + ,radiate_g(ngrid)%cosz ( i,j ) & + ,radiate_g(ngrid)%albedt ( i,j ) & + ,radiate_g(ngrid)%rlongup ( i,j ) & + ,leaf_g(ngrid)%rshort_gnd ( i,j,ip) & + ,leaf_g(ngrid)%rlong_gnd ( i,j,ip) ) end if !---------------------------------------------------------------------------! @@ -445,51 +451,51 @@ subroutine leaf3_timestep() !----- Compute the characteristic scales. ----------------------------------! - call leaf_stars(atm_theta & - ,atm_theiv & - ,atm_shv & - ,atm_rvap & - ,atm_co2 & - ,leaf_g(ngrid)%can_theta (i,j,ip) & - ,leaf_g(ngrid)%can_theiv (i,j,ip) & - ,can_shv & - ,leaf_g(ngrid)%can_rvap (i,j,ip) & - ,leaf_g(ngrid)%can_co2 (i,j,ip) & - ,geoht & - ,leaf_g(ngrid)%veg_displace(i,j,ip) & - ,atm_vels & - ,dtll & - ,leaf_g(ngrid)%patch_rough (i,j,ip) & - ,leaf_g(ngrid)%ustar (i,j,ip) & - ,leaf_g(ngrid)%tstar (i,j,ip) & - ,estar & - ,qstar & - ,leaf_g(ngrid)%rstar (i,j,ip) & - ,leaf_g(ngrid)%cstar (i,j,ip) & - ,leaf_g(ngrid)%zeta (i,j,ip) & - ,leaf_g(ngrid)%ribulk (i,j,ip) & - ,leaf_g(ngrid)%R_aer (i,j,ip) ) + call leaf3_stars(atm_theta & + ,atm_theiv & + ,atm_shv & + ,atm_rvap & + ,atm_co2 & + ,leaf_g(ngrid)%can_theta (i,j,ip) & + ,leaf_g(ngrid)%can_theiv (i,j,ip) & + ,can_shv & + ,leaf_g(ngrid)%can_rvap (i,j,ip) & + ,leaf_g(ngrid)%can_co2 (i,j,ip) & + ,geoht & + ,leaf_g(ngrid)%veg_displace(i,j,ip) & + ,atm_vels & + ,dtll & + ,leaf_g(ngrid)%patch_rough (i,j,ip) & + ,leaf_g(ngrid)%ustar (i,j,ip) & + ,leaf_g(ngrid)%tstar (i,j,ip) & + ,estar & + ,qstar & + ,leaf_g(ngrid)%rstar (i,j,ip) & + ,leaf_g(ngrid)%cstar (i,j,ip) & + ,leaf_g(ngrid)%zeta (i,j,ip) & + ,leaf_g(ngrid)%ribulk (i,j,ip) & + ,leaf_g(ngrid)%R_aer (i,j,ip) ) !---------------------------------------------------------------------------! !----- Find the turbulent fluxes of momentum, heat and moisture. ----------! - call sfclmcv(leaf_g(ngrid)%ustar (i,j,ip) & - ,leaf_g(ngrid)%tstar (i,j,ip) & - ,leaf_g(ngrid)%rstar (i,j,ip) & - ,leaf_g(ngrid)%cstar (i,j,ip) & - ,leaf_g(ngrid)%zeta (i,j,ip) & - ,atm_vels & - ,atm_up & - ,atm_vp & - ,leaf_g(ngrid)%patch_area (i,j,ip) & - ,turb_g(ngrid)%sflux_u (i,j ) & - ,turb_g(ngrid)%sflux_v (i,j ) & - ,turb_g(ngrid)%sflux_w (i,j ) & - ,turb_g(ngrid)%sflux_t (i,j ) & - ,turb_g(ngrid)%sflux_r (i,j ) & - ,turb_g(ngrid)%sflux_c (i,j ) ) + call leaf3_sfclmcv(leaf_g(ngrid)%ustar (i,j,ip) & + ,leaf_g(ngrid)%tstar (i,j,ip) & + ,leaf_g(ngrid)%rstar (i,j,ip) & + ,leaf_g(ngrid)%cstar (i,j,ip) & + ,leaf_g(ngrid)%zeta (i,j,ip) & + ,atm_vels & + ,atm_up & + ,atm_vp & + ,leaf_g(ngrid)%patch_area (i,j,ip) & + ,turb_g(ngrid)%sflux_u (i,j ) & + ,turb_g(ngrid)%sflux_v (i,j ) & + ,turb_g(ngrid)%sflux_w (i,j ) & + ,turb_g(ngrid)%sflux_t (i,j ) & + ,turb_g(ngrid)%sflux_r (i,j ) & + ,turb_g(ngrid)%sflux_c (i,j ) ) !---------------------------------------------------------------------------! @@ -515,20 +521,20 @@ subroutine leaf3_timestep() !----- Update some diagnostic variables. --------------------------------! call flush_leaf_coms('TIMESTEP') - call leaf_ocean_diag(ngrid,nzg & - ,leaf_g(ngrid)%seatp (i,j) & - ,leaf_g(ngrid)%seatf (i,j) & - ,leaf_g(ngrid)%soil_energy (:,i,j,1) ) + call leaf3_ocean_diag(ngrid,nzg & + ,leaf_g(ngrid)%seatp (i,j) & + ,leaf_g(ngrid)%seatf (i,j) & + ,leaf_g(ngrid)%soil_energy (:,i,j,1) ) - call leaf_can_diag(ip ,leaf_g(ngrid)%can_theta (i,j,ip) & + call leaf3_can_diag(ip ,leaf_g(ngrid)%can_theta (i,j,ip) & ,leaf_g(ngrid)%can_theiv (i,j,ip) & ,leaf_g(ngrid)%can_rvap (i,j,ip) & ,leaf_g(ngrid)%leaf_class (i,j,ip) & ,leaf_g(ngrid)%can_prss (i,j,ip) & ,.false. ) - call leaf_veg_diag(leaf_g(ngrid)%veg_energy (i,j,ip) & - ,leaf_g(ngrid)%veg_water (i,j,ip) & - ,leaf_g(ngrid)%veg_hcap (i,j,ip) ) + call leaf3_veg_diag(leaf_g(ngrid)%veg_energy (i,j,ip) & + ,leaf_g(ngrid)%veg_water (i,j,ip) & + ,leaf_g(ngrid)%veg_hcap (i,j,ip) ) case default if (teb_spm == 1) then @@ -613,7 +619,7 @@ subroutine leaf3_timestep() ! soil, vegetation, and canopy ! !---------------------------------------------------------------------! if (leaf_g(ngrid)%patch_area(i,j,ip) >= min_patch_area) then - call leaf_prognostic(ngrid,i,j,ip) + call leaf3_prognostic(ngrid,i,j,ip) end if !---------------------------------------------------------------------! end if @@ -626,46 +632,46 @@ subroutine leaf3_timestep() ! Update all the diagnostic variables. ! !------------------------------------------------------------------------! call flush_leaf_coms('TIMESTEP') - call leaf_soilsfcw_diag(ip,nzg,nzs & - ,leaf_g(ngrid)%soil_energy ( :,i,j,ip) & - ,leaf_g(ngrid)%soil_water ( :,i,j,ip) & - ,leaf_g(ngrid)%soil_text ( :,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_energy ( :,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_mass ( :,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_depth ( :,i,j,ip) & - ,.false.) - call leaf_solve_veg(ip,nzs,leaf_g(ngrid)%leaf_class (i,j,ip) & - ,leaf_g(ngrid)%veg_height ( i,j,ip) & - ,leaf_g(ngrid)%patch_area (i,j,ip) & - ,leaf_g(ngrid)%veg_fracarea (i,j,ip) & - ,leaf_g(ngrid)%veg_tai ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%sfcwater_depth ( :,i,j,ip) & - ,.false.) - - call leaf_can_diag(ip ,leaf_g(ngrid)%can_theta ( i,j,ip) & + call leaf3_soilsfcw_diag(ip,nzg,nzs & + ,leaf_g(ngrid)%soil_energy ( :,i,j,ip) & + ,leaf_g(ngrid)%soil_water ( :,i,j,ip) & + ,leaf_g(ngrid)%soil_text ( :,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_energy ( :,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_mass ( :,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_depth ( :,i,j,ip) & + ,.false.) + call leaf3_solve_veg(ip,nzs,leaf_g(ngrid)%leaf_class (i,j,ip) & + ,leaf_g(ngrid)%veg_height ( i,j,ip) & + ,leaf_g(ngrid)%patch_area (i,j,ip) & + ,leaf_g(ngrid)%veg_fracarea (i,j,ip) & + ,leaf_g(ngrid)%veg_tai ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%sfcwater_depth ( :,i,j,ip) & + ,.false.) + + call leaf3_can_diag(ip ,leaf_g(ngrid)%can_theta ( i,j,ip) & ,leaf_g(ngrid)%can_theiv ( i,j,ip) & ,leaf_g(ngrid)%can_rvap ( i,j,ip) & ,leaf_g(ngrid)%leaf_class ( i,j,ip) & ,leaf_g(ngrid)%can_prss ( i,j,ip) & ,.false. ) - call leaf_veg_diag(leaf_g(ngrid)%veg_energy ( i,j,ip) & - ,leaf_g(ngrid)%veg_water ( i,j,ip) & - ,leaf_g(ngrid)%veg_hcap ( i,j,ip) ) - - call leaf_grndvap(leaf_g(ngrid)%soil_energy (nzg,i,j,ip) & - ,leaf_g(ngrid)%soil_water (nzg,i,j,ip) & - ,leaf_g(ngrid)%soil_text (nzg,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_energy ( 1,i,j,ip) & - ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & - ,leaf_g(ngrid)%can_rvap ( i,j,ip) & - ,leaf_g(ngrid)%can_prss ( i,j,ip) & - ,leaf_g(ngrid)%ground_rsat ( i,j,ip) & - ,leaf_g(ngrid)%ground_rvap ( i,j,ip) & - ,leaf_g(ngrid)%ground_temp ( i,j,ip) & - ,leaf_g(ngrid)%ground_fliq ( i,j,ip) ) + call leaf3_veg_diag(leaf_g(ngrid)%veg_energy ( i,j,ip) & + ,leaf_g(ngrid)%veg_water ( i,j,ip) & + ,leaf_g(ngrid)%veg_hcap ( i,j,ip) ) + + call leaf3_grndvap(leaf_g(ngrid)%soil_energy (nzg,i,j,ip) & + ,leaf_g(ngrid)%soil_water (nzg,i,j,ip) & + ,leaf_g(ngrid)%soil_text (nzg,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_energy ( 1,i,j,ip) & + ,leaf_g(ngrid)%sfcwater_nlev ( i,j,ip) & + ,leaf_g(ngrid)%can_rvap ( i,j,ip) & + ,leaf_g(ngrid)%can_prss ( i,j,ip) & + ,leaf_g(ngrid)%ground_rsat ( i,j,ip) & + ,leaf_g(ngrid)%ground_rvap ( i,j,ip) & + ,leaf_g(ngrid)%ground_temp ( i,j,ip) & + ,leaf_g(ngrid)%ground_fliq ( i,j,ip) ) end select !---------------------------------------------------------------------------! @@ -706,21 +712,28 @@ subroutine leaf3_timestep() !---------------------------------------------------------------------------------------! + !----- Update the 10-day running average for phenology. --------------------------------! + call update_psibar(mxp,myp,nzg,npatch,ia,iz,ja,jz,dtlt & + , leaf_g(ngrid)%soil_energy , leaf_g(ngrid)%soil_water & + , leaf_g(ngrid)%soil_text , leaf_g(ngrid)%leaf_class & + , leaf_g(ngrid)%psibar_10d ) + !---------------------------------------------------------------------------------------! !----- Apply lateral boundary conditions to leaf3 arrays -------------------------------! - call leaf_bcond(mxp,myp,nzg,nzs,npatch,ia,iz,ja,jz,jdim,ibcon & + call leaf3_bcond(mxp,myp,nzg,nzs,npatch,ia,iz,ja,jz,jdim,ibcon & , leaf_g(ngrid)%soil_water , leaf_g(ngrid)%sfcwater_mass & , leaf_g(ngrid)%soil_energy , leaf_g(ngrid)%sfcwater_energy & - , leaf_g(ngrid)%soil_text , leaf_g(ngrid)%sfcwater_depth & + , leaf_g(ngrid)%soil_color , leaf_g(ngrid)%soil_text & + , leaf_g(ngrid)%psibar_10d , leaf_g(ngrid)%sfcwater_depth & , leaf_g(ngrid)%ustar , leaf_g(ngrid)%tstar & , leaf_g(ngrid)%rstar , leaf_g(ngrid)%cstar & , leaf_g(ngrid)%zeta , leaf_g(ngrid)%ribulk & , leaf_g(ngrid)%veg_albedo , leaf_g(ngrid)%veg_fracarea & , leaf_g(ngrid)%veg_lai , leaf_g(ngrid)%veg_tai & , leaf_g(ngrid)%veg_rough , leaf_g(ngrid)%veg_height & - , leaf_g(ngrid)%veg_displace , leaf_g(ngrid)%patch_area & - , leaf_g(ngrid)%patch_rough , leaf_g(ngrid)%patch_wetind & + , leaf_g(ngrid)%veg_displace , leaf_g(ngrid)%patch_area & + , leaf_g(ngrid)%patch_rough , leaf_g(ngrid)%patch_wetind & , leaf_g(ngrid)%leaf_class , leaf_g(ngrid)%soil_rough & , leaf_g(ngrid)%sfcwater_nlev , leaf_g(ngrid)%stom_condct & , leaf_g(ngrid)%ground_rsat , leaf_g(ngrid)%ground_rvap & @@ -738,7 +751,8 @@ subroutine leaf3_timestep() , turb_g(ngrid)%sflux_v , turb_g(ngrid)%sflux_w & , turb_g(ngrid)%sflux_t , turb_g(ngrid)%sflux_r & , turb_g(ngrid)%sflux_c , radiate_g(ngrid)%albedt & - , radiate_g(ngrid)%rlongup ) + , radiate_g(ngrid)%rlongup , leaf_g(ngrid)%rshort_gnd & + , leaf_g(ngrid)%rlong_gnd ) !---------------------------------------------------------------------------------------! return end subroutine leaf3_timestep diff --git a/BRAMS/src/surface/leaf3_bc.f90 b/BRAMS/src/surface/leaf3_bc.f90 index a646d28e2..5f188f191 100644 --- a/BRAMS/src/surface/leaf3_bc.f90 +++ b/BRAMS/src/surface/leaf3_bc.f90 @@ -6,16 +6,17 @@ ! variable should not be copied here; instead, they should be send through MPI, and the ! ! variable table should include the mpt1 flag (lateral boundary condition). ! !------------------------------------------------------------------------------------------! -subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwater_mass & - ,soil_energy,sfcwater_energy,soil_text,sfcwater_depth,ustar,tstar & - ,rstar,cstar,zeta,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai & - ,veg_rough,veg_height,veg_displace,patch_area,patch_rough & - ,patch_wetind,leaf_class,soil_rough,sfcwater_nlev,stom_condct & - ,ground_rsat,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & - ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2,sensible_gc & - ,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp,resphet,veg_ndvip & - ,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c & - ,albedt,rlongup) +subroutine leaf3_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwater_mass & + ,soil_energy,sfcwater_energy,soil_color,soil_text,psibar_10d & + ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & + ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & + ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & + ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & + ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & + ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc & + ,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u & + ,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd & + ,rlong_gnd) implicit none !----- Arguments. ----------------------------------------------------------------------! @@ -32,7 +33,9 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa integer , intent(in) :: ibcon real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_water real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_energy + real, dimension( m2,m3,npat), intent(inout) :: soil_color real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_text + real, dimension( m2,m3,npat), intent(inout) :: psibar_10d real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_mass real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_energy real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_depth @@ -87,24 +90,28 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa real, dimension( m2,m3 ), intent(inout) :: sflux_c real, dimension( m2,m3 ), intent(inout) :: albedt real, dimension( m2,m3 ), intent(inout) :: rlongup + real, dimension( m2,m3,npat), intent(inout) :: rshort_gnd + real, dimension( m2,m3,npat), intent(inout) :: rlong_gnd !----- Local variables. ----------------------------------------------------------------! - integer :: i,j + integer :: i + integer :: j !---------------------------------------------------------------------------------------! !----- Western Boundary ----------------------------------------------------------------! if (iand(ibcon,1) /= 0) then do j=ja,jz - call leaf_clone(m2,m3,mzg,mzs,npat,2,1,j,j & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,2,1,j,j & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end do end if !---------------------------------------------------------------------------------------! @@ -116,16 +123,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Eastern Boundary ----------------------------------------------------------------! if (iand(ibcon,2) /= 0) then do j=ja,jz - call leaf_clone(m2,m3,mzg,mzs,npat,m2-1,m2,j,j & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,m2-1,m2,j,j & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end do end if !---------------------------------------------------------------------------------------! @@ -136,16 +144,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Southern Boundary ---------------------------------------------------------------! if (jdim == 1 .and. iand(ibcon,4) /= 0) then do i = ia,iz - call leaf_clone(m2,m3,mzg,mzs,npat,i,i,2,1 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,i,i,2,1 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end do end if !---------------------------------------------------------------------------------------! @@ -156,16 +165,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Northern Boundary ---------------------------------------------------------------! if (jdim == 1 .and. iand(ibcon,8) /= 0) then do i = ia,iz - call leaf_clone(m2,m3,mzg,mzs,npat,i,i,m3-1,m3 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,i,i,m3-1,m3 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end do end if !---------------------------------------------------------------------------------------! @@ -175,16 +185,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Southwestern corner -------------------------------------------------------------! if (iand(ibcon,5) /= 0 .or. (iand(ibcon,1) /= 0 .and. jdim == 0)) then - call leaf_clone(m2,m3,mzg,mzs,npat,2,1,1+jdim,1 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,2,1,1+jdim,1 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end if !---------------------------------------------------------------------------------------! @@ -193,16 +204,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Southeastern corner -------------------------------------------------------------! if (iand(ibcon,6) /= 0 .or. (iand(ibcon,2) /= 0 .and. jdim == 0)) then - call leaf_clone(m2,m3,mzg,mzs,npat,m2-1,m2,1+jdim,1 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,m2-1,m2,1+jdim,1 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end if !---------------------------------------------------------------------------------------! @@ -211,16 +223,17 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Northwestern corner -------------------------------------------------------------! if (iand(ibcon,9) /= 0 .or. (iand(ibcon,1) /= 0 .and. jdim == 0)) then - call leaf_clone(m2,m3,mzg,mzs,npat,2,1,m3-jdim,m3 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,2,1,m3-jdim,m3 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end if !---------------------------------------------------------------------------------------! @@ -229,21 +242,22 @@ subroutine leaf_bcond(m2,m3,mzg,mzs,npat,ia,iz,ja,jz,jdim,ibcon,soil_water,sfcwa !----- Northeastern corner -------------------------------------------------------------! if (iand(ibcon,10) /= 0 .or. (iand(ibcon,2) /= 0 .and. jdim == 0)) then - call leaf_clone(m2,m3,mzg,mzs,npat,m2-1,m2,m3-jdim,m3 & - ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_text & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo & - ,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv & - ,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc & - ,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt,rlongup) + call leaf3_clone(m2,m3,mzg,mzs,npat,m2-1,m2,m3-jdim,m3 & + ,soil_water,sfcwater_mass,soil_energy,sfcwater_energy,soil_color & + ,soil_text,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,patch_area,patch_rough,patch_wetind & + ,leaf_class,soil_rough,sfcwater_nlev,stom_condct,ground_rsat & + ,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & + ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp & + ,resphet,veg_ndvip,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w & + ,sflux_t,sflux_r,sflux_c,albedt,rlongup,rshort_gnd,rlong_gnd) end if !---------------------------------------------------------------------------------------! return -end subroutine leaf_bcond +end subroutine leaf3_bcond !==========================================================================================! !==========================================================================================! @@ -256,16 +270,17 @@ end subroutine leaf_bcond !==========================================================================================! ! This sub-routine will actually copy the boundary conditions. ! !------------------------------------------------------------------------------------------! -subroutine leaf_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water & - ,sfcwater_mass,soil_energy,sfcwater_energy,soil_text,sfcwater_depth & - ,ustar,tstar,rstar,cstar,zeta,ribulk,veg_albedo,veg_fracarea,veg_lai & - ,veg_tai,veg_rough,veg_height,veg_displace,patch_area,patch_rough & - ,patch_wetind,leaf_class,soil_rough,sfcwater_nlev,stom_condct & - ,ground_rsat,ground_rvap,ground_temp,ground_fliq,veg_water,veg_hcap & - ,veg_energy,can_prss,can_theiv,can_theta,can_rvap,can_co2,sensible_gc & - ,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp,resphet,veg_ndvip & - ,veg_ndvic,veg_ndvif,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c & - ,albedt,rlongup) +subroutine leaf3_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water & + ,sfcwater_mass,soil_energy,sfcwater_energy,soil_color,soil_text & + ,psibar_10d,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk & + ,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height & + ,veg_displace,patch_area,patch_rough,patch_wetind,leaf_class & + ,soil_rough,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap & + ,ground_temp,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss & + ,can_theiv,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc & + ,evap_gc,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic & + ,veg_ndvif,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c,albedt & + ,rlongup,rshort_gnd,rlong_gnd) implicit none !----- Arguments. ----------------------------------------------------------------------! integer , intent(in) :: m2 @@ -279,7 +294,9 @@ subroutine leaf_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water integer , intent(in) :: jdest real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_water real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_energy + real, dimension( m2,m3,npat), intent(inout) :: soil_color real, dimension(mzg,m2,m3,npat), intent(inout) :: soil_text + real, dimension( m2,m3,npat), intent(inout) :: psibar_10d real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_mass real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_energy real, dimension(mzs,m2,m3,npat), intent(inout) :: sfcwater_depth @@ -334,6 +351,8 @@ subroutine leaf_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water real, dimension( m2,m3 ), intent(inout) :: sflux_c real, dimension( m2,m3 ), intent(inout) :: albedt real, dimension( m2,m3 ), intent(inout) :: rlongup + real, dimension( m2,m3,npat), intent(inout) :: rshort_gnd + real, dimension( m2,m3,npat), intent(inout) :: rlong_gnd !----- Local variables. ----------------------------------------------------------------! integer :: kzg integer :: kzs @@ -397,6 +416,11 @@ subroutine leaf_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water veg_ndvic (idest,jdest,ipat) = veg_ndvic (isrc,jsrc,ipat) veg_ndvif (idest,jdest,ipat) = veg_ndvif (isrc,jsrc,ipat) + rshort_gnd (idest,jdest,ipat) = rshort_gnd (isrc,jsrc,ipat) + rlong_gnd (idest,jdest,ipat) = rlong_gnd (isrc,jsrc,ipat) + + soil_color (idest,jdest,ipat) = soil_color (isrc,jsrc,ipat) + psibar_10d (idest,jdest,ipat) = psibar_10d (isrc,jsrc,ipat) soilloop: do kzg = 1,mzg soil_water (kzg,idest,jdest,ipat) = soil_water (kzg,isrc,jsrc,ipat) soil_energy (kzg,idest,jdest,ipat) = soil_energy (kzg,isrc,jsrc,ipat) @@ -411,6 +435,6 @@ subroutine leaf_clone(m2,m3,mzg,mzs,npat,isrc,idest,jsrc,jdest,soil_water end do patchloop return -end subroutine leaf_clone +end subroutine leaf3_clone !==========================================================================================! !==========================================================================================! diff --git a/BRAMS/src/surface/leaf3_can.f90 b/BRAMS/src/surface/leaf3_can.f90 index 4df3baf52..bac7bba70 100644 --- a/BRAMS/src/surface/leaf3_can.f90 +++ b/BRAMS/src/surface/leaf3_can.f90 @@ -4,13 +4,13 @@ ! carbon exchanges with the canopy air space and vegetation. This solves only the ! ! prognostic variables, the diagnostic ones will be updated in a separate sub-routine. ! !------------------------------------------------------------------------------------------! -subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mass & - ,ustar,tstar,rstar,cstar,zeta,ribulk,soil_rough,veg_rough & - ,patch_rough,veg_height,veg_displace,veg_lai,veg_tai,veg_water & - ,veg_hcap,veg_energy,leaf_class,veg_fracarea,stom_condct,can_prss & - ,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc & - ,transp,gpp,plresp,resphet,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,available_water,rshort) +subroutine leaf3_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mass & + ,ustar,tstar,rstar,cstar,zeta,ribulk,soil_rough,veg_rough & + ,patch_rough,veg_height,veg_displace,veg_lai,veg_tai,veg_water & + ,veg_hcap,veg_energy,leaf_class,veg_fracarea,stom_condct,can_prss & + ,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc & + ,transp,gpp,plresp,resphet,ground_rsat,ground_rvap,ground_temp & + ,ground_fliq,available_water,rshort) use leaf_coms use rconstants use therm_lib , only : eslif & ! function @@ -116,7 +116,7 @@ subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mas character(len=3) , parameter :: fmtc='(a)' character(len=9) , parameter :: fmtl='(a,1x,l1)' !----- External functions. -------------------------------------------------------------! - real , external :: leaf_reduced_wind + real , external :: leaf3_reduced_wind !---------------------------------------------------------------------------------------! @@ -171,7 +171,7 @@ subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mas else ggveg = huge_num end if - ggnet = ggfact * ggbare * ggveg / (ggbare + ggveg) + ggnet = ggbare * ggveg / (ggbare + ggveg) !---------------------------------------------------------------------------------------! @@ -304,7 +304,7 @@ subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mas !------------------------------------------------------------------------------------! ! Find the wind speed at the top of the canopy, using the similarity theory. ! !------------------------------------------------------------------------------------! - veg_wind = leaf_reduced_wind(ustar,zeta,ribulk,geoht,veg_displace,veg_height & + veg_wind = leaf3_reduced_wind(ustar,zeta,ribulk,geoht,veg_displace,veg_height & ,patch_rough) @@ -312,7 +312,7 @@ subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mas ! Find the aerodynamic conductances for heat and water at the leaf boundary ! ! layer. ! !------------------------------------------------------------------------------------! - call leaf_aerodynamic_conductances(nveg,veg_wind,veg_temp,can_temp,can_rvap,can_rhos) + call leaf3_aerodynamic_conductances(nveg,veg_wind,veg_temp,can_temp,can_rvap,can_rhos) !------------------------------------------------------------------------------------! @@ -549,7 +549,7 @@ subroutine leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mas end if return -end subroutine leaf_canopy +end subroutine leaf3_canopy !==========================================================================================! !==========================================================================================! @@ -563,7 +563,7 @@ end subroutine leaf_canopy ! This sub-routine initialises a couple of canopy air space variables for a given ! ! patch, before the time step iteration loop. ! !------------------------------------------------------------------------------------------! -subroutine leaf_can_diag(ip,can_theta,can_theiv,can_rvap,leaf_class,can_prss,initial) +subroutine leaf3_can_diag(ip,can_theta,can_theiv,can_rvap,leaf_class,can_prss,initial) use leaf_coms , only : atm_prss & ! intent(in) , atm_theta & ! intent(in) , atm_shv & ! intent(in) @@ -699,7 +699,7 @@ subroutine leaf_can_diag(ip,can_theta,can_theiv,can_rvap,leaf_class,can_prss,ini return -end subroutine leaf_can_diag +end subroutine leaf3_can_diag !==========================================================================================! !==========================================================================================! @@ -713,7 +713,7 @@ end subroutine leaf_can_diag ! This sub-routine initialises a couple of leaf-level variables for a given patch, ! ! before the time step iteration loop. ! !------------------------------------------------------------------------------------------! -subroutine leaf_veg_diag(veg_energy,veg_water,veg_hcap) +subroutine leaf3_veg_diag(veg_energy,veg_water,veg_hcap) use leaf_coms , only : can_temp & ! intent(in) , min_patch_area & ! intent(in) , veg_temp & ! intent(out) @@ -752,6 +752,6 @@ subroutine leaf_veg_diag(veg_energy,veg_water,veg_hcap) !---------------------------------------------------------------------------------------! return -end subroutine leaf_veg_diag +end subroutine leaf3_veg_diag !==========================================================================================! !==========================================================================================! diff --git a/BRAMS/src/surface/leaf3_init.f90 b/BRAMS/src/surface/leaf3_init.f90 index 96941e32b..6eb793cbc 100644 --- a/BRAMS/src/surface/leaf3_init.f90 +++ b/BRAMS/src/surface/leaf3_init.f90 @@ -1,3 +1,4 @@ + !====================================== Change Log ========================================! ! 5.0.0 ! ! ! @@ -18,27 +19,38 @@ subroutine sfcdata() ! Soil Characteristics (see Clapp & Hornberger, 1978; McCumber & Pielke, 1981; ! ! Pielke, 1984; Tremback & Kessler, 1985) ! !------------------------------------------------------------------------------------! - real :: slpots ! Soil moisture potential at saturation [ m] - real :: slmsts ! Soil moisture at saturation [ m3/m3] - real :: slbs ! B exponent [ n/d] - real :: slcpd ! Specific heat of dry soil [ J/m3/K] - real :: soilcp ! Dry soil capacity (at -3.1MPa) [ m3/m3] - real :: soilwp ! Wilting point capacity (at -1.5MPa) [ m3/m3] - real :: slcons ! hydraulic conductivity at saturation [ m/s] - real :: slcons0 ! Surface value for slcons [ m/s] - real :: soilcond0 ! Intercept for conductivity calculation [ N/K/s] - real :: soilcond1 ! Linear coefficient for conductivity [ N/K/s] - real :: soilcond2 ! Quadratic coefficient for conductivity [ N/K/s] - real :: sfldcap ! Soil field capacity [ m3/m3] - real :: albwet ! Albedo for wet soil [ ---] - real :: albdry ! Albedo for dry soil [ ---] - real :: xsand ! Percentage of sand [ ---] - real :: xclay ! Percentage of clay [ ---] - real :: xsilt ! Percentage of silt [ ---] - real :: xrobulk ! Bulk density [ ---] - real :: slden ! "Dry" soil density (porosity) [ kg/m3] + real :: slpots ! Soil moisture potential at saturation [ m] + real :: slmsts ! Soil moisture at saturation [ m3/m3] + real :: slbs ! B exponent [ n/d] + real :: slcpd ! Specific heat of dry soil [ J/m3/K] + real :: soilcp ! Dry soil capacity (at -3.1MPa) [ m3/m3] + real :: soilwp ! Wilting point capacity (at -1.5MPa) [ m3/m3] + real :: slcons ! hydraulic conductivity at saturation [ m/s] + real :: slcons0 ! Surface value for slcons [ m/s] + real :: soilcond0 ! Intercept for conductivity calculation [ N/K/s] + real :: soilcond1 ! Linear coefficient for conductivity [ N/K/s] + real :: soilcond2 ! Quadratic coefficient for conductivity [ N/K/s] + real :: sfldcap ! Soil field capacity [ m3/m3] + real :: albwet ! Albedo for wet soil [ ---] + real :: albdry ! Albedo for dry soil [ ---] + real :: xsand ! Percentage of sand [ ---] + real :: xclay ! Percentage of clay [ ---] + real :: xsilt ! Percentage of silt [ ---] + real :: xrobulk ! Bulk density [ ---] + real :: slden ! "Dry" soil density (porosity) [ kg/m3] + real :: psild ! Soil potential threshold for leaf drop [ m] end type soil_class !.......................................................................................! + type soilcol_class + !------------------------------------------------------------------------------------! + ! Define soil colour structure. ! + !------------------------------------------------------------------------------------! + real(kind=4) :: alb_vis_dry ! Dry soil albedo - Visible [ ---] + real(kind=4) :: alb_nir_dry ! Dry soil albedo - Near Infrared [ ---] + real(kind=4) :: alb_vis_wet ! Saturated soil albedo - Visible [ ---] + real(kind=4) :: alb_nir_wet ! Saturated soil albedo - Near Infrared [ ---] + end type soilcol_class + !.......................................................................................! type vegt_class !----- LEAF-3 biophysical parameters by land use class number. ----------------------! real :: albv_green @@ -55,22 +67,24 @@ subroutine sfcdata() real :: gsw_max real :: leaf_width real :: stom_side + real :: phenology end type vegt_class !----- Local variables. ----------------------------------------------------------------! - type(soil_class) , dimension(nstyp) :: soilparms - type(vegt_class) , dimension(nvtyp+nvtyp_teb) :: bioparms - real , dimension(nstyp) :: xrobulk - integer :: k - integer :: nnn - real :: romin - real :: roorg - real :: slfcap - real :: refdepth - real :: tmin - real :: ratio - real :: xmin - real :: slz0 - real :: ezg + type(soil_class) , dimension(nstyp) :: soilparms + type(vegt_class) , dimension(nvtyp+nvtyp_teb) :: bioparms + type(soilcol_class), dimension(nscol) :: scolparms + real , dimension(nstyp) :: xrobulk + integer :: k + integer :: nnn + real :: romin + real :: roorg + real :: slfcap + real :: refdepth + real :: tmin + real :: ratio + real :: xmin + real :: slz0 + real :: ezg !---------------------------------------------------------------------------------------! @@ -80,97 +94,97 @@ subroutine sfcdata() ! Declare the biophysics parameters. ! ! (1st line) albv_green albv_brown emisv sr_max tai_max ! ! (2nd line) sai veg_clump veg_frac veg_ht rootdep ! - ! (3rd line) dead_frac gsw_max leaf_width stom_side ! + ! (3rd line) dead_frac gsw_max leaf_width stom_side phenology ! !---------------------------------------------------------------------------------------! bioparms = (/ & !----- 0. Ocean. Not really used, and this is class 0. Let's skip it. ---------------! ! vegt_class( 0.00, 0.00, 0.00, 0.0, 0.0 & ! , 0.0, 0.0, 0.00, 0.0, 0.0 & - ! , 0.0, 0.0, 0.00, 0.0 )& + ! , 0.0, 0.0, 0.00, 0.0 0.0)& !----- 1. Lakes, rivers, streams. -----------------------------------------------------! vegt_class( 0.00, 0.00, 0.00, 0.0, 0.0 & , 0.0, 0.0, 0.00, 0.0, 0.0 & - , 0.0, 0.0, 0.00, 0.0 ) & + , 0.0, 0.0, 0.00, 0.0, 0.0) & !----- 2. Ice cap/glacier. ------------------------------------------------------------! ,vegt_class( 0.00, 0.00, 0.00, 0.0, 0.0 & , 0.0, 0.0, 0.00, 0.0, 0.0 & - , 0.0, 0.0, 0.00, 0.0 ) & + , 0.0, 0.0, 0.00, 0.0, 0.0) & !----- 3. Desert, bare soil. ----------------------------------------------------------! ,vegt_class( 0.00, 0.00, 0.00, 0.0, 0.0 & , 0.0, 0.0, 0.00, 0.0, 0.0 & - , 0.0, 0.0, 0.00, 0.0 ) & + , 0.0, 0.0, 0.00, 0.0, 0.0) & !----- 4. Evergreen needleleaf tree. --------------------------------------------------! ,vegt_class( 0.14, 0.24, 0.97, 5.4, 8.0 & , 1.0, 1.0, 0.80, 20.0, 1.5 & - , 0.0, 0.0020, 0.05, 2.0 ) & + , 0.0, 0.0020, 0.05, 2.0, 0.0) & !----- 5. Deciduous needleleaf tree. --------------------------------------------------! ,vegt_class( 0.14, 0.24, 0.95, 5.4, 8.0 & , 1.0, 1.0, 0.80, 22.0, 1.5 & - , 0.0, 0.0020, 0.05, 2.0 ) & + , 0.0, 0.0020, 0.05, 2.0, 4.0) & !----- 6. Deciduous broadleaf tree. ---------------------------------------------------! ,vegt_class( 0.20, 0.24, 0.95, 6.2, 7.0 & , 1.0, 0.0, 0.80, 22.0, 1.5 & - , 0.0, 0.0020, 0.10, 1.0 ) & - !----- 7. Evergreen broadleaf tree. ---------------------------------------------------! + , 0.0, 0.0020, 0.10, 1.0, 4.0) & + !----- 7. "Evergreen" broadleaf tree (but drought deciduous). -------------------------! ,vegt_class( 0.12, 0.18, 0.95, 4.1, 6.5 & , 1.0, 0.0, 0.90, 32.0, 2.5 & - , 0.0, 0.0035, 0.20, 1.0 ) & + , 0.0, 0.0035, 0.20, 1.0, 4.0) & !----- 8. Short grass. ----------------------------------------------------------------! ,vegt_class( 0.13, 0.30, 0.96, 5.1, 4.0 & , 1.0, 0.0, 0.75, 0.3, 0.7 & - , 0.7, 0.0100, 0.10, 1.0 ) & + , 0.7, 0.0100, 0.10, 1.0, 4.0) & !----- 9. Tall grass. -----------------------------------------------------------------! ,vegt_class( 0.24, 0.43, 0.96, 5.1, 5.0 & , 1.0, 0.0, 0.80, 1.2, 1.0 & - , 0.7, 0.0100, 0.10, 1.0 ) & + , 0.7, 0.0100, 0.10, 1.0, 4.0) & !----- 10. Semi-desert. ----------------------------------------------------------------! ,vegt_class( 0.24, 0.24, 0.96, 5.1, 1.0 & , 0.2, 1.0, 0.20, 0.7, 1.0 & - , 0.0, 0.0020, 0.03, 1.0 ) & + , 0.0, 0.0020, 0.03, 1.0, 4.0) & !----- 11. Tundra. ---------------------------------------------------------------------! ,vegt_class( 0.20, 0.24, 0.95, 5.1, 4.5 & , 0.5, 1.0, 0.60, 0.2, 1.0 & - , 0.0, 0.0200, 0.03, 1.0 ) & + , 0.0, 0.0200, 0.03, 1.0, 4.0) & !----- 12. Evergreen shrub. ------------------------------------------------------------! ,vegt_class( 0.14, 0.24, 0.97, 5.1, 5.5 & , 1.0, 1.0, 0.70, 1.0, 1.0 & - , 0.0, 0.0020, 0.05, 1.0 ) & + , 0.0, 0.0020, 0.05, 1.0, 0.0) & !----- 13. Deciduous shrub. ------------------------------------------------------------! ,vegt_class( 0.20, 0.28, 0.97, 5.1, 5.5 & , 1.0, 1.0, 0.70, 1.0, 1.0 & - , 0.0, 0.0020, 0.05, 1.0 ) & + , 0.0, 0.0020, 0.05, 1.0, 4.0) & !----- 14. Mixed woodland. -------------------------------------------------------------! ,vegt_class( 0.16, 0.24, 0.96, 6.2, 7.0 & , 1.0, 0.5, 0.80, 22.0, 1.5 & - , 0.0, 0.0020, 0.08, 1.0 ) & + , 0.0, 0.0020, 0.08, 1.0, 4.0) & !----- 15. Crop/mixed farming, C3 grassland. -------------------------------------------! ,vegt_class( 0.22, 0.40, 0.95, 5.1, 5.0 & , 0.5, 0.0, 0.85, 1.0, 1.0 & - , 0.0, 0.0100, 0.10, 1.0 ) & + , 0.0, 0.0100, 0.10, 1.0, 4.0) & !----- 16. Irrigated crop. -------------------------------------------------------------! ,vegt_class( 0.18, 0.40, 0.95, 5.1, 5.0 & , 0.5, 0.0, 0.80, 1.1, 1.0 & - , 0.0, 0.0020, 0.10, 1.0 ) & + , 0.0, 0.0020, 0.10, 1.0, 0.0) & !----- 17. Bog or marsh. ---------------------------------------------------------------! ,vegt_class( 0.12, 0.43, 0.98, 5.1, 7.0 & , 1.0, 0.0, 0.80, 1.6, 1.0 & - , 0.0, 0.0020, 0.20, 1.0 ) & + , 0.0, 0.0020, 0.20, 1.0, 0.0) & !----- 18. Wooded grassland. -----------------------------------------------------------! ,vegt_class( 0.13, 0.30, 0.96, 5.1, 6.0 & , 1.0, 0.0, 0.80, 7.0, 1.5 & - , 0.0, 0.0100, 0.08, 1.0 ) & + , 0.0, 0.0100, 0.08, 1.0, 4.0) & !----- 19. Urban and built up. ---------------------------------------------------------! ,vegt_class( 0.20, 0.36, 0.90, 5.1, 3.6 & , 1.0, 0.0, 0.74, 6.0, 0.8 & - , 0.0, 0.0020, 0.05, 1.0 ) & + , 0.0, 0.0020, 0.05, 1.0, 0.0) & !----- 20. Wetland evergreen broadleaf tree. -------------------------------------------! ,vegt_class( 0.17, 0.24, 0.95, 4.1, 7.0 & , 1.0, 0.0, 0.90, 32.0, 1.5 & - , 0.0, 0.0020, 0.20, 1.0 ) & + , 0.0, 0.0020, 0.20, 1.0, 0.0) & !----- 21. Very urban. -----------------------------------------------------------------! ,vegt_class( 0.16, 0.24, 0.96, 5.1, 2.0 & , 1.5, 1.0, 0.10, 20.0, 1.5 & - , 0.0, 0.0020, 0.05, 1.0 ) & + , 0.0, 0.0020, 0.05, 1.0, 0.0) & /) !---------------------------------------------------------------------------------------! @@ -205,6 +219,8 @@ subroutine sfcdata() do k = nzg-1,1,-1 if (slz(k+1) > -bioparms(nnn)%rootdep) kroot(nnn) = k end do + + phenology(nnn) = nint(bioparms(nnn)%phenology) end do !---------------------------------------------------------------------------------------! @@ -216,94 +232,94 @@ subroutine sfcdata() ! (1st line) slpots slmsts slbs slcpd soilcp ! ! (2nd line) soilwp slcons slcons0 soilcond0 soilcond1 ! ! (3rd line) soilcond2 sfldcap albwet albdry xsand ! - ! (4th line) xclay xsilt xrobulk slden ! + ! (4th line) xclay xsilt xrobulk slden psild ! !---------------------------------------------------------------------------------------! soilparms = (/ & !----- 1. Sand. ---------------------------------------------------------------------! soil_class( -0.049831046, 0.373250, 3.295000, 1584640., 0.026183447 & , 0.032636854, 2.446421e-5, 0.000500000, 0.3000, 4.8000 & , -2.7000, 0.132130936, 0.229, 0.352, 0.920 & - , 0.030, 0.050, 1200., 1600. ) & + , 0.030, 0.050, 1200., 1600., -76.47872) & !----- 2. Loamy sand. ---------------------------------------------------------------! ,soil_class( -0.067406224, 0.385630, 3.794500, 1584809., 0.041560499 & , 0.050323046, 1.776770e-5, 0.000600000, 0.3000, 4.6600 & , -2.6000, 0.155181959, 0.212, 0.335, 0.825 & - , 0.060, 0.115, 1250., 1600. ) & + , 0.060, 0.115, 1250., 1600., -76.47872) & !----- 3. Sandy loam. ---------------------------------------------------------------! ,soil_class( -0.114261521, 0.407210, 4.629000, 1587042., 0.073495043 & , 0.085973722, 1.022660e-5, 0.000769000, 0.2900, 4.2700 & , -2.3100, 0.194037750, 0.183, 0.307, 0.660 & - , 0.110, 0.230, 1300., 1600. ) & + , 0.110, 0.230, 1300., 1600., -76.47872) & !----- 4. Silt loam. ----------------------------------------------------------------! ,soil_class( -0.566500112, 0.470680, 5.552000, 1568225., 0.150665475 & , 0.171711257, 2.501101e-6, 0.000010600, 0.2700, 3.4700 & , -1.7400, 0.273082063, 0.107, 0.250, 0.200 & - , 0.160, 0.640, 1400., 1600. ) & + , 0.160, 0.640, 1400., 1600., -76.47872) & !----- 5. Loam. ---------------------------------------------------------------------! ,soil_class( -0.260075834, 0.440490, 5.646000, 1588082., 0.125192234 & , 0.142369513, 4.532431e-6, 0.002200000, 0.2800, 3.6300 & , -1.8500, 0.246915025, 0.140, 0.268, 0.410 & - , 0.170, 0.420, 1350., 1600. ) & + , 0.170, 0.420, 1350., 1600., -76.47872) & !----- 6. Sandy clay loam. ----------------------------------------------------------! ,soil_class( -0.116869181, 0.411230, 7.162000, 1636224., 0.136417267 & , 0.150969505, 6.593731e-6, 0.001500000, 0.2800, 3.7800 & , -1.9600, 0.249629687, 0.163, 0.260, 0.590 & - , 0.270, 0.140, 1350., 1600. ) & + , 0.270, 0.140, 1350., 1600., -76.47872) & !----- 7. Silty clay loam. ----------------------------------------------------------! ,soil_class( -0.627769194, 0.478220, 8.408000, 1621562., 0.228171947 & , 0.248747504, 1.435262e-6, 0.000107000, 0.2600, 2.7300 & , -1.2000, 0.333825332, 0.081, 0.195, 0.100 & - , 0.340, 0.560, 1500., 1600. ) & + , 0.340, 0.560, 1500., 1600., -76.47872) & !----- 8. Clayey loam. --------------------------------------------------------------! ,soil_class( -0.281968114, 0.446980, 8.342000, 1636911., 0.192624431 & , 0.210137962, 2.717260e-6, 0.002200000, 0.2700, 3.2300 & , -1.5600, 0.301335491, 0.116, 0.216, 0.320 & - , 0.340, 0.340, 1450., 1600. ) & + , 0.340, 0.340, 1450., 1600., -76.47872) & !----- 9. Sandy clay. ---------------------------------------------------------------! ,soil_class( -0.121283019, 0.415620, 9.538000, 1673422., 0.182198910 & , 0.196607427, 4.314507e-6, 0.000002167, 0.2700, 3.3200 & , -1.6300, 0.286363001, 0.144, 0.216, 0.520 & - , 0.420, 0.060, 1450., 1600. ) & + , 0.420, 0.060, 1450., 1600., -76.47872) & !----- 10. Silty clay. --------------------------------------------------------------! ,soil_class( -0.601312179, 0.479090, 10.461000, 1652723., 0.263228486 & , 0.282143846, 1.055191e-6, 0.000001033, 0.2500, 2.5800 & , -1.0900, 0.360319788, 0.068, 0.159, 0.060 & - , 0.470, 0.470, 1650., 1600. ) & + , 0.470, 0.470, 1650., 1600., -76.47872) & !----- 11. Clay. --------------------------------------------------------------------! ,soil_class( -0.299226464, 0.454400, 12.460000, 1692037., 0.259868987 & , 0.275459057, 1.307770e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.353255209, 0.083, 0.140, 0.200 & - , 0.600, 0.200, 1700., 1600. ) & + , 0.600, 0.200, 1700., 1600., -76.47872) & !----- 12. Peat. --------------------------------------------------------------------! ,soil_class( -0.534564359, 0.469200, 6.180000, 874000., 0.167047523 & , 0.187868805, 2.357930e-6, 0.000008000, 0.0600, 0.4600 & , 0.0000, 0.285709966, 0.070, 0.140, 0.2000 & - , 0.2000, 0.6000, 500., 300. ) & + , 0.2000, 0.6000, 500., 300., -76.47872) & !----- 13. Bedrock. -----------------------------------------------------------------! ,soil_class( 0.0000000, 0.000000, 0.000000, 2130000., 0.000000000 & , 0.000000000, 0.000000e+0, 0.000000000, 4.6000, 0.0000 & , 0.0000, 0.000000001, 0.320, 0.320, 0.0000 & - , 0.0000, 0.0000, 0., 0. ) & + , 0.0000, 0.0000, 0., 0., 0.0000) & !----- 14. Silt. --------------------------------------------------------------------! ,soil_class( -1.047128548, 0.492500, 3.862500, 1510052., 0.112299080 & , 0.135518820, 2.046592e-6, 0.000010600, 0.2700, 3.4700 & , -1.7400, 0.245247642, 0.092, 0.265, 0.075 & - , 0.050, 0.875, 1400., 1600. ) & + , 0.050, 0.875, 1400., 1600., -76.47872) & !----- 15. Heavy clay. --------------------------------------------------------------! ,soil_class( -0.322106879, 0.461200, 15.630000, 1723619., 0.296806035 & , 0.310916364, 7.286705e-7, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.382110712, 0.056, 0.080, 0.100 & - , 0.800, 0.100, 1700., 1600. ) & + , 0.800, 0.100, 1700., 1600., -76.47872) & !----- 16. Clayey sand. -------------------------------------------------------------! ,soil_class( -0.176502150, 0.432325, 11.230000, 1688353., 0.221886929 & , 0.236704039, 2.426785e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.320146708, 0.115, 0.175, 0.375 & - , 0.525, 0.100, 1700., 1600. ) & + , 0.525, 0.100, 1700., 1600., -76.47872) & !----- 17. Clayey silt. -------------------------------------------------------------! ,soil_class( -0.438278332, 0.467825, 11.305000, 1670103., 0.261376708 & , 0.278711303, 1.174982e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.357014719, 0.075, 0.151, 0.125 & - , 0.525, 0.350, 1700., 1600. ) & + , 0.525, 0.350, 1700., 1600., -76.47872) & /) !---------------------------------------------------------------------------------------! @@ -345,6 +361,7 @@ subroutine sfcdata() fhydraul(nnn) = 0. end if + select case (isfcl) case (2) !----- TOPMODEL form - large at surface, and exponential decrease with depth. ----! @@ -387,12 +404,20 @@ subroutine sfcdata() soilcond0(nnn) = soilparms(nnn)%soilcond0 soilcond1(nnn) = soilparms(nnn)%soilcond1 soilcond2(nnn) = soilparms(nnn)%soilcond2 - albwet (nnn) = soilparms(nnn)%albwet - albdry (nnn) = soilparms(nnn)%albdry xsand (nnn) = soilparms(nnn)%xsand xclay (nnn) = soilparms(nnn)%xclay xsilt (nnn) = soilparms(nnn)%xsilt xrobulk (nnn) = soilparms(nnn)%xrobulk + psild (nnn) = soilparms(nnn)%psild + + !----- Find potential at the wilting point. -----------------------------------------! + if (nnn /= 13) then + psiwp (nnn) = soilparms(nnn)%slpots & + / (soilparms(nnn)%soilwp / soilparms(nnn)%slmsts) & + ** soilparms(nnn)%slbs + else + psiwp (nnn) = 0.0 + end if !----- Define the emmisivity and slfc. ----------------------------------------------! emisg(nnn) = .98 @@ -402,6 +427,55 @@ subroutine sfcdata() slfc(nnn) = 0.0 end if end do + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! Fill in the albedo information regarding the soil colour classes. ! + !---------------------------------------------------------------------------------------! + ! | Dry soil | Saturated | ! + ! Soil class |---------------+---------------| ! + ! | VIS | NIR | VIS | NIR | ! + !---------------------------------------------------------------------------------------! + scolparms = (/ & ! + soilcol_class ( 0.36, 0.61, 0.25, 0.50 ) & ! 01 - Brightest + ,soilcol_class ( 0.34, 0.57, 0.23, 0.46 ) & ! 02 + ,soilcol_class ( 0.32, 0.53, 0.21, 0.42 ) & ! 03 + ,soilcol_class ( 0.31, 0.51, 0.20, 0.40 ) & ! 04 + ,soilcol_class ( 0.30, 0.49, 0.19, 0.38 ) & ! 05 + ,soilcol_class ( 0.29, 0.48, 0.18, 0.36 ) & ! 06 + ,soilcol_class ( 0.28, 0.45, 0.17, 0.34 ) & ! 07 + ,soilcol_class ( 0.27, 0.43, 0.16, 0.32 ) & ! 08 + ,soilcol_class ( 0.26, 0.41, 0.15, 0.30 ) & ! 09 + ,soilcol_class ( 0.25, 0.39, 0.14, 0.28 ) & ! 10 + ,soilcol_class ( 0.24, 0.37, 0.13, 0.26 ) & ! 11 + ,soilcol_class ( 0.23, 0.35, 0.12, 0.24 ) & ! 12 + ,soilcol_class ( 0.22, 0.33, 0.11, 0.22 ) & ! 13 + ,soilcol_class ( 0.20, 0.31, 0.10, 0.20 ) & ! 14 + ,soilcol_class ( 0.18, 0.29, 0.09, 0.18 ) & ! 15 + ,soilcol_class ( 0.16, 0.27, 0.08, 0.16 ) & ! 16 + ,soilcol_class ( 0.14, 0.25, 0.07, 0.14 ) & ! 17 + ,soilcol_class ( 0.12, 0.23, 0.06, 0.12 ) & ! 18 + ,soilcol_class ( 0.10, 0.21, 0.05, 0.10 ) & ! 19 + ,soilcol_class ( 0.08, 0.16, 0.04, 0.08 ) & ! 20 - Darkest + ,soilcol_class ( 0.00, 0.00, 0.00, 0.00 ) & ! 21 - ED-2.1, unused + /) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Fill in the vectors. ! + !---------------------------------------------------------------------------------------! + do nnn = 1,nscol + alb_vis_dry(nnn) = scolparms(nnn)%alb_vis_dry + alb_nir_dry(nnn) = scolparms(nnn)%alb_nir_dry + alb_vis_wet(nnn) = scolparms(nnn)%alb_vis_wet + alb_nir_wet(nnn) = scolparms(nnn)%alb_nir_wet + end do + !---------------------------------------------------------------------------------------! return end subroutine sfcdata @@ -455,7 +529,7 @@ end subroutine snowinit ! (2) specifying new hardcoded values in subroutine sfcinit_user in the file ruser.f90, ! ! (3) reading data from the standard RAMS datasets. ! !------------------------------------------------------------------------------------------! -subroutine sfcinit_file(n2,n3,mzg,npat,ifm,patch_area,leaf_class,soil_text) +subroutine sfcinit_file(n2,n3,mzg,npat,ifm,patch_area,leaf_class,soil_color,soil_text) use mem_leaf use rconstants use leaf_coms , only : min_patch_area @@ -467,6 +541,7 @@ subroutine sfcinit_file(n2,n3,mzg,npat,ifm,patch_area,leaf_class,soil_text) integer , intent(in) :: mzg integer , intent(in) :: npat integer , intent(in) :: ifm + real , dimension(n2,n3,npat) , intent(inout) :: soil_color real , dimension(mzg,n2,n3,npat), intent(inout) :: soil_text real , dimension(n2,n3,npat) , intent(inout) :: patch_area real , dimension(n2,n3,npat) , intent(inout) :: leaf_class @@ -494,12 +569,15 @@ subroutine sfcinit_file(n2,n3,mzg,npat,ifm,patch_area,leaf_class,soil_text) do k = 1,mzg soil_text(k,i,j,1) = 0. ! patch 1 end do + soil_color(i,j,1) = 0. + !----- Land patch. ---------------------------------------------------------------! patch_area(i,j,2) = pctlcon leaf_class(i,j,2) = float(nvgcon) do k = 1,mzg soil_text(k,i,j,2) = float(nslcon) end do + soil_color(i,j,2) = isoilcol end do end do !---------------------------------------------------------------------------------------! @@ -520,6 +598,8 @@ subroutine sfcinit_file(n2,n3,mzg,npat,ifm,patch_area,leaf_class,soil_text) soil_text(k,i,j,ipat) = soil_text(k,i,j,2) end do + soil_color(i,j,ipat) = soil_color(i,j,2) + end do end do end do @@ -544,15 +624,16 @@ end subroutine sfcinit_file ! 2. Specifying new values in subroutine sfcinit_nofile_user in the file ruser.f90. ! !------------------------------------------------------------------------------------------! subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,seatf & - ,soil_water,soil_energy,soil_text,sfcwater_mass,sfcwater_energy & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk,veg_fracarea & - ,veg_agb,veg_lai,veg_tai,veg_rough,veg_height,veg_displace & - ,veg_albedo,patch_area,patch_rough,patch_wetind,leaf_class & - ,soil_rough,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap & - ,ground_temp,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss & - ,can_theiv,can_theta,can_rvap,can_co2,sensible_gc,sensible_vc & - ,evap_gc,evap_vc,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic & - ,veg_ndvif,snow_mass,snow_depth,cosz,rlongup,albedt,rvv,prsv,piv & + ,soil_water,soil_energy,psibar_10d,soil_color,soil_text & + ,sfcwater_mass,sfcwater_energy,sfcwater_depth,ustar,tstar,rstar & + ,cstar,zeta,ribulk,veg_fracarea,veg_agb,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,veg_albedo,patch_area,patch_rough & + ,patch_wetind,leaf_class,soil_rough,sfcwater_nlev,stom_condct & + ,ground_rsat,ground_rvap,ground_temp,ground_fliq,veg_water & + ,veg_hcap,veg_energy,can_prss,can_theiv,can_theta,can_rvap & + ,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp & + ,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif,snow_mass & + ,snow_depth,rshort_gnd,rlong_gnd,cosz,rlongup,albedt,rvv,prsv,piv & ,vt2da,vt2db,glat,glon,zot,flpw,rtgt) use mem_grid use mem_leaf @@ -585,6 +666,8 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s real, dimension( n2,n3) , intent(in) :: cosz real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_water real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_energy + real, dimension( n2,n3,npat), intent(inout) :: psibar_10d + real, dimension( n2,n3,npat), intent(inout) :: soil_color real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_text real, dimension(mzs,n2,n3,npat), intent(inout) :: sfcwater_mass real, dimension(mzs,n2,n3,npat), intent(inout) :: sfcwater_energy @@ -633,16 +716,18 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s real, dimension( n2,n3,npat), intent(inout) :: veg_ndvip real, dimension( n2,n3,npat), intent(inout) :: veg_ndvic real, dimension( n2,n3,npat), intent(inout) :: veg_ndvif - real, dimension( n2,n3) , intent(out) :: rlongup - real, dimension( n2,n3) , intent(out) :: albedt - real, dimension( n2,n3) , intent(inout) :: rvv - real, dimension( n2,n3) , intent(inout) :: prsv - real, dimension( n2,n3) , intent(inout) :: piv - real, dimension( n2,n3) , intent(inout) :: vt2da - real, dimension( n2,n3) , intent(inout) :: vt2db - real, dimension( n2,n3) , intent(in) :: glat - real, dimension( n2,n3) , intent(in) :: glon - real, dimension( n2,n3) , intent(inout) :: zot + real, dimension( n2,n3,npat), intent(inout) :: rshort_gnd + real, dimension( n2,n3,npat), intent(inout) :: rlong_gnd + real, dimension( n2,n3) , intent(out) :: rlongup + real, dimension( n2,n3) , intent(out) :: albedt + real, dimension( n2,n3) , intent(inout) :: rvv + real, dimension( n2,n3) , intent(inout) :: prsv + real, dimension( n2,n3) , intent(inout) :: piv + real, dimension( n2,n3) , intent(inout) :: vt2da + real, dimension( n2,n3) , intent(inout) :: vt2db + real, dimension( n2,n3) , intent(in) :: glat + real, dimension( n2,n3) , intent(in) :: glon + real, dimension( n2,n3) , intent(inout) :: zot !----- Local variables. ----------------------------------------------------------------! integer :: k2 integer :: i @@ -651,7 +736,10 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s integer :: ipat integer :: nveg integer :: nsoil - real :: tsoil + real :: soil_temp + real :: soil_fliq + real :: available_water + real :: psi_layer !----- External functions. -------------------------------------------------------------! real , external :: soil_idx2water !---------------------------------------------------------------------------------------! @@ -724,6 +812,7 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s !----- Soil properties. Except for top layer energy, everything is set to zero. --! soil_energy(:,i,j,1) = 0. soil_water (:,i,j,1) = 1. + psibar_10d (i,j,1) = 1. soil_energy(mzg,i,j,1) = cliq * (seatp(i,j) + (seatf(i,j) - seatp(i,j)) & * timefac_sst - tsupercool) @@ -806,6 +895,8 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s plresp (i,j,ipat) = 0.0 resphet (i,j,ipat) = 0.0 + + available_water = 0.0 do k = 1,mzg nsoil = nint(soil_text(k,i,j,ipat)) @@ -829,16 +920,35 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s ! point, we assume all soil water to be frozen, otherwise we assume all ! ! water to be liquid. ! !---------------------------------------------------------------------------! - tsoil = can_temp + stgoff(k) + soil_temp = can_temp + stgoff(k) if (can_temp >= t3ple) then - soil_energy(k,i,j,ipat) = slcpd(nsoil) * tsoil + soil_water(k,i,j,ipat) & - * cliqvlme * (tsoil - tsupercool) + soil_energy(k,i,j,ipat) = slcpd(nsoil) * soil_temp & + + soil_water(k,i,j,ipat) & + * cliqvlme * (soil_temp - tsupercool) + soil_fliq = 1.0 else - soil_energy(k,i,j,ipat) = slcpd(nsoil) * tsoil & - + soil_water(k,i,j,ipat) * cicevlme * tsoil + soil_energy(k,i,j,ipat) = slcpd(nsoil) * soil_temp & + + soil_water(k,i,j,ipat) * cicevlme * soil_temp + soil_fliq = 0.0 + end if + + !------ Integrate the relative potential. ----------------------------------! + if (k >= kroot(nveg) .and. nsoil /= 13) then + psi_layer = slpots(nsoil) & + / (soil_water(k,i,j,ipat) / slmsts(nsoil)) ** slbs(nsoil) + available_water = available_water & + + max(0., (psi_layer-psiwp(nsoil)) & + / (psild(nsoil) - psiwp(nsoil)) ) & + * (slz(k+1) - slz(k)) end if + !---------------------------------------------------------------------------! end do + !----- Normalise the available water. -----------------------------------------! + available_water = available_water / abs(slz(kroot(nveg))) + psibar_10d(i,j,ipat) = available_water + !------------------------------------------------------------------------------! + !------ Surface water, if any, will initially occupy just the first level. ----! do k = 1,mzs sfcwater_mass(k,i,j,ipat) = 0. @@ -895,14 +1005,15 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s , veg_tai (i,j,ipat) , veg_rough (i,j,ipat) & , veg_height (i,j,ipat) , veg_displace (i,j,ipat) & , veg_albedo (i,j,ipat) , veg_ndvip (i,j,ipat) & - , veg_ndvic (i,j,ipat) , veg_ndvif (i,j,ipat) ) - - call leaf_grndvap( soil_energy(mzg,i,j,ipat) , soil_water (mzg,i,j,ipat) & - , soil_text (mzg,i,j,ipat) , sfcwater_energy( 1,i,j,ipat) & - , sfcwater_nlev (i,j,ipat) , can_rvap (i,j,ipat) & - , can_prss (i,j,ipat) , ground_rsat (i,j,ipat) & - , ground_rvap (i,j,ipat) , ground_temp (i,j,ipat) & - , ground_fliq (i,j,ipat) ) + , veg_ndvic (i,j,ipat) , veg_ndvif (i,j,ipat) & + , psibar_10d (i,j,ipat) ) + + call leaf3_grndvap( soil_energy(mzg,i,j,ipat) , soil_water (mzg,i,j,ipat) & + , soil_text (mzg,i,j,ipat) , sfcwater_energy( 1,i,j,ipat) & + , sfcwater_nlev (i,j,ipat) , can_rvap (i,j,ipat) & + , can_prss (i,j,ipat) , ground_rsat (i,j,ipat) & + , ground_rvap (i,j,ipat) , ground_temp (i,j,ipat) & + , ground_fliq (i,j,ipat) ) end do patchloop1 !---------------------------------------------------------------------------------! @@ -915,43 +1026,44 @@ subroutine sfcinit_nofile(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,seatp,s ! ables. ! !------------------------------------------------------------------------------! if (ipat == 1) then - call leaf_ocean_diag(ifm,mzg,seatp (i,j),seatf (i,j),soil_energy(:,i,j,1)) + call leaf3_ocean_diag(ifm,mzg,seatp (i,j),seatf (i,j),soil_energy(:,i,j,1)) end if - call leaf_soilsfcw_diag(ipat,mzg,mzs,soil_energy (:,i,j,ipat) & - ,soil_water (:,i,j,ipat) & - ,soil_text (:,i,j,ipat) & - ,sfcwater_nlev ( i,j,ipat) & - ,sfcwater_energy (:,i,j,ipat) & - ,sfcwater_mass (:,i,j,ipat) & - ,sfcwater_depth (:,i,j,ipat) & - ,.true. ) - - call leaf_solve_veg(ipat,mzs,leaf_class (i,j,ipat) & - ,veg_height ( i,j,ipat) & - ,patch_area (i,j,ipat) & - ,veg_fracarea (i,j,ipat) & - ,veg_tai ( i,j,ipat) & - ,sfcwater_nlev (i,j,ipat) & - ,sfcwater_depth (:,i,j,ipat) & - ,.true. ) - - call leaf_can_diag(ipat,can_theta (i,j,ipat) & - ,can_theiv (i,j,ipat) & - ,can_rvap (i,j,ipat) & - ,leaf_class (i,j,ipat) & - ,can_prss (i,j,ipat) & - ,.true. ) - - call leaf_veg_diag(veg_energy(i,j,ipat),veg_water(i,j,ipat),veg_hcap(i,j,ipat)) - - call sfcrad( mzg, mzs, ipat & - , soil_water (:,i,j,ipat) , soil_text (:,i,j,ipat) & - , sfcwater_depth(:,i,j,ipat) , patch_area ( i,j,ipat) & - , veg_fracarea ( i,j,ipat) , leaf_class ( i,j,ipat) & - , veg_albedo ( i,j,ipat) , sfcwater_nlev ( i,j,ipat) & - , 0. , 0. & - , albedt ( i,j ) , rlongup ( i,j ) & - , cosz ( i,j ) ) + call leaf3_soilsfcw_diag(ipat,mzg,mzs,soil_energy (:,i,j,ipat) & + ,soil_water (:,i,j,ipat) & + ,soil_text (:,i,j,ipat) & + ,sfcwater_nlev ( i,j,ipat) & + ,sfcwater_energy (:,i,j,ipat) & + ,sfcwater_mass (:,i,j,ipat) & + ,sfcwater_depth (:,i,j,ipat) & + ,.true. ) + + call leaf3_solve_veg(ipat,mzs,leaf_class (i,j,ipat) & + ,veg_height ( i,j,ipat) & + ,patch_area (i,j,ipat) & + ,veg_fracarea (i,j,ipat) & + ,veg_tai ( i,j,ipat) & + ,sfcwater_nlev (i,j,ipat) & + ,sfcwater_depth (:,i,j,ipat) & + ,.true. ) + + call leaf3_can_diag(ipat,can_theta (i,j,ipat) & + ,can_theiv (i,j,ipat) & + ,can_rvap (i,j,ipat) & + ,leaf_class (i,j,ipat) & + ,can_prss (i,j,ipat) & + ,.true. ) + + call leaf3_veg_diag(veg_energy(i,j,ipat),veg_water(i,j,ipat),veg_hcap(i,j,ipat)) + + call leaf3_sfcrad( mzg, mzs, ipat & + , soil_water (:,i,j,ipat) , soil_color ( i,j,ipat) & + , soil_text (:,i,j,ipat) , sfcwater_depth(:,i,j,ipat) & + , patch_area ( i,j,ipat) , veg_fracarea ( i,j,ipat) & + , leaf_class ( i,j,ipat) , veg_albedo ( i,j,ipat) & + , sfcwater_nlev ( i,j,ipat) , 0. & + , 0. , cosz ( i,j ) & + , albedt ( i,j ) , rlongup ( i,j ) & + , rshort_gnd ( i,j,ipat) , rlong_gnd ( i,j,ipat) ) end do patchloop2 end do iloop end do jloop diff --git a/BRAMS/src/surface/leaf3_ocean.f90 b/BRAMS/src/surface/leaf3_ocean.f90 index 40882d430..1fa721788 100644 --- a/BRAMS/src/surface/leaf3_ocean.f90 +++ b/BRAMS/src/surface/leaf3_ocean.f90 @@ -25,7 +25,6 @@ subroutine leaf3_ocean(mzg,ustar,tstar,rstar,cstar,patch_rough,can_prss,can_rvap , veg_temp & ! intent(out) , veg_fliq & ! intent(out) , ggveg & ! intent(out) - , ggfact & ! intent(out) , ggnet & ! intent(out) , hflxgc & ! intent(out) , wflxgc & ! intent(out) @@ -37,8 +36,7 @@ subroutine leaf3_ocean(mzg,ustar,tstar,rstar,cstar,patch_rough,can_prss,can_rvap , hflxac & ! intent(out) , wflxac & ! intent(out) , cflxac & ! intent(out) - , ustmin & ! intent(in) - , ggfact ! ! intent(in) + , ustmin ! ! intent(in) use rconstants, only : mmdry & ! intent(in) , mmdryi & ! intent(in) , cp & ! intent(in) @@ -99,7 +97,7 @@ subroutine leaf3_ocean(mzg,ustar,tstar,rstar,cstar,patch_rough,can_prss,can_rvap ! For water patches, the net conductance is the same as the bare ground. ! !---------------------------------------------------------------------------------------! ggveg = huge_num - ggnet = ggbare * ggfact + ggnet = ggbare !---------------------------------------------------------------------------------------! !----- Compute the fluxes from water body to canopy. -----------------------------------! @@ -141,7 +139,7 @@ end subroutine leaf3_ocean ! This routine will find the internal energy of the ocean based on the previous and ! ! future sea surface temperature. ! !------------------------------------------------------------------------------------------! -subroutine leaf_ocean_diag(ifm,mzg,pastsst,futuresst,soil_energy) +subroutine leaf3_ocean_diag(ifm,mzg,pastsst,futuresst,soil_energy) use rconstants, only : cliq & ! intent(in) , tsupercool ! ! intent(in) use mem_grid , only : time ! ! intent(in) @@ -189,6 +187,6 @@ subroutine leaf_ocean_diag(ifm,mzg,pastsst,futuresst,soil_energy) !---------------------------------------------------------------------------------------! return -end subroutine leaf_ocean_diag +end subroutine leaf3_ocean_diag !==========================================================================================! !==========================================================================================! diff --git a/BRAMS/src/surface/leaf3_tw.f90 b/BRAMS/src/surface/leaf3_tw.f90 index f6c65fda2..255984e32 100644 --- a/BRAMS/src/surface/leaf3_tw.f90 +++ b/BRAMS/src/surface/leaf3_tw.f90 @@ -3,7 +3,7 @@ ! This sub-routine is just an interface for the main solver. Some compilers like ! ! ifort 10 give segmentation violation if we call the subroutine directly from leaf3.f90. ! !------------------------------------------------------------------------------------------! -subroutine leaf_prognostic(ifm,i,j,ip) +subroutine leaf3_prognostic(ifm,i,j,ip) use mem_leaf , only : leaf_g ! ! intent(inout) use mem_radiate, only : radiate_g ! ! intent(inout) use mem_grid , only : nzg & ! intent(in) @@ -16,7 +16,7 @@ subroutine leaf_prognostic(ifm,i,j,ip) integer , intent(in) :: ip !---------------------------------------------------------------------------------------! - call leaftw(nzg,nzs & + call leaf3_tw(nzg,nzs & ,leaf_g(ifm)%soil_water (:,i,j,ip),leaf_g(ifm)%soil_energy (:,i,j,ip) & ,leaf_g(ifm)%soil_text (:,i,j,ip),leaf_g(ifm)%sfcwater_energy(:,i,j,ip) & ,leaf_g(ifm)%sfcwater_mass (:,i,j,ip),leaf_g(ifm)%sfcwater_depth (:,i,j,ip) & @@ -45,7 +45,7 @@ subroutine leaf_prognostic(ifm,i,j,ip) ,radiate_g(ifm)%cosz (i,j) ) return -end subroutine leaf_prognostic +end subroutine leaf3_prognostic !==========================================================================================! !==========================================================================================! @@ -56,14 +56,14 @@ end subroutine leaf_prognostic !==========================================================================================! !==========================================================================================! -subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int & - ,sfcwater_mass,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk & - ,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height & - ,veg_displace,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & - ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & - ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv,can_theta & - ,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp & - ,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif,rshort,cosz) +subroutine leaf3_tw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int & + ,sfcwater_mass,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk & + ,veg_albedo,veg_fracarea,veg_lai,veg_tai,veg_rough,veg_height & + ,veg_displace,patch_area,patch_rough,patch_wetind,leaf_class,soil_rough & + ,sfcwater_nlev,stom_condct,ground_rsat,ground_rvap,ground_temp & + ,ground_fliq,veg_water,veg_hcap,veg_energy,can_prss,can_theiv,can_theta & + ,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp & + ,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif,rshort,cosz) use leaf_coms use mem_leaf @@ -244,18 +244,18 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int ! Bedrock. Make the potential exactly the same as the bottom layer, and the flux ! ! will be zero. ! !------------------------------------------------------------------------------------! - soil_water_0 = soil_water (k) - soil_fracliq_0 = soil_fracliq (k) - hydcond_0 = hydcond (k) - psiplusz_0 = psiplusz (k) + soil_water_0 = soil_water (1) + soil_fracliq_0 = soil_fracliq (1) + hydcond_0 = hydcond (1) + psiplusz_0 = psiplusz (1) !------------------------------------------------------------------------------------! case (1) !------------------------------------------------------------------------------------! ! Free drainage. Make the water potential at the layer beneath to be at the ! ! same soil moisture as the bottom layer. ! !------------------------------------------------------------------------------------! - soil_water_0 = soil_water (k) - soil_fracliq_0 = soil_fracliq (k) + soil_water_0 = soil_water (1) + soil_fracliq_0 = soil_fracliq (1) wgpfrac = min(soil_water_0/slmsts(nsoil), 1.0) hydcond_0 = slcons1_0(nsoil) * wgpfrac ** (2.0 * slbs(nsoil) + 3.0) psiplusz_0 = slzt_0 + slpots(nsoil) / wgpfrac ** slbs(nsoil) @@ -266,7 +266,7 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int ! air soil, and find the corresponding hydraulic conductivity. ! !------------------------------------------------------------------------------------! soil_water_0 = soilcp(nsoil) - soil_fracliq_0 = soil_fracliq (k) + soil_fracliq_0 = soil_fracliq (1) wgpfrac = min(soil_water_0/slmsts(nsoil), 1.0) hydcond_0 = slcons1_0(nsoil) * wgpfrac ** (2.0 * slbs(nsoil) + 3.0) psiplusz_0 = slzt_0 + slpots(nsoil) / wgpfrac ** slbs(nsoil) @@ -276,7 +276,7 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int ! Make the soil moisture in the layer beneath to be at field capacity. ! !------------------------------------------------------------------------------------! soil_water_0 = sfldcap(nsoil) - soil_fracliq_0 = soil_fracliq (k) + soil_fracliq_0 = soil_fracliq (1) wgpfrac = min(soil_water_0/slmsts(nsoil), 1.0) hydcond_0 = slcons1_0(nsoil) * wgpfrac ** (2.0 * slbs(nsoil) + 3.0) psiplusz_0 = slzt_0 + slpots(nsoil) / wgpfrac ** slbs(nsoil) @@ -286,7 +286,7 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int ! Aquifer. Make the soil moisture in the layer beneath to be always saturated. ! !------------------------------------------------------------------------------------! soil_water_0 = slmsts(nsoil) - soil_fracliq_0 = soil_fracliq (k) + soil_fracliq_0 = soil_fracliq (1) wgpfrac = min(soil_water_0/slmsts(nsoil), 1.0) hydcond_0 = slcons1_0(nsoil) * wgpfrac ** (2.0 * slbs(nsoil) + 3.0) psiplusz_0 = slzt_0 + slpots(nsoil) / wgpfrac ** slbs(nsoil) @@ -302,12 +302,13 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int ! ure and heat changes to vegetation, and evaluate the resistance parameter rgnd ! ! between canopy air and the top soil or snow surface. ! !---------------------------------------------------------------------------------------! - call leaf_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mass,ustar & - ,tstar,rstar,cstar,zeta,ribulk,soil_rough,veg_rough,patch_rough & - ,veg_height,veg_displace,veg_lai,veg_tai,veg_water,veg_hcap,veg_energy & - ,leaf_class,veg_fracarea,stom_condct,can_prss,can_rvap,can_co2 & - ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp,resphet & - ,ground_rsat,ground_rvap,ground_temp,ground_fliq,available_water,rshort) + call leaf3_canopy(mzg,mzs,ksn,soil_energy,soil_water,soil_text,sfcwater_mass,ustar & + ,tstar,rstar,cstar,zeta,ribulk,soil_rough,veg_rough,patch_rough & + ,veg_height,veg_displace,veg_lai,veg_tai,veg_water,veg_hcap,veg_energy & + ,leaf_class,veg_fracarea,stom_condct,can_prss,can_rvap,can_co2 & + ,sensible_gc,sensible_vc,evap_gc,evap_vc,transp,gpp,plresp,resphet & + ,ground_rsat,ground_rvap,ground_temp,ground_fliq,available_water & + ,rshort) !---------------------------------------------------------------------------------------! @@ -510,8 +511,8 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int !---------------------------------------------------------------------------------------! ! Re-organise the snow layers, and shed the water from the virtual layer. ! !---------------------------------------------------------------------------------------! - call leaf_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & - ,sfcwater_mass,sfcwater_depth) + call leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & + ,sfcwater_mass,sfcwater_depth) !---------------------------------------------------------------------------------------! @@ -540,7 +541,7 @@ subroutine leaftw(mzg,mzs,soil_water, soil_energy,soil_text,sfcwater_energy_int !---------------------------------------------------------------------------------------! return -end subroutine leaftw +end subroutine leaf3_tw !==========================================================================================! !==========================================================================================! @@ -554,8 +555,8 @@ end subroutine leaftw ! This sub-routine initialises the soil and temporary surface water variables for a ! ! given patch, before the time step iteration loop. ! !------------------------------------------------------------------------------------------! -subroutine leaf_soilsfcw_diag(ip,mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & - ,sfcwater_energy_int,sfcwater_mass,sfcwater_depth,initial) +subroutine leaf3_soilsfcw_diag(ip,mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & + ,sfcwater_energy_int,sfcwater_mass,sfcwater_depth,initial) use leaf_coms , only : slcpd & ! intent(in) , soil_tempk & ! intent(out) , soil_fracliq & ! intent(out) @@ -665,7 +666,7 @@ subroutine leaf_soilsfcw_diag(ip,mzg,mzs,soil_energy,soil_water,soil_text,sfcwat !---------------------------------------------------------------------------------------! return -end subroutine leaf_soilsfcw_diag +end subroutine leaf3_soilsfcw_diag !==========================================================================================! !==========================================================================================! @@ -679,8 +680,8 @@ end subroutine leaf_soilsfcw_diag ! This sub-routine re-arranges the snow layers, and dump the water from the virtual ! ! layer to the place that can hold the water. ! !------------------------------------------------------------------------------------------! -subroutine leaf_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & - ,sfcwater_mass,sfcwater_depth) +subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nlev & + ,sfcwater_mass,sfcwater_depth) use mem_leaf , only : ipercol ! ! intent(in) use leaf_coms , only : sfcwater_energy_ext & ! intent(in) , min_sfcwater_mass & ! intent(in) @@ -1170,6 +1171,6 @@ subroutine leaf_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_nl !---------------------------------------------------------------------------------------! return -end subroutine leaf_adjust_sfcw +end subroutine leaf3_adjust_sfcw !==========================================================================================! !==========================================================================================! diff --git a/BRAMS/src/surface/leaf3_utils.f90 b/BRAMS/src/surface/leaf3_utils.f90 index 14c01b7ae..81ed1b3ea 100644 --- a/BRAMS/src/surface/leaf3_utils.f90 +++ b/BRAMS/src/surface/leaf3_utils.f90 @@ -4,11 +4,16 @@ ! This subroutine computes the characteristic scales, using one of the following surf- ! ! ace layer parametrisation. ! ! ! +! ! ! 1. Based on L79; ! ! 2. Based on: OD95, but with some terms computed as in L79 and B71 to avoid singular- ! -! ities. ! +! ities (now using the iterative method to find zeta). ! ! 3. Based on BH91, using an iterative method to find zeta, and using the modified ! ! equation for stable layers. ! +! 4. Based on CLM04, with special functions for very stable and very stable case, even ! +! though we use a different functional form for very unstable case for momentum. ! +! This is ensure that phi_m decreases monotonically as zeta becomes more negative. ! +! We use a power law of order of -1/6 instead. ! ! ! ! References: ! ! B71. BUSINGER, J.A, et. al; Flux-Profile relationships in the atmospheric surface ! @@ -19,18 +24,20 @@ ! atmospheric models. J. Appl. Meteor., 30, 327-341, 1991. ! ! OD95. ONCLEY, S.P.; DUDHIA, J.; Evaluation of surface fluxes from MM5 using observa- ! ! tions. Mon. Wea. Rev., 123, 3344-3357, 1995. ! +! CLM04. OLESON, K. W., et al.; Technical description of the community land model (CLM) ! +! NCAR Technical Note NCAR/TN-461+STR, Boulder, CO, May 2004. ! +! ! !------------------------------------------------------------------------------------------! -subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm & - ,theta_can,theiv_can,shv_can,rvap_can,co2_can & - ,zref,dheight,uref,dtll,rough,ustar,tstar,estar,qstar,rstar,cstar & - ,zeta,rib,r_aer) +subroutine leaf3_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm & + ,theta_can,theiv_can,shv_can,rvap_can,co2_can & + ,zref,dheight,uref,dtll,rough,ustar,tstar,estar,qstar,rstar,cstar & + ,zeta,rib,r_aer) use mem_leaf , only : istar ! ! intent(in) use rconstants, only : grav & ! intent(in) , vonk & ! intent(in) , epim1 & ! intent(in) , halfpi ! ! intent(in) use leaf_coms , only : ustmin & ! intent(in) - , ggfact & ! intent(in) , bl79 & ! intent(in) , csm & ! intent(in) , csh & ! intent(in) @@ -93,11 +100,17 @@ subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm !----- Local variables, used by OD95 and/or BH91. --------------------------------------! real :: zeta0m ! roughness(momentum)/(Obukhov length). real :: zeta0h ! roughness(heat)/(Obukhov length). + real :: utotal ! Total wind (actual + convective) + real :: uconv ! Convective velocity + real :: uconv_prev ! Previous convective velocity + real :: change ! Difference in convective velocity + integer :: icnt ! Iteration counter !----- Aux. environment conditions. ----------------------------------------------------! real :: thetav_atm ! Atmos. virtual potential temperature [ K] real :: thetav_can ! Canopy air virtual pot. temperature [ K] !----- External functions. -------------------------------------------------------------! - real, external :: cbrt ! Cubic root + real, external :: cbrt ! Cubic root + real, external :: leaf3_sflux_w ! Surface flux in the w direction !---------------------------------------------------------------------------------------! @@ -108,6 +121,15 @@ subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm lnzoz0m = log(zoz0m) zoz0h = z0moz0h * zoz0m lnzoz0h = log(zoz0h) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Find the Bulk Richardson number. For stable cases, and for L79 in both cases, ! + ! this will be the definitive RiB, whilst this is the first guess, which will be ! + ! corrected by the convective velocity in the other unstable cases. ! + !---------------------------------------------------------------------------------------! rib = 2.0 * grav * (zref-dheight-rough) * (thetav_atm-thetav_can) & / ( (thetav_atm+thetav_can) * uref * uref) stable = thetav_atm >= thetav_can @@ -117,11 +139,11 @@ subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm !---------------------------------------------------------------------------------------! - ! Correct the bulk Richardson number in case it's too stable and we are not running ! - ! the L79 model. We also define a stable case correction to bring down the stars other ! - ! than ustar, so the flux doesn't increase for stabler cases (it remains constant). ! + ! Correct the bulk Richardson number in case it's too stable. We also define a ! + ! stable case correction to bring down the stars other than ustar, so the flux doesn't ! + ! increase for stabler cases (it remains constant). ! !---------------------------------------------------------------------------------------! - if (rib > ribmax .and. istar /= 1) then + if (rib > ribmax) then uuse = sqrt(rib/ribmax) * uref rib = ribmax else @@ -177,72 +199,111 @@ subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm !----- Compute zeta from u* and T* --------------------------------------------------! zeta = grav * vonk * c3 * (theta_atm - theta_can) / (theta_atm * ustar * ustar) + !------------------------------------------------------------------------------------! - case (2,4) + case default !------------------------------------------------------------------------------------! ! 2. Here we use the model proposed by OD95, the standard for MM5, but with some ! - ! terms that were computed in B71 (namely, the "0" terms). which prevent sin- ! - ! gularities. Since we use OD95 to estimate zeta, which avoids the computation ! - ! of the Obukhov length L , we can't compute zeta0 by its definition(z0/L). How- ! - ! ever we know zeta, so zeta0 can be written as z0/z * zeta. ! - ! 4. We use the model proposed by BH91, but we find zeta using the approximation ! - ! given by OD95. ! + ! terms that were computed in B71 (namely, the "0" terms), which prevent sin- ! + ! gularities. ! + ! However we know zeta, so zeta0 can be written as z0/z * zeta. ! + ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! + ! method, except that the stable functions are computed in a more generic way. ! + ! BH91 claim that the oft-used approximation (-beta*zeta) can cause poor ! + ! ventilation of the stable layer, leading to decoupling between the atmo- ! + ! sphere and the canopy air space and excessive cooling ! + ! 4. Here we use a similar approach as in CLM04, excepth that the momentum flux ! + ! gradient function for the unstable case for momentum is switched by a power ! + ! of -1/6 (kind of the square of the heat one). This is to guarantee that ! + ! the psi function doesn't have local maxima/minima. ! !------------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ---------------------------! + !----- Initialise uconv. ------------------------------------------------------------! + uconv = 0.0 + !----- Check if we need to go through the iterative process. ------------------------! if (stable) then - !----- Stable case. --------------------------------------------------------------! - zeta = rib * lnzoz0m / (1.1 - 5.0 * rib) + !----- We now compute the stability correction functions. ------------------------! + zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) + zeta0m = rough * zeta / (zref-dheight) + zeta0h = z0hoz0m * zeta0m + + !----- Find the aerodynamic resistance similarly to L79. -------------------------! + r_aer = tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable)) & + * (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable)) & + / (vonk * vonk * uuse) + + !----- Find ustar, making sure it is not too small. ------------------------------! + ustar = max (ustmin, vonk * uuse & + / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + + + !----- Find the coefficient to scale the other stars. ----------------------------! + c3 = vonk / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) + !---------------------------------------------------------------------------------! else - !----- Unstable case. ------------------------------------------------------------! - zeta = rib * lnzoz0m - end if - zeta0m = rough * zeta / (zref - dheight) + !---------------------------------------------------------------------------------! + ! Unstable case. Here we run a few iterations to make sure we correct the ! + ! bulk Richardson number. This is really a simple correction, so we don't need ! + ! uconv to be totally in equilibrium. ! + !---------------------------------------------------------------------------------! + unstable: do icnt=1,6 + !----- Update total winds. ----------------------------------------------------! + uconv_prev = uconv + utotal = sqrt(uuse*uuse + uconv_prev * uconv_prev) + !------------------------------------------------------------------------------! - !----- Find the aerodynamic resistance similarly to L79. ----------------------------! - r_aer = tprandtl * (lnzoz0m - psih(zeta,stable) + psih(zeta0m,stable)) & - * (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable)) & - / (vonk * vonk * uuse) - !----- Finding ustar, making sure it is not too small. ------------------------------! - ustar = max (ustmin, vonk * uuse & - / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !----- Update the Bulk Richardson number. -------------------------------------! + rib = 2.0 * grav * (zref-dheight-rough) * (thetav_atm-thetav_can) & + / ( (thetav_atm+thetav_can) * utotal) + !------------------------------------------------------------------------------! - !----- Finding the coefficient to scale the other stars. ----------------------------! - c3 = vonk / (tprandtl * (lnzoz0m - psih(zeta,stable) + psih(zeta0m,stable))) - !------------------------------------------------------------------------------------! + !----- We now compute the stability correction functions. ---------------------! + zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) + !------------------------------------------------------------------------------! - case (3,5) - !------------------------------------------------------------------------------------! - ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! - ! method, with the two following (important) differences. ! - ! a. Zeta (z/L) is actually found using the iterative method. ! - ! b. Stable functions are computed in a more generic way. BH91 claim that the ! - ! oft-used approximation (-beta*zeta) can cause poor ventilation of the stable ! - ! layer, leading to decoupling between the atmosphere and the canopy air space ! - ! and excessive cooling. ! - ! 5. Similar as 3, but we compute the stable functions the same way as OD95. ! - !------------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ---------------------------! - zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) - zeta0m = rough * zeta / (zref-dheight) - zeta0h = z0hoz0m * zeta0m - !----- Finding the aerodynamic resistance similarly to L79. -------------------------! - r_aer = tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable)) & - * (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable)) & - / (vonk * vonk * uuse) + !----- Find the coefficient to scale the other stars. -------------------------! + zeta0m = rough * zeta / (zref-dheight) + zeta0h = z0hoz0m * zeta0m + !------------------------------------------------------------------------------! - !----- Finding ustar, making sure it is not too small. ------------------------------! - ustar = max (ustmin, vonk * uuse & - / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !----- Find ustar, making sure it is not too small. ---------------------------! + ustar = max (ustmin, vonk * uuse & + / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !------------------------------------------------------------------------------! - !----- Finding the coefficient to scale the other stars. ----------------------------! - c3 = vonk / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) - !------------------------------------------------------------------------------------! + !----- Find the coefficient to scale the other stars. -------------------------! + c3 = vonk & + / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) + !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! + ! Use potential virtual temperature here because convection is related to ! + ! buoyancy. ! + !------------------------------------------------------------------------------! + tstar = c3 * (thetav_atm - thetav_can ) + !------------------------------------------------------------------------------! + + + !----- Estimate the convective velocity. --------------------------------------! + uconv = leaf3_sflux_w(zeta,tstar,ustar) / ustar + !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! + ! We are only after a rough estimate of this velocity, so if the differ- ! + ! ence is less than the RK4 tolerance, then it's enough. ! + !------------------------------------------------------------------------------! + change = 2.0 * abs(uconv-uconv_prev) / (abs(uconv) + abs(uconv_prev)) + if (change < 0.01) exit unstable + !------------------------------------------------------------------------------! + end do unstable + end if end select !----- Finding all stars. --------------------------------------------------------------! @@ -268,7 +329,7 @@ subroutine leaf_stars(theta_atm,theiv_atm,shv_atm,rvap_atm,co2_atm return -end subroutine leaf_stars +end subroutine leaf3_stars !==========================================================================================! !==========================================================================================! @@ -282,20 +343,36 @@ end subroutine leaf_stars ! This routine computes the turbulent fluxes of momentum, heat and moisture from the ! ! surface layer using the Manton-Cotton algebraic surface layer equations. ! !------------------------------------------------------------------------------------------! -subroutine sfclmcv(ustar,tstar,rstar,cstar,zeta,vels_pat,ups,vps,patch_area & - ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c) +subroutine leaf3_sfclmcv(ustar,tstar,rstar,cstar,zeta,vels_pat,ups,vps,patch_area & + ,sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c) use rconstants use leaf_coms , only : g_urban ! ! intent(in) use teb_spm_start , only : teb_spm ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! - real , intent(in) :: ustar,tstar,rstar,cstar,zeta - real , intent(in) :: vels_pat,ups,vps,patch_area - real , intent(inout) :: sflux_u,sflux_v,sflux_w,sflux_t,sflux_r,sflux_c + real , intent(in) :: ustar + real , intent(in) :: tstar + real , intent(in) :: rstar + real , intent(in) :: cstar + real , intent(in) :: zeta + real , intent(in) :: vels_pat + real , intent(in) :: ups + real , intent(in) :: vps + real , intent(in) :: patch_area + real , intent(inout) :: sflux_u + real , intent(inout) :: sflux_v + real , intent(inout) :: sflux_w + real , intent(inout) :: sflux_t + real , intent(inout) :: sflux_r + real , intent(inout) :: sflux_c !----- Local variables. ----------------------------------------------------------------! - real :: cosine1,sine1,vtscr,cx,psin + real :: cosine1 + real :: sine1 + real :: vtscr !----- Local constants. ----------------------------------------------------------------! real , parameter :: wtol = 1.e-20 + !----- External functions. -------------------------------------------------------------! + real , external :: leaf3_sflux_w !---------------------------------------------------------------------------------------! cosine1 = ups / vels_pat @@ -314,19 +391,53 @@ subroutine sfclmcv(ustar,tstar,rstar,cstar,zeta,vels_pat,ups,vps,patch_area !----- TEB currently doesn't save CO2, so compute sflux_c outside the if statement. ----! sflux_c = sflux_c - cstar * vtscr - !----- Define cx based on the layer stability. -----------------------------------------! - if (zeta < 0.)then - cx = zeta * sqrt(sqrt(1. - 15. * zeta)) - else - cx = zeta / (1.0 + 4.7 * zeta) - end if + !----- Define vertical flux. -----------------------------------------------------------! + sflux_w = sflux_w + leaf3_sflux_w(zeta,tstar,ustar) * patch_area + + return +end subroutine leaf3_sfclmcv +!==========================================================================================! +!==========================================================================================! + + + + - psin = sqrt((1.-2.86 * cx) / (1. + cx * (-5.39 + cx * 6.998 ))) - sflux_w = sflux_w + (0.27 * max(6.25 * (1. - cx) * psin,wtol) - 1.18 * cx * psin) & - * ustar * vtscr +!==========================================================================================! +!==========================================================================================! +! Vertical flux, as in: ! +! ! +! Manton, M. J., Cotton, W. R., 1977: Parameterization of the atmospheric surface ! +! layer. J. Atm. Sci., 34, 331-334. ! +!------------------------------------------------------------------------------------------! +real function leaf3_sflux_w(zeta,tstar,ustar) + use consts_coms , only : vonk ! intent(in) + + implicit none + !----- Arguments -----------------------------------------------------------------------! + real, intent(in) :: zeta + real, intent(in) :: ustar + real, intent(in) :: tstar + !----- Local variables -----------------------------------------------------------------! + real :: cx + real :: psin + !----- Constants -----------------------------------------------------------------------! + real, parameter :: wtol = 1.e-20 + !---------------------------------------------------------------------------------------! + + if (zeta < 0.0)then + cx = zeta * sqrt(sqrt(1.0 - 15.0 * zeta)) + else + cx = zeta / (1.0 + 4.7 * zeta) + endif + + psin = sqrt((1.0-2.86 * cx) / (1.0 + cx * (-5.390 + cx * 6.9980 ))) + leaf3_sflux_w = ( 0.27 * max(6.25 * (1.0 - cx) * psin,wtol) & + - 1.180 * cx * psin) * ustar * ustar + return -end subroutine sfclmcv +end function leaf3_sflux_w !==========================================================================================! !==========================================================================================! @@ -359,9 +470,9 @@ end subroutine sfclmcv ! ! ! Lee, T. J., R. A. Pielke, 1993: Corrigendum. J. Appl. Meteorol., 32, 580-580. (LP93) ! !------------------------------------------------------------------------------------------! -subroutine leaf_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energy_int & - ,sfcwater_nlev,can_rvap,can_prss,ground_rsat,ground_rvap & - ,ground_temp,ground_fliq) +subroutine leaf3_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energy_int & + ,sfcwater_nlev,can_rvap,can_prss,ground_rsat,ground_rvap & + ,ground_temp,ground_fliq) use leaf_coms , only : slcpd & ! intent(in) , slpots & ! intent(in) @@ -380,8 +491,7 @@ subroutine leaf_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energ use therm_lib , only : rslif & ! function , qwtk & ! function , qtk ! ! function - use mem_leaf , only : igrndvap & ! intent(in) - , betapower ! ! intent(in) + use mem_leaf , only : igrndvap ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! @@ -450,11 +560,10 @@ subroutine leaf_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energ ! shut down when the soil approaches the dry air soil moisture, we offset both the ! ! soil moisture and field capacity to the soil moisture above dry air soil. This is ! ! necessary to avoid evaporation to be large just slightly above the dry air soil, ! - ! which was happening especially for those clay-rich soil types. To switch the ! - ! power to the same as LP92/LP93, set betapower to 2. ! + ! which was happening especially for those clay-rich soil types. ! !------------------------------------------------------------------------------------! smterm = (topsoil_water - soilcp(nsoil)) / (sfldcap(nsoil) - soilcp(nsoil)) - beta = (.5 * (1. - cos (min(1.,smterm) * pi1))) ** betapower + beta = .5 * (1. - cos (min(1.,smterm) * pi1)) !------------------------------------------------------------------------------------! @@ -495,6 +604,14 @@ subroutine leaf_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energ ggsoil = ggsoil0 * exp(kksoil * smterm) !---------------------------------------------------------------------------------! + case (5) + !---------------------------------------------------------------------------------! + ! Combination of NP89 and P86. ! + !---------------------------------------------------------------------------------! + ground_rvap = max(can_rvap, ground_rsat * beta) + ggsoil = ggsoil0 * exp(kksoil * smterm) + !---------------------------------------------------------------------------------! + end select case default @@ -514,7 +631,7 @@ subroutine leaf_grndvap(topsoil_energy,topsoil_water,topsoil_text,sfcwater_energ end select return -end subroutine leaf_grndvap +end subroutine leaf3_grndvap !==========================================================================================! !==========================================================================================! @@ -906,7 +1023,8 @@ end subroutine sfc_pcp ! and albedo. ! !------------------------------------------------------------------------------------------! subroutine vegndvi(ifm,patch_area,leaf_class,veg_fracarea,veg_lai,veg_tai,veg_rough & - ,veg_height,veg_displace,veg_albedo,veg_ndvip,veg_ndvic,veg_ndvif) + ,veg_height,veg_displace,veg_albedo,veg_ndvip,veg_ndvic,veg_ndvif & + ,psibar_10d) use leaf_coms use rconstants @@ -929,24 +1047,25 @@ subroutine vegndvi(ifm,patch_area,leaf_class,veg_fracarea,veg_lai,veg_tai,veg_ro real , intent(out) :: veg_rough real , intent(out) :: veg_albedo real , intent(inout) :: veg_ndvic + real , intent(in) :: psibar_10d !----- Local variables. ----------------------------------------------------------------! - integer :: nveg - real :: sr - real :: fpar - real :: dead_lai - real :: green_frac + integer :: nveg + real :: sr + real :: fpar + real :: dead_lai + real :: green_frac !----- Local constants. ----------------------------------------------------------------! - real , parameter :: sr_min=1.081 - real , parameter :: fpar_min=.001 - real , parameter :: fpar_max=.950 - real , parameter :: fpcon=-.3338082 - real , parameter :: ccc=-2.9657 - real , parameter :: bz=.91 - real , parameter :: hz=.0075 - real , parameter :: extinc_veg=0.75 + real , parameter :: sr_min = 1.081 + real , parameter :: fpar_min = 0.001 + real , parameter :: fpar_max = 0.950 + real , parameter :: fpcon = -0.3338082 + real , parameter :: ccc = -2.9657 + real , parameter :: bz = 0.91 + real , parameter :: hz = 0.0075 + real , parameter :: extinc_veg = 0.75 !----- Locally saved variables. --------------------------------------------------------! - logical , save :: nvcall = .true. - real, dimension(nvtyp+nvtyp_teb), save :: dfpardsr + logical , save :: nvcall = .true. + real, dimension(nvtyp+nvtyp_teb), save :: dfpardsr !---------------------------------------------------------------------------------------! @@ -985,11 +1104,11 @@ subroutine vegndvi(ifm,patch_area,leaf_class,veg_fracarea,veg_lai,veg_tai,veg_ro veg_fracarea = 0. else - - ! Time-interpolate ndvi to get current value veg_ndvic(i,j) for this patch - ! Limit ndvi to prevent values > .99 to prevent division by zero. - + !------------------------------------------------------------------------------------! + ! Time-interpolate NDVI to get current value veg_ndvic(i,j) for this patch. Limit ! + ! NDVI to prevent values > .99 to prevent division by zero. ! + !------------------------------------------------------------------------------------! if (iuselai == 1) then veg_ndvic = max(0.0,veg_ndvip + (veg_ndvif - veg_ndvip) * timefac_ndvi) @@ -1010,31 +1129,53 @@ subroutine vegndvi(ifm,patch_area,leaf_class,veg_fracarea,veg_lai,veg_tai,veg_ro if (nveg == 7) veg_ndvic = max(0.7,veg_ndvic) end if + !------------------------------------------------------------------------------------! - if (iuselai == 1) then + !------------------------------------------------------------------------------------! + ! Here we decide which way we are going to compute LAI. If NDVIFLG is 0 or 2, ! + ! we use LEAF-3 phenology, otherwise we use NDVI to prescribe LAI. ! + !------------------------------------------------------------------------------------! + select case (ndviflg(ifm)) + case (1) + !------ We've read information from files, use it. -------------------------------! - veg_lai = veg_ndvic + if (iuselai == 1) then + !----- Input data were LAI, copy it. ------------------------------------------! + veg_lai = veg_ndvic - else + else - !----- Compute "simple ratio" and limit between sr_min and sr_max(nveg). ---------! - sr = min(sr_max(nveg), max(sr_min, (1. + veg_ndvic) / (1. - veg_ndvic) ) ) + !----- Compute "simple ratio" and limit between sr_min and sr_max(nveg). ------! + sr = min(sr_max(nveg), max(sr_min, (1. + veg_ndvic) / (1. - veg_ndvic) ) ) - !----- Compute fpar. -------------------------------------------------------------! - fpar = fpar_min + (sr - sr_min) * dfpardsr(nveg) + !----- Compute fpar. ----------------------------------------------------------! + fpar = fpar_min + (sr - sr_min) * dfpardsr(nveg) + + !------------------------------------------------------------------------------! + ! Compute green leaf area index (veg_lai), dead leaf area index ! + ! (dead_lai), total area index (tai), and green fraction. ! + !------------------------------------------------------------------------------! + veg_lai = glai_max(nveg) * ( veg_clump(nveg) * fpar / fpar_max & + + (1. - veg_clump(nveg)) * alog(1. - fpar) & + * fpcon ) + end if + case default !---------------------------------------------------------------------------------! - ! Compute green leaf area index (veg_lai), dead leaf area index (dead_lai), ! - ! total area index (tai), and green fraction. ! + ! We haven't read anything, use the table value, scaled by phenology if needed ! + ! by this PFT. ! !---------------------------------------------------------------------------------! - veg_lai = glai_max(nveg) * ( veg_clump(nveg) * fpar / fpar_max & - + (1. - veg_clump(nveg)) * alog(1. - fpar) * fpcon ) - - end if - - + select case (phenology(nveg)) + case (4) + !----- Use drought/cold phenology. --------------------------------------------! + veg_lai = glai_max(nveg) * max(0.02,min(1.0,psibar_10d)) + case default + !----- Evergreen. -------------------------------------------------------------! + veg_lai = glai_max(nveg) + end select + end select dead_lai = (glai_max(nveg) - veg_lai) * dead_frac(nveg) veg_tai = veg_lai + sai(nveg) + dead_lai green_frac = veg_lai / veg_tai @@ -1072,8 +1213,9 @@ end subroutine vegndvi ! through each layer based on mass per square meter. algs is the resultant albedo from ! ! snow plus ground. ! !------------------------------------------------------------------------------------------! -subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_fracarea & - ,leaf_class,veg_albedo,sfcwater_nlev,rshort,rlong,albedt,rlongup,cosz ) +subroutine leaf3_sfcrad(mzg,mzs,ip,soil_water,soil_color,soil_text,sfcwater_depth & + ,patch_area,veg_fracarea,leaf_class,veg_albedo,sfcwater_nlev,rshort & + ,rlong,cosz,albedt,rlongup,rshort_gnd,rlong_gnd) use mem_leaf use leaf_coms use rconstants @@ -1090,6 +1232,7 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ integer , intent(in) :: mzs integer , intent(in) :: ip real , dimension(mzg), intent(in) :: soil_water + real , intent(in) :: soil_color real , dimension(mzg), intent(in) :: soil_text real , dimension(mzs), intent(in) :: sfcwater_depth real , intent(in) :: patch_area @@ -1102,10 +1245,13 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ real , intent(in) :: cosz real , intent(inout) :: albedt real , intent(inout) :: rlongup + real , intent(inout) :: rshort_gnd + real , intent(inout) :: rlong_gnd !----- Local variables. ----------------------------------------------------------------! integer :: k integer :: m integer :: nsoil + integer :: colour integer :: nveg integer :: ksn real :: alb @@ -1137,15 +1283,23 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ if (ip == 1) then !----- Compute the albedo and upward longwave for water patches. --------------------! if (cosz > .03) then - alb = min(max(-.0139 + .0467 * tan(acos(cosz)),.03),.999) - albedt = albedt + patch_area * alb + alb = min(max(-.0139 + .0467 * tan(acos(cosz)),.03),.999) + albedt = albedt + patch_area * alb + else + alb = 0.0 end if - rlongup = rlongup + patch_area * stefan * soil_tempk(mzg) ** 4 + rlongup = rlongup + patch_area * stefan * soil_tempk(mzg) ** 4 + + rshort_gnd = alb * rshort + rlong_gnd = 0.0 elseif (isfcl == 0) then !------ Not running a land surface model, use prescribed value of can_temp. ---------! - albedt = albedt + patch_area * albedo - rlongup = rlongup + patch_area * stefan * can_temp ** 4 + albedt = albedt + patch_area * albedo + rlongup = rlongup + patch_area * stefan * can_temp ** 4 + + rshort_gnd = albedt * rshort + rlong_gnd = 0.0 else !------ Running an actual land surface model... -------------------------------------! @@ -1163,34 +1317,27 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ ! using some soil texture dependence, even though soil colour depends on a lot more ! ! things. ! !------------------------------------------------------------------------------------! - ! nsoil=nint(soil_text(mzg)) - ! select case (nsoil) - ! case (13) - ! !----- Bedrock, no soil moisture, use dry soil albedo. -------------------------! - ! alg = albdry(nsoil) - ! case default - ! !-------------------------------------------------------------------------------! - ! ! Find relative soil moisture. Not sure about this one, but I am assuming ! - ! ! that albedo won't change below the dry air soil moisture, and that should be ! - ! ! the dry value. ! - ! !-------------------------------------------------------------------------------! - ! fcpct = max(0., min(1., (soil_water(mzg) - soilcp(nsoil)) & - ! / (slmsts(nsoil) - soilcp(nsoil)) ) ) - ! alg = albdry(nsoil) + fcpct * (albwet(nsoil) - albdry(nsoil)) - ! end select nsoil = nint(soil_text(mzg)) select case (nsoil) case (13) !----- Bedrock, use constants soil value for granite. ----------------------------! - alg = albdry(nsoil) + alg = 0.32 case (12) !----- Peat, follow McCumber and Pielke (1981). ----------------------------------! fcpct = soil_water(mzg) / slmsts(nsoil) alg = max (0.07, 0.14 * (1.0 - fcpct)) case default - !----- Other soils, follow McCumber and Pielke (1981). ---------------------------! - fcpct = soil_water(mzg) / slmsts(nsoil) - alg = max (0.14, 0.31 - 0.34 * fcpct) + !----- Other soils. --------------------------------------------------------------! + colour = nint(soil_color) + select case (colour) + case (21) + fcpct = soil_water(mzg) / slmsts(nsoil) + alg = max(0.14, 0.31 - 0.34 * fcpct) + case default + fcpct = max (0.00, 0.11 - 0.40 * soil_water(mzg)) + alg = min (0.5 * (alb_nir_dry(nscol) + alb_vis_dry(nscol)) & + ,0.5 * (alb_nir_wet(nscol) + alb_vis_wet(nscol)) + fcpct ) + end select end select !------------------------------------------------------------------------------------! @@ -1229,6 +1376,7 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ !------------------------------------------------------------------------------------! + !----- Adding urban contribution if running TEB. ------------------------------------! if (teb_spm==1) then if (nint(g_urban) == 0) then @@ -1292,10 +1440,23 @@ subroutine sfcrad(mzg,mzs,ip,soil_water,soil_text,sfcwater_depth,patch_area,veg_ rlonga_a = 0. end if !------------------------------------------------------------------------------------! + + + + !----- Integrate the total absorbed light by ground (top soil plus TSW layers). -----! + rshort_gnd = rshort_g + do k=1,ksn + rshort_gnd = rshort_gnd + rshort_s(k) + end do + rlong_gnd = rlonga_gs + rlongv_gs - rlonggs_a - rlonggs_v + !------------------------------------------------------------------------------------! + + + end if return -end subroutine sfcrad +end subroutine leaf3_sfcrad !==========================================================================================! !==========================================================================================! @@ -1309,7 +1470,7 @@ end subroutine sfcrad ! This function determines the wind at a given height, given that the stars are al- ! ! ready known, as well as the Richardson number and the zetas. ! !------------------------------------------------------------------------------------------! -real(kind=4) function leaf_reduced_wind(ustar,zeta,rib,zref,dheight,height,rough) +real(kind=4) function leaf3_reduced_wind(ustar,zeta,rib,zref,dheight,height,rough) use rconstants , only : vonk ! ! intent(in) use leaf_coms , only : bl79 & ! intent(in) , csm & ! intent(in) @@ -1383,7 +1544,7 @@ real(kind=4) function leaf_reduced_wind(ustar,zeta,rib,zref,dheight,height,rough end if !----- Find the wind. ---------------------------------------------------------------! - leaf_reduced_wind = (ustar/vonk) * (lnhoz0/sqrt(fm)) + leaf3_reduced_wind = (ustar/vonk) * (lnhoz0/sqrt(fm)) case default !----- Other methods. ----------------------------------------------------! @@ -1392,7 +1553,8 @@ real(kind=4) function leaf_reduced_wind(ustar,zeta,rib,zref,dheight,height,rough zeta0 = zeta * rough / (zref-dheight) !------------------------------------------------------------------------------------! - leaf_reduced_wind = (ustar/vonk) * (lnhoz0 - psim(zetah,stable) + psim(zeta0,stable)) + leaf3_reduced_wind = (ustar/vonk) & + * (lnhoz0 - psim(zetah,stable) + psim(zeta0,stable)) end select !---------------------------------------------------------------------------------------! @@ -1400,12 +1562,12 @@ real(kind=4) function leaf_reduced_wind(ustar,zeta,rib,zref,dheight,height,rough !----- Impose the wind to be more than the minimum. ------------------------------------! - leaf_reduced_wind = max(leaf_reduced_wind, ugbmin) + leaf3_reduced_wind = max(leaf3_reduced_wind, ugbmin) !---------------------------------------------------------------------------------------! return -end function leaf_reduced_wind +end function leaf3_reduced_wind !==========================================================================================! !==========================================================================================! @@ -1429,7 +1591,7 @@ end function leaf_reduced_wind ! - gbh is in J/(K m2 s), and ! ! - gbw is in kg_H2O/m2/s. ! !------------------------------------------------------------------------------------------! -subroutine leaf_aerodynamic_conductances(iveg,veg_wind,veg_temp,can_temp,can_shv,can_rhos) +subroutine leaf3_aerodynamic_conductances(iveg,veg_wind,veg_temp,can_temp,can_shv,can_rhos) use leaf_coms , only : leaf_width & ! intent(in) , aflat_turb & ! intent(in) , aflat_lami & ! intent(in) @@ -1518,7 +1680,7 @@ subroutine leaf_aerodynamic_conductances(iveg,veg_wind,veg_temp,can_temp,can_shv !---------------------------------------------------------------------------------------! return -end subroutine leaf_aerodynamic_conductances +end subroutine leaf3_aerodynamic_conductances !==========================================================================================! !==========================================================================================! @@ -1532,7 +1694,7 @@ end subroutine leaf_aerodynamic_conductances ! This sub-routine copies some atmospheric fields from the 2-D arrays to the common ! ! module variable. ! !------------------------------------------------------------------------------------------! -subroutine leaf_atmo1d(m2,m3,i,j,thp,theta,rv,rtp,co2p,up,vp,pitot,dens,height,pcpg,qpcpg & +subroutine leaf3_atmo1d(m2,m3,i,j,thp,theta,rv,rtp,co2p,up,vp,pitot,dens,height,pcpg,qpcpg & ,dpcpg) use leaf_coms , only : ubmin & ! intent(in) , atm_up & ! intent(out) @@ -1617,7 +1779,7 @@ subroutine leaf_atmo1d(m2,m3,i,j,thp,theta,rv,rtp,co2p,up,vp,pitot,dens,height,p !---------------------------------------------------------------------------------------! return -end subroutine leaf_atmo1d +end subroutine leaf3_atmo1d !==========================================================================================! !==========================================================================================! @@ -1862,8 +2024,8 @@ end subroutine normal_accfluxes !==========================================================================================! ! This sub-routine decides whether this patch should be solved or not. ! !------------------------------------------------------------------------------------------! -subroutine leaf_solve_veg(ip,mzs,leaf_class,veg_height,patch_area,veg_fracarea,veg_tai & - ,sfcwater_nlev,sfcwater_depth,initial) +subroutine leaf3_solve_veg(ip,mzs,leaf_class,veg_height,patch_area,veg_fracarea,veg_tai & + ,sfcwater_nlev,sfcwater_depth,initial) use leaf_coms, only : min_patch_area & ! intent(in) , tai_max & ! intent(in) , tai_min & ! intent(in) @@ -1928,6 +2090,115 @@ subroutine leaf_solve_veg(ip,mzs,leaf_class,veg_height,patch_area,veg_fracarea,v !---------------------------------------------------------------------------------------! return -end subroutine leaf_solve_veg +end subroutine leaf3_solve_veg +!==========================================================================================! +!==========================================================================================! + + + + + +!==========================================================================================! +!==========================================================================================! +! This sub-routine updates the 10-day running average of the relative soil potential ! +! for phenology in the next time step. ! +!------------------------------------------------------------------------------------------! +subroutine update_psibar(m2,m3,mzg,npat,ia,iz,ja,jz,dtime,soil_energy,soil_water,soil_text & + ,leaf_class,psibar_10d) + use therm_lib , only : qwtk ! ! subroutine + use mem_leaf , only : slz & ! intent(in) + , dtleaf ! ! intent(in) + use leaf_coms , only : slpots & ! intent(in) + , slbs & ! intent(in) + , slcpd & ! intent(in) + , kroot & ! intent(in) + , psild & ! intent(in) + , psiwp ! ! intent(in) + use rconstants, only : wdns & ! intent(in) + , day_sec ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: m2 + integer , intent(in) :: m3 + integer , intent(in) :: mzg + integer , intent(in) :: npat + integer , intent(in) :: ia + integer , intent(in) :: iz + integer , intent(in) :: ja + integer , intent(in) :: jz + real , intent(in) :: dtime + real , dimension(mzg,m2,m3,npat), intent(in) :: soil_energy + real , dimension(mzg,m2,m3,npat), intent(in) :: soil_water + real , dimension(mzg,m2,m3,npat), intent(in) :: soil_text + real , dimension (m2,m3,npat), intent(in) :: leaf_class + real , dimension (m2,m3,npat), intent(inout) :: psibar_10d + !----- Local variables. ----------------------------------------------------------------! + integer :: i + integer :: j + integer :: k + integer :: ip + integer :: nsoil + integer :: nveg + real :: available_water + real :: psi_layer + real :: soil_temp + real :: soil_fliq + real :: weight + !---------------------------------------------------------------------------------------! + + + !----- Find the weight. ----------------------------------------------------------------! + weight = min(dtime,dtleaf) / (10. * day_sec) + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Loop over all points, but skip water patches. ! + !---------------------------------------------------------------------------------------! + yloop: do j=ja,jz + xloop: do i=ia,iz + patchloop: do ip=2,npat + nveg = nint(leaf_class(i,j,ip)) + available_water = 0.0 + do k = kroot(nveg),mzg + nsoil = nint(soil_text(k,i,j,ip)) + + if (nsoil /= 13) then + !----- Find the liquid fraction, which will scale available water. ------! + call qwtk(soil_energy(k,i,j,ip),soil_water(k,i,j,ip)*wdns,slcpd(nsoil) & + ,soil_temp,soil_fliq) + !------------------------------------------------------------------------! + + + !----- Add the contribution of this layer, based on the potential. ------! + available_water = available_water & + + max(0., (psi_layer - psiwp(nsoil)) & + / (psild(nsoil) - psiwp(nsoil)) ) & + * soil_fliq * (slz(k+1)-slz(k)) + !------------------------------------------------------------------------! + end if + end do + !------------------------------------------------------------------------------! + + + + !----- Normalise the available water. -----------------------------------------! + available_water = available_water / abs(slz(kroot(nveg))) + !------------------------------------------------------------------------------! + + + + !----- Move the moving average. -----------------------------------------------! + psibar_10d(i,j,ip) = available_water * weight & + + psibar_10d(i,j,ip) * (1.0 - weight) + !------------------------------------------------------------------------------! + + end do patchloop + end do xloop + end do yloop + !---------------------------------------------------------------------------------------! + + return +end subroutine update_psibar !==========================================================================================! !==========================================================================================! diff --git a/BRAMS/src/surface/leaf_coms.f90 b/BRAMS/src/surface/leaf_coms.f90 index bbd8a075e..423075e2c 100644 --- a/BRAMS/src/surface/leaf_coms.f90 +++ b/BRAMS/src/surface/leaf_coms.f90 @@ -26,13 +26,12 @@ module leaf_coms , twothirds ! ! intent(in) !----- Parameters that are initialised from RAMSIN. ------------------------------------! + real :: ugbmin ! Minimum leaf-level velocity [ m/s] + real :: ubmin ! Minimum velocity [ m/s] real :: ustmin ! Minimum ustar [ m/s] - real :: ggfact ! Factor to multiply ground->canopy conductance. real :: gamm ! Gamma used by Businger et al. (1971) - momentum. real :: gamh ! Gamma used by Businger et al. (1971) - heat. real :: tprandtl ! Turbulent Prandtl number. - real :: vh2vr ! Vegetation roughness:vegetation height ratio - real :: vh2dh ! Displacement height:vegetation height ratio real :: ribmax ! Maximum bulk Richardson number real :: leaf_maxwhc ! Leaf maximum water holding capacity [kg/m2leaf] real :: min_patch_area ! Minimum patch area to consider @@ -40,10 +39,6 @@ module leaf_coms - !----- This parameter is assigned based on namelist variables. -------------------------! - real :: vkopr ! von Karman / turbulent Prandtl - !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! ! Commons used by LEAF-3. ! @@ -200,6 +195,7 @@ module leaf_coms integer, parameter :: nstyp = 17 ! # of soil types integer, parameter :: nvtyp = 20 ! # of land use types integer, parameter :: nvtyp_teb = 1 ! # of TEB extra land use types (21 - Very urban). + integer, parameter :: nscol = 21 ! # of soil colour types !---------------------------------------------------------------------------------------! @@ -208,9 +204,10 @@ module leaf_coms real, dimension(nstyp) :: slden,slcpd,slbs,slcond,sfldcap,slcons,slmsts,slpots real, dimension(nstyp) :: ssand,sclay,sorgan,sporo,soilwp,soilcp,slfc,emisg real, dimension(nstyp) :: slcons00,slcons0,fhydraul,xsilt,xsand,xclay - real, dimension(nstyp) :: albwet,albdry + real, dimension(nstyp) :: psild,psiwp real, dimension(nstyp) :: soilcond0,soilcond1,soilcond2,slcons1_0 real, dimension(nzgmax,nstyp) :: slcons1 + real, dimension(nscol) :: alb_vis_dry,alb_nir_dry,alb_vis_wet,alb_nir_wet !---------------------------------------------------------------------------------------! @@ -219,7 +216,7 @@ module leaf_coms real , dimension(nvtyp+nvtyp_teb) :: albv_green,albv_brown,emisv,sr_max,tai_max real , dimension(nvtyp+nvtyp_teb) :: sai,veg_clump,veg_frac,veg_ht,glai_max real , dimension(nvtyp+nvtyp_teb) :: gsw_max,dead_frac,leaf_width,stom_side - integer, dimension(nvtyp+nvtyp_teb) :: kroot + integer, dimension(nvtyp+nvtyp_teb) :: kroot,phenology real , dimension(nzgmax,nvtyp+nvtyp_teb) :: root !---------------------------------------------------------------------------------------! @@ -264,23 +261,18 @@ module leaf_coms real, parameter :: water_stab_thresh = 3.0 !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Speed-related minimum values we will consider. ! - !---------------------------------------------------------------------------------------! - real, parameter :: ugbmin = 0.25 ! Minimum leaf-level velocity [ m/s] - real, parameter :: ubmin = 0.65 ! Minimum velocity [ m/s] - !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! ! Constants for surface layer models. ! !---------------------------------------------------------------------------------------! + real, parameter :: vh2vr = 0.13 ! Vegetation roughness:vegetation hgt ratio + real, parameter :: vh2dh = 0.63 ! Displacement height:vegetation hgt ratio !----- Louis (1979) model. -------------------------------------------------------------! - real, parameter :: bl79 = 5.0 ! b prime parameter - real, parameter :: csm = 7.5 ! C* for momentum (eqn. 20, not co2 char. scale) - real, parameter :: csh = 5.0 ! C* for heat (eqn.20, not co2 char. scale) - real, parameter :: dl79 = 5.0 ! ??? + real, parameter :: bl79 = 5.0 ! b prime parameter + real, parameter :: csm = 7.5 ! C* for momentum (eqn. 20, not co2 char. scale) + real, parameter :: csh = 5.0 ! C* for heat (eqn.20, not co2 char. scale) + real, parameter :: dl79 = 5.0 ! ??? !----- Oncley and Dudhia (1995) model. -------------------------------------------------! - real, parameter :: bbeta = 5.0 ! Beta used by Businger et al. (1971) + real, parameter :: beta_s = 5.0 ! Beta used by Businger et al. (1971) !----- Beljaars and Holtslag (1991) model. ---------------------------------------------! real, parameter :: abh91 = -1.00 ! -a from equation (28) and (32) real, parameter :: bbh91 = -twothirds ! -b from equation (28) and (32) @@ -295,6 +287,22 @@ module leaf_coms real, parameter :: atetf = ate * fbh91 ! a * e * f real, parameter :: z0moz0h = 1.0 ! z0(M)/z0(h) real, parameter :: z0hoz0m = 1. / z0moz0h ! z0(M)/z0(h) + ! Modified CLM (2004) model. These will be initialised later. -------------------! + real :: beta_vs ! Beta for the very stable case (CLM eq. 5.30) + real :: chim ! CLM coefficient for very unstable case (momentum) + real :: chih ! CLM coefficient for very unstable case (heat) + real :: zetac_um ! critical zeta below which it becomes very unstable (momentum) + real :: zetac_uh ! critical zeta below which it becomes very unstable (heat) + real :: zetac_sm ! critical zeta above which it becomes very stable (momentum) + real :: zetac_sh ! critical zeta above which it becomes very stable (heat) + real :: zetac_umi ! 1. / zetac_umi + real :: zetac_uhi ! 1. / zetac_uhi + real :: zetac_smi ! 1. / zetac_smi + real :: zetac_shi ! 1. / zetac_shi + real :: zetac_umi16 ! 1/(-zetac_umi)^(1/6) + real :: zetac_uhi13 ! 1/(-zetac_umi)^(1/6) + real :: psimc_um ! psim evaluation at zetac_um + real :: psihc_uh ! psih evaluation at zetac_uh !---------------------------------------------------------------------------------------! @@ -692,7 +700,47 @@ end subroutine flush_leaf_coms - !=======================================================================================! + !=======================================================================================! + !=======================================================================================! + ! This sub-routine initialises several parameters for the surface layer model. ! + !---------------------------------------------------------------------------------------! + subroutine sfclyr_init_params() + use rconstants, only : onesixth + implicit none + !----- External functions. ----------------------------------------------------------! + real, external :: cbrt ! Cubic root + !------------------------------------------------------------------------------------! + + !----- Similar to CLM (2004), but with different phi_m for very unstable case. ------! + zetac_um = -1.5 + zetac_uh = -0.5 + zetac_sm = 1.0 + zetac_sh = zetac_sm + !----- Define chim and chih so the functions are continuous. ------------------------! + chim = (-zetac_um) ** onesixth / sqrt(sqrt(1.0 - gamm * zetac_um)) + chih = cbrt(-zetac_uh) / sqrt(1.0 - gamh * zetac_uh) + beta_vs = 1.0 - (1.0 - beta_s) * zetac_sm + !----- Define derived values to speed up the code a little. -------------------------! + zetac_umi = 1.0 / zetac_um + zetac_uhi = 1.0 / zetac_uh + zetac_smi = 1.0 / zetac_sm + zetac_shi = 1.0 / zetac_sh + zetac_umi16 = 1.0 / (- zetac_um) ** onesixth + zetac_uhi13 = 1.0 / cbrt(-zetac_uh) + + !------------------------------------------------------------------------------------! + ! Initialise these values with dummies, it will be updated after we define the ! + ! functions. ! + !------------------------------------------------------------------------------------! + psimc_um = 0. + psimc_um = psim(zetac_um,.false.) + psihc_uh = 0. + psihc_uh = psih(zetac_uh,.false.) + !------------------------------------------------------------------------------------! + + return + end subroutine sfclyr_init_params + !=======================================================================================! !=======================================================================================! @@ -704,7 +752,8 @@ end subroutine flush_leaf_coms ! This function computes the stability correction function for momentum. ! !---------------------------------------------------------------------------------------! real function psim(zeta,stable) - use rconstants, only : halfpi + use rconstants, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) use mem_leaf , only : istar implicit none !----- Arguments. -------------------------------------------------------------------! @@ -715,17 +764,40 @@ real function psim(zeta,stable) !------------------------------------------------------------------------------------! if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psim = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psim = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psim = abh91 * zeta & + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) & + bcod + case (4) !----- CLM (2004) (including neglected terms). --------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + psim = (1.0 - beta_vs) * log(zeta * zetac_smi) & + + (1.0 - beta_s ) * zetac_sm - zeta + else + !----- Normal stable case. -------------------------------------------------! + psim = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psim = log(zeta * zetac_umi) & + + 6.0 * chim * ((- zeta) ** (-onesixth) - zetac_umi16) & + + psimc_um + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) & + - 2.0*atan(xx) + halfpi + end if + end select end if return end function psim @@ -750,21 +822,45 @@ real function psih(zeta,stable) logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! - if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psih = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psih = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psih = 1.0 - (1.0 + ate * zeta)**fbh91 & + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) + bcod + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + psih = (1.0 - beta_vs) * log(zeta * zetac_shi) & + + (1.0 - beta_s ) * zetac_sh - zeta + else + !----- Normal stable case. -------------------------------------------------! + psih = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - psih = log(0.25 * (1.0+yy) * (1.0+yy)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psih = log(zeta * zetac_uhi) & + + 3.0 * chih * (1./cbrt(-zeta) - zetac_uhi13) & + + psihc_uh + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + end if + end select end if + return end function psih !=======================================================================================! !=======================================================================================! @@ -781,6 +877,7 @@ end function psih !---------------------------------------------------------------------------------------! real function dpsimdzeta(zeta,stable) use mem_leaf , only : istar + use rconstants, only : onesixth implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -788,19 +885,37 @@ real function dpsimdzeta(zeta,stable) !----- Local variables. -------------------------------------------------------------! real :: xx !------------------------------------------------------------------------------------! - if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsimdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsimdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsimdzeta = abh91 + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + dpsimdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsimdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsimdzeta = (1.0 - chim * (-zeta)**onesixth) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + end if + end select end if return @@ -826,21 +941,41 @@ real function dpsihdzeta(zeta,stable) logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! - if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsihdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsihdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsihdzeta = - atetf * (1.0 + ate * zeta)**fm1 & + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + dpsihdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsihdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - dpsihdzeta = -gamh / (yy * (1.0 + yy)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsihdzeta = (1.0 + chih / cbrt(zeta)) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + end if + end select end if return @@ -867,6 +1002,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) use therm_lib, only : toler & ! intent(in) , maxfpo & ! intent(in) , maxit ! ! intent(in) + use mem_leaf , only : istar implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: rib ! Bulk Richardson number [ ---] @@ -878,6 +1014,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) real , intent(in) :: lnzoz0h ! ln[zref/roughness(heat)] [ ---] logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! + real :: ribuse ! Richardson number to use [ ---] real :: fm ! lnzoz0m - psim(zeta) + psim(zeta0m) [ ---] real :: fh ! lnzoz0h - psih(zeta) + psih(zeta0h) [ ---] real :: dfmdzeta ! d(fm)/d(zeta) [ ---] @@ -903,22 +1040,56 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) logical :: zside ! Flag... I'm on the z-side. [ T|F] !------------------------------------------------------------------------------------! + + + !----- Define some values that won't change during the iterative method. ------------! + z0moz = 1. / zoz0m + z0hoz = 1. / zoz0h + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! - ! First thing: if the bulk Richardson number is zero or almost zero, then we ! - ! rather just assign z/L to be the one given by Oncley and Dudhia (1995). This ! - ! saves time and also avoids the risk of having zeta with the opposite sign. ! + ! First thing, check whether this is a stable case and we are running methods 2 ! + ! or 4. In these methods, there is a singularity that must be avoided. ! !------------------------------------------------------------------------------------! - zetasmall = vkopr * rib * min(lnzoz0m,lnzoz0h) - if (rib <= 0. .and. zetasmall > - z0moz0h * toler) then - zoobukhov = vkopr * rib * lnzoz0m + select case (istar) + case (2,4) + ribuse = min(rib, (1.0 - toler) * tprandtl / (beta_s * (1.0 - min(z0moz,z0hoz)))) + + !---------------------------------------------------------------------------------! + ! Stable case, using Oncley and Dudhia, we can solve it analytically. ! + !---------------------------------------------------------------------------------! + if (stable .and. istar == 2) then + zoobukhov = ribuse * min(lnzoz0m,lnzoz0h) & + / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) *ribuse) + return + end if + !---------------------------------------------------------------------------------! + case default + ribuse = rib + end select + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! If the bulk Richardson number is zero or almost zero, then we rather just ! + ! assign z/L to be the one similar to Oncley and Dudhia (1995). This saves time and ! + ! also avoids the risk of having zeta with the opposite sign. ! + !------------------------------------------------------------------------------------! + zetasmall = ribuse * min(lnzoz0m,lnzoz0h) + if (ribuse <= 0. .and. zetasmall > - z0moz0h * toler) then + zoobukhov = zetasmall / tprandtl return - elseif (rib > 0. .and. zetasmall < z0moz0h * toler) then - zoobukhov = zetasmall / (1.1 - 5.0 * rib) + elseif (ribuse > 0. .and. zetasmall < z0moz0h * toler) then + zoobukhov = zetasmall / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) * ribuse) return else zetamin = toler zetamax = -toler end if + !------------------------------------------------------------------------------------! !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.20. ! + ! Ri is too positive. ! !------------------------------------------------------------------------------------! - zetaa = vkopr * rib * lnzoz0m + zetaa = ribuse * lnzoz0m / tprandtl !----- Finding the function and its derivative. -------------------------------------! zeta0m = zetaa * z0moz @@ -948,9 +1119,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) fh = lnzoz0h - psih(zetaa,stable) + psih(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable) - dpsimdzeta(zetaa,stable) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable) - dpsihdzeta(zetaa,stable) - funa = vkopr * rib * fm * fm / fh - zetaa - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + funa = ribuse * fm * fm / (tprandtl * fh) - zetaa + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !----- Copying just in case it fails at the first iteration. ------------------------! zetaz = zetaa @@ -998,9 +1169,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) fh = lnzoz0h - psih(zetaz,stable) + psih(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable) - dpsimdzeta(zetaz,stable) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable) - dpsihdzeta(zetaz,stable) - fun = vkopr * rib * fm * fm / fh - zetaz - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + fun = ribuse * fm * fm / (tprandtl * fh) - zetaz + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>Can) [ W/mē] , sensible_vc ! ! Sens. heat (Veg->Can) [ W/mē] + !------------------------------------------------------------------------------------! + ! This is based on a 10-day running average of the relative soil moisture ! + ! potential in the root zone, and it is used by all vegetation types that have ! + ! drought phenology (phenology(nveg) = 4) and LAI is not to be read from standard ! + ! files. ! + !------------------------------------------------------------------------------------! + real, dimension(:,:,:), pointer :: psibar_10d + + !------------------------------------------------------------------------------------! + ! Radiation variables, for diagnostics only (nxp,nyp,npatch). ! + !------------------------------------------------------------------------------------! + real, dimension(:,:,:), pointer :: rshort_gnd & ! Absorbed SW radiation [ W/mē] + , rlong_gnd ! ! Absorbed LW radiation [ W/mē] + !------------------------------------------------------------------------------------! ! Miscellaneous properties, dimensioned by (nxp,nyp,npatch). ! !------------------------------------------------------------------------------------! @@ -129,6 +144,7 @@ Module mem_leaf ! Other variables. ! !---------------------------------------------------------------------------------------! integer :: nslcon ! Soil texture if constant for entire domain + integer :: isoilcol ! Number of vegetation types integer :: nvgcon ! Vegetation class if constant for entire domain integer :: nvegpat ! Number of vegetation types integer :: isfcl ! Surface model (1. LEAF3, 2. LEAF-Hydro, 5. ED2) @@ -164,8 +180,6 @@ Module mem_leaf real :: dtleaf ! LEAF-3 target time step. It will be either this ! this or the actual BRAMS time step (which- ! ever is the lowest). - real :: betapower ! Power for the beta parameter that controls - ! ground evaporation. real, dimension(nzgmax) :: stgoff ! Initial soil temperature offset real, dimension(nzgmax) :: slmstr ! Initial soil moisture if constant for entire domain @@ -211,6 +225,7 @@ subroutine alloc_leaf(leaf,nz,nx,ny,nzg,nzs,np,ng,teb_spm) allocate (leaf%soil_energy (nzg,nx,ny,np)) allocate (leaf%soil_text (nzg,nx,ny,np)) allocate (leaf%soil_rough ( nx,ny,np)) + allocate (leaf%soil_color ( nx,ny,np)) allocate (leaf%sfcwater_mass (nzs,nx,ny,np)) allocate (leaf%sfcwater_energy (nzs,nx,ny,np)) @@ -267,6 +282,10 @@ subroutine alloc_leaf(leaf,nz,nx,ny,nzg,nzs,np,ng,teb_spm) allocate (leaf%transp ( nx,ny,np)) allocate (leaf%sensible_gc ( nx,ny,np)) allocate (leaf%sensible_vc ( nx,ny,np)) + allocate (leaf%psibar_10d ( nx,ny,np)) + + allocate (leaf%rshort_gnd ( nx,ny,np)) + allocate (leaf%rlong_gnd ( nx,ny,np)) allocate (leaf%R_aer ( nx,ny,np)) @@ -304,6 +323,7 @@ subroutine nullify_leaf(leaf) if (associated(leaf%soil_energy )) nullify(leaf%soil_energy ) if (associated(leaf%soil_text )) nullify(leaf%soil_text ) if (associated(leaf%soil_rough )) nullify(leaf%soil_rough ) + if (associated(leaf%soil_color )) nullify(leaf%soil_color ) if (associated(leaf%sfcwater_mass )) nullify(leaf%sfcwater_mass ) if (associated(leaf%sfcwater_energy )) nullify(leaf%sfcwater_energy ) @@ -360,6 +380,10 @@ subroutine nullify_leaf(leaf) if (associated(leaf%transp )) nullify(leaf%transp ) if (associated(leaf%sensible_gc )) nullify(leaf%sensible_gc ) if (associated(leaf%sensible_vc )) nullify(leaf%sensible_vc ) + if (associated(leaf%psibar_10d )) nullify(leaf%psibar_10d ) + + if (associated(leaf%rshort_gnd )) nullify(leaf%rshort_gnd ) + if (associated(leaf%rlong_gnd )) nullify(leaf%rlong_gnd ) if (associated(leaf%R_aer )) nullify(leaf%R_aer ) if (associated(leaf%G_URBAN )) nullify(leaf%G_URBAN ) @@ -396,6 +420,7 @@ subroutine zero_leaf(leaf) if (associated(leaf%soil_energy )) leaf%soil_energy = 0.0 if (associated(leaf%soil_text )) leaf%soil_text = 0.0 if (associated(leaf%soil_rough )) leaf%soil_rough = 0.0 + if (associated(leaf%soil_color )) leaf%soil_color = 0.0 if (associated(leaf%sfcwater_mass )) leaf%sfcwater_mass = 0.0 if (associated(leaf%sfcwater_energy )) leaf%sfcwater_energy = 0.0 @@ -452,6 +477,10 @@ subroutine zero_leaf(leaf) if (associated(leaf%transp )) leaf%transp = 0.0 if (associated(leaf%sensible_gc )) leaf%sensible_gc = 0.0 if (associated(leaf%sensible_vc )) leaf%sensible_vc = 0.0 + if (associated(leaf%psibar_10d )) leaf%psibar_10d = 0.0 + + if (associated(leaf%rshort_gnd )) leaf%rshort_gnd = 0.0 + if (associated(leaf%rlong_gnd )) leaf%rlong_gnd = 0.0 if (associated(leaf%R_aer )) leaf%R_aer = 0.0 if (associated(leaf%G_URBAN )) leaf%G_URBAN = 0.0 @@ -486,6 +515,7 @@ subroutine dealloc_leaf(leaf) if (associated(leaf%soil_energy )) deallocate(leaf%soil_energy ) if (associated(leaf%soil_text )) deallocate(leaf%soil_text ) if (associated(leaf%soil_rough )) deallocate(leaf%soil_rough ) + if (associated(leaf%soil_color )) deallocate(leaf%soil_color ) if (associated(leaf%sfcwater_mass )) deallocate(leaf%sfcwater_mass ) if (associated(leaf%sfcwater_energy )) deallocate(leaf%sfcwater_energy ) @@ -542,6 +572,10 @@ subroutine dealloc_leaf(leaf) if (associated(leaf%transp )) deallocate(leaf%transp ) if (associated(leaf%sensible_gc )) deallocate(leaf%sensible_gc ) if (associated(leaf%sensible_vc )) deallocate(leaf%sensible_vc ) + if (associated(leaf%psibar_10d )) deallocate(leaf%psibar_10d ) + + if (associated(leaf%rshort_gnd )) deallocate(leaf%rshort_gnd ) + if (associated(leaf%rlong_gnd )) deallocate(leaf%rlong_gnd ) if (associated(leaf%R_aer )) deallocate(leaf%R_aer ) if (associated(leaf%G_URBAN )) deallocate(leaf%G_URBAN ) @@ -641,6 +675,10 @@ subroutine filltab_leaf(leaf,leafm,imean,nmz,nmx,nmy,nmzg,nmzs,nmpat,ng) call vtables2(leaf%soil_rough,leafm%soil_rough,ng,npts,imean & ,'SOIL_ROUGH :6:hist:anal:mpti:mpt3'//trim(str_recycle)) + if (associated(leaf%soil_color)) & + call vtables2(leaf%soil_color,leafm%soil_color,ng,npts,imean & + ,'SOIL_COLOR :6:hist:anal:mpti:mpt3'//trim(str_recycle)) + if (associated(leaf%sfcwater_nlev)) & call vtables2(leaf%sfcwater_nlev,leafm%sfcwater_nlev,ng,npts,imean & ,'SFCWATER_NLEV :6:hist:anal:mpti:mpt3'//trim(str_recycle)) @@ -817,6 +855,10 @@ subroutine filltab_leaf(leaf,leafm,imean,nmz,nmx,nmy,nmzg,nmzs,nmpat,ng) call vtables2(leaf%sensible_vc,leafm%sensible_vc,ng,npts,imean & ,'SENSIBLE_VC :6:hist:anal:mpti:mpt3') + if (associated(leaf%psibar_10d)) & + call vtables2(leaf%psibar_10d,leafm%psibar_10d,ng,npts,imean & + ,'PSIBAR_10D :6:hist:anal:mpti:mpt3') + if (associated(leaf%R_aer)) & call vtables2(leaf%R_aer,leafm%R_aer,ng,npts,imean & ,'R_AER :6:hist:mpti:mpt3') @@ -825,6 +867,14 @@ subroutine filltab_leaf(leaf,leafm,imean,nmz,nmx,nmy,nmzg,nmzs,nmpat,ng) call vtables2(leaf%G_URBAN,leafm%G_URBAN,ng,npts,imean & ,'G_URBAN :6:hist:anal:mpti:mpt3'//trim(str_recycle)) + if (associated(leaf%rshort_gnd)) & + call vtables2(leaf%rshort_gnd,leafm%rshort_gnd,ng,npts,imean & + ,'RSHORT_GND :6:hist:anal:mpti:mpt3') + + if (associated(leaf%rlong_gnd)) & + call vtables2(leaf%rlong_gnd,leafm%rlong_gnd,ng,npts,imean & + ,'RLONG_GND :6:hist:anal:mpti:mpt3') + !------------------------------------------------------------------------------------! ! 2-D variables, dimensioned by nx*ny. ! diff --git a/BRAMS/src/surface/ruser.f90 b/BRAMS/src/surface/ruser.f90 index 7890fc526..2509967c5 100644 --- a/BRAMS/src/surface/ruser.f90 +++ b/BRAMS/src/surface/ruser.f90 @@ -244,7 +244,7 @@ subroutine ndviinit_user(n2,n3,npat,ifm,veg_ndvif) !***************************************************************************** subroutine sfcinit_file_user(n2,n3,mzg,npat,ifm & - ,patch_area,leaf_class,soil_text) + ,patch_area,leaf_class,soil_color,soil_text) use rconstants @@ -255,7 +255,7 @@ subroutine sfcinit_file_user(n2,n3,mzg,npat,ifm & integer :: n2,n3,mzg,npat,ifm,i,j,k,ipat real, dimension(mzg,n2,n3,npat) :: soil_text -real, dimension(n2,n3,npat) :: patch_area,leaf_class +real, dimension(n2,n3,npat) :: patch_area,leaf_class,soil_color ! This subroutine is the intended location for a user to customize the ! PATCH_AREA, leaf_class, and SOIL_TEXT arrays. It is called after all @@ -353,17 +353,17 @@ subroutine sfcinit_file_user(n2,n3,mzg,npat,ifm & ! required by the user. ! !------------------------------------------------------------------------------------------! subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,soil_water & - ,soil_energy,soil_text,sfcwater_mass,sfcwater_energy & - ,sfcwater_depth,ustar,tstar,rstar,cstar,zeta,ribulk & - ,veg_fracarea,veg_agb,veg_lai,veg_tai,veg_rough,veg_height & - ,veg_displace,veg_albedo,patch_area,patch_rough & + ,soil_energy,psibar_10d,soil_color,soil_text,sfcwater_mass & + ,sfcwater_energy,sfcwater_depth,ustar,tstar,rstar,cstar,zeta & + ,ribulk,veg_fracarea,veg_agb,veg_lai,veg_tai,veg_rough & + ,veg_height,veg_displace,veg_albedo,patch_area,patch_rough & ,patch_wetind,leaf_class,soil_rough,sfcwater_nlev & ,stom_condct,ground_rsat,ground_rvap,ground_temp,ground_fliq & ,veg_water,veg_hcap,veg_energy,can_prss,can_theiv,can_theta & ,can_rvap,can_co2,sensible_gc,sensible_vc,evap_gc,evap_vc & ,transp,gpp,plresp,resphet,veg_ndvip,veg_ndvic,veg_ndvif & - ,snow_mass,snow_depth,cosz,rlongup,albedt,rvv,prsv,piv,vt2da & - ,vt2db,glat,glon,zot,flpw,rtgt) + ,snow_mass,snow_depth,rshort_gnd,rlong_gnd,cosz,rlongup & + ,albedt,rvv,prsv,piv,vt2da,vt2db,glat,glon,zot,flpw,rtgt) use mem_grid use mem_leaf @@ -394,6 +394,8 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so real, dimension( n2,n3) , intent(in) :: cosz real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_water real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_energy + real, dimension( n2,n3,npat), intent(inout) :: soil_color + real, dimension( n2,n3,npat), intent(inout) :: psibar_10d real, dimension(mzg,n2,n3,npat), intent(inout) :: soil_text real, dimension(mzs,n2,n3,npat), intent(inout) :: sfcwater_mass real, dimension(mzs,n2,n3,npat), intent(inout) :: sfcwater_energy @@ -442,6 +444,8 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so real, dimension( n2,n3,npat), intent(inout) :: veg_ndvip real, dimension( n2,n3,npat), intent(inout) :: veg_ndvic real, dimension( n2,n3,npat), intent(inout) :: veg_ndvif + real, dimension( n2,n3,npat), intent(inout) :: rshort_gnd + real, dimension( n2,n3,npat), intent(inout) :: rlong_gnd real, dimension( n2,n3) , intent(inout) :: rlongup real, dimension( n2,n3) , intent(inout) :: albedt real, dimension( n2,n3) , intent(inout) :: rvv @@ -650,12 +654,13 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so ! end if - ! call vegndvi(ifm,patch_area (i,j,ipat) ,leaf_class(i,j,ipat) & - ! ,veg_fracarea(i,j,ipat) ,veg_lai (i,j,ipat) & - ! ,veg_tai (i,j,ipat) ,veg_rough (i,j,ipat) & - ! ,veg_height (i,j,ipat) ,veg_albedo(i,j,ipat) & - ! ,veg_ndvip (i,j,ipat) ,veg_ndvic (i,j,ipat) & - ! ,veg_ndvif (i,j,ipat) ) + ! call vegndvi(ifm, patch_area (i,j,ipat) , leaf_class (i,j,ipat) & + ! , veg_fracarea (i,j,ipat) , veg_lai (i,j,ipat) & + ! , veg_tai (i,j,ipat) , veg_rough (i,j,ipat) & + ! , veg_height (i,j,ipat) , veg_displace (i,j,ipat) & + ! , veg_albedo (i,j,ipat) , veg_ndvip (i,j,ipat) & + ! , veg_ndvic (i,j,ipat) , veg_ndvif (i,j,ipat) & + ! , psibar_10d (i,j,ipat) ) ! call leaf_grndvap(soil_energy(mzg,i,j,ipat),soil_water (mzg,i,j,ipat) & ! ,soil_text (mzg,i,j,ipat),sfcwater_energy(mzs,i,j,ipat) & @@ -665,15 +670,15 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so ! ,ground_fliq (i,j,ipat)) ! call sfcrad( nzg, nzs, ipat & - ! , soil_water (:,i,j,ipat) , soil_text (:,i,j,ipat) & - ! , sfcwater_depth (:,i,j,ipat) , patch_area ( i,j,ipat) & - ! , veg_fracarea ( i,j,ipat) , leaf_class ( i,j,ipat) & - ! , veg_albedo ( i,j,ipat) , sfcwater_nlev ( i,j,ipat) & - ! , rshort ( i,j ) , rlong ( i,j ) & - ! , albedt ( i,j ) , rlongup ( i,j ) & - ! , cosz ( i,j ) , g_urban & - ! , emis_town , alb_town & - ! , ts_town ) + ! , soil_water (:,i,j,ipat) , soil_color ( i,j,ipat) & + ! , soil_text (:,i,j,ipat) , sfcwater_depth (:,i,j,ipat) & + ! , patch_area ( i,j,ipat) , veg_fracarea ( i,j,ipat) & + ! , leaf_class ( i,j,ipat) , veg_albedo ( i,j,ipat) & + ! , sfcwater_nlev ( i,j,ipat) , rshort ( i,j ) & + ! , rlong ( i,j ) , albedt ( i,j ) & + ! , rlongup ( i,j ) , cosz ( i,j ) & + ! , g_urban , emis_town & + ! , alb_town , ts_town ) ! end do patchloop ! end do iloop ! end do jloop diff --git a/BRAMS/src/surface/urban_canopy.f90 b/BRAMS/src/surface/urban_canopy.f90 index a56dc5a14..fd02035ac 100644 --- a/BRAMS/src/surface/urban_canopy.f90 +++ b/BRAMS/src/surface/urban_canopy.f90 @@ -120,7 +120,7 @@ subroutine urb_drag_init() !************************************************************************ subroutine getdrag(nzp,nxp,nyp,xm,ym,zm,cdrag) - +use grid_dims, only : str_len implicit none integer :: nxp,nyp,nzp @@ -134,7 +134,7 @@ subroutine getdrag(nzp,nxp,nyp,xm,ym,zm,cdrag) real :: rim1_cd,rim2_cd,rjm1_cd,rjm2_cd,rkm1_cd,rkm2_cd,ric,rjc,rkc logical :: there -character(len=80) :: fname='./cdrag_data' +character(len=str_len) :: fname='./cdrag_data' ! Read in the prepared drag coeff file diff --git a/BRAMS/src/teb_spm/gaspart.f90 b/BRAMS/src/teb_spm/gaspart.f90 index f81161646..402ef4100 100644 --- a/BRAMS/src/teb_spm/gaspart.f90 +++ b/BRAMS/src/teb_spm/gaspart.f90 @@ -707,7 +707,7 @@ subroutine init_conc_prev(name_name) ,nnxp1(maxgrds),nnyp1(maxgrds),nnzp1(maxgrds),nzg1,nzs1,npatch1 integer :: iyr,imn,idy,itm,ie,maxarr,ngr,nc - character (len=80) :: hnameinh,prefix + character (len=str_len) :: hnameinh,prefix character (len=2) :: cng integer, external :: cio_i,cio_f,cio_i_sca integer,save :: iunhd=11 diff --git a/BRAMS/src/teb_spm/mem_emiss.f90 b/BRAMS/src/teb_spm/mem_emiss.f90 index dee360fa3..115c4a24d 100644 --- a/BRAMS/src/teb_spm/mem_emiss.f90 +++ b/BRAMS/src/teb_spm/mem_emiss.f90 @@ -7,7 +7,7 @@ !########################################################################### Module mem_emiss - + use grid_dims, only : str_len !--------------------------------------------------------------------------- integer :: isource !Flag for using emission module - EDF !This flag is set up in RAMSIN @@ -30,7 +30,7 @@ Module mem_emiss integer :: ichemi, & !for photochemical module activation - EDF ichemi_in !flag for reading a previous run as initial values - character (len=256) :: CHEMDATA_IN !path for initial values reading + character (len=str_len) :: CHEMDATA_IN !path for initial values reading !--------------------------------------------------------------------------- end Module diff --git a/BRAMS/src/turb/tkenn.f90 b/BRAMS/src/turb/tkenn.f90 index f9e631a9f..0e96ffc1d 100644 --- a/BRAMS/src/turb/tkenn.f90 +++ b/BRAMS/src/turb/tkenn.f90 @@ -28,7 +28,7 @@ ! VAN DOP, H. Atmospheric turbulence and air pollution modelling. Dordrecht: D. ! ! Reidel Publishing Company, 1982, chap. 7, p. 275-310. ! ! ! -! VOGEZELANG, D. H. P.; HOLTSLAG, A. M. Evaluation and model impacts of alternati- ! +! VOGELEZANG, D. H. P.; HOLTSLAG, A. M. Evaluation and model impacts of alternati- ! ! ve boundary-layer height formulations. Boundary-Layer Meteor., v. 81, p. 245- ! ! 269, 1996. ! !==========================================================================================! diff --git a/ED/Template/Template/ED2IN b/ED/Template/Template/ED2IN index 3c2c10082..d987377da 100644 --- a/ED/Template/Template/ED2IN +++ b/ED/Template/Template/ED2IN @@ -11,10 +11,6 @@ $ED_NL NL%EXPNME = 'ED version 2.1 test' !---------------------------------------------------------------------------------------! - NL%EXPNME = 'ED version 2.1 test' ! Simulation name - - !---------------------------------------------------------------------------------------! - @@ -237,7 +233,7 @@ $ED_NL ! 2. In case IQOUTPUT is set to 3, then UNITFAST has to be 0. ! ! ! !---------------------------------------------------------------------------------------! - NL%UNITFAST = 2 + NL%UNITFAST = 0 NL%UNITSTATE = 3 !---------------------------------------------------------------------------------------! @@ -414,6 +410,40 @@ $ED_NL !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! ISOILCOL -- LEAF-3 and ED-2 soil colour classes that the model will use when ISOILFLG ! + ! is set to 2. Soil classes are from 1 to 20 (1 = lightest; 20 = darkest). ! + ! The values are the same as CLM-4.0. The table is the albedo for visible ! + ! and near infra-red. ! + !---------------------------------------------------------------------------------------! + ! ! + ! |-----------------------------------------------------------------------| ! + ! | | Dry soil | Saturated | | Dry soil | Saturated | ! + ! | Class |-------------+-------------| Class +-------------+-------------| ! + ! | | VIS | NIR | VIS | NIR | | VIS | NIR | VIS | NIR | ! + ! |-------+------+------+------+------+-------+------+------+------+------| ! + ! | 1 | 0.36 | 0.61 | 0.25 | 0.50 | 11 | 0.24 | 0.37 | 0.13 | 0.26 | ! + ! | 2 | 0.34 | 0.57 | 0.23 | 0.46 | 12 | 0.23 | 0.35 | 0.12 | 0.24 | ! + ! | 3 | 0.32 | 0.53 | 0.21 | 0.42 | 13 | 0.22 | 0.33 | 0.11 | 0.22 | ! + ! | 4 | 0.31 | 0.51 | 0.20 | 0.40 | 14 | 0.20 | 0.31 | 0.10 | 0.20 | ! + ! | 5 | 0.30 | 0.49 | 0.19 | 0.38 | 15 | 0.18 | 0.29 | 0.09 | 0.18 | ! + ! | 6 | 0.29 | 0.48 | 0.18 | 0.36 | 16 | 0.16 | 0.27 | 0.08 | 0.16 | ! + ! | 7 | 0.28 | 0.45 | 0.17 | 0.34 | 17 | 0.14 | 0.25 | 0.07 | 0.14 | ! + ! | 8 | 0.27 | 0.43 | 0.16 | 0.32 | 18 | 0.12 | 0.23 | 0.06 | 0.12 | ! + ! | 9 | 0.26 | 0.41 | 0.15 | 0.30 | 19 | 0.10 | 0.21 | 0.05 | 0.10 | ! + ! | 10 | 0.25 | 0.39 | 0.14 | 0.28 | 20 | 0.08 | 0.16 | 0.04 | 0.08 | ! + ! |-----------------------------------------------------------------------| ! + ! ! + ! Soil type 21 is a special case in which we use the albedo method that used to be ! + ! the default in ED-2.1. ! + !---------------------------------------------------------------------------------------! + NL%ISOILCOL = mysoilcol + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! These variables are used to define the soil properties when you don't want to use ! ! the standard soil classes. ! @@ -445,9 +475,27 @@ $ED_NL ! 2 = porosity (saturation) ! ! STGOFF - initial temperature offset (soil temperature = air temperature + offset) ! !---------------------------------------------------------------------------------------! - NL%SLZ = myslz - NL%SLMSTR = myslmstr - NL%STGOFF = mystgoff + NL%SLZ = myslz1 + myslz2 + myslz3 + myslz4 + myslz5 + myslz6 + myslz7 + NL%SLMSTR = myslmstr1 + myslmstr2 + myslmstr3 + myslmstr4 + myslmstr5 + myslmstr6 + myslmstr7 + NL%STGOFF = mystgoff1 + mystgoff2 + mystgoff3 + mystgoff4 + mystgoff5 + mystgoff6 + mystgoff7 !---------------------------------------------------------------------------------------! @@ -523,6 +571,20 @@ $ED_NL + !---------------------------------------------------------------------------------------! + ! IVEGT_DYNAMICS -- The vegetation dynamics scheme. ! + ! 0. No vegetation dynamics, the initial state will be preserved, ! + ! even though the model will compute the potential values. This ! + ! option is useful for theoretical simulations only. ! + ! 1. Normal ED vegetation dynamics (Moorcroft et al 2001). ! + ! The normal option for almost any simulation. ! + !---------------------------------------------------------------------------------------! + NL%IVEGT_DYNAMICS = myvegtdyn + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! INTEGRATION_SCHEME -- The biophysics integration scheme. ! ! 0. Euler step. The fastest, but it doesn't estimate ! @@ -551,13 +613,13 @@ $ED_NL !---------------------------------------------------------------------------------------! ! IBRANCH_THERMO -- This determines whether branches should be included in the ! - ! vegetation thermodynamics and radiation or not. This is under ! - ! development, not fully tested, so we suggest leaving it as 0. ! - ! Options are: ! - ! 0. No branches in energy/radiation; ! - ! 1. Use Conijn (1995) numbers; ! - ! 2. Use parameterization from Jarvela (2004); ! - ! 3. Use the same allometry as Ahrends et al. (2010) ! + ! vegetation thermodynamics and radiation or not. ! + ! 0. No branches in energy/radiation (ED-2.1 default); ! + ! 1. Branches are accounted in the energy and radiation. Branchwood ! + ! and leaf are treated separately in the canopy radiation scheme, ! + ! but solved as a single pool in the biophysics integration. ! + ! 2. Similar to 1, but branches are treated as separate pools in the ! + ! biophysics (thus doubling the number of prognostic variables). ! !---------------------------------------------------------------------------------------! NL%IBRANCH_THERMO = mybranch !---------------------------------------------------------------------------------------! @@ -578,38 +640,32 @@ $ED_NL ! coefficients for CO2 and O2, as in Farquhar et al. (1980) and in CLM. ! ! 2 -- Collatz et al. (1991). We use the power (Q10) equations, with Collatz et al. ! ! parameters for compensation point, and the Michaelis-Mentel coefficients. The ! - ! leaf respiration correction for high and low temperatures are the same as in ! - ! Moorcroft et al. (2001), but the correction for Vm is done like in Collatz. ! + ! correction for high and low temperatures are the same as in Moorcroft et al. ! + ! (2001). ! ! 3 -- Same as 2, except that we find Gamma* as in Farquhar et al. (1980) and in CLM. ! !---------------------------------------------------------------------------------------! - NL%IPHYSIOL = myphysiol - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! ISTOMA_SCHEME -- This is the scheme used to compute stomatal conductance and ! - ! photosynthesis. ! - ! 0. Full, exact calculation each time. ! - ! 1. (defunct) 'small perturbation' scheme. ! - !---------------------------------------------------------------------------------------! - NL%ISTOMA_SCHEME = 0 + NL%IPHYSIOL = 2 !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! IALLOM -- Which allometry to use (this affects tropical PFTs only) ! + ! IALLOM -- Which allometry to use (this mostly affects tropical PFTs. Temperate PFTs ! + ! will use the new root allometry and the maximum crown area if IALLOM is set ! + ! to 1 or 2). ! ! 0. Original ED-2.1 ! - ! 1. Baker et al. (2004), equation 2, keeping the same balive:bdead ratio ! - ! 2. Baker et al. (2004), equation 2, keeping the same balive as in ED-2.1 ! - ! 3. Same as 2, but using a DBH-> Root depth equation based on ! - ! Kenzo et al. (2009) for a secondary forest in Malaysia. Roots will ! - ! be shallow, though... ! - ! 4. Same as 2, but with an experimental root depth that makes canopy trees ! - ! to have root depths of 5m and grasses/seedlings at 0.5 to have root ! - ! depth of 0.5 m. ! + ! 1. a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004), equation 2. Balive is the ! + ! default ED-2.1; ! + ! b. Experimental root depth that makes canopy trees to have root depths ! + ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! + ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! + ! crown area ! + ! 2. Similar to 1, but with a few extra changes. ! + ! a. Height -> DBH allometry as in Poorter et al. (2006) ! + ! b. Balive is retuned, using a few leaf biomass allometric equations for ! + ! a few genuses in Costa Rica. References: ! + ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! !---------------------------------------------------------------------------------------! NL%IALLOM = myallom !---------------------------------------------------------------------------------------! @@ -700,28 +756,51 @@ $ED_NL ! cohorts are stacked on the top of each other. ! ! 1. Dietze (2008) model. Cohorts have a finite radius, and cohorts are ! ! stacked on the top of each other. ! - ! 2. Cohorts have a finite radius with horizontal, but they are no longer ! - ! organised by cohort index. Instead, cohorts of the same height ! - ! compete for light as the radiation is solved layer by layer rather ! - ! than cohort by cohort. This is still under development, ideas are ! - ! welcome. ! !---------------------------------------------------------------------------------------! - NL%CROWN_MOD = mycrownmod + NL%CROWN_MOD = mycrown !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! ICAN_SWRAD -- This variable specifies which canopy radiation model to use for short- ! - ! wave radiation within the canopy: ! - ! 0. Beers law. Added back just for theroretical tests, don't use it if ! - ! you are unsure. This cannot be used with CROWN_MOD = 2. ! - ! 1. Two-stream model. The default and recommended method. ! + ! The following variables control the canopy radiation solver. ! ! ! - ! In either case longwave will be solved using two-stream model. ! - !---------------------------------------------------------------------------------------! - NL%ICAN_SWRAD = mycanswrad + ! ICANRAD -- Specifies how canopy radiation is solved. This variable sets both ! + ! shortwave and longwave. ! + ! 0. Two-stream model (Medvigy 2006), with the possibility to apply ! + ! finite crown area to direct shortwave radiation. ! + ! 1. Multiple-scattering model (Zhao and Qualls 2005,2006), with the ! + ! possibility to apply finite crown area to all radiation fluxes. ! + ! LTRANS_VIS -- Leaf transmittance for tropical plants - Visible/PAR ! + ! LTRANS_NIR -- Leaf transmittance for tropical plants - Near Infrared ! + ! LREFLECT_VIS -- Leaf reflectance for tropical plants - Visible/PAR ! + ! LREFLECT_NIR -- Leaf reflectance for tropical plants - Near Infrared ! + ! ORIENT_TREE -- Leaf orientation factor for tropical trees. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! ORIENT_GRASS -- Leaf orientation factor for tropical grasses. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! CLUMP_TREE -- Clumping factor for tropical trees. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + ! CLUMP_GRASS -- Clumping factor for tropical grasses. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + !---------------------------------------------------------------------------------------! + NL%ICANRAD = mycanrad + NL%LTRANS_VIS = myltransvis + NL%LTRANS_NIR = myltransnir + NL%LREFLECT_VIS = mylreflectvis + NL%LREFLECT_NIR = mylreflectnir + NL%ORIENT_TREE = myorienttree + NL%ORIENT_GRASS = myorientgrass + NL%CLUMP_TREE = myclumptree + NL%CLUMP_GRASS = myclumpgrass !---------------------------------------------------------------------------------------! @@ -740,49 +819,107 @@ $ED_NL !---------------------------------------------------------------------------------------! ! H2O_PLANT_LIM -- this determines whether plant photosynthesis can be limited by ! - ! soil moisture, the FSW term: ! - ! 0. No soil moisture limitation, FSW = 1 ! - ! 1. Original ED-1.0/ED-2.0 method, where ! - ! FSW = Supply / (Demand + Supply) ! - ! 2. Alternative and experimental method based on CLM. It checks ! - ! the water potential only, with all contribution of transpiration ! - ! accounted by gsw. It also ignores root biomass. ! + ! soil moisture, the FSW, defined as FSW = Supply / (Demand + Supply). ! + ! ! + ! Demand is always the transpiration rates in case soil moisture is ! + ! not limiting (the psi_0 term times LAI). The supply is determined ! + ! by Kw * nplant * Broot * Available_Water, and the definition of ! + ! available water changes depending on H2O_PLANT_LIM: ! + ! 0. Force FSW = 1 (effectively available water is infinity). ! + ! 1. Available water is the total soil water above wilting point, ! + ! integrated across all layers within the rooting zone. ! + ! 2. Available water is the soil water at field capacity minus ! + ! wilting point, scaled by the so-called wilting factor: ! + ! (psi(k) - (H - z(k)) - psi_wp) / (psi_fc - psi_wp) ! + ! where psi is the matric potentital at layer k, z is the layer ! + ! depth, H it the crown height and psi_fc and psi_wp are the ! + ! matric potentials at wilting point and field capacity. This is ! !---------------------------------------------------------------------------------------! - NL%H2O_PLANT_LIM = mywlimit + NL%H2O_PLANT_LIM = myh2olimit !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! These following variables are factors that multiply some of the ED-2.1 default ! - ! parameters. Setting them to 1.0 will make them the default. These are applied ! - ! mostly to tropical C3 plants. ! + ! The following variables are factors that control photosynthesis and respiration. ! + ! Notice that some of them are relative values whereas others are absolute. ! ! ! - ! VMFACT -- Factor multiplying the default Vm0 ! - ! MFACT -- Factor multiplying the stomatal slope M. ! - ! KFACT -- Factor multiplying the water conductance Kw. This is used only when ! - ! H2O_PLANT_LIM = 1. ! - ! GAMFACT -- Factor multiplying the dark respiration factor (gamma) ! - ! D0FACT -- Factor multiplying the transpiration control in gsw (D0) ! - ! ALPHAFACT -- Factor for changing the quantum yield of C3 plants. This is only ! - ! applied when QUANTUM_EFFICIENCY_T = 0. ! - ! THETACRIT -- Leaf drought phenology threshold. This is the relative soil moisture ! - ! above the wilting point below which the drought-deciduous plants will ! - ! start shedding their leaves ! - ! LWFACT -- Factor for changing the leaf width (w) ! - ! THIOFF -- Offset to be added to the Vm_high_temp ! - ! GGFACT -- factor to multiply the ground to canopy conductance. Default value ! - ! is 1.0. ! - !---------------------------------------------------------------------------------------! - NL%VMFACT = myvmfact - NL%MFACT = mymfact - NL%KFACT = mykfact - NL%GAMFACT = mygamfact - NL%D0FACT = myd0fact - NL%ALPHAFACT = myalphafact + ! VMFACT_C3 -- Factor multiplying the default Vm0 for C3 plants (1.0 = default). ! + ! VMFACT_C4 -- Factor multiplying the default Vm0 for C4 plants (1.0 = default). ! + ! MPHOTO_TRC3 -- Stomatal slope (M) for tropical C3 plants ! + ! MPHOTO_TEC3 -- Stomatal slope (M) for conifers and temperate C3 plants ! + ! MPHOTO_C4 -- Stomatal slope (M) for C4 plants. ! + ! BPHOTO_BLC3 -- cuticular conductance for broadleaf C3 plants [umol/m2/s] ! + ! BPHOTO_NLC3 -- cuticular conductance for needleleaf C3 plants [umol/m2/s] ! + ! BPHOTO_C4 -- cuticular conductance for C4 plants [umol/m2/s] ! + ! KW_GRASS -- Water conductance for trees, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! KW_TREE -- Water conductance for grasses, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! GAMMA_C3 -- The dark respiration factor (gamma) for C3 plants. Subtropical ! + ! conifers will be scaled by GAMMA_C3 * 0.028 / 0.02 ! + ! GAMMA_C4 -- The dark respiration factor (gamma) for C4 plants. ! + ! D0_GRASS -- The transpiration control in gsw (D0) for ALL grasses. ! + ! D0_TREE -- The transpiration control in gsw (D0) for ALL trees. ! + ! ALPHA_C3 -- Quantum yield of ALL C3 plants. This is only applied when ! + ! QUANTUM_EFFICIENCY_T = 0. ! + ! ALPHA_C4 -- Quantum yield of C4 plants. This is always applied. ! + ! KLOWCO2IN -- The coefficient that controls the PEP carboxylase limited rate of ! + ! carboxylation for C4 plants. ! + ! RRFFACT -- Factor multiplying the root respiration factor for ALL PFTs. ! + ! (1.0 = default). ! + ! GROWTHRESP -- The actual growth respiration factor (C3/C4 tropical PFTs only). ! + ! (1.0 = default). ! + ! LWIDTH_GRASS -- Leaf width for grasses, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). ! + ! LWIDTH_BLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to broadleaf trees ! + ! only. ! + ! LWIDTH_NLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to conifer trees ! + ! only. ! + ! Q10_C3 -- Q10 factor for C3 plants (used only if IPHYSIOL is set to 2 or 3). ! + ! Q10_C4 -- Q10 factor for C4 plants (used only if IPHYSIOL is set to 2 or 3). ! + !---------------------------------------------------------------------------------------! + NL%VMFACT_C3 = myvmfactc3 + NL%VMFACT_C4 = myvmfactc4 + NL%MPHOTO_TRC3 = mymphototrc3 + NL%MPHOTO_TEC3 = mymphototec3 + NL%MPHOTO_C4 = mymphotoc4 + NL%BPHOTO_BLC3 = mybphotoblc3 + NL%BPHOTO_NLC3 = mybphotonlc3 + NL%BPHOTO_C4 = mybphotoc4 + NL%KW_GRASS = mykwgrass + NL%KW_TREE = mykwtree + NL%GAMMA_C3 = mygammac3 + NL%GAMMA_C4 = mygammac4 + NL%D0_GRASS = myd0grass + NL%D0_TREE = myd0tree + NL%ALPHA_C3 = myalphac3 + NL%ALPHA_C4 = myalphac4 + NL%KLOWCO2IN = myklowco2 + NL%RRFFACT = myrrffact + NL%GROWTHRESP = mygrowthresp + NL%LWIDTH_GRASS = mylwidthgrass + NL%LWIDTH_BLTREE = mylwidthbltree + NL%LWIDTH_NLTREE = mylwidthnltree + NL%Q10_C3 = myq10c3 + NL%Q10_C4 = myq10c4 + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! THETACRIT -- Leaf drought phenology threshold. The sign matters here: ! + ! >= 0. -- This is the relative soil moisture above the wilting point ! + ! below which the drought-deciduous plants will start shedding ! + ! their leaves ! + ! < 0. -- This is the soil potential in MPa below which the drought- ! + ! -deciduous plants will start shedding their leaves. The wilt- ! + ! ing point is by definition -1.5MPa, so make sure that the value ! + ! is above -1.5. ! + !---------------------------------------------------------------------------------------! NL%THETACRIT = mythcrit - NL%LWFACT = mylwfact - NL%THIOFF = mythioff - NL%GGFACT = myggfact !---------------------------------------------------------------------------------------! @@ -793,7 +930,7 @@ $ED_NL ! 1. Quantum efficiency varies with temperature following ! ! Ehleringer (1978) polynomial fit. ! !---------------------------------------------------------------------------------------! - NL%QUANTUM_EFFICIENCY_T = myquantum + NL%QUANTUM_EFFICIENCY_T = 0 !---------------------------------------------------------------------------------------! @@ -830,9 +967,13 @@ $ED_NL ! often will never allow fires. ! ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! - ! SM_FIRE -- Threshold to define the relative soil moisture above dry air of the ! - ! top 75cm that will trigger fires. Used only when include_fire is ! - ! set to 2. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2. The sign here matters. ! + ! >= 0. - Minimum relative soil moisture above dry air of the top 75cm ! + ! that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top 75 cm ! + ! that will prevent fires to happen. The dry air soil ! + ! potential is defined as -3.1 MPa, so make sure SM_FIRE is ! + ! greater than this value. ! !---------------------------------------------------------------------------------------! NL%INCLUDE_FIRE = 2 NL%SM_FIRE = mysmfire @@ -863,43 +1004,29 @@ $ED_NL ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! ! the drag and sheltering within the canopy. ! + ! 4. Same as 0, but if finds the ground conductance following CLM ! + ! technical note (equations 5.98-5.100). ! !---------------------------------------------------------------------------------------! NL%ICANTURB = myicanturb !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! I_BLYR_CONDCT -- This flag controls the boundary layer conductance. This is for ! - ! tests only and should be removed soon, so unless you know what you ! - ! are doing, leave it as zero. ! - ! 0. The Nusselt number for forced convection is estimated using the ! - ! average winds, with no corrections ! - ! 1. The actual Nusselt number for forced convection is multiplied by ! - ! 2.5 as the Reynolds number gets close or greater than 10,000. ! - ! 2. The actual Nusselt number for forced convection is multiplied by ! - ! 10. as the Reynolds number gets close or greater than 10,000. ! - !---------------------------------------------------------------------------------------! - NL%I_BLYR_CONDCT = myblyrcnd - !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! ISFCLYRM -- Similarity theory model. The model that computes u*, T*, etc... ! - ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to estimate ! - ! the flux based on the bulk Richardson number ! - ! 2. Oncley and Dudhia (1995) model, based on MM5. It uses an empirical relation ! - ! between bulk Richardson number and z/L, then computes the flux functions. ! - ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it finds z/L using a ! - ! root-finding method, and it has a different parametrisation for stable layers ! - ! that works better during night time. This is the default and recommended ! - ! method. ! - ! 4. The parametrisation of Beljaars and Holtslag, but using z/L estimation as in ! - ! Oncley and Dudhia. ! - ! 5. The parametrisation of Oncley and Dudhia, but using z/L estimation as in ! - ! Beljaars and Holtslag. ! + ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! + ! estimate the flux based on the bulk Richardson number ! + ! ! + ! All models below use an interative method to find z/L, and the only change ! + ! is the functional form of the psi functions. ! + ! ! + ! 2. Oncley and Dudhia (1995) model, based on MM5. ! + ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it uses an alternative ! + ! method for the stable case that mixes more than the OD95. ! + ! 4. CLM (2004). Similar to 2 and 3, but they have special functions to deal with ! + ! very stable and very stable cases. ! !---------------------------------------------------------------------------------------! - NL%ISFCLYRM = myisfclyrm + NL%ISFCLYRM = mysfclyrm !---------------------------------------------------------------------------------------! @@ -913,10 +1040,11 @@ $ED_NL ! 2. Test # 2 of Mahfouf and Noilhan (1991) ! ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! ! 4. Test # 4 of Mahfouf and Noilhan (1991) ! + ! 5. Combination of test #1 (alpha) and test #2 (soil resistance). ! ! In all cases the beta term is modified so it approaches zero as soil moisture goes ! ! to dry air soil. ! !---------------------------------------------------------------------------------------! - NL%IED_GRNDVAP = mygrndvap + NL%IED_GRNDVAP = mygndvap !---------------------------------------------------------------------------------------! @@ -931,19 +1059,13 @@ $ED_NL ! Ignored when ISTAR = 1 ! ! TPRANDTL -- Turbulent Prandtl number ! ! Ignored when ISTAR = 1 ! - ! VH2VR -- Ratio between vegetation roughness and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! - ! VH2DH -- Ratio between 0-plane displacement height and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! ! RIBMAX -- maximum bulk Richardson number. ! ! LEAF_MAXWHC -- Maximum water that can be intercepted by leaves, in kg/m2leaf. ! !---------------------------------------------------------------------------------------! - NL%GAMM = 13. - NL%GAMH = 13. - NL%TPRANDTL = 0.74 - NL%VH2VR = 0.13 - NL%VH2DH = 0.63 - NL%RIBMAX = 1.00 + NL%GAMM = mygamm + NL%GAMH = mygamh + NL%TPRANDTL = mytprandtl + NL%RIBMAX = myribmax NL%LEAF_MAXWHC = 0.11 !---------------------------------------------------------------------------------------! @@ -963,7 +1085,7 @@ $ED_NL ! 2. Soil conductivity decreases with depth even for constant soil moisture ! ! , otherwise it is the same as 1. ! !---------------------------------------------------------------------------------------! - NL%IPERCOL = mypercol + NL%IPERCOL = 1 !---------------------------------------------------------------------------------------! @@ -1031,7 +1153,7 @@ $ED_NL ! MIN_SITE_AREA -- This is the minimum fraction area of a given soil type that allows a ! ! site to be created (ignored if IED_INIT_MODE is set to 3). ! !---------------------------------------------------------------------------------------! - NL%MAXSITE = 6 + NL%MAXSITE = 1 NL%MAXPATCH = 20 NL%MAXCOHORT = 80 NL%MIN_SITE_AREA = 0.005 @@ -1063,7 +1185,7 @@ $ED_NL ! average patch age is still 1/TREEFALL_DISTURBANCE_RATE ! !---------------------------------------------------------------------------------------! NL%TREEFALL_DISTURBANCE_RATE = 0.014 - NL%TIME2CANOPY = myagefall + NL%TIME2CANOPY = 0. !---------------------------------------------------------------------------------------! @@ -1074,24 +1196,23 @@ $ED_NL ! -folding lifetime" of the TSW in seconds due to runoff. If you don't ! ! want runoff to happen, set this to 0. ! !---------------------------------------------------------------------------------------! - NL%RUNOFF_TIME = myrunoff - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! BETAPOWER -- power to apply in the ground evaporation model (see IED_GRNDVAP ! - ! references). Default value is 1.0. ! - !---------------------------------------------------------------------------------------! - NL%BETAPOWER = mybpower + NL%RUNOFF_TIME = 1800. !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! USTMIN -- minimum friction velocity, u*, in m/s. ! + ! The following variables control the minimum values of various velocities in the ! + ! canopy. This is needed to avoid the air to be extremely still, or to avoid singular- ! + ! ities. When defining the values, keep in mind that UBMIN >= UGBMIN >= USTMIN. ! + ! ! + ! UBMIN -- minimum wind speed at the top of the canopy air space [ m/s] ! + ! UGBMIN -- minimum wind speed at the leaf level [ m/s] ! + ! USTMIN -- minimum friction velocity, u*, in m/s. [ m/s] ! !---------------------------------------------------------------------------------------! + NL%UBMIN = myubmin + NL%UGBMIN = myugbmin NL%USTMIN = myustmin !---------------------------------------------------------------------------------------! @@ -1141,7 +1262,10 @@ $ED_NL ! the model is run. ! ! IMETCYC1 -- First year with meteorological information ! ! IMETCYCF -- Last year with meteorological information ! - ! IMETAVG -- How the input radiation was originally averaged. ! + ! IMETAVG -- How the input radiation was originally averaged. You must tell this ! + ! because ED-2.1 can make a interpolation accounting for the cosine of ! + ! zenith angle. ! + ! -1. I don't know, use linear interpolation. ! ! 0. No average, the values are instantaneous ! ! 1. Averages ending at the reference time ! ! 2. Averages beginning at the reference time ! @@ -1206,7 +1330,7 @@ $ED_NL !---------------------------------------------------------------------------------------! ! IOPTINPT -- Optimization configuration. (Currently not used) ! !---------------------------------------------------------------------------------------! - NL%IOPTINPT = '' + NL%IOPTINPT = '' !---------------------------------------------------------------------------------------! $END !==========================================================================================! diff --git a/ED/Template/Template/callserial.sh b/ED/Template/Template/callserial.sh index b520a42b0..96ff11710 100755 --- a/ED/Template/Template/callserial.sh +++ b/ED/Template/Template/callserial.sh @@ -1,16 +1,23 @@ #!/bin/sh -#------------------------------------- CUSTOMIZE HERE -------------------------------------# +#---------------------------------- Change settings here ----------------------------------# root='thisroot' +moi='myname' here=${root}/'thispoly' # Directory to start the run -exe=${here}'/ed' # Executable +exe=${here}'/myexec' # Executable logfile=${here}'/serial_out.out' # Log file of the executable run errfile=${here}'/serial_out.err' # Executable error file currloc=`pwd` # Current location + +mddir='met_driver' +datasrc='mypackdata' +datadest='/scratch/mlongo' + +datasize=39000000 #------------------------------------------------------------------------------------------# -#----- Erasing old logfiles and joblogs ---------------------------------------------------# +#----- Erase old logfiles and joblogs -----------------------------------------------------# if [ -s ${logfile} ] then rm -fv ${logfile} @@ -20,8 +27,244 @@ if [ -s ${errfile} ] then rm -fv ${errfile} fi +#------------------------------------------------------------------------------------------# + + +#----- Find the waiting time before the first check. If none was given, make up one... ---# +if [ 'x'${1} == 'x999999' ] +then + zzz=0 + copy='n' + +elif [ 'x'${1} == 'x' ] +then + zzz=`date +%S` + if [ ${zzz} -lt 10 ] + then + zzz=`echo ${zzz} | awk '{print substr($1,2,1)}'` + fi + let zzz=${zzz}%15 + let zzz=${zzz}+2 + copy='y' +else + zzz=${1} + copy='y' +fi +#------------------------------------------------------------------------------------------# + + + +#----- These are the names of the lock and unlock files. ----------------------------------# +dontcopy=${datadest}/dontcopy_072.txt +diskfull=${datadest}/fulldisk_072.txt +unlocked=${datadest}/unlocked_072.txt +#------------------------------------------------------------------------------------------# + + + +#----- Make the code more "personal", so it is easy to spot where the runs are running. ---# +thismach=`hostname -s` +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Decide whether to copy files or not. # +#------------------------------------------------------------------------------------------# +if [ ${copy} == 'n' ] +then + success='true' +else + success='false' + + #----- Take a break before checking, so we avoid several jobs going simultaneously. ----# + blah='Waiting '${zzz}' seconds before checking for the first time...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + sleep ${zzz} + #---------------------------------------------------------------------------------------# + + if [ ! -s ${dontcopy} ] && [ ! -s ${diskfull} ] + then + #----- Don't remove the directory if it is there... ---------------------------------# + if [ ! -s ${datadest} ] + then + mkdir ${datadest} + fi + echo 'Copying files to node '${thismach}'... ' > ${dontcopy} + + blah=' + Files are not all there, cleaning path before we copy again.' + blah=${blah}' Please hold!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + if [ -s ${datadest}/${mddir} ] + then + blah=' - Deleting old stuff from the meterological forcing driver...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + /bin/rm -fr ${datadest}/${mddir} 1>> ${logfile} 2>> ${errfile} + fi + + #----- First thing we do is to check whether this disk is full. ---------------------# + blah=' - Checking whether there is enough disk space...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + ans=`df /scratch` + nwords=`echo ${ans} | wc -w` + let avail=${nwords}-2 + space=`echo ${ans} | awk '{print $'${avail}'}'` + + if [ ${space} -gt ${datasize} ] + then + + #----- Copy the meteorological forcing. ------------------------------------------# + blah=' - Copying the meterological forcing driver...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + cp -rfv ${datasrc}/${mddir} ${datadest} 1>> ${logfile} 2>> ${errfile} -#----- Submitting the jobs to the nodes ---------------------------------------------------# -cd ${here} -${exe} -f ${here}/ED2IN 1> ${logfile} 2> ${errfile} -cd ${currloc} + + #----- Copy finished. Create a file to unlock this node. ------------------------# + echo 'All the data needed are here!' > ${unlocked} + + blah=' + The files were successfully copied to '${thismach}'.' + blah=${blah}' The run will start soon!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + success='true' + else + blah=' - Sorry, but there is not enough disk space here...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + echo 'The available disk size is not enough to run here...' > ${diskfull} + /bin/rm -f ${dontcopy} + fi + + elif [ -s ${diskfull} ] + then + last=`date +%s -r ${diskfull}` + now=`date +%s` + let howlong=${now}-${last} + + if [ ${howlong} -gt 43200 ] + then + + echo 'Copying files to node '${thismach}'... ' > ${dontcopy} + + blah=' + Files are not all here, cleaning the directory before we copy again.' + blah=${blah}' Please hold!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + if [ -s ${datadest}/${mddir} ] + then + blah=' - Deleting old stuff from the meterological forcing driver...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + /bin/rm -fr ${datadest}/${mddir} 1>> ${logfile} 2>> ${errfile} + fi + + #----- First thing we do is to check whether this disk is full. ------------------------# + blah=' - Checking whether there is enough disk space...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + ans=`df /scratch` + nwords=`echo ${ans} | wc -w` + let avail=${nwords}-2 + space=`echo ${ans} | awk '{print $'${avail}'}'` + + if [ ${space} -gt ${datasize} ] + then + + #----- Copy the meteorological forcing. ---------------------------------------------# + blah=' - Copying the meterological forcing driver...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + cp -rfv ${datasrc}/${mddir} ${datadest} 1>> ${logfile} 2>> ${errfile} + + + #----- Copy finished. Create a file to unlock this node. ---------------------------# + echo 'All the data needed are here!' > ${unlocked} + + blah=' + The files were successfully copied to '${thismach}'.' + blah=${blah}' The run will start soon!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + success='true' + else + blah=' - Sorry, but there is still not enough disk space here...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + echo 'The available disk size is not enough to run here...' > ${diskfull} + /bin/rm -f ${dontcopy} + fi + fi + + elif [ ! -s ${unlocked} ] + then + + pp=-1 + while [ ! -s ${unlocked} ] && [ ! -s ${diskfull} ] + do + let pp=${pp}+1 + + #----- Variety is the key when it comes to automated messages... --------------------# + let isfour=${pp}%4 + let iseight=${pp}%8 + let istwelve=${pp}%12 + let issixty=${pp}%60 + + #----- Print some messages to entertain the bored user. -----------------------------# + if [ ${pp} -eq 0 ] + then + blah=' ~ Another job is copying the files to here ('${thismach}').' + blah=${blah}' Please hold!' + elif [ ${issixty} -eq 0 ] + then + blah=" + Patience is a virtue, isn't it?" + elif [ ${istwelve} -eq 0 ] + then + blah=' + Your simulation is very important to us. Please hold!' + elif [ ${iseight} -eq 0 ] + then + blah=' + Thank you for choosing '${thismach}'. Please hold!' + elif [ ${isfour} -eq 0 ] + then + blah=' + All our representatives are busy, but we will be with you shortly.' + blah=${blah}' Please hold!' + else + blah=' - Input data are not ready yet... ('${pp}' minutes waiting so far)' + fi + + echo ${blah} 1>> ${logfile} 2>> ${errfile} + + sleep 60 + done + + if [ -s ${unlocked} ] + then + blah=' + Thank you for waiting. The files are here and the run will start soon!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + success='true' + else + blah=' + Sorry... There was not enough disk space here.' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + fi + #------------------------------------------------------------------------------------# + else + success='true' + fi + #---------------------------------------------------------------------------------------# +fi +#------------------------------------------------------------------------------------------# + + + +#----- Start the run. ---------------------------------------------------------------------# +if [ ${success} == 'true' ] +then + blah='Waiting '${zzz}' seconds before starting the run...' + echo ${blah} 1>> ${logfile} 2>> ${errfile} + sleep ${zzz} + + #----- The time we were waiting. -------------------------------------------------------# + cd ${here} + ${exe} -f ${here}/ED2IN 1>> ${logfile} 2>> ${errfile} + cd ${currloc} +else + blah='Execution will not happen this time... Good luck next time!!!' + echo ${blah} 1>> ${logfile} 2>> ${errfile} +fi +#------------------------------------------------------------------------------------------# diff --git a/ED/Template/Template/ed b/ED/Template/Template/ed deleted file mode 120000 index 114b26ed3..000000000 --- a/ED/Template/Template/ed +++ /dev/null @@ -1 +0,0 @@ -../executable/ed_2.1-opt \ No newline at end of file diff --git a/ED/Template/Template/plot_daily.r b/ED/Template/Template/plot_daily.r index 8e13310e8..a72ac512f 100644 --- a/ED/Template/Template/plot_daily.r +++ b/ED/Template/Template/plot_daily.r @@ -206,7 +206,7 @@ names(hovdi) = nameshovdi #----- Retrieve the information about the regional run. -----------------------------------# regio = locations(where=region,here=here,yearbeg=yearbeg,yearend=yearend, - monthbeg=monthbeg,daybeg=daybeg,monthly=FALSE,fullonly=fullonly) + monthbeg=monthbeg,daybeg=daybeg,filetype="D",fullonly=fullonly) inpref = regio$pathin rstpref = regio$pathrst yeara = regio$yeara diff --git a/ED/Template/Template/plot_fast.r b/ED/Template/Template/plot_fast.r index b6807a0fc..0e24236a0 100644 --- a/ED/Template/Template/plot_fast.r +++ b/ED/Template/Template/plot_fast.r @@ -241,7 +241,7 @@ names(hovdi) = nameshovdi #----- Retrieve the information about the regional run. -----------------------------------# regio = locations(where=region,here=here,yearbeg=yearbeg,yearend=yearend, - monthbeg=monthbeg,daybeg=daybeg,monthly=FALSE,fullonly=fullonly) + monthbeg=monthbeg,daybeg=daybeg,filetype="D",fullonly=fullonly) inpref = regio$pathin rstpref = regio$pathrst yeara = regio$yeara diff --git a/ED/Template/Template/plot_monthly.r b/ED/Template/Template/plot_monthly.r index 565e826b2..b9cfe489d 100644 --- a/ED/Template/Template/plot_monthly.r +++ b/ED/Template/Template/plot_monthly.r @@ -1,13 +1,16 @@ #----- Here is the user-defined variable section. -----------------------------------------# -here = "thispath" # Current directory. +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are srcdir = "/n/Moorcroft_Lab/Users/mlongo/util/Rsc" # Source directory. outroot = "thisoutroot" monthbeg = thismontha yearbeg = thisyeara # First year to consider yearend = thisyearz # Maximum year to consider myplaces = c("thispoly") -sasmonth = c(2,5,8,11) -outform = "png" # Formats for output file. Supported formats are: +sasmonth.short = c(2,5,8,11) +sasmonth.long = 5 +nyears.long = 25 +outform = "png" # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing @@ -30,9 +33,9 @@ ncolshov = 200 # Target number of colours for Hovmoller diagram hovgrid = TRUE # Should I include a grid on the Hovmoller plots? legwhere = "topleft" # Where should I place the legend? -inset = 0.05 # inset distance between legend and edge of plot region. +inset = 0.01 # inset distance between legend and edge of plot region. legbg = "white" # Legend background colour. -scalleg = 0.32 +scalleg = 0.20 cex.main = 0.8 # Scale coefficient for the title theta = 315. # Azimuth for perspective projection @@ -45,660 +48,16 @@ cexmin = 0.5 # Minimum "head" size of the lollipop cexmax = 3.0 # Maximum "head" size of the lollipop ylnudge = 0.05 # Nudging factor for ylimit -ptype = "l" # Type of plot -ptyped = "p" # Type of plot -ptypeb = "o" # Type of plot - -tserdist = TRUE # Time series of disturbance rates - -#------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -# List of possible plots. In case you don't want some of them, simply switch plt to F. # -#------------------------------------------------------------------------------------------# -#----- Time series per PFT. ---------------------------------------------------------------# -ntspft = 17 -tsplot01 = list(vnam="agbpft" ,desc="Above ground biomass" ,unit="kgC/m2" ,plt=T) -tsplot02 = list(vnam="laipft" ,desc="Leaf area index" ,unit="m2/m2" ,plt=T) -tsplot03 = list(vnam="waipft" ,desc="Wood area index" ,unit="m2/m2" ,plt=T) -tsplot04 = list(vnam="taipft" ,desc="Total area index" ,unit="m2/m2" ,plt=T) -tsplot05 = list(vnam="bseedspft" ,desc="Seed biomass" ,unit="kgC/m2" ,plt=T) -tsplot06 = list(vnam="gpppft" ,desc="Gross primary productivity",unit="kgC/m2/yr" ,plt=T) -tsplot07 = list(vnam="npppft" ,desc="Net primary productivity" ,unit="kgC/m2/yr" ,plt=T) -tsplot08 = list(vnam="mcopft" ,desc="Maintenance costs" ,unit="kgC/m2/yr" ,plt=T) -tsplot09 = list(vnam="cbapft" ,desc="Carbon balance" ,unit="kgC/m2/yr" ,plt=T) -tsplot10 = list(vnam="ldroppft" ,desc="Leaf drop" ,unit="kgC/m2/yr" ,plt=T) -tsplot11 = list(vnam="balivepft" ,desc="Biomass of active tissues" ,unit="kgC/m2" ,plt=T) -tsplot12 = list(vnam="bdeadpft" ,desc="Structural biomass" ,unit="kgC/m2" ,plt=T) -tsplot13 = list(vnam="bleafpft" ,desc="Leaf biomass" ,unit="kgC/m2" ,plt=T) -tsplot14 = list(vnam="brootpft" ,desc="Root biomass" ,unit="kgC/m2" ,plt=T) -tsplot15 = list(vnam="bswoodpft" ,desc="Sapwood biomass" ,unit="kgC/m2" ,plt=T) -tsplot16 = list(vnam="bstorepft" ,desc="Storage biomass" ,unit="kgC/m2" ,plt=T) -tsplot17 = list(vnam="basareapft",desc="Basal area" ,unit="m2/m2" ,plt=T) -#----- Time series per PFT. ---------------------------------------------------------------# -ntslu = 6 -lsplot01 = list(vnam="agblu" ,desc="Above ground biomass" ,unit="kgC/m2" ,plt=F) -lsplot02 = list(vnam="lailu" ,desc="Leaf area index" ,unit="m2/m2" ,plt=F) -lsplot03 = list(vnam="gpplu" ,desc="Gross primary productivity",unit="kgC/m2/yr" ,plt=F) -lsplot04 = list(vnam="npplu" ,desc="Net primary productivity" ,unit="kgC/m2/yr" ,plt=F) -lsplot05 = list(vnam="arealu" ,desc="Fraction of area" ,unit="" ,plt=F) -lsplot06 = list(vnam="basarealu" ,desc="Basal area" ,unit="m2/m2" ,plt=F) -#----- Size (DBH) and age structure of cohort level variables. ----------------------------# -npsas = 30 -psas01 = list(vnam="lightco" ,desc="Light level" ,unit="--" , plt=T) -psas02 = list(vnam="beamextco",desc="Downward direct light" ,unit="--" , plt=T) -psas03 = list(vnam="diffextco",desc="Downward diffuse light" ,unit="--" , plt=T) -psas04 = list(vnam="parlco" ,desc="Absorbed PAR " ,unit="W/m2" , plt=T) -psas05 = list(vnam="lambdaco" ,desc="Light extinction" ,unit="m2/m2" , plt=T) -psas06 = list(vnam="gppco" ,desc="Gross primary productivity",unit="kgC/plant/yr", plt=T) -psas07 = list(vnam="respco" ,desc="Total plant respiration" ,unit="kgC/plant/yr", plt=T) -psas08 = list(vnam="nppco" ,desc="Net primary productivity" ,unit="kgC/plant/yr", plt=T) -psas09 = list(vnam="cbrbarco" ,desc="Relative carbon balance" ,unit="--" , plt=T) -psas10 = list(vnam="cbalco" ,desc="Carbon balance" ,unit="kgC/plant/yr", plt=T) -psas11 = list(vnam="mcostco" ,desc="Maintenance costs" ,unit="kgC/plant/yr", plt=T) -psas12 = list(vnam="ncbmortco",desc="Mortality due to Neg. CB" ,unit="1/yr" , plt=T) -psas13 = list(vnam="agbco" ,desc="Above-ground biomass" ,unit="kgC/plant" , plt=T) -psas14 = list(vnam="fsoco" ,desc="Fraction of open stomata" ,unit="--" , plt=T) -psas15 = list(vnam="nplantco" ,desc="Plant density" ,unit="plant/m2" , plt=T) -psas16 = list(vnam="laico" ,desc="Leaf area index" ,unit="m2/m2" , plt=T) -psas17 = list(vnam="waico" ,desc="Wood area index" ,unit="m2/m2" , plt=T) -psas18 = list(vnam="taico" ,desc="Total area index" ,unit="m2/m2" , plt=T) -psas19 = list(vnam="demandco" ,desc="Water demand" ,unit="kg/m2_l/day" , plt=T) -psas20 = list(vnam="supplyco" ,desc="Water supply" ,unit="kg/m2_l/day" , plt=T) -psas21 = list(vnam="heightco" ,desc="Cohort height" ,unit="m" , plt=T) -psas22 = list(vnam="gpplco" ,desc="Gross primary productivity",unit="kgC/m2lf/yr" , plt=T) -psas23 = list(vnam="baco" ,desc="Basal area" ,unit="m2" , plt=T) -psas24 = list(vnam="ldropco" ,desc="Leaf drop" ,unit="kgC/plant/yr", plt=T) -psas25 = list(vnam="baliveco" ,desc="Biomass of active tissues" ,unit="kgC/plant" , plt=T) -psas26 = list(vnam="bdeadco" ,desc="Structural biomass" ,unit="kgC/plant" , plt=T) -psas27 = list(vnam="bleafco" ,desc="Leaf biomass" ,unit="kgC/plant" , plt=T) -psas28 = list(vnam="brootco" ,desc="Root biomass" ,unit="kgC/plant" , plt=T) -psas29 = list(vnam="bswoodco" ,desc="Sapwood biomass" ,unit="kgC/plant" , plt=T) -psas30 = list(vnam="bstoreco" ,desc="Storage biomass" ,unit="kgC/plant" , plt=T) -#----- Time series of some variables per PFT, with size or age distribution. --------------# -nfcpft = 16 -fcpft01 = list(vnam="agbpftdbh",desc="Above-ground biomass" ,unit="kgC/m2" - ,cls="dbh",csch="iatlas",plt=F) -fcpft02 = list(vnam="laipftdbh",desc="Leaf area index" ,unit="m2/m2" - ,cls="dbh",csch="iatlas",plt=F) -fcpft03 = list(vnam="waipftdbh",desc="Wood area index" ,unit="m2/m2" - ,cls="dbh",csch="iatlas",plt=F) -fcpft04 = list(vnam="taipftdbh",desc="Total area index" ,unit="m2/m2" - ,cls="dbh",csch="iatlas",plt=F) -fcpft05 = list(vnam="gpppftdbh",desc="Gross primary productivity",unit="kgC/m2/yr" - ,cls="dbh",csch="muitas",plt=F) -fcpft06 = list(vnam="npppftdbh",desc="Net primary productivity" ,unit="kgC/m2/yr" - ,cls="dbh",csch="muitas",plt=F) -fcpft07 = list(vnam="mcopftdbh",desc="Maintenance costs" ,unit="kgC/m2/yr" - ,cls="dbh",csch="muitas",plt=F) -fcpft08 = list(vnam="cbapftdbh",desc="Carbon balance" ,unit="kgC/m2/yr" - ,cls="dbh",csch="muitas",plt=F) -fcpft09 = list(vnam="agbpftage",desc="Above-ground biomass" ,unit="kgC/m2" - ,cls="age",csch="iatlas",plt=F) -fcpft10 = list(vnam="laipftage",desc="Leaf area index" ,unit="m2/m2" - ,cls="age",csch="iatlas",plt=F) -fcpft11 = list(vnam="waipftage",desc="Wood area index" ,unit="m2/m2" - ,cls="age",csch="iatlas",plt=F) -fcpft12 = list(vnam="taipftage",desc="Total area index" ,unit="m2/m2" - ,cls="age",csch="iatlas",plt=F) -fcpft13 = list(vnam="gpppftage",desc="Gross primary productivity",unit="kgC/m2/yr" - ,cls="age",csch="muitas",plt=F) -fcpft14 = list(vnam="npppftage",desc="Net primary productivity" ,unit="kgC/m2/yr" - ,cls="age",csch="muitas",plt=F) -fcpft15 = list(vnam="mcopftage",desc="Maintenance costs" ,unit="kgC/m2/yr" - ,cls="age",csch="muitas",plt=F) -fcpft16 = list(vnam="cbapftage",desc="Carbon balance" ,unit="kgC/m2/yr" - ,cls="age",csch="muitas",plt=F) -#----- Box plots --------------------------------------------------------------------------# -nbox = 24 -bplot01 = list(vnam="gpp" ,desc="Gross Primary productivity" ,unit="kgC/m2/yr" - ,plt=T) -bplot02 = list(vnam="plresp" ,desc="Plant respiration" ,unit="kgC/m2/yr" - ,plt=T) -bplot03 = list(vnam="hetresp" ,desc="Heterotrophic respiration" ,unit="kgC/m2/yr" - ,plt=T) -bplot04 = list(vnam="nep" ,desc="Net ecosystem production" ,unit="kgC/m2/yr" - ,plt=T) -bplot05 = list(vnam="sens" ,desc="Sensible heat flux" ,unit="W/m2" - ,plt=T) -bplot06 = list(vnam="evap" ,desc="Evaporation " ,unit="kg/m2/day" - ,plt=T) -bplot07 = list(vnam="transp" ,desc="Transpiration" ,unit="kg/m2/day" - ,plt=T) -bplot08 = list(vnam="atm.temp" ,desc="Atmospheric temperature" ,unit="degC" - ,plt=T) -bplot09 = list(vnam="atm.shv" ,desc="Atmospheric specific humidity" ,unit="g/kg" - ,plt=T) -bplot10 = list(vnam="atm.co2" ,desc="Atmospheric CO2 mixing ratio" ,unit="umol/mol" - ,plt=T) -bplot11 = list(vnam="can.temp" ,desc="Canopy air temperature" ,unit="degC" - ,plt=T) -bplot12 = list(vnam="can.shv" ,desc="Canopy air specific humidity" ,unit="g/kg" - ,plt=T) -bplot13 = list(vnam="can.co2" ,desc="Canopy air CO2 mixing ratio" ,unit="umol/mol" - ,plt=T) -bplot14 = list(vnam="rain" ,desc="Total monthly precipitation" ,unit="mm" - ,plt=T) -bplot15 = list(vnam="leaf.temp" ,desc="Leaf temperature" ,unit="degC" - ,plt=T) -bplot16 = list(vnam="wood.temp" ,desc="Wood temperature" ,unit="degC" - ,plt=T) -bplot17 = list(vnam="gnd.temp" ,desc="Ground temperature" ,unit="degC" - ,plt=T) -bplot18 = list(vnam="et" ,desc="Evapotranspiration" ,unit="kg/m2/day" - ,plt=T) -bplot19 = list(vnam="fs.open" ,desc="Fraction of open stomata" ,unit="---" - ,plt=T) -bplot20 = list(vnam="rshort" ,desc="Downward Shortwave radiation" ,unit="W/m2" - ,plt=T) -bplot21 = list(vnam="rlong" ,desc="Downward Longwave radiation" ,unit="W/m2" - ,plt=T) -bplot22 = list(vnam="gnd.shv" ,desc="Ground specific humidity" ,unit="g/kg" - ,plt=T) -bplot23 = list(vnam="rshort.beam",desc="Direct incident SW radiation" ,unit="W/m2" - ,plt=T) -bplot24 = list(vnam="rshort.diff",desc="Diffuse incident SW radiation" ,unit="W/m2" - ,plt=T) -#----- Similar to Hovmoller diagrams. -----------------------------------------------------# -nhov = 37 -hovdi01 = list(vnam="gpp" ,desc="Gross Primary productivity" ,unit="kgC/m2/yr" - ,csch="atlas" ,plt=T) -hovdi02 = list(vnam="plresp" ,desc="Plant respiration" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hovdi03 = list(vnam="hetresp" ,desc="Heterotrophic respiration" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hovdi04 = list(vnam="npp" ,desc="Net primary production" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hovdi05 = list(vnam="sens" ,desc="Sensible heat flux" ,unit="W/m2" - ,csch="muitas" ,plt=T) -hovdi06 = list(vnam="evap" ,desc="Evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi07 = list(vnam="transp" ,desc="Transpiration" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi08 = list(vnam="atm.temp" ,desc="Atmospheric temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hovdi09 = list(vnam="atm.shv" ,desc="Atmospheric specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hovdi10 = list(vnam="atm.co2" ,desc="Atmospheric CO2 mixing ratio" ,unit="umol/mol" - ,csch="muitas" ,plt=F) -hovdi11 = list(vnam="can.temp" ,desc="Canopy air temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hovdi12 = list(vnam="can.shv" ,desc="Canopy air specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hovdi13 = list(vnam="can.co2" ,desc="Canopy air CO2 mixing ratio" ,unit="umol/mol" - ,csch="muitas" ,plt=T) -hovdi14 = list(vnam="rain" ,desc="Total monthly precipitation" ,unit="mm" - ,csch="imuitas" ,plt=T) -hovdi15 = list(vnam="leaf.temp" ,desc="Leaf temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hovdi16 = list(vnam="wood.temp" ,desc="Wood temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hovdi17 = list(vnam="gnd.temp" ,desc="Ground temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hovdi18 = list(vnam="gnd.shv" ,desc="Ground specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hovdi19 = list(vnam="workload" ,desc="Workload" ,unit="steps/day" - ,csch="muitas" ,plt=T) -hovdi20 = list(vnam="et" ,desc="Evapotranspiration" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi21 = list(vnam="fs.open" ,desc="Fraction of open stomata" ,unit="---" - ,csch="imuitas" ,plt=T) -hovdi22 = list(vnam="specwork" ,desc="Specific workload" ,unit="steps/patch/day" - ,csch="muitas" ,plt=T) -hovdi23 = list(vnam="wflxgc" ,desc="Ground evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi24 = list(vnam="wflxlc" ,desc="Leaf evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi25 = list(vnam="wflxwc" ,desc="Wood evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hovdi26 = list(vnam="nep" ,desc="Net ecosystem production" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hovdi27 = list(vnam="nee" ,desc="Net ecosystem exchange" ,unit="kgC/m2/yr" - ,csch="imuitas" ,plt=T) -hovdi28 = list(vnam="cba" ,desc="Carbon balance" ,unit="kgC/m2/day" - ,csch="atlas" ,plt=T) -hovdi29 = list(vnam="mco" ,desc="Maintenance costs" ,unit="kgC/m2/yr" - ,csch="iatlas" ,plt=T) -hovdi30 = list(vnam="ldrop" ,desc="Leaf drop" ,unit="kgC/m2/yr" - ,csch="iatlas" ,plt=T) -hovdi31 = list(vnam="rshort" ,desc="Downward shortwave radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hovdi32 = list(vnam="rlong" ,desc="Downward longwave radiation" ,unit="W/m2" - ,csch="cloudy" ,plt=T) -hovdi33 = list(vnam="rshort.gnd" ,desc="Abs. gnd. shortwave radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hovdi34 = list(vnam="rlong.gnd" ,desc="Abs. gnd. longwave radiation" ,unit="W/m2" - ,csch="cloudy" ,plt=T) -hovdi35 = list(vnam="rshort.beam",desc="Direct incident SW radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hovdi36 = list(vnam="rshort.diff",desc="Diffuse incident SW radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hovdi37 = list(vnam="albedo" ,desc="SW albedo" ,unit="---" - ,csch="muitas" ,plt=T) -#----- Time series with several variables in it. ------------------------------------------# -ntser=9 -tser01 = list(vnam = c("gpp","plresp","hetresp","nee") - ,desc = c("GPP","Plant resp.","Het. resp.","NEE") - ,colour = c("forestgreen","chartreuse","sienna","deepskyblue") - ,lwd = c(1.5,1.5,1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "carbflux" - ,theme = "Carbon fluxes" - ,unit = "kgC/m2/yr" - ,legpos = "topleft" - ,plt = TRUE) -tser02 = list(vnam = c("rshort","rlong","latent","sens") - ,desc = c("Down SW","Down LW","Latent","Sensible") - ,colour = c("goldenrod","lawngreen","midnightblue","firebrick") - ,lwd = c(1.5,1.5,1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "eneflux" - ,theme = "Energy fluxes" - ,unit = "W/m2" - ,legpos = "topleft" - ,plt = TRUE) -tser03 = list(vnam = c("wflxgc","et","wflxlc","wflxwc","transp") - ,desc = c("Ground->Canopy","Canopy->Atm","Leaf->Canopy" - ,"Wood->Canopy","Transpiration") - ,colour = c("firebrick","midnightblue","chartreuse" - ,"goldenrod","darkolivegreen") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "h2oflux" - ,theme = "Water fluxes" - ,unit = "kg/m2/day" - ,legpos = "topleft" - ,plt = TRUE) -tser04 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","gnd.temp") - ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Ground") - ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "temperature" - ,theme = "Temperature" - ,unit = "degC" - ,legpos = "topleft" - ,plt = TRUE) -tser05 = list(vnam = c("atm.shv","can.shv","gnd.shv") - ,desc = c("Atmosphere","Canopy air","Ground") - ,colour = c("deepskyblue","gray21","sienna") - ,lwd = c(1.5,1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "h2ovapour" - ,theme = "Water vapour mixing ratio" - ,unit = "g/kg" - ,legpos = "topleft" - ,plt = TRUE) -tser06 = list(vnam = c("atm.co2","can.co2") - ,desc = c("Atmosphere","Canopy air") - ,colour = c("deepskyblue","lawngreen") - ,lwd = c(1.5,1.5) - ,type = ptype - ,plog = "" - ,prefix = "co2" - ,theme = "CO2 mixing ratio" - ,unit = "umol/mol" - ,legpos = "topleft" - ,plt = TRUE) -tser07 = list(vnam = c("rain") - ,desc = c("Precipitation") - ,colour = c("midnightblue") - ,lwd = c(2.5) - ,type = ptype - ,plog = "" - ,prefix = "prec" - ,theme = "Precipitation rate" - ,unit = "mm/hr" - ,legpos = "bottomleft" - ,plt = TRUE) -tser08 = list(vnam = c("npat.global") - ,desc = c("Patch count") - ,colour = c("darkorange3") - ,lwd = c(2.5) - ,type = ptype - ,plog = "" - ,prefix = "npatch" - ,theme = "Total number of patches" - ,unit = "---" - ,legpos = "topleft" - ,plt = TRUE) -tser09 = list(vnam = c("ncoh.global") - ,desc = c("Cohort count") - ,colour = c("limegreen") - ,lwd = c(2.5) - ,type = ptype - ,plog = "" - ,prefix = "ncohort" - ,theme = "Total number of cohorts" - ,unit = "---" - ,legpos = "topleft" - ,plt = TRUE) -#------------------------------------------------------------------------------------------# - - - - -#----- "Climatology of the mean diurnal cycle with several variables in it. ---------------# -nclim=12 -clim01 = list(vnam = c("gpp","plresp","hetresp","nep","nee") - ,desc = c("GPP","Plant resp.","Het. resp.","NEP","NEE") - ,colour = c("chartreuse","goldenrod","sienna","forestgreen","deepskyblue") - ,lwd = c(2.5,2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "carbflux" - ,theme = "Carbon fluxes" - ,unit = "kgC/m2/yr" - ,legpos = "topleft" - ,plt = TRUE) -clim02 = list(vnam = c("rshort","rlong","rlongup","latent","sens") - ,desc = c("Down SW","Down LW","Up LW","Latent","Sensible") - ,colour = c("goldenrod","lawngreen","purple4","midnightblue","firebrick") - ,lwd = c(2.5,2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "eneflux" - ,theme = "Energy fluxes" - ,unit = "W/m2" - ,legpos = "topleft" - ,plt = TRUE) -clim03 = list(vnam = c("wflxgc","et","wflxlc","wflxwc","transp") - ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy" - ,"Wood->Canopy","Transpiration") - ,colour = c("firebrick","midnightblue","chartreuse" - ,"goldenrod","darkolivegreen") - ,lwd = c(2.5,2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "h2oflux" - ,theme = "Water fluxes" - ,unit = "kg/m2/day" - ,legpos = "topleft" - ,plt = TRUE) -clim04 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","gnd.temp") - ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Ground") - ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") - ,lwd = c(2.5,2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "temperature" - ,theme = "Temperature" - ,unit = "degC" - ,legpos = "topleft" - ,plt = TRUE) -clim05 = list(vnam = c("atm.shv","can.shv","gnd.shv") - ,desc = c("Atmosphere","Canopy air","Ground") - ,colour = c("deepskyblue","gray21","sienna") - ,lwd = c(2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "h2ovapour" - ,theme = "Water vapour mixing ratio" - ,unit = "g/kg" - ,legpos = "topleft" - ,plt = TRUE) -clim06 = list(vnam = c("atm.co2","can.co2") - ,desc = c("Atmosphere","Canopy air") - ,colour = c("deepskyblue","lawngreen") - ,lwd = c(2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "co2" - ,theme = "CO2 mixing ratio" - ,unit = "umol/mol" - ,legpos = "bottomleft" - ,plt = TRUE) -clim07 = list(vnam = c("rain") - ,desc = c("Precipitation") - ,colour = c("midnightblue") - ,lwd = c(2.5) - ,type = ptype - ,plog = "" - ,prefix = "prec" - ,theme = "Precipitation rate" - ,unit = "mm/hr" - ,legpos = "topleft" - ,plt = TRUE) -clim08 = list(vnam = c("fs.open") - ,desc = c("Fraction of open stomata") - ,colour = c("green3") - ,lwd = c(2.5) - ,type = ptype - ,plog = "" - ,prefix = "fsopen" - ,theme = "Fraction of open stomata" - ,unit = "---" - ,legpos = "bottomleft" - ,plt = TRUE) -clim09 = list(vnam = c("rshort","rshort.beam","rshort.diff","rshort.gnd") - ,desc = c("Down Top canopy","Beam","Diffuse","Abs. Ground") - ,colour = c("deepskyblue","goldenrod","gray33","firebrick") - ,lwd = c(2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "rshort" - ,theme = "Short wave radiation" - ,unit = "W/m2" - ,legpos = "topleft" - ,plt = TRUE) -clim10 = list(vnam = c("rlong","rlongup","rlong.gnd") - ,desc = c("Down Top canopy","Upward LW","Abs. Ground") - ,colour = c("deepskyblue","firebrick","goldenrod") - ,lwd = c(2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "rlong" - ,theme = "Long wave radiation" - ,unit = "W/m2" - ,legpos = "topleft" - ,plt = TRUE) -clim11 = list(vnam = c("albedo","albedo.beam","albedo.diff","rlong.albedo") - ,desc = c("SW Albedo (Net)","SW Albedo (Beam)","SW Albedo (Diff)" - ,"LW Albedo") - ,colour = c("deepskyblue","goldenrod","gray33","firebrick") - ,lwd = c(2.5,2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "albedo" - ,theme = "Albedo" - ,unit = "---" - ,legpos = "topleft" - ,plt = TRUE) -clim12 = list(vnam = c("hflxgc","sens","hflxlc","hflxwc") - ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy","Wood->Canopy") - ,colour = c("firebrick","midnightblue","chartreuse","goldenrod") - ,lwd = c(2.5,2.5,2.5) - ,type = ptype - ,plog = "" - ,prefix = "heatflux" - ,theme = "Sensible heat fluxes" - ,unit = "kg/m2/day" - ,legpos = "topleft" - ,plt = TRUE) -#------------------------------------------------------------------------------------------# - - -#----- Similar to Hovmoller diagrams, but with month/year in the y axis and hour in x. ----# -nhdcyc = 29 -hdcyc01 = list(vnam="gpp" ,desc="Gross Primary productivity" ,unit="kgC/m2/yr" - ,csch="atlas" ,plt=T) -hdcyc02 = list(vnam="plresp" ,desc="Plant respiration" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hdcyc03 = list(vnam="hetresp" ,desc="Heterotrophic respiration" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hdcyc04 = list(vnam="sens" ,desc="Sensible heat flux" ,unit="W/m2" - ,csch="muitas" ,plt=T) -hdcyc05 = list(vnam="evap" ,desc="Evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc06 = list(vnam="transp" ,desc="Transpiration" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc07 = list(vnam="atm.temp" ,desc="Atmospheric temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hdcyc08 = list(vnam="atm.shv" ,desc="Atmospheric specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hdcyc09 = list(vnam="atm.co2" ,desc="Atmospheric CO2 mixing ratio" ,unit="umol/mol" - ,csch="muitas" ,plt=F) -hdcyc10 = list(vnam="can.temp" ,desc="Canopy air temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hdcyc11 = list(vnam="can.shv" ,desc="Canopy air specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hdcyc12 = list(vnam="can.co2" ,desc="Canopy air CO2 mixing ratio" ,unit="umol/mol" - ,csch="muitas" ,plt=T) -hdcyc13 = list(vnam="rain" ,desc="Total monthly precipitation" ,unit="mm" - ,csch="imuitas" ,plt=T) -hdcyc14 = list(vnam="leaf.temp" ,desc="Leaf temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hdcyc15 = list(vnam="wood.temp" ,desc="Wood temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hdcyc16 = list(vnam="gnd.temp" ,desc="Ground temperature" ,unit="degC" - ,csch="muitas" ,plt=T) -hdcyc17 = list(vnam="gnd.shv" ,desc="Ground specific humidity" ,unit="g/kg" - ,csch="imuitas" ,plt=T) -hdcyc18 = list(vnam="et" ,desc="'Evapotranspiration" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc19 = list(vnam="fs.open" ,desc="Fraction of open stomata" ,unit="---" - ,csch="imuitas" ,plt=T) -hdcyc20 = list(vnam="wflxgc" ,desc="Ground evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc21 = list(vnam="wflxlc" ,desc="Leaf evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc22 = list(vnam="wflxwc" ,desc="Wood evaporation" ,unit="kg/m2/day" - ,csch="imuitas" ,plt=T) -hdcyc23 = list(vnam="nep" ,desc="Net ecosystem production" ,unit="kgC/m2/yr" - ,csch="muitas" ,plt=T) -hdcyc24 = list(vnam="nee" ,desc="Net ecosystem exchange" ,unit="kgC/m2/yr" - ,csch="imuitas" ,plt=T) -hdcyc25 = list(vnam="rshort" ,desc="Downward shortwave radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hdcyc26 = list(vnam="rlong" ,desc="Downward longwave radiation" ,unit="W/m2" - ,csch="cloudy" ,plt=T) -hdcyc27 = list(vnam="rshort.gnd",desc="Abs. gnd. shortwave radiation" ,unit="W/m2" - ,csch="icloudy" ,plt=T) -hdcyc28 = list(vnam="rlong.gnd" ,desc="Abs. gnd. longwave radiation" ,unit="W/m2" - ,csch="cloudy" ,plt=T) -hdcyc29 = list(vnam="albedo" ,desc="Shortwave albedo" ,unit="---" - ,csch="muitas" ,plt=T) -#------------------------------------------------------------------------------------------# - - - - -#----- Comparison between observations and model averages. --------------------------------# -ncompdcyc = 3 -compdcyc01 = list( vnam = "gpp" - , desc = "Gross Primary Productivity" - , unit = "kgC/m2/yr" - , plotsd = TRUE - , colour = c("darkgreen","gray14") - , errcol = c("chartreuse","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "topleft" - , plt = TRUE) -compdcyc02 = list( vnam = "nee" - , desc = "Net Ecosystem Exchange" - , unit = "kgC/m2/yr" - , plotsd = TRUE - , colour = c("darkgreen","gray14") - , errcol = c("chartreuse","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "bottomleft" - , plt = TRUE) -compdcyc03 = list( vnam = "et" - , desc = "Evapotranspiration" - , unit = "kgH2O/m2/day" - , plotsd = TRUE - , colour = c("midnightblue","gray14") - , errcol = c("steelblue","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "topleft" - , plt = TRUE) -#------------------------------------------------------------------------------------------# - - - - -#----- Comparison between observations and model averages. --------------------------------# -ncompmmean = 3 -compmmean01 = list( vnam = "gpp" - , desc = "Gross Primary Productivity" - , unit = "kgC/m2/yr" - , plotsd = TRUE - , colour = c("darkgreen","gray14") - , errcol = c("chartreuse","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "topleft" - , plt = TRUE) -compmmean02 = list( vnam = "nee" - , desc = "Net Ecosystem Exchange" - , unit = "kgC/m2/yr" - , plotsd = TRUE - , colour = c("darkgreen","gray14") - , errcol = c("chartreuse","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "topleft" - , plt = TRUE) -compmmean03 = list( vnam = "et" - , desc = "Evapotranspiration" - , unit = "kgH2O/m2/day" - , plotsd = TRUE - , colour = c("midnightblue","gray14") - , errcol = c("steelblue","gray61") - , angle = c(45,-45) - , dens = c(40, 40) - , lwd = c(2.5,2.5) - , shwd = c(1.0,1.0) - , type = "o" - , plog = "" - , legpos = "topleft" - , plt = TRUE) -#------------------------------------------------------------------------------------------# - - - -#----- Annual mean. -----------------------------------------------------------------------# -nsoilclim = 3 -soilclim01 = list(vnam="soil.water" ,desc = "Soil moisture" - ,unit = "m3/m3" ,csch = "imuitas" - ,pnlog=FALSE ,plt = TRUE) -soilclim02 = list(vnam="soil.temp" ,desc = "Soil temperature" - ,unit = "C" ,csch = "muitas" - ,pnlog=FALSE ,plt = TRUE) -soilclim03 = list(vnam="soil.mstpot",desc = "(Negative) Soil moisture potential" - ,unit = "m" ,csch = "muitas" - ,pnlog=TRUE ,plt = TRUE) -#------------------------------------------------------------------------------------------# - +ptype = "l" # Type of plot +ptyped = "p" # Type of plot +ptypeb = "o" # Type of plot +tserdist = TRUE # Time series of disturbance rates +drought.mark = mydroughtmark +drought.yeara = mydroughtyeara +drought.yearz = mydroughtyearz +months.drought = mymonthsdrought #----- Loading some packages. -------------------------------------------------------------# library(hdf5) @@ -722,140 +81,35 @@ options(locatorBell=FALSE) #----- Load some files with functions. ----------------------------------------------------# -source(paste(srcdir,"atlas.r" ,sep="/")) -source(paste(srcdir,"charutils.r" ,sep="/")) -source(paste(srcdir,"census.r" ,sep="/")) -source(paste(srcdir,"cloudy.r" ,sep="/")) -source(paste(srcdir,"error.bar.r" ,sep="/")) -source(paste(srcdir,"globdims.r" ,sep="/")) -source(paste(srcdir,"locations.r" ,sep="/")) -source(paste(srcdir,"muitas.r" ,sep="/")) -source(paste(srcdir,"plotsize.r" ,sep="/")) -source(paste(srcdir,"pretty.log.r" ,sep="/")) -source(paste(srcdir,"pretty.time.r",sep="/")) -source(paste(srcdir,"qapply.r" ,sep="/")) -source(paste(srcdir,"rconstants.r" ,sep="/")) -source(paste(srcdir,"soilutils.r" ,sep="/")) -source(paste(srcdir,"sombreado.r" ,sep="/")) -source(paste(srcdir,"southammap.r" ,sep="/")) -source(paste(srcdir,"timeutils.r" ,sep="/")) +source(paste(srcdir,"atlas.r" ,sep="/")) +source(paste(srcdir,"charutils.r" ,sep="/")) +source(paste(srcdir,"census.r" ,sep="/")) +source(paste(srcdir,"cloudy.r" ,sep="/")) +source(paste(srcdir,"error.bar.r" ,sep="/")) +source(paste(srcdir,"globdims.r" ,sep="/")) +source(paste(srcdir,"locations.r" ,sep="/")) +source(paste(srcdir,"muitas.r" ,sep="/")) +source(paste(srcdir,"plotsize.r" ,sep="/")) +source(paste(srcdir,"pmonthly_varlist.r",sep="/")) +source(paste(srcdir,"pretty.log.r" ,sep="/")) +source(paste(srcdir,"pretty.time.r" ,sep="/")) +source(paste(srcdir,"qapply.r" ,sep="/")) +source(paste(srcdir,"rconstants.r" ,sep="/")) +source(paste(srcdir,"soilutils.r" ,sep="/")) +source(paste(srcdir,"sombreado.r" ,sep="/")) +source(paste(srcdir,"southammap.r" ,sep="/")) +source(paste(srcdir,"timeutils.r" ,sep="/")) +#----- These should be called after the others. --------------------------------------------# +source(paste(srcdir,"physiology.coms.r",sep="/")) +source(paste(srcdir,"pft.coms.r" ,sep="/")) #----- Load observations. -----------------------------------------------------------------# -obsrfile = paste(srcdir,"LBA_MIP.RData",sep="/") +obsrfile = paste(srcdir,"LBA_MIP.v4.RData",sep="/") load(file=obsrfile) - -#----- Define some default legend colours and names. --------------------------------------# -pftnames = c("C4 Grass","Early Tropical","Mid Tropical","Late Tropical","Temp. C3 Grass" - ,"North Pine","South Pine","Late Conifer","Early Temperate","Mid Temperate" - ,"Late Temperate","C3 Pasture","C3 Crop","C4 Pasture","C4 Crop" - ,"C3 Grass","Araucaria","Total") -pftcols = c("gold","chartreuse","limegreen","darkgreen","purple3" - ,"deepskyblue","aquamarine","midnightblue","darkorange3","sienna" - ,"firebrick","orchid","coral","gray45","olivedrab" - ,"goldenrod","steelblue","gray22") - -lunames = c("Agricultural","Secondary","Primary","Total") -lucols = c("goldenrod","chartreuse","darkgreen","gray22") - -distnames = c("Agr->Agr" ,"2nd->Agr" ,"Prim->Agr" - ,"Agr->2nd" ,"2nd->2nd" ,"Prim->2nd" - ,"Agr->Prim","2nd->Prim","Prim->Prim") -distcols = c("gold","darkorange2","firebrick" - ,"lightskyblue","turquoise","steelblue" - ,"palegreen","chartreuse","forestgreen") - #----- Define plot window size ------------------------------------------------------------# size = plotsize(proje=FALSE,paper=paper) - -#------------------------------------------------------------------------------------------# -# Using brute force to concatenate the plotting lists. # -#------------------------------------------------------------------------------------------# -#----- Time series by PFT plot. -----------------------------------------------------------# -tspft = list() -for (s in 1:ntspft){ - sss = substring(100+s,2,3) - tsts = paste("tsplot",sss,sep="") - tspft[[s]] = get(tsts) -} #end for -#----- Time series by LU plot. ------------------------------------------------------------# -tslu = list() -for (s in 1:ntslu){ - sss = substring(100+s,2,3) - lulu = paste("lsplot",sss,sep="") - tslu[[s]] = get(lulu) -} #end for -#----- Size (DBH) and age structure cohort level variables. -------------------------------# -sasplot = list() -for (s in 1:npsas){ - sss = substring(100+s,2,3) - psps = paste("psas",sss,sep="") - sasplot[[s]] = get(psps) -} #end for -#----- Time series of some variables per PFT, with size or age distribution. ---------------# -fcpft = list() -for (s in 1:nfcpft){ - sss = substring(100+s,2,3) - fcfc = paste("fcpft",sss,sep="") - fcpft[[s]] = get(fcfc) -} #end for -#----- Box plots --------------------------------------------------------------------------# -bplot = list() -for (s in 1:nbox){ - sss = substring(100+s,2,3) - bpbp = paste("bplot",sss,sep="") - bplot[[s]] = get(bpbp) -} #end for -#----- Hovmoller diagram ------------------------------------------------------------------# -hovdi = list() -for (s in 1:nhov){ - sss = substring(100+s,2,3) - hdhd = paste("hovdi",sss,sep="") - hovdi[[s]] = get(hdhd) -} #end for -#----- Time series ------------------------------------------------------------------------# -tser = list() -for (s in 1:ntser){ - sss = substring(100+s,2,3) - tsts = paste("tser",sss,sep="") - tser[[s]] = get(tsts) -} #end for -#----- Time series of "mean diurnal cycle climatology" ------------------------------------# -clim = list() -for (s in 1:nclim){ - sss = substring(100+s,2,3) - clcl = paste("clim",sss,sep="") - clim[[s]] = get(clcl) -} #end for -#----- Hovmoller diagram ------------------------------------------------------------------# -hdcyc = list() -for (s in 1:nhdcyc){ - sss = substring(100+s,2,3) - hdhd = paste("hdcyc",sss,sep="") - hdcyc[[s]] = get(hdhd) -} #end for -#----- Comparison of mean diurnal cycle ---------------------------------------------------# -compdcyc = list() -for (o in 1:ncompdcyc){ - ccc = substring(100+o,2,3) - cpcp = paste("compdcyc",ccc,sep="") - compdcyc[[o]] = get(cpcp) -} #end for -#----- Comparison of monthly means --------------------------------------------------------# -compmmean = list() -for (o in 1:ncompmmean){ - ccc = substring(100+o,2,3) - cmcm = paste("compmmean",ccc,sep="") - compmmean[[o]] = get(cmcm) -} #end for -#----- Soil profile climatology. ----------------------------------------------------------# -soilclim = list() -for (o in 1:nsoilclim){ - ccc = substring(100+o,2,3) - scsc = paste("soilclim",ccc,sep="") - soilclim[[o]] = get(scsc) -} #end for #------------------------------------------------------------------------------------------# @@ -872,7 +126,7 @@ if (! file.exists(outroot)) dir.create(outroot) for (place in myplaces){ #----- Retrieve default information about this place and set up some variables. --------# - thispoi = locations(where=place,here=here,yearbeg=yearbeg,yearend=yearend + thispoi = locations(where=place,here=there,yearbeg=yearbeg,yearend=yearend ,monthbeg=monthbeg) inpref = thispoi$pathin outmain = paste(outroot,place,sep="/") @@ -884,6 +138,15 @@ for (place in myplaces){ yearz = thispoi$yearz meszz = thispoi$monz + #----- Decide how frequently the cohort-level variables should be saved. ---------------# + if (yearz - yeara + 1 <= nyears.long){ + sasmonth = sasmonth.short + }else{ + sasmonth = sasmonth.long + }#end if + + + #----- Create the directories in case they don't exist. --------------------------------# if (! file.exists(outmain)) dir.create(outmain) if (! file.exists(outpref)) dir.create(outpref) @@ -897,121 +160,137 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# totmon = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) #----- Size (DBH) and age arrays. ------------------------------------------------------# - agbpftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - laipftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - waipftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - taipftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - gpppftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - npppftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - mcopftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - cbapftdbh = array(data=0.,dim=c(totmon,ndbh,npft)) - agbpftage = array(data=0.,dim=c(totmon,nage,npft)) - laipftage = array(data=0.,dim=c(totmon,nage,npft)) - waipftage = array(data=0.,dim=c(totmon,nage,npft)) - taipftage = array(data=0.,dim=c(totmon,nage,npft)) - gpppftage = array(data=0.,dim=c(totmon,nage,npft)) - npppftage = array(data=0.,dim=c(totmon,nage,npft)) - mcopftage = array(data=0.,dim=c(totmon,nage,npft)) - cbapftage = array(data=0.,dim=c(totmon,nage,npft)) + agbpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + laipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + waipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + taipftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + gpppftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + npppftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + mcopftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + cbapftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + ldrpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + fsopftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + demandpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + supplypftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + nplantpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + ncbmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) #----- PFT arrays. The "+1" column contains the total. -------------------------------# - agbpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bseedspft = matrix(data=0,nrow=totmon,ncol=npft+1) - laipft = matrix(data=0,nrow=totmon,ncol=npft+1) - waipft = matrix(data=0,nrow=totmon,ncol=npft+1) - taipft = matrix(data=0,nrow=totmon,ncol=npft+1) - gpppft = matrix(data=0,nrow=totmon,ncol=npft+1) - npppft = matrix(data=0,nrow=totmon,ncol=npft+1) - mcopft = matrix(data=0,nrow=totmon,ncol=npft+1) - cbapft = matrix(data=0,nrow=totmon,ncol=npft+1) - ldroppft = matrix(data=0,nrow=totmon,ncol=npft+1) - balivepft = matrix(data=0,nrow=totmon,ncol=npft+1) - bdeadpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bleafpft = matrix(data=0,nrow=totmon,ncol=npft+1) - brootpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bswoodpft = matrix(data=0,nrow=totmon,ncol=npft+1) - bstorepft = matrix(data=0,nrow=totmon,ncol=npft+1) - basareapft = matrix(data=0,nrow=totmon,ncol=npft+1) + agbpft = matrix(data=0,nrow=totmon,ncol=npft+1) + bseedspft = matrix(data=0,nrow=totmon,ncol=npft+1) + nplantpft = matrix(data=0,nrow=totmon,ncol=npft+1) + laipft = matrix(data=0,nrow=totmon,ncol=npft+1) + waipft = matrix(data=0,nrow=totmon,ncol=npft+1) + taipft = matrix(data=0,nrow=totmon,ncol=npft+1) + gpppft = matrix(data=0,nrow=totmon,ncol=npft+1) + npppft = matrix(data=0,nrow=totmon,ncol=npft+1) + mcopft = matrix(data=0,nrow=totmon,ncol=npft+1) + cbapft = matrix(data=0,nrow=totmon,ncol=npft+1) + ldroppft = matrix(data=0,nrow=totmon,ncol=npft+1) + balivepft = matrix(data=0,nrow=totmon,ncol=npft+1) + bdeadpft = matrix(data=0,nrow=totmon,ncol=npft+1) + bleafpft = matrix(data=0,nrow=totmon,ncol=npft+1) + brootpft = matrix(data=0,nrow=totmon,ncol=npft+1) + bswoodpft = matrix(data=0,nrow=totmon,ncol=npft+1) + bstorepft = matrix(data=0,nrow=totmon,ncol=npft+1) + basareapft = matrix(data=0,nrow=totmon,ncol=npft+1) + leafresppft = matrix(data=0,nrow=totmon,ncol=npft+1) + rootresppft = matrix(data=0,nrow=totmon,ncol=npft+1) + growthresppft = matrix(data=0,nrow=totmon,ncol=npft+1) #----- LU arrays. The "+1" column contains the total. --------------------------------# - agblu = matrix(data=0,nrow=totmon,ncol=nlu+1) - lailu = matrix(data=0,nrow=totmon,ncol=nlu+1) - gpplu = matrix(data=0,nrow=totmon,ncol=nlu+1) - npplu = matrix(data=0,nrow=totmon,ncol=nlu+1) - arealu = matrix(data=0,nrow=totmon,ncol=nlu+1) - basarealu = matrix(data=0,nrow=totmon,ncol=nlu+1) + agblu = matrix(data=0,nrow=totmon,ncol=nlu+1) + lailu = matrix(data=0,nrow=totmon,ncol=nlu+1) + gpplu = matrix(data=0,nrow=totmon,ncol=nlu+1) + npplu = matrix(data=0,nrow=totmon,ncol=nlu+1) + arealu = matrix(data=0,nrow=totmon,ncol=nlu+1) + basarealu = matrix(data=0,nrow=totmon,ncol=nlu+1) #----- Miscellaneous arrays. -----------------------------------------------------------# - dist = array(NA,dim=c(totmon,nlu,nlu)) + dist = array(NA,dim=c(totmon,nlu,nlu)) #----- Polygon level vectors. ----------------------------------------------------------# - gpp = NULL - plresp = NULL - hetresp = NULL - mco = NULL - npp = NULL - cba = NULL - ldrop = NULL - npp = NULL - nep = NULL - nee = NULL - evap = NULL - transp = NULL - atm.temp = NULL - can.temp = NULL - atm.co2 = NULL - can.co2 = NULL - leaf.temp = NULL - wood.temp = NULL - atm.shv = NULL - can.shv = NULL - can.co2 = NULL - sens = NULL - latent = NULL - et = NULL - agb = NULL - lai = NULL - wai = NULL - tai = NULL - area = NULL - rain = NULL - gnd.temp = NULL - gnd.shv = NULL - workload = NULL - specwork = NULL - fs.open = NULL - hflxgc = NULL - hflxlc = NULL - hflxwc = NULL - wflxgc = NULL - wflxlc = NULL - wflxwc = NULL - et = NULL - rshort = NULL - rshort.beam = NULL - rshort.diff = NULL - rlong = NULL - rshort.gnd = NULL - rlong.gnd = NULL - rlongup = NULL - albedo = NULL - albedo.beam = NULL - albedo.diff = NULL - rlong.albedo = NULL - npat.global = NULL - ncoh.global = NULL - mmsqu.gpp = NULL - mmsqu.plresp = NULL - mmsqu.hetresp = NULL - mmsqu.nee = NULL - mmsqu.sens = NULL - mmsqu.hflxlc = NULL - mmsqu.hflxwc = NULL - mmsqu.hflxgc = NULL - mmsqu.et = NULL - mmsqu.latent = NULL - mmsqu.wflxlc = NULL - mmsqu.wflxwc = NULL - mmsqu.wflxgc = NULL - mmsqu.evap = NULL - mmsqu.transp = NULL + gpp = NULL + npp = NULL + plresp = NULL + leaf.resp = NULL + root.resp = NULL + growth.resp = NULL + hetresp = NULL + mco = NULL + npp = NULL + cba = NULL + ldrop = NULL + nep = NULL + nee = NULL + cflxca = NULL + cflxst = NULL + evap = NULL + transp = NULL + ustar = NULL + atm.vels = NULL + atm.prss = NULL + atm.temp = NULL + can.prss = NULL + can.temp = NULL + atm.co2 = NULL + can.co2 = NULL + leaf.temp = NULL + wood.temp = NULL + atm.shv = NULL + can.shv = NULL + can.co2 = NULL + hflxca = NULL + qwflxca = NULL + wflxca = NULL + agb = NULL + nplant = NULL + lai = NULL + wai = NULL + tai = NULL + area = NULL + rain = NULL + gnd.temp = NULL + gnd.shv = NULL + workload = NULL + specwork = NULL + fs.open = NULL + hflxgc = NULL + hflxlc = NULL + hflxwc = NULL + wflxgc = NULL + wflxlc = NULL + wflxwc = NULL + et = NULL + rshort = NULL + rshort.beam = NULL + rshort.diff = NULL + rlong = NULL + rshort.gnd = NULL + rlong.gnd = NULL + rlongup = NULL + albedo = NULL + albedo.beam = NULL + albedo.diff = NULL + rlong.albedo = NULL + npat.global = NULL + ncoh.global = NULL + mmsqu.gpp = NULL + mmsqu.plresp = NULL + mmsqu.leaf.resp = NULL + mmsqu.root.resp = NULL + mmsqu.plresp = NULL + mmsqu.hetresp = NULL + mmsqu.cflxca = NULL + mmsqu.cflxst = NULL + mmsqu.hflxca = NULL + mmsqu.hflxlc = NULL + mmsqu.hflxwc = NULL + mmsqu.hflxgc = NULL + mmsqu.wflxca = NULL + mmsqu.qwflxca = NULL + mmsqu.wflxlc = NULL + mmsqu.wflxwc = NULL + mmsqu.wflxgc = NULL + mmsqu.evap = NULL + mmsqu.transp = NULL #----- Cohort level lists. -------------------------------------------------------------# lightco = list() @@ -1057,6 +336,36 @@ for (place in myplaces){ first.time = TRUE + + #---------------------------------------------------------------------------------------# + # Make a list with the time span of each drought so we can plot rectangles showing # + # the drought. # + #---------------------------------------------------------------------------------------# + drought = list() + year = drought.yeara + ndrought = length(months.drought) + n = 0 + overyear = months.drought[1] > months.drought[ndrought] + for (year in seq(from=drought.yeara,to=drought.yearz-as.integer(overyear),by=1)){ + n = n + 1 + + #----- Define the beginning and the end of the drought. -----------------------------# + month.start = months.drought[1] + month.end = 1 + (months.drought[ndrought] %% 12) + year.start = year + year.end = year + as.integer(month.end == 1) + 1 + + drought.whena = chron(dates=paste(month.start,1,year.start,sep="/")) + drought.whenz = chron(dates=paste(month.end ,1,year.end ,sep="/")) + drought[[n]] = c(drought.whena,drought.whenz) + }#end for + #----- ndrought becomes the number of blocks with drought. -----------------------------# + ndrought = length(drought) + #---------------------------------------------------------------------------------------# + + + + #----- Loop over years. ----------------------------------------------------------------# for (year in yeara:yearz){ if (year == yeara){ @@ -1123,16 +432,22 @@ for (place in myplaces){ #----- Mean diurnal cycle. ---------------------------------------------------# dcycmean = list() dcycmean$gpp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$npp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$plresp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$leaf.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$root.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$growth.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$hetresp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$nep = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$nee = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$sens = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$cflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$cflxst = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$hflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$hflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$hflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$hflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$latent = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmean$et = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$qwflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$wflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$wflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$wflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$wflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) @@ -1151,6 +466,7 @@ for (place in myplaces){ dcycmean$atm.prss = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$can.prss = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$atm.vels = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$ustar = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$fs.open = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$rain = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$rshort = matrix(data=0,nrow=totmon,ncol=ndcycle) @@ -1167,16 +483,21 @@ for (place in myplaces){ dcycmsqu = list() dcycmsqu$gpp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$npp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$plresp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$leaf.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$root.resp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$hetresp = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$nep = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$nee = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$sens = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$cflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$cflxst = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$hflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$hflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$hflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$hflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$et = matrix(data=0,nrow=totmon,ncol=ndcycle) - dcycmsqu$latent = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$qwflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmsqu$wflxca = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$wflxlc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$wflxwc = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmsqu$wflxgc = matrix(data=0,nrow=totmon,ncol=ndcycle) @@ -1197,44 +518,57 @@ for (place in myplaces){ #----- Load the simple variables. -----------------------------------------------# - gpp = c(gpp , mymont$MMEAN.GPP ) - plresp = c(plresp , mymont$MMEAN.PLRESP ) - hetresp = c(hetresp , mymont$MMEAN.RH ) - nep = c(nep , mymont$MMEAN.NEP ) - npp = c(npp , mymont$MMEAN.GPP - mymont$MMEAN.PLRESP ) - nee = c(nee , mymont$MMEAN.NEE ) - sens = c(sens , - mymont$MMEAN.SENSIBLE.AC ) - hflxlc = c(hflxlc , mymont$MMEAN.SENSIBLE.LC ) - hflxwc = c(hflxwc , mymont$MMEAN.SENSIBLE.WC ) - hflxgc = c(hflxgc , mymont$MMEAN.SENSIBLE.GC ) - latent = c(latent , - mymont$MMEAN.VAPOR.AC * alvl ) - et = c(et , - mymont$MMEAN.VAPOR.AC * day.sec ) - wflxlc = c(wflxlc , mymont$MMEAN.VAPOR.LC * day.sec ) - wflxwc = c(wflxwc , mymont$MMEAN.VAPOR.WC * day.sec ) - wflxgc = c(wflxgc , mymont$MMEAN.VAPOR.GC * day.sec ) - evap = c(evap , mymont$MMEAN.EVAP * day.sec ) - transp = c(transp , mymont$MMEAN.TRANSP * day.sec ) - - mmsqu.gpp = c(mmsqu.gpp ,mymont$MMSQU.GPP ) - mmsqu.plresp = c(mmsqu.plresp ,mymont$MMSQU.PLRESP ) - mmsqu.hetresp = c(mmsqu.hetresp,mymont$MMSQU.RH ) - mmsqu.nee = c(mmsqu.nee ,mymont$MMSQU.NEE ) - mmsqu.sens = c(mmsqu.sens ,mymont$MMSQU.SENSIBLE.AC ) - mmsqu.hflxlc = c(mmsqu.hflxlc ,mymont$MMSQU.SENSIBLE.LC ) - mmsqu.hflxwc = c(mmsqu.hflxwc ,mymont$MMSQU.SENSIBLE.WC ) - mmsqu.hflxgc = c(mmsqu.hflxgc ,mymont$MMSQU.SENSIBLE.GC ) - mmsqu.et = c(mmsqu.et ,mymont$MMSQU.VAPOR.AC * day.sec * day.sec ) - mmsqu.latent = c(mmsqu.latent ,mymont$MMSQU.VAPOR.AC * alvl * alvl ) - mmsqu.wflxlc = c(mmsqu.wflxlc ,mymont$MMSQU.VAPOR.LC * day.sec * day.sec ) - mmsqu.wflxwc = c(mmsqu.wflxwc ,mymont$MMSQU.VAPOR.WC * day.sec * day.sec ) - mmsqu.wflxgc = c(mmsqu.wflxgc ,mymont$MMSQU.VAPOR.GC * day.sec * day.sec ) - mmsqu.evap = c(mmsqu.evap ,mymont$MMSQU.EVAP * day.sec * day.sec ) - mmsqu.transp = c(mmsqu.transp ,mymont$MMSQU.TRANSP * day.sec * day.sec ) - + gpp = c(gpp , mymont$MMEAN.GPP ) + plresp = c(plresp , mymont$MMEAN.PLRESP ) + leaf.resp = c(leaf.resp , mymont$MMEAN.LEAF.RESP ) + root.resp = c(root.resp , mymont$MMEAN.ROOT.RESP ) + growth.resp = c(growth.resp , mymont$MMEAN.GROWTH.RESP ) + hetresp = c(hetresp , mymont$MMEAN.RH ) + nep = c(nep , mymont$MMEAN.NEP ) + nee = c(nee , - mymont$MMEAN.CARBON.AC + + mymont$MMEAN.CARBON.ST ) + cflxca = c(cflxca , - mymont$MMEAN.CARBON.AC ) + cflxst = c(cflxst , mymont$MMEAN.CARBON.ST ) + hflxca = c(hflxca , - mymont$MMEAN.SENSIBLE.AC ) + hflxlc = c(hflxlc , mymont$MMEAN.SENSIBLE.LC ) + hflxwc = c(hflxwc , mymont$MMEAN.SENSIBLE.WC ) + hflxgc = c(hflxgc , mymont$MMEAN.SENSIBLE.GC ) + qwflxca = c(qwflxca , - mymont$MMEAN.VAPOR.AC * alvl ) + wflxca = c(wflxca , - mymont$MMEAN.VAPOR.AC * day.sec ) + wflxlc = c(wflxlc , mymont$MMEAN.VAPOR.LC * day.sec ) + wflxwc = c(wflxwc , mymont$MMEAN.VAPOR.WC * day.sec ) + wflxgc = c(wflxgc , mymont$MMEAN.VAPOR.GC * day.sec ) + evap = c(evap , mymont$MMEAN.EVAP * day.sec ) + transp = c(transp , mymont$MMEAN.TRANSP * day.sec ) + + mmsqu.gpp = c(mmsqu.gpp ,mymont$MMSQU.GPP ) + mmsqu.plresp = c(mmsqu.plresp ,mymont$MMSQU.PLRESP ) + mmsqu.leaf.resp = c(mmsqu.leaf.resp ,mymont$MMSQU.PLRESP ) + mmsqu.root.resp = c(mmsqu.root.resp ,mymont$MMSQU.PLRESP ) + mmsqu.hetresp = c(mmsqu.hetresp,mymont$MMSQU.RH ) + mmsqu.cflxca = c(mmsqu.cflxca ,mymont$MMSQU.CARBON.AC ) + mmsqu.cflxst = c(mmsqu.cflxst ,mymont$MMSQU.CARBON.ST ) + mmsqu.hflxca = c(mmsqu.hflxca ,mymont$MMSQU.SENSIBLE.AC ) + mmsqu.hflxlc = c(mmsqu.hflxlc ,mymont$MMSQU.SENSIBLE.LC ) + mmsqu.hflxwc = c(mmsqu.hflxwc ,mymont$MMSQU.SENSIBLE.WC ) + mmsqu.hflxgc = c(mmsqu.hflxgc ,mymont$MMSQU.SENSIBLE.GC ) + mmsqu.wflxca = c(mmsqu.wflxca ,mymont$MMSQU.VAPOR.AC * day.sec * day.sec ) + mmsqu.qwflxca = c(mmsqu.qwflxca,mymont$MMSQU.VAPOR.AC * alvl * alvl ) + mmsqu.wflxlc = c(mmsqu.wflxlc ,mymont$MMSQU.VAPOR.LC * day.sec * day.sec ) + mmsqu.wflxwc = c(mmsqu.wflxwc ,mymont$MMSQU.VAPOR.WC * day.sec * day.sec ) + mmsqu.wflxgc = c(mmsqu.wflxgc ,mymont$MMSQU.VAPOR.GC * day.sec * day.sec ) + mmsqu.evap = c(mmsqu.evap ,mymont$MMSQU.EVAP * day.sec * day.sec ) + mmsqu.transp = c(mmsqu.transp ,mymont$MMSQU.TRANSP * day.sec * day.sec ) + + ustar = c(ustar ,mymont$MMEAN.USTAR ) + + atm.vels = c(atm.vels ,mymont$MMEAN.ATM.VELS ) + atm.prss = c(atm.prss ,mymont$MMEAN.ATM.PRSS * 0.01 ) atm.temp = c(atm.temp ,mymont$MMEAN.ATM.TEMP - t00 ) atm.shv = c(atm.shv ,mymont$MMEAN.ATM.SHV * kg2g ) atm.co2 = c(atm.co2 ,mymont$MMEAN.ATM.CO2 ) + can.prss = c(can.prss ,mymont$MMEAN.CAN.PRSS * 0.01 ) can.temp = c(can.temp ,mymont$MMEAN.CAN.TEMP - t00 ) can.shv = c(can.shv ,mymont$MMEAN.CAN.SHV * kg2g ) can.co2 = c(can.co2 ,mymont$MMEAN.CAN.CO2 ) @@ -1287,15 +621,20 @@ for (place in myplaces){ #--------------------------------------------------------------------------------# dcycmean$gpp [m,] = mymont$QMEAN.GPP dcycmean$plresp [m,] = mymont$QMEAN.PLRESP + dcycmean$npp [m,] = mymont$QMEAN.GPP - mymont$QMEAN.PLRESP + dcycmean$leaf.resp [m,] = mymont$QMEAN.LEAF.RESP + dcycmean$root.resp [m,] = mymont$QMEAN.ROOT.RESP dcycmean$hetresp [m,] = mymont$QMEAN.RH dcycmean$nep [m,] = mymont$QMEAN.NEP - dcycmean$nee [m,] = mymont$QMEAN.NEE - dcycmean$sens [m,] = - mymont$QMEAN.SENSIBLE.AC + dcycmean$nee [m,] = - mymont$QMEAN.CARBON.AC + mymont$QMEAN.CARBON.ST + dcycmean$cflxca [m,] = - mymont$QMEAN.CARBON.AC + dcycmean$cflxst [m,] = - mymont$QMEAN.CARBON.ST + dcycmean$hflxca [m,] = - mymont$QMEAN.SENSIBLE.AC dcycmean$hflxlc [m,] = mymont$QMEAN.SENSIBLE.LC dcycmean$hflxwc [m,] = mymont$QMEAN.SENSIBLE.WC dcycmean$hflxgc [m,] = mymont$QMEAN.SENSIBLE.GC - dcycmean$et [m,] = - mymont$QMEAN.VAPOR.AC * day.sec - dcycmean$latent [m,] = - mymont$QMEAN.VAPOR.AC * alvl + dcycmean$wflxca [m,] = - mymont$QMEAN.VAPOR.AC * day.sec + dcycmean$qwflxca [m,] = - mymont$QMEAN.VAPOR.AC * alvl dcycmean$wflxlc [m,] = mymont$QMEAN.VAPOR.LC * day.sec dcycmean$wflxwc [m,] = mymont$QMEAN.VAPOR.WC * day.sec dcycmean$wflxgc [m,] = mymont$QMEAN.VAPOR.GC * day.sec @@ -1313,9 +652,10 @@ for (place in myplaces){ dcycmean$gnd.shv [m,] = mymont$QMEAN.GND.SHV * kg2g dcycmean$atm.co2 [m,] = mymont$QMEAN.ATM.CO2 dcycmean$can.co2 [m,] = mymont$QMEAN.CAN.CO2 - dcycmean$atm.prss [m,] = mymont$QMEAN.ATM.PRSS - dcycmean$can.prss [m,] = mymont$QMEAN.CAN.PRSS dcycmean$atm.vels [m,] = mymont$QMEAN.ATM.VELS + dcycmean$ustar [m,] = mymont$QMEAN.USTAR + dcycmean$atm.prss [m,] = mymont$QMEAN.ATM.PRSS * 0.01 + dcycmean$can.prss [m,] = mymont$QMEAN.CAN.PRSS * 0.01 dcycmean$fs.open [m,] = mymont$QMEAN.FS.OPEN dcycmean$rain [m,] = mymont$QMEAN.PCPG * day.sec dcycmean$rshort [m,] = mymont$QMEAN.RSHORT @@ -1332,15 +672,18 @@ for (place in myplaces){ dcycmsqu$gpp [m,] = mymont$QMSQU.GPP dcycmsqu$plresp [m,] = mymont$QMSQU.PLRESP + dcycmsqu$leaf.resp [m,] = mymont$QMSQU.LEAF.RESP + dcycmsqu$root.resp [m,] = mymont$QMSQU.ROOT.RESP dcycmsqu$hetresp [m,] = mymont$QMSQU.RH dcycmsqu$nep [m,] = mymont$QMSQU.NEP - dcycmsqu$nee [m,] = mymont$QMSQU.NEE - dcycmsqu$sens [m,] = mymont$QMSQU.SENSIBLE.AC + dcycmsqu$cflxca [m,] = mymont$QMSQU.CARBON.AC + dcycmsqu$cflxst [m,] = mymont$QMSQU.CARBON.ST + dcycmsqu$hflxca [m,] = mymont$QMSQU.SENSIBLE.AC dcycmsqu$hflxlc [m,] = mymont$QMSQU.SENSIBLE.LC dcycmsqu$hflxwc [m,] = mymont$QMSQU.SENSIBLE.WC dcycmsqu$hflxgc [m,] = mymont$QMSQU.SENSIBLE.GC - dcycmsqu$et [m,] = mymont$QMSQU.VAPOR.AC * day.sec * day.sec - dcycmsqu$latent [m,] = mymont$QMSQU.VAPOR.AC * alvl * alvl + dcycmsqu$wflxca [m,] = mymont$QMSQU.VAPOR.AC * day.sec * day.sec + dcycmsqu$qwflxca [m,] = mymont$QMSQU.VAPOR.AC * alvl * alvl dcycmsqu$wflxlc [m,] = mymont$QMSQU.VAPOR.WC * day.sec * day.sec dcycmsqu$wflxwc [m,] = mymont$QMSQU.VAPOR.LC * day.sec * day.sec dcycmsqu$wflxgc [m,] = mymont$QMSQU.VAPOR.GC * day.sec * day.sec @@ -1401,101 +744,104 @@ for (place in myplaces){ areapaage = tapply(X=areapa,INDEX=agepafac,sum,na.rm=TRUE) areaage = areapaage[as.character(agefac)] - pftconow = mymont$PFT - nplantconow = mymont$NPLANT - heightconow = mymont$HITE - baconow = mymont$BA.CO - agbconow = mymont$AGB.CO - bseedsconow = mymont$BSEEDS.CO - laiconow = mymont$LAI.CO - waiconow = mymont$WAI.CO - taiconow = laiconow + waiconow - gppconow = mymont$MMEAN.GPP.CO - respconow = ( mymont$MMEAN.LEAF.RESP.CO + mymont$MMEAN.ROOT.RESP.CO - + mymont$MMEAN.GROWTH.RESP.CO + mymont$MMEAN.STORAGE.RESP.CO - + mymont$MMEAN.VLEAF.RESP.CO ) - nppconow = gppconow-respconow - cbalconow = mymont$MMEAN.CB - mcostconow = mymont$MMEAN.LEAF.MAINTENANCE + mymont$MMEAN.ROOT.MAINTENANCE - ldropconow = mymont$MMEAN.LEAF.DROP.CO - cbrbarconow = mymont$CBR.BAR - ncbmortconow = mymont$MMEAN.MORT.RATE[,2] - fsoconow = mymont$MMEAN.FS.OPEN.CO - lightconow = mymont$MMEAN.LIGHT.LEVEL - lambdaconow = mymont$MMEAN.LAMBDA.LIGHT.CO - beamextconow = mymont$MMEAN.BEAMEXT.LEVEL - diffextconow = mymont$MMEAN.BEAMEXT.LEVEL - parlconow = mymont$MMEAN.PAR.L - - baliveconow = mymont$BALIVE - bdeadconow = mymont$BDEAD - bleafconow = mymont$BLEAF - brootconow = mymont$BROOT - bswoodconow = mymont$BSAPWOOD - bstoreconow = mymont$BSTORAGE + pftconow = mymont$PFT + nplantconow = mymont$NPLANT + heightconow = mymont$HITE + baconow = mymont$BA.CO + agbconow = mymont$AGB.CO + bseedsconow = mymont$BSEEDS.CO + laiconow = mymont$LAI.CO + waiconow = mymont$WAI.CO + taiconow = laiconow + waiconow + gppconow = mymont$MMEAN.GPP.CO + leafrespconow = mymont$MMEAN.LEAF.RESP.CO + rootrespconow = mymont$MMEAN.ROOT.RESP.CO + growthrespconow = mymont$MMEAN.GROWTH.RESP.CO + respconow = ( mymont$MMEAN.LEAF.RESP.CO + mymont$MMEAN.ROOT.RESP.CO + + mymont$MMEAN.GROWTH.RESP.CO + mymont$MMEAN.STORAGE.RESP.CO + + mymont$MMEAN.VLEAF.RESP.CO ) + nppconow = gppconow-respconow + cbalconow = mymont$MMEAN.CB + mcostconow = ( mymont$MMEAN.LEAF.MAINTENANCE + + mymont$MMEAN.ROOT.MAINTENANCE ) + ldropconow = mymont$MMEAN.LEAF.DROP.CO + cbrbarconow = mymont$CBR.BAR + ncbmortconow = mymont$MMEAN.MORT.RATE[,2] + fsoconow = mymont$MMEAN.FS.OPEN.CO + lightconow = mymont$MMEAN.LIGHT.LEVEL + lambdaconow = mymont$MMEAN.LAMBDA.LIGHT.CO + beamextconow = mymont$MMEAN.BEAMEXT.LEVEL + diffextconow = mymont$MMEAN.BEAMEXT.LEVEL + parlconow = mymont$MMEAN.PAR.L + + baliveconow = mymont$BALIVE + bdeadconow = mymont$BDEAD + bleafconow = mymont$BLEAF + brootconow = mymont$BROOT + bswoodconow = mymont$BSAPWOOD + bstoreconow = mymont$BSTORAGE sel = laiconow > 1.e-10 - demandconow = mymont$MMEAN.PSI.OPEN * day.sec + demandconow = mymont$MMEAN.PSI.OPEN * laiconow * day.sec supplyconow = mymont$MMEAN.WATER.SUPPLY * day.sec gpplconow = gppconow - demandconow[sel] = demandconow[sel] / laiconow[sel] - supplyconow[sel] = supplyconow[sel] / laiconow[sel] gpplconow [sel] = nplantconow[sel] * gppconow[sel] / laiconow[sel] - demandconow[!sel] = 0. - supplyconow[!sel] = 0. gpplconow [!sel] = 0. #-----------------------------------------------------------------------------# }else{ #----- Make everything NA. ---------------------------------------------------# - areaconow = NA - luconow = NA - dbhconow = NA - dbhbks = NA - dbhcut = NA - dbhlevs = NA - dbhfac = NA - ageconow = NA - agebks = NA - agecut = NA - agelevs = NA - agefac = NA - agepacut = NA - agepafac = NA - areapaage = NA - areaage = NA - pftconow = NA - nplantconow = NA - heightconow = NA - agbconow = NA - baconow = NA - bseedsconow = NA - laiconow = NA - waiconow = NA - taiconow = NA - gppconow = NA - gpplconow = NA - respconow = NA - nppconow = NA - cbalconow = NA - mcostconow = NA - ldropconow = NA - cbrbarconow = NA - ncbmortconow = NA - fsoconow = NA - lightconow = NA - lambdaconow = NA - beamextconow = NA - diffextconow = NA - parlconow = NA - demandconow = NA - supplyconow = NA - baliveconow = NA - bdeadconow = NA - bleafconow = NA - brootconow = NA - bswoodconow = NA - bstoreconow = NA + areaconow = NA + luconow = NA + dbhconow = NA + dbhbks = NA + dbhcut = NA + dbhlevs = NA + dbhfac = NA + ageconow = NA + agebks = NA + agecut = NA + agelevs = NA + agefac = NA + agepacut = NA + agepafac = NA + areapaage = NA + areaage = NA + pftconow = NA + nplantconow = NA + heightconow = NA + agbconow = NA + baconow = NA + bseedsconow = NA + laiconow = NA + waiconow = NA + taiconow = NA + gppconow = NA + gpplconow = NA + leafrespconow = NA + rootrespconow = NA + growthrespconow = NA + respconow = NA + nppconow = NA + cbalconow = NA + mcostconow = NA + ldropconow = NA + cbrbarconow = NA + ncbmortconow = NA + fsoconow = NA + lightconow = NA + lambdaconow = NA + beamextconow = NA + diffextconow = NA + parlconow = NA + demandconow = NA + supplyconow = NA + baliveconow = NA + bdeadconow = NA + bleafconow = NA + brootconow = NA + bswoodconow = NA + bstoreconow = NA }#end if #----- Define some classes that can be defined even when no cohorts exist. ------# @@ -1517,72 +863,88 @@ for (place in myplaces){ sel = pftconow == p }#end if if (any(sel)){ - laipft [m,p] = laipft [m,p] + sum(laiconow [sel] * areaconow[sel]) - waipft [m,p] = waipft [m,p] + sum(waiconow [sel] * areaconow[sel]) - taipft [m,p] = taipft [m,p] + sum(taiconow [sel] * areaconow[sel]) - - basareapft[m,p] = ( basareapft [m,p] - + sum( nplantconow[sel] * baconow [sel] - * areaconow[sel])) - agbpft [m,p] = ( agbpft [m,p] - + sum( nplantconow[sel] * agbconow [sel] - * areaconow[sel])) - bseedspft [m,p] = ( bseedspft [m,p] - + sum( nplantconow[sel] * bseedsconow [sel] - * areaconow [sel])) - gpppft [m,p] = ( gpppft [m,p] - + sum( nplantconow[sel] * gppconow [sel] - * areaconow[sel])) - npppft [m,p] = ( npppft [m,p] - + sum( nplantconow[sel] * nppconow [sel] - * areaconow[sel])) - mcopft [m,p] = ( mcopft [m,p] - + sum( nplantconow[sel] * mcostconow [sel] - * areaconow[sel])) - cbapft [m,p] = ( cbapft [m,p] - + sum( nplantconow[sel] * cbalconow [sel] - * areaconow[sel])) - ldroppft [m,p] = ( ldroppft [m,p] - + sum( nplantconow[sel] * ldropconow [sel] - * areaconow[sel])) - balivepft [m,p] = ( balivepft [m,p] - + sum( nplantconow[sel] * baliveconow[sel] - * areaconow[sel])) - bdeadpft [m,p] = ( bdeadpft [m,p] - + sum( nplantconow[sel] * bdeadconow[sel] - * areaconow[sel])) - bleafpft [m,p] = ( bleafpft [m,p] - + sum( nplantconow[sel] * bleafconow[sel] - * areaconow[sel])) - brootpft [m,p] = ( brootpft [m,p] - + sum( nplantconow[sel] * brootconow[sel] - * areaconow[sel])) - bswoodpft [m,p] = ( bswoodpft [m,p] - + sum( nplantconow[sel] * bswoodconow[sel] - * areaconow[sel])) - bstorepft [m,p] = ( bstorepft [m,p] - + sum( nplantconow[sel] * bstoreconow[sel] - * areaconow[sel])) + #----- "Extensive" variables, add them. ----------------------------------# + nplantpft[m,p] = nplantpft[m,p] + sum(nplantconow[sel] * areaconow[sel]) + laipft [m,p] = laipft [m,p] + sum(laiconow [sel] * areaconow[sel]) + waipft [m,p] = waipft [m,p] + sum(waiconow [sel] * areaconow[sel]) + taipft [m,p] = taipft [m,p] + sum(taiconow [sel] * areaconow[sel]) + + #----- "Intensive" variables, nplant or LAI are used as weights. ---------# + basareapft[m,p] = ( basareapft [m,p] + + sum( nplantconow[sel] * baconow [sel] + * areaconow[sel])) + agbpft [m,p] = ( agbpft [m,p] + + sum( nplantconow[sel] * agbconow [sel] + * areaconow[sel])) + bseedspft [m,p] = ( bseedspft [m,p] + + sum( nplantconow[sel] * bseedsconow [sel] + * areaconow [sel])) + gpppft [m,p] = ( gpppft [m,p] + + sum( nplantconow[sel] * gppconow [sel] + * areaconow[sel])) + npppft [m,p] = ( npppft [m,p] + + sum( nplantconow[sel] * nppconow [sel] + * areaconow[sel])) + mcopft [m,p] = ( mcopft [m,p] + + sum( nplantconow[sel] * mcostconow [sel] + * areaconow[sel])) + cbapft [m,p] = ( cbapft [m,p] + + sum( nplantconow[sel] * cbalconow [sel] + * areaconow[sel])) + ldroppft [m,p] = ( ldroppft [m,p] + + sum( nplantconow[sel] * ldropconow [sel] + * areaconow[sel])) + balivepft [m,p] = ( balivepft [m,p] + + sum( nplantconow[sel] * baliveconow[sel] + * areaconow[sel])) + bdeadpft [m,p] = ( bdeadpft [m,p] + + sum( nplantconow[sel] * bdeadconow[sel] + * areaconow[sel])) + bleafpft [m,p] = ( bleafpft [m,p] + + sum( nplantconow[sel] * bleafconow[sel] + * areaconow[sel])) + brootpft [m,p] = ( brootpft [m,p] + + sum( nplantconow[sel] * brootconow[sel] + * areaconow[sel])) + bswoodpft [m,p] = ( bswoodpft [m,p] + + sum( nplantconow[sel] * bswoodconow[sel] + * areaconow[sel])) + bstorepft [m,p] = ( bstorepft [m,p] + + sum( nplantconow[sel] * bstoreconow[sel] + * areaconow[sel])) + leafresppft[m,p] = ( leafresppft [m,p] + + sum( nplantconow[sel] * leafrespconow[sel] + * areaconow[sel])) + rootresppft[m,p] = ( rootresppft [m,p] + + sum( nplantconow[sel] * rootrespconow[sel] + * areaconow[sel])) + growthresppft[m,p] = ( growthresppft [m,p] + + sum( nplantconow[sel] * growthrespconow[sel] + * areaconow[sel])) } } #------ Find the total. ---------------------------------------------------------# - laipft [m,npft+1] = sum(laipft [m,1:npft],na.rm=TRUE) - waipft [m,npft+1] = sum(waipft [m,1:npft],na.rm=TRUE) - taipft [m,npft+1] = sum(taipft [m,1:npft],na.rm=TRUE) - agbpft [m,npft+1] = sum(agbpft [m,1:npft],na.rm=TRUE) - bseedspft [m,npft+1] = sum(bseedspft [m,1:npft],na.rm=TRUE) - gpppft [m,npft+1] = sum(gpppft [m,1:npft],na.rm=TRUE) - npppft [m,npft+1] = sum(npppft [m,1:npft],na.rm=TRUE) - mcopft [m,npft+1] = sum(mcopft [m,1:npft],na.rm=TRUE) - cbapft [m,npft+1] = sum(cbapft [m,1:npft],na.rm=TRUE) - ldroppft [m,npft+1] = sum(ldroppft [m,1:npft],na.rm=TRUE) - balivepft [m,npft+1] = sum(balivepft [m,1:npft],na.rm=TRUE) - bdeadpft [m,npft+1] = sum(bdeadpft [m,1:npft],na.rm=TRUE) - bleafpft [m,npft+1] = sum(bleafpft [m,1:npft],na.rm=TRUE) - brootpft [m,npft+1] = sum(brootpft [m,1:npft],na.rm=TRUE) - bswoodpft [m,npft+1] = sum(bswoodpft [m,1:npft],na.rm=TRUE) - bstorepft [m,npft+1] = sum(bstorepft [m,1:npft],na.rm=TRUE) - basareapft [m,npft+1] = sum(basareapft [m,1:npft],na.rm=TRUE) + nplantpft [m,npft+1] = sum(nplantpft [m,1:npft],na.rm=TRUE) + laipft [m,npft+1] = sum(laipft [m,1:npft],na.rm=TRUE) + waipft [m,npft+1] = sum(waipft [m,1:npft],na.rm=TRUE) + taipft [m,npft+1] = sum(taipft [m,1:npft],na.rm=TRUE) + agbpft [m,npft+1] = sum(agbpft [m,1:npft],na.rm=TRUE) + bseedspft [m,npft+1] = sum(bseedspft [m,1:npft],na.rm=TRUE) + gpppft [m,npft+1] = sum(gpppft [m,1:npft],na.rm=TRUE) + npppft [m,npft+1] = sum(npppft [m,1:npft],na.rm=TRUE) + mcopft [m,npft+1] = sum(mcopft [m,1:npft],na.rm=TRUE) + cbapft [m,npft+1] = sum(cbapft [m,1:npft],na.rm=TRUE) + ldroppft [m,npft+1] = sum(ldroppft [m,1:npft],na.rm=TRUE) + balivepft [m,npft+1] = sum(balivepft [m,1:npft],na.rm=TRUE) + bdeadpft [m,npft+1] = sum(bdeadpft [m,1:npft],na.rm=TRUE) + bleafpft [m,npft+1] = sum(bleafpft [m,1:npft],na.rm=TRUE) + brootpft [m,npft+1] = sum(brootpft [m,1:npft],na.rm=TRUE) + bswoodpft [m,npft+1] = sum(bswoodpft [m,1:npft],na.rm=TRUE) + bstorepft [m,npft+1] = sum(bstorepft [m,1:npft],na.rm=TRUE) + basareapft [m,npft+1] = sum(basareapft [m,1:npft],na.rm=TRUE) + leafresppft [m,npft+1] = sum(leafresppft [m,1:npft],na.rm=TRUE) + rootresppft [m,npft+1] = sum(rootresppft [m,1:npft],na.rm=TRUE) + growthresppft[m,npft+1] = sum(growthresppft[m,1:npft],na.rm=TRUE) #--------------------------------------------------------------------------------# @@ -1636,76 +998,96 @@ for (place in myplaces){ selpft = pftconow == p sel = selpft & seldbh if (any(sel)){ - laipftdbh [m,d,p] = laipftdbh [m,d,p] + - sum(laiconow [sel] * areaconow[sel]) - waipftdbh [m,d,p] = waipftdbh [m,d,p] + - sum(waiconow [sel] * areaconow[sel]) - taipftdbh [m,d,p] = taipftdbh [m,d,p] + - sum(taiconow [sel] * areaconow[sel]) - agbpftdbh [m,d,p] = agbpftdbh [m,d,p] + - sum( nplantconow[sel] * agbconow [sel] - * areaconow[sel]) - gpppftdbh [m,d,p] = gpppftdbh [m,d,p] + - sum( nplantconow[sel] * gppconow [sel] - * areaconow[sel]) - npppftdbh [m,d,p] = npppftdbh [m,d,p] + - sum( nplantconow[sel] * nppconow [sel] - * areaconow[sel]) - mcopftdbh [m,d,p] = mcopftdbh [m,d,p] + - sum( nplantconow[sel] * mcostconow [sel] - * areaconow[sel]) - cbapftdbh [m,d,p] = cbapftdbh [m,d,p] + - sum( nplantconow[sel] * cbalconow [sel] - * areaconow[sel]) + laipftdbh [m,d,p] = laipftdbh [m,d,p] + + sum(laiconow [sel] * areaconow[sel]) + waipftdbh [m,d,p] = waipftdbh [m,d,p] + + sum(waiconow [sel] * areaconow[sel]) + taipftdbh [m,d,p] = taipftdbh [m,d,p] + + sum(taiconow [sel] * areaconow[sel]) + nplantpftdbh [m,d,p] = nplantpftdbh [m,d,p] + + sum(nplantconow [sel] * areaconow[sel]) + agbpftdbh [m,d,p] = agbpftdbh [m,d,p] + + sum( nplantconow[sel] * agbconow [sel] + * areaconow[sel]) + gpppftdbh [m,d,p] = gpppftdbh [m,d,p] + + sum( nplantconow[sel] * gppconow [sel] + * areaconow[sel]) + npppftdbh [m,d,p] = npppftdbh [m,d,p] + + sum( nplantconow[sel] * nppconow [sel] + * areaconow[sel]) + mcopftdbh [m,d,p] = mcopftdbh [m,d,p] + + sum( nplantconow[sel] * mcostconow [sel] + * areaconow[sel]) + cbapftdbh [m,d,p] = cbapftdbh [m,d,p] + + sum( nplantconow[sel] * cbalconow [sel] + * areaconow[sel]) + ldrpftdbh [m,d,p] = ldrpftdbh [m,d,p] + + sum( nplantconow[sel] * ldropconow [sel] + * areaconow[sel]) + fsopftdbh [m,d,p] = fsopftdbh [m,d,p] + + sum( laiconow[sel] * fsoconow [sel] + * areaconow[sel]) + ncbmortpftdbh[m,d,p] = ncbmortpftdbh [m,d,p] + + sum( nplantconow[sel] * ncbmortconow [sel] + * areaconow[sel]) + demandpftdbh [m,d,p] = demandpftdbh [m,d,p] + + sum(demandconow [sel] * areaconow[sel]) + supplypftdbh [m,d,p] = supplypftdbh [m,d,p] + + sum(supplyconow [sel] * areaconow[sel]) } } } - #--------------------------------------------------------------------------------# + #------ Fso must be normalised by LAI. ------------------------------------------# + for (p in 1:npft){ + #---- Find the total for this PFT and store at class ndbh + 1... -------------# + laipftdbh [m,ndbh+1,p] = sum(laipftdbh [m,1:ndbh,p]) + waipftdbh [m,ndbh+1,p] = sum(waipftdbh [m,1:ndbh,p]) + taipftdbh [m,ndbh+1,p] = sum(taipftdbh [m,1:ndbh,p]) + nplantpftdbh [m,ndbh+1,p] = sum(nplantpftdbh [m,1:ndbh,p]) + agbpftdbh [m,ndbh+1,p] = sum(agbpftdbh [m,1:ndbh,p]) + gpppftdbh [m,ndbh+1,p] = sum(gpppftdbh [m,1:ndbh,p]) + npppftdbh [m,ndbh+1,p] = sum(npppftdbh [m,1:ndbh,p]) + mcopftdbh [m,ndbh+1,p] = sum(mcopftdbh [m,1:ndbh,p]) + cbapftdbh [m,ndbh+1,p] = sum(cbapftdbh [m,1:ndbh,p]) + ldrpftdbh [m,ndbh+1,p] = sum(ldrpftdbh [m,1:ndbh,p]) + demandpftdbh [m,ndbh+1,p] = sum(demandpftdbh [m,1:ndbh,p]) + supplypftdbh [m,ndbh+1,p] = sum(supplypftdbh [m,1:ndbh,p]) + #-----------------------------------------------------------------------------# + #----- Find the average Fsopen for each DBH class and amongst all classes. ---# + for (d in 1:ndbh){ + if (laipftdbh[m,d,p] != 0){ + fsopftdbh[m,d,p] = fsopftdbh[m,d,p] / laipftdbh[m,d,p] + }#end if + if (laipftdbh[m,ndbh+1,p] != 0){ + fsopftdbh[m,ndbh+1,p] = ( sum( fsopftdbh[m,1:ndbh,p] + * laipftdbh[m,1:ndbh,p] ) + / laipftdbh[m,ndbh+1,p] ) + }#end for + #--------------------------------------------------------------------------# + }#end for + #-----------------------------------------------------------------------------# - #--------------------------------------------------------------------------------# - # Build the age structure arrays. # - #--------------------------------------------------------------------------------# - for (a in 1:nage){ - if (all(is.na(agefac))){ - selage = rep(FALSE,times=length(agefac)) - }else{ - selage = agefac == a - }#end if - for (p in 1:npft){ - if (all(is.na(pftconow))){ - selpft = rep(FALSE,times=length(pftconow)) - }else{ - selpft = pftconow == p + + #-----------------------------------------------------------------------------# + # Find the average mortality rate for each DBH class and amongst all # + # classes. # + #-----------------------------------------------------------------------------# + for (d in 1:ndbh){ + if (nplantpftdbh[m,d,p] != 0){ + ncbmortpftdbh[m,d,p] = ncbmortpftdbh[m,d,p] / nplantpftdbh[m,d,p] }#end if - sel = selpft & selage - if (any(sel)){ - laipftage [m,a,p] = laipftage [m,a,p] + - sum(laiconow [sel] * areaconow[sel] / areaage[sel]) - waipftage [m,a,p] = waipftage [m,a,p] + - sum(waiconow [sel] * areaconow[sel] / areaage[sel]) - taipftage [m,a,p] = taipftage [m,a,p] + - sum(taiconow [sel] * areaconow[sel] / areaage[sel]) - agbpftage [m,a,p] = agbpftage [m,a,p] + - sum( nplantconow[sel] * agbconow [sel] - * areaconow[sel] / areaage[sel]) - gpppftage [m,a,p] = gpppftage [m,a,p] + - sum( nplantconow[sel] * gppconow [sel] - * areaconow[sel] / areaage[sel]) - npppftage [m,a,p] = npppftage [m,a,p] + - sum( nplantconow[sel] * nppconow [sel] - * areaconow[sel] / areaage[sel]) - mcopftage [m,a,p] = mcopftage [m,a,p] + - sum( nplantconow[sel] * mcostconow [sel] - * areaconow[sel] / areaage[sel]) - cbapftage [m,a,p] = cbapftage [m,a,p] + - sum( nplantconow[sel] * cbalconow [sel] - * areaconow[sel] / areaage[sel]) - } - } - } + if (nplantpftdbh[m,ndbh+1,p] != 0){ + ncbmortpftdbh[m,ndbh+1,p] = ( sum( ncbmortpftdbh[m,1:ndbh,p] + * nplantpftdbh [m,1:ndbh,p] ) + / nplantpftdbh[m,ndbh+1,p] ) + }#end for + #--------------------------------------------------------------------------# + }#end for + #-----------------------------------------------------------------------------# + }#end for #--------------------------------------------------------------------------------# @@ -1714,14 +1096,15 @@ for (place in myplaces){ #--------------------------------------------------------------------------------# # Build the derived variables. # #--------------------------------------------------------------------------------# - npp = c(npp ,sum(npppft [m,]) ) - mco = c(mco ,sum(mcopft [m,]) ) - cba = c(cba ,sum(cbapft [m,]) ) - lai = c(lai ,sum(laipft [m,]) ) - wai = c(wai ,sum(waipft [m,]) ) - tai = c(tai ,sum(taipft [m,]) ) - agb = c(agb ,sum(agbpft [m,]) ) - ldrop = c(ldrop,sum(ldroppft[m,]) ) + npp = c(npp ,sum(npppft [m,1:npft]) ) + mco = c(mco ,sum(mcopft [m,1:npft]) ) + cba = c(cba ,sum(cbapft [m,1:npft]) ) + nplant = c(nplant,sum(nplantpft[m,1:npft]) ) + lai = c(lai ,sum(laipft [m,1:npft]) ) + wai = c(wai ,sum(waipft [m,1:npft]) ) + tai = c(tai ,sum(taipft [m,1:npft]) ) + agb = c(agb ,sum(agbpft [m,1:npft]) ) + ldrop = c(ldrop ,sum(ldroppft [m,1:npft]) ) #--------------------------------------------------------------------------------# @@ -1791,42 +1174,60 @@ for (place in myplaces){ print (" * Aggregating the monthly mean...") mont12mn = list() mont12mn$gpp = tapply(X=gpp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$npp = tapply(X=npp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$nep = tapply(X=nep ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$plresp = tapply(X=plresp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$leaf.resp = tapply(X=leaf.resp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$root.resp = tapply(X=root.resp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$growth.resp = tapply(X=growth.resp ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$hetresp = tapply(X=hetresp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$cflxca = tapply(X=cflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$cflxst = tapply(X=cflxst ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$nee = tapply(X=nee ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12mn$sens = tapply(X=sens ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$hflxca = tapply(X=hflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$hflxlc = tapply(X=hflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$hflxwc = tapply(X=hflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$hflxgc = tapply(X=hflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12mn$et = tapply(X=et ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12mn$latent = tapply(X=latent ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$wflxca = tapply(X=wflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$qwflxca = tapply(X=qwflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$wflxlc = tapply(X=wflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$wflxwc = tapply(X=wflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$wflxgc = tapply(X=wflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$evap = tapply(X=evap ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$transp = tapply(X=transp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$rain = tapply(X=rain ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$atm.temp = tapply(X=atm.temp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$rshort = tapply(X=rshort ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$rlong = tapply(X=rlong ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$atm.shv = tapply(X=atm.shv ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$atm.co2 = tapply(X=atm.co2 ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$atm.prss = tapply(X=atm.prss ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$atm.vels = tapply(X=atm.vels ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12mn$ustar = tapply(X=ustar ,INDEX=mfac,FUN=mean,na.rm=TRUE) mont12mn$soil.temp = qapply(mat=soil.temp ,index=mfac,bycol=T,func=mean,na.rm=T) mont12mn$soil.water = qapply(mat=soil.water ,index=mfac,bycol=T,func=mean,na.rm=T) mont12mn$soil.mstpot = qapply(mat=soil.mstpot,index=mfac,bycol=T,func=mean,na.rm=T) - #----- Find the mean sum of squares. ---------------------------------------------------# print (" * Aggregating the monthly mean sum of squares...") - mont12sq = list() - mont12sq$gpp = tapply(X=mmsqu.gpp ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$plresp = tapply(X=mmsqu.plresp ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$hetresp = tapply(X=mmsqu.hetresp,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$nee = tapply(X=mmsqu.nee ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$sens = tapply(X=mmsqu.sens ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$hflxlc = tapply(X=mmsqu.hflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$hflxwc = tapply(X=mmsqu.hflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$hflxgc = tapply(X=mmsqu.hflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$et = tapply(X=mmsqu.et ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$latent = tapply(X=mmsqu.latent ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$wflxlc = tapply(X=mmsqu.wflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$wflxwc = tapply(X=mmsqu.wflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$wflxgc = tapply(X=mmsqu.wflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$evap = tapply(X=mmsqu.evap ,INDEX=mfac,FUN=mean,na.rm=TRUE) - mont12sq$transp = tapply(X=mmsqu.transp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq = list() + mont12sq$gpp = tapply(X=mmsqu.gpp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$plresp = tapply(X=mmsqu.plresp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$leaf.resp = tapply(X=mmsqu.leaf.resp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$root.resp = tapply(X=mmsqu.root.resp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$hetresp = tapply(X=mmsqu.hetresp ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$cflxca = tapply(X=mmsqu.cflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$cflxst = tapply(X=mmsqu.cflxst ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$hflxca = tapply(X=mmsqu.hflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$hflxlc = tapply(X=mmsqu.hflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$hflxwc = tapply(X=mmsqu.hflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$hflxgc = tapply(X=mmsqu.hflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$wflxca = tapply(X=mmsqu.wflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$qwflxca = tapply(X=mmsqu.qwflxca ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$wflxlc = tapply(X=mmsqu.wflxlc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$wflxwc = tapply(X=mmsqu.wflxwc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$wflxgc = tapply(X=mmsqu.wflxgc ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$evap = tapply(X=mmsqu.evap ,INDEX=mfac,FUN=mean,na.rm=TRUE) + mont12sq$transp = tapply(X=mmsqu.transp ,INDEX=mfac,FUN=mean,na.rm=TRUE) #---------------------------------------------------------------------------------------# # Here we convert the sum of squares into standard deviation. The standard devi- # # ation can be written in two different ways, and we will use the latter because it # @@ -1841,39 +1242,55 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# print (" * Finding the standard deviation...") srnorm1 = sqrt(1./(1. - 1. / moncensus)) - srnorm1[!is.finite(srnorm1)] = NA + srnorm1[!is.finite(srnorm1)] = 0. mont12sd = list() - mont12sd$gpp = sqrt(mont12sq$gpp - mont12mn$gpp^2 ) * srnorm1 - mont12sd$plresp = sqrt(mont12sq$plresp - mont12mn$plresp^2 ) * srnorm1 - mont12sd$hetresp = sqrt(mont12sq$hetresp - mont12mn$hetresp^2 ) * srnorm1 - mont12sd$nee = sqrt(mont12sq$nee - mont12mn$nee^2 ) * srnorm1 - mont12sd$sens = sqrt(mont12sq$sens - mont12mn$sens^2 ) * srnorm1 - mont12sd$hflxlc = sqrt(mont12sq$hflxlc - mont12mn$hflxlc^2 ) * srnorm1 - mont12sd$hflxwc = sqrt(mont12sq$hflxwc - mont12mn$hflxwc^2 ) * srnorm1 - mont12sd$hflxgc = sqrt(mont12sq$hflxgc - mont12mn$hflxgc^2 ) * srnorm1 - mont12sd$et = sqrt(mont12sq$et - mont12mn$et^2 ) * srnorm1 - mont12sd$latent = sqrt(mont12sq$latent - mont12mn$latent^2 ) * srnorm1 - mont12sd$wflxlc = sqrt(mont12sq$wflxlc - mont12mn$wflxlc^2 ) * srnorm1 - mont12sd$wflxwc = sqrt(mont12sq$wflxwc - mont12mn$wflxwc^2 ) * srnorm1 - mont12sd$wflxgc = sqrt(mont12sq$wflxgc - mont12mn$wflxgc^2 ) * srnorm1 - mont12sd$evap = sqrt(mont12sq$evap - mont12mn$evap^2 ) * srnorm1 - mont12sd$transp = sqrt(mont12sq$transp - mont12mn$transp^2 ) * srnorm1 - #----- Discard the standard deviations that may have somehow become NaN. ---------------# - mont12sd$gpp [!is.finite(mont12mn$gpp )] = NA - mont12sd$plresp [!is.finite(mont12mn$plresp )] = NA - mont12sd$hetresp [!is.finite(mont12mn$hetresp )] = NA - mont12sd$nee [!is.finite(mont12mn$nee )] = NA - mont12sd$sens [!is.finite(mont12mn$sens )] = NA - mont12sd$hflxlc [!is.finite(mont12mn$hflxlc )] = NA - mont12sd$hflxlc [!is.finite(mont12mn$hflxwc )] = NA - mont12sd$hflxgc [!is.finite(mont12mn$hflxgc )] = NA - mont12sd$et [!is.finite(mont12mn$et )] = NA - mont12sd$latent [!is.finite(mont12mn$latent )] = NA - mont12sd$wflxlc [!is.finite(mont12mn$wflxlc )] = NA - mont12sd$wflxwc [!is.finite(mont12mn$wflxwc )] = NA - mont12sd$wflxgc [!is.finite(mont12mn$wflxgc )] = NA - mont12sd$evap [!is.finite(mont12mn$evap )] = NA - mont12sd$transp [!is.finite(mont12mn$transp )] = NA + mont12sd$gpp = sqrt(mont12sq$gpp - mont12mn$gpp^2 ) * srnorm1 + mont12sd$plresp = sqrt(mont12sq$plresp - mont12mn$plresp^2 ) * srnorm1 + mont12sd$leaf.resp = sqrt(mont12sq$leaf.resp - mont12mn$leaf.resp^2 ) * srnorm1 + mont12sd$root.resp = sqrt(mont12sq$root.resp - mont12mn$root.resp^2 ) * srnorm1 + mont12sd$hetresp = sqrt(mont12sq$hetresp - mont12mn$hetresp^2 ) * srnorm1 + mont12sd$cflxca = sqrt(mont12sq$cflxca - mont12mn$cflxca^2 ) * srnorm1 + mont12sd$cflxst = sqrt(mont12sq$cflxst - mont12mn$cflxst^2 ) * srnorm1 + mont12sd$hflxca = sqrt(mont12sq$hflxca - mont12mn$hflxca^2 ) * srnorm1 + mont12sd$hflxlc = sqrt(mont12sq$hflxlc - mont12mn$hflxlc^2 ) * srnorm1 + mont12sd$hflxwc = sqrt(mont12sq$hflxwc - mont12mn$hflxwc^2 ) * srnorm1 + mont12sd$hflxgc = sqrt(mont12sq$hflxgc - mont12mn$hflxgc^2 ) * srnorm1 + mont12sd$wflxca = sqrt(mont12sq$wflxca - mont12mn$wflxca^2 ) * srnorm1 + mont12sd$qwflxca = sqrt(mont12sq$qwflxca - mont12mn$qwflxca^2 ) * srnorm1 + mont12sd$wflxlc = sqrt(mont12sq$wflxlc - mont12mn$wflxlc^2 ) * srnorm1 + mont12sd$wflxwc = sqrt(mont12sq$wflxwc - mont12mn$wflxwc^2 ) * srnorm1 + mont12sd$wflxgc = sqrt(mont12sq$wflxgc - mont12mn$wflxgc^2 ) * srnorm1 + mont12sd$evap = sqrt(mont12sq$evap - mont12mn$evap^2 ) * srnorm1 + mont12sd$transp = sqrt(mont12sq$transp - mont12mn$transp^2 ) * srnorm1 + #---------------------------------------------------------------------------------------# + # Set standard deviations that became NaN to 0. This usually happens when we run # + # the post-processing script when the simulation hasn't run for more than 2 years. We # + # can't find the standard deviation because the number of degrees of freedom becomes 0. # + #---------------------------------------------------------------------------------------# + mont12sd$gpp [!is.finite(mont12mn$gpp )] = 0. + mont12sd$plresp [!is.finite(mont12mn$plresp )] = 0. + mont12sd$leaf.resp [!is.finite(mont12mn$leaf.resp )] = 0. + mont12sd$root.resp [!is.finite(mont12mn$root.resp )] = 0. + mont12sd$hetresp [!is.finite(mont12mn$hetresp )] = 0. + mont12sd$cflxca [!is.finite(mont12mn$cflxca )] = 0. + mont12sd$cflxst [!is.finite(mont12mn$cflxst )] = 0. + mont12sd$hflxca [!is.finite(mont12mn$hflxca )] = 0. + mont12sd$hflxlc [!is.finite(mont12mn$hflxlc )] = 0. + mont12sd$hflxlc [!is.finite(mont12mn$hflxwc )] = 0. + mont12sd$hflxgc [!is.finite(mont12mn$hflxgc )] = 0. + mont12sd$wflxca [!is.finite(mont12mn$wflxca )] = 0. + mont12sd$qwflxca [!is.finite(mont12mn$qwflxca )] = 0. + mont12sd$wflxlc [!is.finite(mont12mn$wflxlc )] = 0. + mont12sd$wflxwc [!is.finite(mont12mn$wflxwc )] = 0. + mont12sd$wflxgc [!is.finite(mont12mn$wflxgc )] = 0. + mont12sd$evap [!is.finite(mont12mn$evap )] = 0. + mont12sd$transp [!is.finite(mont12mn$transp )] = 0. + #---------------------------------------------------------------------------------------# + # Estimate the standard deviation of NPP, NEP, and NEE. # + #---------------------------------------------------------------------------------------# + mont12sd$npp = sqrt(mont12sd$gpp^2 + mont12sd$plresp^2) + mont12sd$nep = sqrt(mont12sd$gpp^2 + mont12sd$plresp^2 + mont12sd$hetresp^2) + mont12sd$nee = sqrt(mont12sd$cflxca^2 + mont12sd$cflxst^2) #---------------------------------------------------------------------------------------# @@ -1884,16 +1301,21 @@ for (place in myplaces){ print (" - Aggregating the monthly mean of the diurnal cycle...") dcyc12mn = list() dcyc12mn$gpp = qapply(dcycmean$gpp ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$npp = qapply(dcycmean$npp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$plresp = qapply(dcycmean$plresp ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$leaf.resp = qapply(dcycmean$leaf.resp ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$root.resp = qapply(dcycmean$root.resp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$hetresp = qapply(dcycmean$hetresp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$nep = qapply(dcycmean$nep ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$nee = qapply(dcycmean$nee ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12mn$sens = qapply(dcycmean$sens ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$cflxca = qapply(dcycmean$cflxca ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$cflxst = qapply(dcycmean$cflxst ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$hflxca = qapply(dcycmean$hflxca ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$hflxlc = qapply(dcycmean$hflxlc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$hflxwc = qapply(dcycmean$hflxwc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$hflxgc = qapply(dcycmean$hflxgc ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12mn$et = qapply(dcycmean$et ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12mn$latent = qapply(dcycmean$latent ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$wflxca = qapply(dcycmean$wflxca ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$qwflxca = qapply(dcycmean$qwflxca ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$wflxlc = qapply(dcycmean$wflxlc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$wflxwc = qapply(dcycmean$wflxwc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$wflxgc = qapply(dcycmean$wflxgc ,index=mfac,bycol=T,func=mean,na.rm=T) @@ -1912,6 +1334,7 @@ for (place in myplaces){ dcyc12mn$atm.prss = qapply(dcycmean$atm.prss ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$can.prss = qapply(dcycmean$can.prss ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$atm.vels = qapply(dcycmean$atm.vels ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12mn$ustar = qapply(dcycmean$ustar ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$fs.open = qapply(dcycmean$fs.open ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$rain = qapply(dcycmean$rain ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12mn$rshort = qapply(dcycmean$rshort ,index=mfac,bycol=T,func=mean,na.rm=T) @@ -1931,15 +1354,18 @@ for (place in myplaces){ dcyc12sq = list() dcyc12sq$gpp = qapply(dcycmsqu$gpp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$plresp = qapply(dcycmsqu$plresp ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$leaf.resp = qapply(dcycmsqu$leaf.resp ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$root.resp = qapply(dcycmsqu$root.resp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$hetresp = qapply(dcycmsqu$hetresp ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$nep = qapply(dcycmsqu$nep ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12sq$nee = qapply(dcycmsqu$nee ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12sq$sens = qapply(dcycmsqu$sens ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$cflxca = qapply(dcycmsqu$cflxca ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$cflxst = qapply(dcycmsqu$cflxst ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$hflxca = qapply(dcycmsqu$hflxca ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$hflxlc = qapply(dcycmsqu$hflxlc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$hflxwc = qapply(dcycmsqu$hflxwc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$hflxgc = qapply(dcycmsqu$hflxgc ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12sq$et = qapply(dcycmsqu$et ,index=mfac,bycol=T,func=mean,na.rm=T) - dcyc12sq$latent = qapply(dcycmsqu$latent ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$wflxca = qapply(dcycmsqu$wflxca ,index=mfac,bycol=T,func=mean,na.rm=T) + dcyc12sq$qwflxca = qapply(dcycmsqu$qwflxca ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$wflxlc = qapply(dcycmsqu$wflxlc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$wflxwc = qapply(dcycmsqu$wflxwc ,index=mfac,bycol=T,func=mean,na.rm=T) dcyc12sq$wflxgc = qapply(dcycmsqu$wflxgc ,index=mfac,bycol=T,func=mean,na.rm=T) @@ -1959,39 +1385,77 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# print (" - Finding the standard deviation...") srnorm1 = sqrt(1./(1. - 1. / moncnt)) - srnorm1[!is.finite(srnorm1)] = NA + srnorm1[!is.finite(srnorm1)] = 0. dcyc12sd = list() dcyc12sd$gpp = sqrt(dcyc12sq$gpp -dcyc12mn$gpp^2 )*srnorm1 dcyc12sd$plresp = sqrt(dcyc12sq$plresp -dcyc12mn$plresp^2 )*srnorm1 + dcyc12sd$leaf.resp = sqrt(dcyc12sq$leaf.resp-dcyc12mn$leaf.resp^2 )*srnorm1 + dcyc12sd$root.resp = sqrt(dcyc12sq$root.resp-dcyc12mn$root.resp^2 )*srnorm1 dcyc12sd$hetresp = sqrt(dcyc12sq$hetresp -dcyc12mn$hetresp^2 )*srnorm1 dcyc12sd$nep = sqrt(dcyc12sq$nep -dcyc12mn$nep^2 )*srnorm1 - dcyc12sd$nee = sqrt(dcyc12sq$nee -dcyc12mn$nee^2 )*srnorm1 - dcyc12sd$sens = sqrt(dcyc12sq$sens -dcyc12mn$sens^2 )*srnorm1 + dcyc12sd$cflxca = sqrt(dcyc12sq$cflxca -dcyc12mn$cflxca^2 )*srnorm1 + dcyc12sd$cflxst = sqrt(dcyc12sq$cflxst -dcyc12mn$cflxst^2 )*srnorm1 + dcyc12sd$hflxca = sqrt(dcyc12sq$hflxca -dcyc12mn$hflxca^2 )*srnorm1 dcyc12sd$hflxlc = sqrt(dcyc12sq$hflxlc -dcyc12mn$hflxlc^2 )*srnorm1 dcyc12sd$hflxwc = sqrt(dcyc12sq$hflxwc -dcyc12mn$hflxwc^2 )*srnorm1 dcyc12sd$hflxgc = sqrt(dcyc12sq$hflxgc -dcyc12mn$hflxgc^2 )*srnorm1 - dcyc12sd$et = sqrt(dcyc12sq$et -dcyc12mn$et^2 )*srnorm1 - dcyc12sd$latent = sqrt(dcyc12sq$latent -dcyc12mn$latent^2 )*srnorm1 + dcyc12sd$wflxca = sqrt(dcyc12sq$wflxca -dcyc12mn$wflxca^2 )*srnorm1 + dcyc12sd$qwflxca = sqrt(dcyc12sq$qwflxca -dcyc12mn$qwflxca^2 )*srnorm1 dcyc12sd$wflxlc = sqrt(dcyc12sq$wflxlc -dcyc12mn$wflxlc^2 )*srnorm1 dcyc12sd$wflxwc = sqrt(dcyc12sq$wflxwc -dcyc12mn$wflxwc^2 )*srnorm1 dcyc12sd$wflxgc = sqrt(dcyc12sq$wflxgc -dcyc12mn$wflxgc^2 )*srnorm1 dcyc12sd$transp = sqrt(dcyc12sq$transp -dcyc12mn$transp^2 )*srnorm1 - #----- Discard the standard deviations that may have somehow become NaN. ---------------# - dcyc12sd$gpp [!is.finite(dcyc12sd$gpp )] = NA - dcyc12sd$plresp [!is.finite(dcyc12sd$plresp )] = NA - dcyc12sd$hetresp [!is.finite(dcyc12sd$hetresp)] = NA - dcyc12sd$nep [!is.finite(dcyc12sd$nep )] = NA - dcyc12sd$nee [!is.finite(dcyc12sd$nee )] = NA - dcyc12sd$sens [!is.finite(dcyc12sd$sens )] = NA - dcyc12sd$hflxlc [!is.finite(dcyc12sd$hflxlc )] = NA - dcyc12sd$hflxwc [!is.finite(dcyc12sd$hflxwc )] = NA - dcyc12sd$hflxgc [!is.finite(dcyc12sd$hflxgc )] = NA - dcyc12sd$et [!is.finite(dcyc12sd$et )] = NA - dcyc12sd$latent [!is.finite(dcyc12sd$latent )] = NA - dcyc12sd$wflxlc [!is.finite(dcyc12sd$wflxlc )] = NA - dcyc12sd$wflxwc [!is.finite(dcyc12sd$wflxwc )] = NA - dcyc12sd$wflxgc [!is.finite(dcyc12sd$wflxgc )] = NA - dcyc12sd$transp [!is.finite(dcyc12sd$transp )] = NA + #---------------------------------------------------------------------------------------# + # Set standard deviations that became NaN to 0. This usually happens when we run # + # the post-processing script when the simulation hasn't run for more than 2 years. We # + # can't find the standard deviation because the number of degrees of freedom becomes 0. # + #---------------------------------------------------------------------------------------# + dcyc12sd$gpp [!is.finite(dcyc12sd$gpp )] = 0. + dcyc12sd$plresp [!is.finite(dcyc12sd$plresp )] = 0. + dcyc12sd$leaf.resp [!is.finite(dcyc12sd$leaf.resp )] = 0. + dcyc12sd$root.resp [!is.finite(dcyc12sd$root.resp )] = 0. + dcyc12sd$hetresp [!is.finite(dcyc12sd$hetresp )] = 0. + dcyc12sd$nep [!is.finite(dcyc12sd$nep )] = 0. + dcyc12sd$cflxca [!is.finite(dcyc12sd$cflxca )] = 0. + dcyc12sd$cflxst [!is.finite(dcyc12sd$cflxst )] = 0. + dcyc12sd$hflxca [!is.finite(dcyc12sd$hflxca )] = 0. + dcyc12sd$hflxlc [!is.finite(dcyc12sd$hflxlc )] = 0. + dcyc12sd$hflxwc [!is.finite(dcyc12sd$hflxwc )] = 0. + dcyc12sd$hflxgc [!is.finite(dcyc12sd$hflxgc )] = 0. + dcyc12sd$wflxca [!is.finite(dcyc12sd$wflxca )] = 0. + dcyc12sd$qwflxca [!is.finite(dcyc12sd$qwflxca )] = 0. + dcyc12sd$wflxlc [!is.finite(dcyc12sd$wflxlc )] = 0. + dcyc12sd$wflxwc [!is.finite(dcyc12sd$wflxwc )] = 0. + dcyc12sd$wflxgc [!is.finite(dcyc12sd$wflxgc )] = 0. + dcyc12sd$transp [!is.finite(dcyc12sd$transp )] = 0. + #---------------------------------------------------------------------------------------# + # Estimate NPP and NEE standard deviation. # + #---------------------------------------------------------------------------------------# + dcyc12sd$npp = sqrt(dcyc12sd$gpp^2 + dcyc12sd$plresp^2) + dcyc12sd$nee = sqrt(dcyc12sd$cflxca^2 + dcyc12sd$cflxst^2) + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Remove all elements of the DBH/PFT class that do not have a single valid cohort # + # at any given time. # + #---------------------------------------------------------------------------------------# + empty = nplantpftdbh == 0 + agbpftdbh [empty] = NA + laipftdbh [empty] = NA + waipftdbh [empty] = NA + taipftdbh [empty] = NA + gpppftdbh [empty] = NA + npppftdbh [empty] = NA + mcopftdbh [empty] = NA + cbapftdbh [empty] = NA + ldrpftdbh [empty] = NA + fsopftdbh [empty] = NA + demandpftdbh [empty] = NA + supplypftdbh [empty] = NA + nplantpftdbh [empty] = NA + ncbmortpftdbh [empty] = NA #---------------------------------------------------------------------------------------# @@ -2016,7 +1480,8 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Define a suitable scale for those time series that uses thismonth... # #---------------------------------------------------------------------------------------# - whenplot = pretty.time(thismonth,n=8) + whenplot6 = pretty.time(thismonth,n=6) + whenplot8 = pretty.time(thismonth,n=8) #---------------------------------------------------------------------------------------# @@ -2081,6 +1546,7 @@ for (place in myplaces){ vnam = thistspft$vnam description = thistspft$desc unit = thistspft$unit + plog = thistspft$plog plotit = thistspft$plt #----- Check whether the user wants to have this variable plotted. ------------------# @@ -2095,6 +1561,13 @@ for (place in myplaces){ #----- Load variable -------------------------------------------------------------# thisvar = get(vnam) + if (plog){ + #----- Eliminate non-positive values in case it is a log plot. ----------------# + thisvar[thisvar <= 0] = NA + }#end if + #---------------------------------------------------------------------------------# + + #----- Loop over output formats. -------------------------------------------------# for (o in 1:nout){ @@ -2108,27 +1581,64 @@ for (place in myplaces){ postscript(file=fichier,width=size$width,height=size$height ,pointsize=ptsz,paper=paper) }#end if - #---- Find the limit, and nudge it in case it is constant. --------------------# - ylimit = range(thisvar[,selpft],na.rm=TRUE) - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + + + #------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is # + # a constant, nudge the limits so the plot command will not complain. # + #------------------------------------------------------------------------------# + if (plog){ + xylog = "y" + ylimit = range(log(thisvar[,selpft]),na.rm=TRUE) + if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + ylimit = exp(ylimit) + }else{ + ylimit = range(thisvar[,selpft],na.rm=TRUE) + xylog="" + if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ + ylimit = c(-1,1) + }else if(ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }#end if + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) }#end if + #------------------------------------------------------------------------------# + + letitre = paste(description,lieu,sep=" - ") - cols = pftcols[selpft] - legs = pftnames[selpft] + cols = pft$colour[selpft] + legs = pft$name [selpft] plot(x=thismonth,y=thisvar[,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",xaxt="n",ylab=unit,cex.main=0.7) - axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) + + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + if (plotgrid){ - abline(v=whenplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (n in 1:(npft+1)){ if (selpft[n]){ - lines(thismonth,thisvar[,n],type="l",col=pftcols[n],lwd=lwidth) + lines(thismonth,thisvar[,n],type="l",col=pft$colour[n],lwd=lwidth) }#end if }#end for legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) @@ -2147,6 +1657,131 @@ for (place in myplaces){ + #---------------------------------------------------------------------------------------# + # Time series by DBH, by PFT. # + #---------------------------------------------------------------------------------------# + #----- Find the PFTs to plot. ----------------------------------------------------------# + pftuse = which(apply(X=agbpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + for (v in 1:ntspftdbh){ + thistspftdbh = tspftdbh[[v]] + vnam = thistspftdbh$vnam + description = thistspftdbh$desc + unit = thistspftdbh$unit + plog = thistspftdbh$plog + plotit = thistspftdbh$plt + + #----- Load variable ----------------------------------------------------------------# + thisvar = get(vnam) + if (plog){ + xylog="y" + thisvar[thisvar <= 0] = NA + }else{ + xylog="" + }#end if + #----- Check whether the user wants to have this variable plotted. ------------------# + if (plotit && length(pftuse) > 0 && any(is.finite(thisvar))){ + + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"tsdbh",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + outvar = paste(outdir,vnam,sep="/") + if (! file.exists(outvar)) dir.create(outvar) + #---------------------------------------------------------------------------------# + + print (paste(" +",description,"time series for DBH class...")) + + + #---------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # + #---------------------------------------------------------------------------------# + if (plog){ + xylog = "y" + ylimit = range(log(thisvar[,,pftuse]),na.rm=TRUE) + if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + ylimit = exp(ylimit) + }else{ + ylimit = range(thisvar[,,pftuse],na.rm=TRUE) + xylog="" + if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ + ylimit = c(-1,1) + }else if(ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }#end if + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + }#end if + #---------------------------------------------------------------------------------# + + for (p in pftuse){ + + cpp = substring(100+p,2,3) + pftlab = paste("pft-",cpp,sep="") + + print (paste(" -",pft$name[p])) + + + #----- Loop over output formats. ----------------------------------------------# + for (o in 1:nout){ + fichier = paste(outvar,"/",vnam,"-",pftlab,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=paper) + }#end if + + letitre = paste(description,pft$name[p],lieu,sep=" - ") + plot(x=thismonth,y=thisvar[,1,p],type="n",main=letitre,ylim=ylimit + ,xlab="Time",xaxt="n",ylab=unit,cex.main=0.7,log=xylog) + axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if + if (plotgrid){ + abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") + }#end if + for (d in seq(from=1,to=ndbh+1,by=1)){ + lines(thismonth,thisvar[,d,p],type="l",col=dbhcols[d],lwd=lwidth) + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=dbhnames,col=dbhcols + ,ncol=2,title="DBH class",lwd=lwidth,cex=0.8) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end for (p in pftuse) + }#end if (tseragbpft) + } #end for tseries + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# # Time series by LU. # #---------------------------------------------------------------------------------------# @@ -2155,6 +1790,7 @@ for (place in myplaces){ vnam = thistslu$vnam description = thistslu$desc unit = thistslu$unit + plog = thistslu$plog plotit = thistslu$plt #----- Check whether the user wants to have this variable plotted. ------------------# @@ -2167,8 +1803,15 @@ for (place in myplaces){ if (! file.exists(outdir)) dir.create(outdir) print (paste(" +",description,"time series for all LUs...")) + + #----- Load variable -------------------------------------------------------------# thisvar = get(vnam) + if (plog){ + #----- Eliminate non-positive values in case it is a log plot. ----------------# + thisvar[thisvar <= 0] = NA + }#end if + #---------------------------------------------------------------------------------# #----- Loop over output formats. -------------------------------------------------# for (o in 1:nout){ @@ -2182,23 +1825,57 @@ for (place in myplaces){ postscript(file=fichier,width=size$width,height=size$height ,pointsize=ptsz,paper=paper) }#end if - #---- Find the limit, and nudge it in case it is constant. --------------------# - ylimit = range(thisvar[,sellu],na.rm=TRUE) - if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ - ylimit = c(-1,1) - }else if(ylimit[1] == ylimit[2] ){ - ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) - ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + + + #------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is # + # a constant, nudge the limits so the plot command will not complain. # + #------------------------------------------------------------------------------# + if (plog){ + xylog = "y" + ylimit = range(log(thisvar[,selpft]),na.rm=TRUE) + if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + ylimit = exp(ylimit) + }else{ + ylimit = range(thisvar[,selpft],na.rm=TRUE) + xylog="" + if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ + ylimit = c(-1,1) + }else if(ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }#end if + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) }#end if + #------------------------------------------------------------------------------# letitre = paste(description,lieu,sep=" - ") cols = lucols[sellu] legs = lunames[sellu] plot(thismonth,thisvar[,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",ylab=unit,xaxt="n",cex.main=0.7) - axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) + + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if if (plotgrid){ - abline(v=whenplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (n in 1:(nlu+1)){ if (sellu[n]){ @@ -2238,6 +1915,11 @@ for (place in myplaces){ postscript(file=fichier,width=size$width,height=size$height ,pointsize=ptsz,paper=paper) }#end if + + #---------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # + #---------------------------------------------------------------------------------# ylimit = NULL for (jlu in 1:nlu){ for (ilu in 1:nlu){ @@ -2250,14 +1932,26 @@ for (place in myplaces){ ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) }#end if + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + #---------------------------------------------------------------------------------# + letitre = paste("Disturbance rates",lieu,sep=" - ") cols = NULL legs = NULL plot(thismonth,dist[,1,1],type="n",main=letitre,ylim=ylimit ,xlab="Time",ylab="[1/yr]",xaxt="n",cex.main=0.7) - axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if if (plotgrid){ - abline(v=whenplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if n = 0 for (jlu in 1:nlu){ @@ -2312,25 +2006,49 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# outdir = paste(outpref,"tseries",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",description,"time series for several variables...")) + print (paste(" +",theme,"time series for several variables...")) #----- Define the number of layers. ----------------------------------------------# nlayers = length(vnames) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find the limit, make some room for the legend, and in case the field is a # + # constant, nudge the limits so the plot command will not complain. # + #---------------------------------------------------------------------------------# ylimit = NULL for (l in 1:nlayers){ thisvar = get(vnames[l]) ylimit = range(c(ylimit,thisvar),na.rm=TRUE) }#end for - if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ - ylimit[1] = -1 - ylimit[2] = 1 - }else if (ylimit[1] == ylimit[2] & ylimit[1] > 0){ - ylimit[2] = (1.0+scalleg) * ylimit[1] - }else if (ylimit[1] == ylimit[2] & ylimit[1] < 0){ - ylimit[2] = (1.0-scalleg) * ylimit[1] + if (plog){ + xylog = "y" + ylimit = range(ylimit,na.rm=TRUE) + if (any(! is.finite(ylimit)) || (ylimit[1] == ylimit[2] && ylimit[1] == 0)){ + ylimit = c(-1,1) + }else if (ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) + ylimit = exp(ylimit) }else{ + xylog="" + if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ + ylimit = c(-1,1) + }else if(ylimit[1] == ylimit[2] ){ + ylimit[1] = ylimit[1] * ( 1. - sign(ylimit[1]) * ylnudge) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * ylnudge) + }#end if ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + ydrought = c(ylimit[1] - 0.5 * (ylimit[2]-ylimit[1]) + ,ylimit[2] + 0.5 * (ylimit[2]-ylimit[1])) }#end if #---------------------------------------------------------------------------------# @@ -2360,18 +2078,25 @@ for (place in myplaces){ letitre = paste(theme," - ",lieu," \n"," Time series: ",theme,sep="") plot(x=thismonth,y=thisvar,type="n",main=letitre,xlab="Time" - ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=xylog,xaxt="n" ,cex.main=cex.main) - axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + axis(side=1,at=whenplot8$levels,labels=whenplot8$labels,padj=whenplot8$padj) + if (drought.mark){ + for (n in 1:ndrought){ + rect(xleft = drought[[n]][1],ybottom = ydrought[1] + ,xright = drought[[n]][2],ytop = ydrought[2] + ,col = "gray84",border=NA) + }#end for + }#end if if (plotgrid){ - abline(v=whenplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=whenplot8$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (l in 1:nlayers){ thisvar = get(vnames[l]) points(x=thismonth,y=thisvar,col=lcolours[l] ,lwd=llwd[l],type=ltype,pch=16,cex=0.8) }#end for - legend(x=legpos,inset=0.05,legend=description,col=lcolours,lwd=llwd) + legend(x=legpos,inset=0.05,legend=description,col=lcolours,lwd=llwd,cex=0.8) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -2476,7 +2201,7 @@ for (place in myplaces){ ,cex.main=cex.main) axis(side=1,at=dcycplot$levels,labels=dcycplot$labels,padj=dcycplot$padj) if (plotgrid){ - abline(v=dcycplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=dcycplot$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if for (l in 1:nlayers){ thisvar = dcyc12mn[[vnames[l]]] @@ -2525,7 +2250,7 @@ for (place in myplaces){ plotit = compnow$plt #----- Check whether there are observations for this particular site. ---------------# - if (iata == "mao"){ + if (iata == "mao" | iata == "bdf"){ obsnow = "obs.m34" }else if(iata == "stm"){ obsnow = "obs.s67" @@ -2563,14 +2288,32 @@ for (place in myplaces){ outtheme = paste(outdir,vname,sep="/") if (! file.exists(outtheme)) dir.create(outtheme) print (paste(" +",description,"comparison...")) + #---------------------------------------------------------------------------------# + #----- Define the number of layers. ----------------------------------------------# thismean = dcyc12mn[[vname]] thissdev = dcyc12sd[[vname]] + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Some variables have no standard deviation in the model. Make them 0 if this # + # is the case. # + #---------------------------------------------------------------------------------# + if (length(thissdev) == 0){ + thissdev = 0. * thismean + }#end if + #---------------------------------------------------------------------------------# + + #----- Append the last hour before the first one. --------------------------------# thismean = cbind(thismean[,ndcycle],thismean) thissdev = cbind(thissdev[,ndcycle],thissdev) + #---------------------------------------------------------------------------------# + #----- Find the plot range. ------------------------------------------------------# if (plotsd){ @@ -2616,7 +2359,7 @@ for (place in myplaces){ ,cex.main=cex.main) axis(side=1,at=dcycplot$levels,labels=dcycplot$labels,padj=dcycplot$padj) if (plotgrid){ - abline(v=dcycplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=dcycplot$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if if (plotsd){ err.x = c(thisday,rev(thisday),NA,thisday,rev(thisday)) @@ -2680,7 +2423,7 @@ for (place in myplaces){ plotit = compnow$plt #----- Check whether there are observations for this particular site. ---------------# - if (iata == "mao"){ + if (iata == "mao" | iata == "bdf"){ obsnow = "obs.m34" }else if(iata == "stm"){ obsnow = "obs.s67" @@ -2709,6 +2452,9 @@ for (place in myplaces){ sdvar = paste("msdev",vname,sep=".") obsmean = thisobs[[mnvar]] obssdev = thisobs[[sdvar]] + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# # Check whether the time series directory exists. If not, create it. # @@ -2716,11 +2462,27 @@ for (place in myplaces){ outdir = paste(outpref,"compmmean",sep="/") if (! file.exists(outdir)) dir.create(outdir) print (paste(" - ",description,"comparison...")) + #---------------------------------------------------------------------------------# + #----- Define the number of layers. ----------------------------------------------# thismean = mont12mn[[vname]] thissdev = mont12sd[[vname]] + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Some variables have no standard deviation in the model. Make them 0 if this # + # is the case. # + #---------------------------------------------------------------------------------# + if (length(thissdev) == 0){ + thissdev = 0. * thismean + }#end if + #---------------------------------------------------------------------------------# + + #----- Find the plot range. ------------------------------------------------------# if (plotsd){ @@ -2768,7 +2530,7 @@ for (place in myplaces){ ,cex.main=cex.main) axis(side=1,at=montplot$levels,labels=montplot$labels,padj=montplot$padj) if (plotgrid){ - abline(v=montplot$levels,h=axTicks(side=2),col="lightgray",lty="solid") + abline(v=montplot$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if if (plotsd){ err.x = c(montmont,rev(montmont),NA,montmont,rev(montmont)) @@ -2828,7 +2590,7 @@ for (place in myplaces){ print (paste(" + Climatology profile of ",description,"...")) #----- Find the number of rows and columns, and the axes. ------------------------# - monaxis = sort(unique(monnum[sel])) + monaxis = sort(unique(monnum)) soilaxis = slz nmon = length(monaxis) nsoil = nzg @@ -2891,7 +2653,7 @@ for (place in myplaces){ ,plot.axes={axis(side=1,at=monat,labels=monlab) axis(side=2,at=zat,labels=znice) if (hovgrid){ - abline(h=zat,v=monat,col="lightgray",lty="dotted") + abline(h=zat,v=monat,col="gray52",lty="dotted") }#end if hovgrid }#end plot.axes ) @@ -2911,6 +2673,116 @@ for (place in myplaces){ + #---------------------------------------------------------------------------------------# + # Plot the climatology of the soil properties. # + #---------------------------------------------------------------------------------------# + for (sts in 1:nsoilts){ + + #----- Retrieve variable information from the list. ---------------------------------# + thissts = soilts[[sts]] + vnam = thissts$vnam + description = thissts$desc + unit = thissts$unit + vcscheme = thissts$csch + pnlog = thissts$pnlog + plotit = thissts$plt + + if (plotit){ + + #---------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"soilts",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + print (paste(" + Time series profile of ",description,"...")) + + #----- Find the number of rows and columns, and the axes. ------------------------# + timeaxis = thismonth + soilaxis = slz + nmon = length(timeaxis) + nsoil = nzg + + #----- Convert the vector data into an array. ------------------------------------# + vararr = get(vnam) + + #----- Copy Decembers ans Januaries to make the edges buffered. ------------------# + first = vararr[1,] + first = c(first,first[nzg],first[nzg]) + + last = vararr[totmon,] + last = c(last[1],last[1],last) + + #----- Bind first and last year to the array, to make the edges buffered. --------# + varbuff = cbind(vararr[,1],vararr,vararr[,nzg]) + varbuff = rbind(first,varbuff,last) + + #---------------------------------------------------------------------------------# + # Expand the month and year axes. Make the first and last time equal time # + # steps. # + #---------------------------------------------------------------------------------# + dwhen = as.numeric(thismonth[2]-thismonth[1]) + whenaxis = c(chron(as.numeric(thismonth[1]-dwhen)) + ,timeaxis + ,chron(as.numeric(thismonth[totmon]+dwhen))) + soilaxis = -log(-1.0 * c( slz[1]*(slz[1]/slz[2]) + , soilaxis + , slz[nzg]*(slz[nzg]/slz[nzg-1]) )) + + if (pnlog){ + vrange = range(varbuff,na.rm=TRUE) + vlevels = pretty.log(x=vrange,n=ncolshov) + vnlev = length(vlevels) + }else{ + vrange = range(varbuff,na.rm=TRUE) + vlevels = pretty(x=vrange,n=ncolshov) + vnlev = length(vlevels) + }#end if + + #----- Loop over formats. --------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outdir,"/",vnam,"-",suffix,".",outform[o],sep="") + if(outform[o] == "x11"){ + X11(width=size$width,height=size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=size$width*depth,height=size$height*depth + ,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=size$width,height=size$height + ,pointsize=ptsz,paper=paper) + }#end if + + letitre = paste(description," - ",lieu,sep="") + sombreado(x=whenaxis,y=soilaxis,z=varbuff,levels=vlevels,nlevels=vnlev + ,color.palette=get(vcscheme) + ,plot.title=title(main=letitre,xlab="Month",ylab="Soil depth [m]" + ,cex.main=0.7) + ,key.title=title(main=unit,cex.main=0.8) + ,key.log=pnlog + ,plot.axes={axis(side=1,at=whenplot6$levels + ,labels=whenplot6$labels,padj=whenplot6$padj) + axis(side=2,at=zat,labels=znice) + if (hovgrid){ + abline(h=zat,v=whenplot6$levels,col="gray52" + ,lty="dotted") + }#end if hovgrid + }#end plot.axes + )#end sombreado + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end if plotit + }#end for nhov + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# # Plot the Hovmoller looking diagrams showing months and years. # #---------------------------------------------------------------------------------------# @@ -3009,10 +2881,10 @@ for (place in myplaces){ axis(side=2,at=yrat) if (hovgrid){ for (yl in yrat){ - abline(h=yl,col="lightgray",lty="dotted") + abline(h=yl,col="gray52",lty="dotted") } #end for yl for (ml in monat){ - abline(v=ml,col="lightgray",lty="dotted") + abline(v=ml,col="gray52",lty="dotted") } #end for ml }#end if hovgrid }#end plot.axes @@ -3104,7 +2976,7 @@ for (place in myplaces){ axis(side=2,at=dcycplot$levels,labels=dcycplot$labels) if (hovgrid){ abline(v=hdcycplot$levels,h=dcycplot$levels - ,col="lightgray",lty="dotted") + ,col="gray52",lty="dotted") }#end if hovgrid }#end plot.axes ) @@ -3284,11 +3156,11 @@ for (place in myplaces){ ,rep(NA,times=ncohnow))) pchww = rep(c(NA,16,NA),times=ncohnow) cexww = rep(cexww,each=3) - colww = pftcols[pftww] + colww = pft$colour[pftww] pftin = sort(unique(pftco[[ww]])) - colleg = pftcols[pftin] - pftleg = pftnames[pftin] + colleg = pft$colour[pftin] + pftleg = pft$name [pftin] #----- Loop over output formats. -------------------------------------------# @@ -3305,7 +3177,7 @@ for (place in myplaces){ ,pointsize=ptsz,paper=paper) }#end if - stcol = pftcols[pftww] + stcol = pft$colour[pftww] letitre = paste(description," - ",lieu, "\n Time :",mlist[mm],"/",thisyear,sep=" ") lezlab = paste(description," [",unit,"]",sep="") @@ -3337,121 +3209,6 @@ for (place in myplaces){ } #end if }#end for npsas #---------------------------------------------------------------------------------------# - - - - - - #---------------------------------------------------------------------------------------# - # Plot the filled contour plots as function of time and PFT. # - #---------------------------------------------------------------------------------------# - for (v in 1:nfcpft){ - - #----- Retrieve variable information from the list. ---------------------------------# - thisfc = fcpft[[v]] - vnam = thisfc$vnam - description = thisfc$desc - unit = thisfc$unit - vcscheme = thisfc$csch - vclass = thisfc$cls - plotit = thisfc$plt - - if (plotit && any(selpft)){ - #---------------------------------------------------------------------------------# - # Define which class we are going to plot. # - #---------------------------------------------------------------------------------# - if (vclass == "age"){ - thisclass = classage - expclass = c(classage[1]-dage,classage,classage[nage]+dage) - nclass = nage - atclass = pretty(classage) - leylab = "Age class" - }else{ # if (vclass == "dbh"){ - thisclass = classdbh - expclass = c(classdbh[1]-ddbh,classdbh,classdbh[ndbh]+ddbh) - nclass = ndbh - atclass = pretty(classdbh) - leylab = "DBH class" - }#end if vclass - - #---------------------------------------------------------------------------------# - # Check if the directory exists. If not, create it. # - #---------------------------------------------------------------------------------# - outdir = paste(outpref,"fcpft",sep="/") - if (! file.exists(outdir)) dir.create(outdir) - print (paste(" + ",description," time series by ",leylab,"...",sep="")) - - #----- Load this variable into "thisvar". ----------------------------------------# - thisvar = get(vnam) - - #---------------------------------------------------------------------------------# - # Define which PFTs to run. Also, find the overall range amongst all PFTs, # - # so all plants are in the same scale. # - #---------------------------------------------------------------------------------# - selpftonly = selpft[1:npft] - pftrun = seq(from=1,to=npft,by=1)[selpftonly] - vrange = range(thisvar[,,selpftonly],na.rm=TRUE) - vlevels = pretty(x=vrange,n=ncolsfc) - vnlev = length(vlevels) - - - for (p in pftrun){ - if (p < 10){ - cpcp = paste("0",p,sep="") - }else{ - cpcp = as.character(p) - } #end if - for (o in 1:nout){ - fichier = paste(outdir,"/",vnam,"-pft",cpcp,"-",suffix,".",outform[o] - ,sep="") - if(outform[o] == "x11"){ - X11(width=size$width,height=size$height,pointsize=ptsz) - }else if(outform[o] == "png"){ - png(filename=fichier,width=size$width*depth,height=size$height*depth - ,pointsize=ptsz,res=depth) - }else if(outform[o] == "eps"){ - postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) - }#end if - - #----- Copy this PFT to a scratch array. -----------------------------------# - var00 = as.matrix(thisvar[,,p]) - - #----- Expand the axis so all meaningful information is in the middle. -----# - before = thismonth[1]-(thismonth[2]-thismonth[1]) - after = thismonth[tlast]+(thismonth[tlast]-thismonth[tlast-1]) - expmonth = c(before,thismonth,after) - expmonth = chron(expmonth,out.format=c(dates="day-mon-yr",times=NULL)) - zero = rep(0,times=tlast) - expvar = cbind(zero,var00,zero) - expvar = rbind(expvar[1,],expvar,expvar[tlast,]) - - letitre = paste(description,". PFT:",p," - ",lieu,sep="") - sombreado(x=expmonth,y=expclass,z=expvar,levels=vlevels,nlevels=vnlev - ,color.palette=get(vcscheme) - ,plot.title=title(main=letitre,xlab="Time",ylab=leylab,cex.main=0.7) - ,key.title=title(main=unit,cex.main=0.8) - ,plot.axes={axis(side=1,at=whenplot$levels,labels=whenplot$labels - ,padj=whenplot$padj) - axis(side=2,at=atclass) - if (fcgrid){ - abline(v=whenplot$levels,h=atclass,col="lightgray" - ,lty="solid") - }#end if - }#end plot.axes - ) - - if (outform[o] == "x11"){ - locator(n=1) - dev.off() - }else{ - dev.off() - }#end if - } #end for outform - }#end for pftrun - }#end if plotit - }#end for nfcpft - #---------------------------------------------------------------------------------------# }#end for places #q("no") diff --git a/ED/Template/Template/plot_photo.r b/ED/Template/Template/plot_photo.r index fb0c9b793..82188a345 100644 --- a/ED/Template/Template/plot_photo.r +++ b/ED/Template/Template/plot_photo.r @@ -46,31 +46,31 @@ nplant.min = 4.e-8 # Minimum nplant. # List of possible plots. In case you don't want some of them, simply switch plt to F. # #------------------------------------------------------------------------------------------# #----- Time series plots. -----------------------------------------------------------------# -nhov = 17 +nhov = 18 hovdi01 = list(vnam = c("gpp","leaf.resp","a.open","a.clos") ,desc = c("GPP","Leaf resp.","A (open)","A (closed)") ,colour = c("forestgreen","sienna","chartreuse","goldenrod") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "carbflux" ,theme = "Carbon fluxes" ,unit = "umol/m2_leaf/s" ,legpos = "topleft" ,plt = TRUE) -hovdi02 = list(vnam = c("parv","util.parv","parv.min") - ,desc = c("Cohort PAR","Used PAR","Daytime PAR") - ,colour = c("darkorange","goldenrod","firebrick") - ,lwd = c(1.5,1.5) +hovdi02 = list(vnam = c("parv","util.parv","parv.min","nirv") + ,desc = c("Cohort PAR","Used PAR","Daytime PAR","Cohort NIR") + ,colour = c("darkorange","goldenrod","firebrick","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "parflux" - ,theme = "PAR fluxes" - ,unit = "umol/m2/s" + ,theme = "Radiation fluxes" + ,unit = "umol/m2_leaf/s" ,legpos = "topleft" ,plt = TRUE) hovdi03 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","ground.temp") ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Surface") ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "temperature" ,theme = "Temperature" @@ -80,7 +80,7 @@ hovdi03 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","ground. hovdi04 = list(vnam = c("atm.shv","can.shv","ground.shv","lsfc.shv.clos","lint.shv") ,desc = c("Atmosphere","Canopy air","Ground","Leaf Surface","Intercellular") ,colour = c("deepskyblue","gray21","sienna","chartreuse","forestgreen") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "h2oclosed" ,theme = "Water vapour mixing ratio (Closed stomata)" @@ -90,7 +90,7 @@ hovdi04 = list(vnam = c("atm.shv","can.shv","ground.shv","lsfc.shv.clos","lint hovdi05 = list(vnam = c("atm.shv","can.shv","ground.shv","lsfc.shv.open","lint.shv") ,desc = c("Atmosphere","Canopy air","Ground","Leaf Surface","Intercellular") ,colour = c("deepskyblue","gray21","sienna","chartreuse","forestgreen") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "h2oopen" ,theme = "Water vapour mixing ratio (Open stomata)" @@ -101,7 +101,7 @@ hovdi06 = list(vnam = c("atm.co2","can.co2","lsfc.co2.clos","lint.co2.clos","c ,desc = c("Atmosphere","Canopy air","Leaf surface","Intercellular" ,"GPP comp. point") ,colour = c("deepskyblue","gray21","chartreuse","forestgreen","yellowgreen") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "co2closed" ,theme = "CO2 mixing ratio (Closed stomata)" @@ -112,7 +112,7 @@ hovdi07 = list(vnam = c("atm.co2","can.co2","lsfc.co2.open","lint.co2.open","c ,desc = c("Atmosphere","Canopy air","Leaf surface","Intercellular" ,"GPP comp. point") ,colour = c("deepskyblue","gray21","chartreuse","forestgreen","yellowgreen") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "co2open" ,theme = "CO2 mixing ratio (open stomata)" @@ -133,7 +133,7 @@ hovdi09 = list(vnam = c("wood.rbw","leaf.rbw","rsw","rsw.open","rsw.clos") ,desc = c("Wood Bnd. layer","Leaf Bnd. layer","Stomatal" ,"Stomatal (open)","Stomatal (closed)") ,colour = c("goldenrod","limegreen","midnightblue","steelblue","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "resist" ,theme = "Resistance" @@ -143,7 +143,7 @@ hovdi09 = list(vnam = c("wood.rbw","leaf.rbw","rsw","rsw.open","rsw.clos") hovdi10 = list(vnam = c("fsw","fsn","fs.open") ,desc = c("Water","Nitrogen","Net") ,colour = c("deepskyblue","goldenrod","midnightblue") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "fsopen" ,theme = "Fraction of stomata that are open" @@ -153,7 +153,7 @@ hovdi10 = list(vnam = c("fsw","fsn","fs.open") hovdi11 = list(vnam = c("psi.open","psi.clos","h2o.supply") ,desc = c("Psi (open)","Psi (closed)","Supply") ,colour = c("midnightblue","steelblue","olivedrab") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "psi" ,theme = "Water flux" @@ -163,7 +163,7 @@ hovdi11 = list(vnam = c("psi.open","psi.clos","h2o.supply") hovdi12 = list(vnam = c("atm.wind","veg.wind","ustar") ,desc = c("Free atmosphere","Vegetation","Friction vel.") ,colour = c("deepskyblue","forestgreen","sienna") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "wind" ,theme = "Wind speed" @@ -173,7 +173,7 @@ hovdi12 = list(vnam = c("atm.wind","veg.wind","ustar") hovdi13 = list(vnam = c("limit.flag") ,desc = c("Photo limitation") ,colour = c("olivedrab") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptyped ,prefix = "flglim" ,theme = "Limitation flag" @@ -183,7 +183,7 @@ hovdi13 = list(vnam = c("limit.flag") hovdi14 = list(vnam = c("light.lim","rubisco.lim","low.co2.lim") ,desc = c("Light","Rubisco","Low CO2") ,colour = c("lawngreen","goldenrod","steelblue") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "limitation" ,theme = "Photosynthesis limitations" @@ -193,7 +193,7 @@ hovdi14 = list(vnam = c("light.lim","rubisco.lim","low.co2.lim") hovdi15 = list(vnam = c("vm") ,desc = c("Maximum capacity") ,colour = c("olivedrab") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,prefix = "vm" ,theme = "Maximum Rubisco capacity" @@ -204,7 +204,7 @@ hovdi16 = list(vnam = c("wood.gbw","leaf.gbw","gsw","gsw.open","gsw.clos") ,desc = c("Wood Bnd. layer","Leaf Bnd. layer","Stomatal" ,"Stomatal (open)","Stomatal (closed)") ,colour = c("goldenrod","limegreen","midnightblue","steelblue","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "condct" ,theme = "Conductance" @@ -214,13 +214,23 @@ hovdi16 = list(vnam = c("wood.gbw","leaf.gbw","gsw","gsw.open","gsw.clos") hovdi17 = list(vnam = c("wood.gbw.mmos","leaf.gbw.mmos","gsw.clos.mmos") ,desc = c("Wood Bnd. layer","Leaf Bnd. layer","Stomatal (closed)") ,colour = c("goldenrod","limegreen","sienna") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "condctmmos" ,theme = "Conductance" ,unit = "mm/s" ,legpos = "topleft" ,plt = TRUE) +hovdi18 = list(vnam = c("par.area","nir.area") + ,desc = c("Cohort PAR","Cohort NIR") + ,colour = c("darkorange","deepskyblue") + ,lwd = c(2.0,2.0) + ,type = ptype + ,prefix = "areaparflux" + ,theme = "Radiation fluxes" + ,unit = "umol/m2_gnd/s" + ,legpos = "topleft" + ,plt = TRUE) #----- Loading some packages. -------------------------------------------------------------# diff --git a/ED/Template/Template/plot_rk4.r b/ED/Template/Template/plot_rk4.r index 54ccd69d9..cf4dc7a3a 100644 --- a/ED/Template/Template/plot_rk4.r +++ b/ED/Template/Template/plot_rk4.r @@ -41,11 +41,11 @@ hovgrid = TRUE # Should I include a grid on the Hovmoller plots # List of possible plots. In case you don't want some of them, simply switch plt to F. # #------------------------------------------------------------------------------------------# #----- Time series plots. -----------------------------------------------------------------# -nphov = 25 +nphov = 28 phovdi01 = list(vnam = c("gpp","plresp","hetresp","cflxac") ,desc = c("GPP","Plant resp.","Het. resp.","Atm->Canopy") ,colour = c("forestgreen","chartreuse","sienna","deepskyblue") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "carbflux" @@ -58,7 +58,7 @@ phovdi02 = list(vnam = c("met.rshort","met.rlong","gnd.rshort" ,desc = c("Met SW","Met LW","Ground SW","Ground LW","Latent","Sensible") ,colour = c("goldenrod","limegreen","deepskyblue","chartreuse" ,"midnightblue","firebrick") - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "eneflux" @@ -66,12 +66,12 @@ phovdi02 = list(vnam = c("met.rshort","met.rlong","gnd.rshort" ,unit = "W/m2" ,legpos = "topleft" ,plt = TRUE) -phovdi03 = list(vnam = c("qwflxgc","qwflxac","qwflxlc","qwflxwc","qtransp","qdewgnd") - ,desc = c("Ground->Canopy","Air->Canopy","Leaf->Canopy","Wood->Canopy" - ,"Transpiration","Dew") +phovdi03 = list(vnam = c("wflxgc","wflxca","wflxlc","wflxwc","transp") + ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy","Wood->Canopy" + ,"Transpiration") ,colour = c("firebrick","midnightblue","chartreuse","goldenrod" - ,"darkolivegreen","deepskyblue") - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5) + ,"darkolivegreen") + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "h2oflux" @@ -79,10 +79,10 @@ phovdi03 = list(vnam = c("qwflxgc","qwflxac","qwflxlc","qwflxwc","qtransp","qd ,unit = "kg/m2/day" ,legpos = "topleft" ,plt = TRUE) -phovdi04 = list(vnam = c("hflxgc","hflxac","hflxlc","hflxwc") - ,desc = c("Ground->Canopy","Air->Canopy","Leaf->Canopy","Wood->Canopy") +phovdi04 = list(vnam = c("hflxgc","hflxca","hflxlc","hflxwc") + ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy","Wood->Canopy") ,colour = c("firebrick","midnightblue","chartreuse","goldenrod") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "sensflux" @@ -93,7 +93,7 @@ phovdi04 = list(vnam = c("hflxgc","hflxac","hflxlc","hflxwc") phovdi05 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","sfc.temp") ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Surface") ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "temperature" @@ -104,7 +104,7 @@ phovdi05 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","sfc.te phovdi06 = list(vnam = c("atm.shv","can.shv","sfc.shv") ,desc = c("Atmosphere","Canopy air","Surface") ,colour = c("deepskyblue","gray21","sienna") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "h2ovapour" @@ -115,7 +115,7 @@ phovdi06 = list(vnam = c("atm.shv","can.shv","sfc.shv") phovdi07 = list(vnam = c("atm.relhum","can.relhum") ,desc = c("Atmosphere","Canopy air") ,colour = c("aquamarine","navy") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "relhum" @@ -126,7 +126,7 @@ phovdi07 = list(vnam = c("atm.relhum","can.relhum") phovdi08 = list(vnam = c("atm.supsat","can.supsat") ,desc = c("Atmosphere","Canopy air") ,colour = c("steelblue","navy") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "supsat" @@ -137,7 +137,7 @@ phovdi08 = list(vnam = c("atm.supsat","can.supsat") phovdi09 = list(vnam = c("atm.co2","can.co2") ,desc = c("Atmosphere","Canopy air") ,colour = c("chartreuse","darkolivegreen") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "co2con" @@ -148,7 +148,7 @@ phovdi09 = list(vnam = c("atm.co2","can.co2") phovdi10 = list(vnam = c("atm.prss","can.prss") ,desc = c("Atmosphere","Canopy air") ,colour = c("violetred3","purple3") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "press" @@ -159,7 +159,7 @@ phovdi10 = list(vnam = c("atm.prss","can.prss") phovdi11 = list(vnam = c("atm.theiv","can.theiv") ,desc = c("Atmosphere","Canopy air") ,colour = c("orange","firebrick") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "theiv" @@ -170,7 +170,7 @@ phovdi11 = list(vnam = c("atm.theiv","can.theiv") phovdi12 = list(vnam = c("atm.thetav","can.thetav") ,desc = c("Atmosphere","Canopy air") ,colour = c("lawngreen","forestgreen") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "thetav" @@ -181,7 +181,7 @@ phovdi12 = list(vnam = c("atm.thetav","can.thetav") phovdi13 = list(vnam = c("prec","intercept","throughfall","wshed") ,desc = c("Precipitation","Interception","Throughfall","Shedding") ,colour = c("midnightblue","forestgreen","dodgerblue","aquamarine") - ,lwd = c(2.5,1.5,1.5,1.5) + ,lwd = c(2.5,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "prec" @@ -192,7 +192,7 @@ phovdi13 = list(vnam = c("prec","intercept","throughfall","wshed") phovdi14 = list(vnam = c("atm.vels","ustar") ,desc = c("Wind speed","Friction vel.") ,colour = c("midnightblue","goldenrod") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "wind" @@ -204,7 +204,7 @@ phovdi15 = list(vnam = c("soilcp","soilwp","soilfc","slmsts","soil.water") ,desc = c("Dry soil","Wilting Point","Field capacity","Saturation" ,"Soil moisture") ,colour = c("firebrick","goldenrod","steelblue","midnightblue","olivedrab") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "smoist" @@ -215,7 +215,7 @@ phovdi15 = list(vnam = c("soilcp","soilwp","soilfc","slmsts","soil.water") phovdi16 = list(vnam = c("zeta","ri.bulk") ,desc = c("Height scale","Richardson") ,colour = c("goldenrod","steelblue") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "turb" @@ -226,7 +226,7 @@ phovdi16 = list(vnam = c("zeta","ri.bulk") phovdi17 = list(vnam = c("ksn") ,desc = c("Ponding layers") ,colour = c("steelblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,plog = "" ,prefix = "pond" @@ -237,7 +237,7 @@ phovdi17 = list(vnam = c("ksn") phovdi18 = list(vnam = c("hdid") ,desc = c("Time step") ,colour = c("midnightblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptypeb ,plog = "y" ,prefix = "tstep" @@ -248,7 +248,7 @@ phovdi18 = list(vnam = c("hdid") phovdi19 = list(vnam = c("flag.wflxgc") ,desc = c("Flag") ,colour = c("purple") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptyped ,plog = "" ,prefix = "flagwflx" @@ -259,7 +259,7 @@ phovdi19 = list(vnam = c("flag.wflxgc") phovdi20 = list(vnam = c("atm.rhos","can.rhos") ,desc = c("Atmosphere","Canopy air") ,colour = c("sienna","goldenrod") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "dens" @@ -270,7 +270,7 @@ phovdi20 = list(vnam = c("atm.rhos","can.rhos") phovdi21 = list(vnam = c("atm.idgas","can.idgas") ,desc = c("Atmosphere","Canopy air") ,colour = c("midnightblue","deepskyblue") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "idgas" @@ -281,7 +281,7 @@ phovdi21 = list(vnam = c("atm.idgas","can.idgas") phovdi22 = list(vnam = c("flag.sfcwater") ,desc = c("Flag") ,colour = c("steelblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptyped ,plog = "" ,prefix = "flagsfcw" @@ -292,7 +292,7 @@ phovdi22 = list(vnam = c("flag.sfcwater") phovdi23 = list(vnam = c("cum.step") ,desc = c("Time step") ,colour = c("darkolivegreen") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,plog = "" ,prefix = "cum.step" @@ -303,7 +303,7 @@ phovdi23 = list(vnam = c("cum.step") phovdi24 = list(vnam = c("ggbare","ggveg","ggnet","ggold") ,desc = c("Bare","Vegetation","Net","0.2*u*") ,colour = c("darkorange3","lawngreen","goldenrod","steelblue") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "ggnd" @@ -314,7 +314,7 @@ phovdi24 = list(vnam = c("ggbare","ggveg","ggnet","ggold") phovdi25 = list(vnam = c("rgbare","rgveg","rgnet","rgold") ,desc = c("Bare","Vegetation","Net","0.2*u*") ,colour = c("darkorange3","lawngreen","goldenrod","steelblue") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "rgnd" @@ -322,7 +322,48 @@ phovdi25 = list(vnam = c("rgbare","rgveg","rgnet","rgold") ,unit = "s/m" ,legpos = "topleft" ,plt = TRUE) - +phovdi26 = list(vnam = c("par.top","par.beam.top","par.diff.top" + ,"par.bot","par.beam.bot","par.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "parrad" + ,theme = "PAR radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) +phovdi27 = list(vnam = c("nir.top","nir.beam.top","nir.diff.top" + ,"nir.bot","nir.beam.bot","nir.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "nirrad" + ,theme = "NIR radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) +phovdi28 = list(vnam = c("swv.top","swv.beam.top","swv.diff.top" + ,"swv.bot","swv.beam.bot","swv.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "swvrad" + ,theme = "SWV radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) #------------------------------------------------------------------------------------------# @@ -511,16 +552,17 @@ for (place in myplaces){ cpatch$hetresp = cpatch$cwdrh + cpatch$soilrh #----- Water flux in kg/m2/day. -----------------------------------------------------# - cpatch$qwflxlc = cpatch$wflxlc * day.sec - cpatch$qwflxwc = cpatch$wflxwc * day.sec - cpatch$qwflxgc = cpatch$wflxgc * day.sec - cpatch$qwflxac = cpatch$wflxac * day.sec - cpatch$qtransp = cpatch$transp * day.sec - cpatch$qdewgnd = cpatch$dewgnd * day.sec + cpatch$wflxlc = cpatch$wflxlc * day.sec + cpatch$wflxwc = cpatch$wflxwc * day.sec + cpatch$wflxgc = cpatch$wflxgc * day.sec + cpatch$wflxac = cpatch$wflxac * day.sec + cpatch$wflxca = - cpatch$wflxac + cpatch$transp = cpatch$transp * day.sec #----- Canopy -> Atmosphere fluxes in W/m2. -----------------------------------------# - cpatch$qwflxca = -cpatch$wflxac * alvl - cpatch$hflxca = -cpatch$hflxac + cpatch$qwflxca = - cpatch$wflxac * alvl / day.sec + cpatch$hflxca = - cpatch$hflxac + cpatch$cflxca = - cpatch$cflxac #----- Virtual potential temperature. -----------------------------------------------# cpatch$atm.thetav = cpatch$atm.theta * (1. + epim1 * cpatch$atm.shv) @@ -579,6 +621,23 @@ for (place in myplaces){ #------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------# + # Total shortwave radiation. # + #------------------------------------------------------------------------------------# + cpatch$par.top = cpatch$par.beam.top + cpatch$par.diff.top + cpatch$par.bot = cpatch$par.beam.bot + cpatch$par.diff.bot + + cpatch$nir.top = cpatch$nir.beam.top + cpatch$nir.diff.top + cpatch$nir.bot = cpatch$nir.beam.bot + cpatch$nir.diff.bot + + cpatch$swv.top = cpatch$par.top + cpatch$nir.top + cpatch$swv.beam.top = cpatch$par.beam.top + cpatch$nir.beam.top + cpatch$swv.diff.top = cpatch$par.diff.top + cpatch$nir.diff.top + cpatch$swv.bot = cpatch$par.bot + cpatch$nir.bot + cpatch$swv.beam.bot = cpatch$par.beam.bot + cpatch$nir.beam.bot + cpatch$swv.diff.bot = cpatch$par.diff.bot + cpatch$nir.diff.bot + #------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------# # Define a nice grid for time. # #------------------------------------------------------------------------------------# diff --git a/ED/Template/Template/plot_rk4pc.r b/ED/Template/Template/plot_rk4pc.r index dc17fd491..fcdc1659b 100644 --- a/ED/Template/Template/plot_rk4pc.r +++ b/ED/Template/Template/plot_rk4pc.r @@ -39,11 +39,11 @@ hovgrid = TRUE # Should I include a grid on the Hovmoller plots # List of possible plots. In case you don't want some of them, simply switch plt to F. # #------------------------------------------------------------------------------------------# #----- Time series plots. -----------------------------------------------------------------# -nphov = 25 +nphov = 28 phovdi01 = list(vnam = c("gpp","plresp","hetresp","cflxac") ,desc = c("GPP","Plant resp.","Het. resp.","Atm->Canopy") ,colour = c("forestgreen","chartreuse","sienna","deepskyblue") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "carbflux" @@ -56,7 +56,7 @@ phovdi02 = list(vnam = c("met.rshort","met.rlong","gnd.rshort" ,desc = c("Met SW","Met LW","Ground SW","Ground LW","Latent","Sensible") ,colour = c("goldenrod","limegreen","deepskyblue","chartreuse" ,"midnightblue","firebrick") - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "eneflux" @@ -64,12 +64,12 @@ phovdi02 = list(vnam = c("met.rshort","met.rlong","gnd.rshort" ,unit = "W/m2" ,legpos = "topleft" ,plt = TRUE) -phovdi03 = list(vnam = c("qwflxgc","qwflxac","qwflxlc","qwflxwc","qtransp","qdewgnd") - ,desc = c("Ground->Canopy","Air->Canopy","Leaf->Canopy","Wood->Canopy" - ,"Transpiration","Dew") +phovdi03 = list(vnam = c("wflxgc","wflxca","wflxlc","wflxwc","transp") + ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy","Wood->Canopy" + ,"Transpiration") ,colour = c("firebrick","midnightblue","chartreuse","goldenrod" - ,"darkolivegreen","deepskyblue") - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5) + ,"darkolivegreen") + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "h2oflux" @@ -77,10 +77,10 @@ phovdi03 = list(vnam = c("qwflxgc","qwflxac","qwflxlc","qwflxwc","qtransp","qd ,unit = "kg/m2/day" ,legpos = "topleft" ,plt = TRUE) -phovdi04 = list(vnam = c("hflxgc","hflxac","hflxlc","hflxwc") - ,desc = c("Ground->Canopy","Air->Canopy","Leaf->Canopy","Wood->Canopy") +phovdi04 = list(vnam = c("hflxgc","hflxca","hflxlc","hflxwc") + ,desc = c("Ground->Canopy","Canopy->Air","Leaf->Canopy","Wood->Canopy") ,colour = c("firebrick","midnightblue","chartreuse","goldenrod") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "sensflux" @@ -91,7 +91,7 @@ phovdi04 = list(vnam = c("hflxgc","hflxac","hflxlc","hflxwc") phovdi05 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","sfc.temp") ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Surface") ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "temperature" @@ -102,7 +102,7 @@ phovdi05 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","sfc.te phovdi06 = list(vnam = c("atm.shv","can.shv","sfc.shv") ,desc = c("Atmosphere","Canopy air","Surface") ,colour = c("deepskyblue","gray21","sienna") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "h2ovapour" @@ -113,7 +113,7 @@ phovdi06 = list(vnam = c("atm.shv","can.shv","sfc.shv") phovdi07 = list(vnam = c("atm.relhum","can.relhum") ,desc = c("Atmosphere","Canopy air") ,colour = c("aquamarine","navy") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "relhum" @@ -124,7 +124,7 @@ phovdi07 = list(vnam = c("atm.relhum","can.relhum") phovdi08 = list(vnam = c("atm.supsat","can.supsat") ,desc = c("Atmosphere","Canopy air") ,colour = c("steelblue","navy") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "supsat" @@ -135,7 +135,7 @@ phovdi08 = list(vnam = c("atm.supsat","can.supsat") phovdi09 = list(vnam = c("atm.co2","can.co2") ,desc = c("Atmosphere","Canopy air") ,colour = c("chartreuse","darkolivegreen") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "co2con" @@ -146,7 +146,7 @@ phovdi09 = list(vnam = c("atm.co2","can.co2") phovdi10 = list(vnam = c("atm.prss","can.prss") ,desc = c("Atmosphere","Canopy air") ,colour = c("violetred3","purple3") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "press" @@ -157,7 +157,7 @@ phovdi10 = list(vnam = c("atm.prss","can.prss") phovdi11 = list(vnam = c("atm.theiv","can.theiv") ,desc = c("Atmosphere","Canopy air") ,colour = c("orange","firebrick") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "theiv" @@ -168,7 +168,7 @@ phovdi11 = list(vnam = c("atm.theiv","can.theiv") phovdi12 = list(vnam = c("atm.thetav","can.thetav") ,desc = c("Atmosphere","Canopy air") ,colour = c("lawngreen","forestgreen") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "thetav" @@ -179,7 +179,7 @@ phovdi12 = list(vnam = c("atm.thetav","can.thetav") phovdi13 = list(vnam = c("prec","intercept","throughfall","wshed") ,desc = c("Precipitation","Interception","Throughfall","Shedding") ,colour = c("midnightblue","forestgreen","dodgerblue","aquamarine") - ,lwd = c(2.5,1.5,1.5,1.5) + ,lwd = c(2.5,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "prec" @@ -190,7 +190,7 @@ phovdi13 = list(vnam = c("prec","intercept","throughfall","wshed") phovdi14 = list(vnam = c("atm.vels","ustar") ,desc = c("Wind speed","Friction vel.") ,colour = c("midnightblue","goldenrod") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "wind" @@ -202,7 +202,7 @@ phovdi15 = list(vnam = c("soilcp","soilwp","soilfc","slmsts","soil.water") ,desc = c("Dry soil","Wilting Point","Field capacity","Saturation" ,"Soil moisture") ,colour = c("firebrick","goldenrod","steelblue","midnightblue","olivedrab") - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "smoist" @@ -213,7 +213,7 @@ phovdi15 = list(vnam = c("soilcp","soilwp","soilfc","slmsts","soil.water") phovdi16 = list(vnam = c("zeta","ri.bulk") ,desc = c("Height scale","Richardson") ,colour = c("goldenrod","steelblue") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "turb" @@ -224,7 +224,7 @@ phovdi16 = list(vnam = c("zeta","ri.bulk") phovdi17 = list(vnam = c("ksn") ,desc = c("Ponding layers") ,colour = c("steelblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,plog = "" ,prefix = "pond" @@ -235,7 +235,7 @@ phovdi17 = list(vnam = c("ksn") phovdi18 = list(vnam = c("hdid") ,desc = c("Time step") ,colour = c("midnightblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptypeb ,plog = "y" ,prefix = "tstep" @@ -246,7 +246,7 @@ phovdi18 = list(vnam = c("hdid") phovdi19 = list(vnam = c("flag.wflxgc") ,desc = c("Flag") ,colour = c("purple") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptyped ,plog = "" ,prefix = "flagwflx" @@ -257,7 +257,7 @@ phovdi19 = list(vnam = c("flag.wflxgc") phovdi20 = list(vnam = c("atm.rhos","can.rhos") ,desc = c("Atmosphere","Canopy air") ,colour = c("sienna","goldenrod") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "dens" @@ -268,7 +268,7 @@ phovdi20 = list(vnam = c("atm.rhos","can.rhos") phovdi21 = list(vnam = c("atm.idgas","can.idgas") ,desc = c("Atmosphere","Canopy air") ,colour = c("midnightblue","deepskyblue") - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,plog = "" ,prefix = "idgas" @@ -279,7 +279,7 @@ phovdi21 = list(vnam = c("atm.idgas","can.idgas") phovdi22 = list(vnam = c("flag.sfcwater") ,desc = c("Flag") ,colour = c("steelblue") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptyped ,plog = "" ,prefix = "flagsfcw" @@ -290,7 +290,7 @@ phovdi22 = list(vnam = c("flag.sfcwater") phovdi23 = list(vnam = c("cum.step") ,desc = c("Time step") ,colour = c("darkolivegreen") - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,plog = "" ,prefix = "cum.step" @@ -301,7 +301,7 @@ phovdi23 = list(vnam = c("cum.step") phovdi24 = list(vnam = c("ggbare","ggveg","ggnet","ggold") ,desc = c("Bare","Vegetation","Net","0.2*u*") ,colour = c("darkorange3","lawngreen","goldenrod","steelblue") - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "ggnd" @@ -312,7 +312,7 @@ phovdi24 = list(vnam = c("ggbare","ggveg","ggnet","ggold") phovdi25 = list(vnam = c("rgbare","rgveg","rgnet","rgold") ,desc = c("Bare","Vegetation","Net","0.2*u*") ,colour = c("darkorange3","lawngreen","goldenrod","steelblue") - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,plog = "" ,prefix = "rgnd" @@ -320,6 +320,48 @@ phovdi25 = list(vnam = c("rgbare","rgveg","rgnet","rgold") ,unit = "s/m" ,legpos = "topleft" ,plt = TRUE) +phovdi26 = list(vnam = c("par.top","par.beam.top","par.diff.top" + ,"par.bot","par.beam.bot","par.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "parrad" + ,theme = "PAR radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) +phovdi27 = list(vnam = c("nir.top","nir.beam.top","nir.diff.top" + ,"nir.bot","nir.beam.bot","nir.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "nirrad" + ,theme = "NIR radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) +phovdi28 = list(vnam = c("swv.top","swv.beam.top","swv.diff.top" + ,"swv.bot","swv.beam.bot","swv.diff.bot") + ,desc = c("Top","Beam Top","Diffuse Top" + ,"Bottom","Beam Bottom","Diffuse Bottom") + ,colour = c("firebrick","sienna","gold" + ,"midnightblue","steelblue","deepskyblue") + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) + ,type = ptype + ,plog = "" + ,prefix = "swvrad" + ,theme = "SWV radiation" + ,unit = "W/m2" + ,legpos = "topleft" + ,plt = TRUE) #------------------------------------------------------------------------------------------# @@ -337,7 +379,7 @@ chovdi01 = list(vnam = c("gpp","leaf.resp","root.resp","growth.resp","storage. ,colour = c("forestgreen","chartreuse","sienna","steelblue","goldenrod" ,"purple3") ,cohlev = c(TRUE,TRUE,TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "carbflux" ,theme = "Carbon fluxes" @@ -348,7 +390,7 @@ chovdi02 = list(vnam = c("atm.temp","can.temp","leaf.temp","wood.temp","sfc.te ,desc = c("Atmosphere","Canopy air","Leaf","Wood","Surface") ,colour = c("deepskyblue","gray21","chartreuse","goldenrod","sienna") ,cohlev = c(FALSE,FALSE,TRUE,TRUE,FALSE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "temperature" ,theme = "Temperature" @@ -359,7 +401,7 @@ chovdi03 = list(vnam = c("atm.shv","can.shv","sfc.shv","lint.shv") ,desc = c("Atmosphere","Canopy air","Ground","Intercellular") ,colour = c("deepskyblue","gray21","sienna","chartreuse","forestgreen") ,cohlev = c(FALSE,FALSE,FALSE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "h2ovap" ,theme = "Water vapour mixing ratio" @@ -371,7 +413,7 @@ chovdi04 = list(vnam = c("wood.rbw","leaf.rbw","rsw","rsw.open","rsw.clos") ,"Stomatal (open)","Stomatal (closed)") ,colour = c("goldenrod","limegreen","midnightblue","steelblue","sienna") ,cohlev = c(TRUE,TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "resist" ,theme = "Resistance" @@ -382,7 +424,7 @@ chovdi05 = list(vnam = c("fs.open") ,desc = c("Net") ,colour = c("midnightblue") ,cohlev = c(TRUE) - ,lwd = c(1.5) + ,lwd = c(2.0) ,type = ptype ,prefix = "fsopen" ,theme = "Fraction of stomata that are open" @@ -393,7 +435,7 @@ chovdi06 = list(vnam = c("atm.vels","veg.wind","ustar") ,desc = c("Free atmosphere","Vegetation","Friction vel.") ,colour = c("deepskyblue","forestgreen","sienna") ,cohlev = c(FALSE,TRUE,FALSE) - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "wind" ,theme = "Wind speed" @@ -405,7 +447,7 @@ chovdi07 = list(vnam = c("wood.gbw","leaf.gbw","gsw","gsw.open","gsw.clos") ,"Stomatal (open)","Stomatal (closed)") ,colour = c("goldenrod","limegreen","midnightblue","steelblue","sienna") ,cohlev = c(TRUE,TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "condct" ,theme = "Conductance" @@ -416,7 +458,7 @@ chovdi08 = list(vnam = c("wood.gbw.mmos","leaf.gbw.mmos","gsw.clos.mmos") ,desc = c("Wood Bnd. layer","Leaf Bnd. layer","Stomatal (closed)") ,colour = c("goldenrod","limegreen","sienna") ,cohlev = c(TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0) ,type = ptype ,prefix = "condctmmos" ,theme = "Conductance" @@ -427,7 +469,7 @@ chovdi09 = list(vnam = c("leaf.liquid","leaf.frozen","wood.liquid","wood.froze ,desc = c("Liquid (Leaf)","Ice (Leaf)","Liquid (Wood)","Ice (Wood)") ,colour = c("midnightblue","deepskyblue","sienna","goldenrod") ,cohlev = c(TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "water" ,theme = "Water on vegetation surface" @@ -438,7 +480,7 @@ chovdi10 = list(vnam = c("leaf.energy","wood.energy") ,desc = c("Leaf","Wood") ,colour = c("forestgreen","goldenrod") ,cohlev = c(TRUE,TRUE) - ,lwd = c(1.5,1.5) + ,lwd = c(2.0,2.0) ,type = ptype ,prefix = "energy" ,theme = "Internal energy" @@ -449,7 +491,7 @@ chovdi11 = list(vnam = c("leaf.hcap","leaf.h2o.hcap","wood.hcap","wood.h2o.hca ,desc = c("Leaf","Leaf Water","Wood","Wood Water") ,colour = c("lawngreen","deepskyblue","sienna","goldenrod") ,cohlev = c(TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "hcap" ,theme = "Heat capacity" @@ -463,7 +505,7 @@ chovdi12 = list(vnam = c("rshort.l","rlong.l","hflxlc","qwflxlc","qwshed","qtr ,colour = c("yellow3","goldenrod","firebrick","midnightblue","royalblue" ,"lawngreen","deepskyblue") ,cohlev = c(TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "leafenergy" ,theme = "Energy fluxes" @@ -477,7 +519,7 @@ chovdi13 = list(vnam = c("rshort.w","rlong.w","hflxwc","qwflxwc","qwshed","qtr ,colour = c("yellow3","goldenrod","firebrick","midnightblue","royalblue" ,"lawngreen","deepskyblue") ,cohlev = c(TRUE,TRUE,TRUE,TRUE,TRUE,TRUE,TRUE) - ,lwd = c(1.5,1.5,1.5,1.5,1.5,1.5,1.5) + ,lwd = c(2.0,2.0,2.0,2.0,2.0,2.0,2.0) ,type = ptype ,prefix = "woodenergy" ,theme = "Energy fluxes" @@ -685,16 +727,17 @@ for (place in myplaces){ cpatch$hetresp = cpatch$cwdrh + cpatch$soilrh #----- Water flux in kg/m2/day. -----------------------------------------------------# - cpatch$qwflxlc = cpatch$wflxlc * day.sec - cpatch$qwflxwc = cpatch$wflxwc * day.sec - cpatch$qwflxgc = cpatch$wflxgc * day.sec - cpatch$qwflxac = cpatch$wflxac * day.sec - cpatch$qtransp = cpatch$transp * day.sec - cpatch$qdewgnd = cpatch$dewgnd * day.sec + cpatch$wflxlc = cpatch$wflxlc * day.sec + cpatch$wflxwc = cpatch$wflxwc * day.sec + cpatch$wflxgc = cpatch$wflxgc * day.sec + cpatch$wflxac = cpatch$wflxac * day.sec + cpatch$wflxca = - cpatch$wflxac + cpatch$transp = cpatch$transp * day.sec #----- Canopy -> Atmosphere fluxes in W/m2. -----------------------------------------# - cpatch$qwflxca = -cpatch$wflxac * alvl + cpatch$qwflxca = -cpatch$wflxac * alvl / day.sec cpatch$hflxca = -cpatch$hflxac + cpatch$cflxca = -cpatch$cflxac #----- Virtual potential temperature. -----------------------------------------------# cpatch$atm.thetav = cpatch$atm.theta * (1. + epim1 * cpatch$atm.shv) @@ -752,6 +795,24 @@ for (place in myplaces){ #------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------# + # Total shortwave radiation. # + #------------------------------------------------------------------------------------# + cpatch$par.top = cpatch$par.beam.top + cpatch$par.diff.top + cpatch$par.bot = cpatch$par.beam.bot + cpatch$par.diff.bot + + cpatch$nir.top = cpatch$nir.beam.top + cpatch$nir.diff.top + cpatch$nir.bot = cpatch$nir.beam.bot + cpatch$nir.diff.bot + + cpatch$swv.top = cpatch$par.top + cpatch$nir.top + cpatch$swv.beam.top = cpatch$par.beam.top + cpatch$nir.beam.top + cpatch$swv.diff.top = cpatch$par.diff.top + cpatch$nir.diff.top + cpatch$swv.bot = cpatch$par.bot + cpatch$nir.bot + cpatch$swv.beam.bot = cpatch$par.beam.bot + cpatch$nir.beam.bot + cpatch$swv.diff.bot = cpatch$par.diff.bot + cpatch$nir.diff.bot + #------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------# # Define a nice grid for time. # #------------------------------------------------------------------------------------# diff --git a/ED/Template/Template/srun.sh b/ED/Template/Template/srun.sh index 603292bf7..1bd60f3e6 100755 --- a/ED/Template/Template/srun.sh +++ b/ED/Template/Template/srun.sh @@ -1,24 +1,57 @@ -#------------------------------------- CUSTOMIZE HERE -------------------------------------# -here='pathhere/thispoly' # Folder to start the run +#--------------------------------- Change settings here -----------------------------------# +here='pathhere/thispoly' # Folder to start the run queue='thisqueue' # Queue name options='' # Options, or leave it blank... bsub='/lsf/7.0/linux2.6-glibc2.3-x86_64/bin/bsub' # bsub, command to submit the job joblog=${here}'/serial_lsf.out' # Name of the job output -jobname='thisdesc-thispoly' -callserial=${here}'/callserial.sh' # Name of executable +jobname='thisdesc-thispoly' # Job name +callserial=${here}'/callserial.sh' # Name of executable +thisnum=myorder #------------------------------------------------------------------------------------------# -#----- Erasing old logfiles and joblogs ---------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Special queues, make sure they use the least amount of nodes. # +#------------------------------------------------------------------------------------------# +if [ ${queue} == "wofsy" ] +then + if [ ${thisnum} -le 12 ] + then + options='hname=wofsy011' + elif [ ${thisnum} -le 24 ] + then + options='hname=wofsy012' + elif [ ${thisnum} -le 36 ] + then + options='hname=wofsy013' + fi +elif [ ${queue} == "camd" ] +then + if [ ${thisnum} -le 48 ] + then + options='hname=camd06' + elif [ ${thisnum} -le 96 ] + then + options='hname=camd08' + fi +fi +#------------------------------------------------------------------------------------------# + + +#----- Erase old logfiles and joblogs -----------------------------------------------------# if [ -s ${joblog} ] then rm -fv ${joblog} fi +#------------------------------------------------------------------------------------------# -#----- Submitting the job, we use a shell script so we can track the run on the fly -------# + + +#----- Submit the job, we use a shell script so we can track the run on the fly -----------# if [ 'x'${options} == 'x' ] then ${bsub} -q ${queue} -o ${joblog} -J ${jobname} -n 1 ${callserial} zzzzzzzz else ${bsub} -q ${queue} -R ${options} -o ${joblog} -J ${jobname} -n 1 ${callserial} zzzzzzzz fi +#------------------------------------------------------------------------------------------# diff --git a/ED/Template/callserial.sh b/ED/Template/callserial.sh deleted file mode 100755 index b520a42b0..000000000 --- a/ED/Template/callserial.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/sh - -#------------------------------------- CUSTOMIZE HERE -------------------------------------# -root='thisroot' -here=${root}/'thispoly' # Directory to start the run -exe=${here}'/ed' # Executable -logfile=${here}'/serial_out.out' # Log file of the executable run -errfile=${here}'/serial_out.err' # Executable error file -currloc=`pwd` # Current location -#------------------------------------------------------------------------------------------# - - -#----- Erasing old logfiles and joblogs ---------------------------------------------------# -if [ -s ${logfile} ] -then - rm -fv ${logfile} -fi - -if [ -s ${errfile} ] -then - rm -fv ${errfile} -fi - -#----- Submitting the jobs to the nodes ---------------------------------------------------# -cd ${here} -${exe} -f ${here}/ED2IN 1> ${logfile} 2> ${errfile} -cd ${currloc} diff --git a/ED/Template/check_run.sh b/ED/Template/check_run.sh index f3e42b4f2..72401b520 100755 --- a/ED/Template/check_run.sh +++ b/ED/Template/check_run.sh @@ -46,63 +46,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/delall.sh b/ED/Template/delall.sh index 26477bebf..6941e9902 100755 --- a/ED/Template/delall.sh +++ b/ED/Template/delall.sh @@ -1,7 +1,34 @@ #!/bin/sh -mainpath=`pwd` -lonlat=${mainpath}'/joborder.txt' +here=`pwd` +moi=`whoami` +diskthere='/n/scratch2/moorcroft_lab' +lonlat=${here}'/joborder.txt' + +#----- Find the output path (both local and remote paths will be cleaned). ----------------# +basehere=`basename ${here}` +dirhere=`dirname ${here}` +while [ ${basehere} != ${moi} ] +do + basehere=`basename ${dirhere}` + dirhere=`dirname ${dirhere}` +done +diskhere=${dirhere} +echo '-------------------------------------------------------------------------------' +echo ' - Simulation control on disk: '${diskhere} +echo ' - Output on disk: '${diskthere} +echo '-------------------------------------------------------------------------------' +there=`echo ${here} | sed s@${diskhere}@${diskthere}@g` +#------------------------------------------------------------------------------------------# + + + + +#----- Determine the number of polygons to run. -------------------------------------------# let npolys=`wc -l ${lonlat} | awk '{print $1 }'`-3 +#------------------------------------------------------------------------------------------# + + + #----- Check that the user is aware that it will remove everything... ---------------------# if [ 'x'${1} == 'x-d' ] @@ -15,6 +42,9 @@ if [ ${proceed} != 'y' -a ${proceed} != 'Y' ] then exit fi +#------------------------------------------------------------------------------------------# + + #----- Check that the user is aware that it will remove everything... ---------------------# echo ' ' @@ -57,6 +87,7 @@ do echo ' - Deletion will begin in '${delfun}' seconds...' sleep 1 done +#------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# # Loop over all polygons. # @@ -72,74 +103,94 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# - therepath=`echo ${mainpath} | sed s@/n/Moorcroft_Lab/Users@/n/moorcroft_scratch@g` if [ 'x'${1} == 'x-d' ] then - rm -frv ${mainpath}'/'${polyname} - rm -frv ${therepath}'/'${polyname} + rm -frv ${here}'/'${polyname} + rm -frv ${there}'/'${polyname} else - cd ${mainpath}'/'${polyname} + cd ${here}'/'${polyname} + ./purge.sh + cd ${there}'/'${polyname} ./purge.sh fi done diff --git a/ED/Template/epost.sh b/ED/Template/epost.sh index a165a53d9..3f2661534 100755 --- a/ED/Template/epost.sh +++ b/ED/Template/epost.sh @@ -1,14 +1,50 @@ #!/bin/bash -here=`pwd` # ! Main path -thisqueue='moorcroft2b' # ! Queue where jobs should be submitted -lonlat=${here}'/joborder.txt' # ! File with the job instructions +here=`pwd` # ! Main path +diskthere='/n/scratch2/moorcroft_lab' # ! Disk where the output files are +thisqueue='moorcroft' # ! Queue where jobs should be submitted +lonlat=${here}'/joborder.txt' # ! File with the job instructions #----- Outroot is the main output directory. ----------------------------------------------# -outroot='/n/data/moorcroft_lab/mlongo/diary/simulations/figures/Template' +outroot='/n/moorcroftfs1/mlongo/diary/XXXXXXXXXXXXX/figures/Template' +#------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Tell whether to plot pseudo-drought or not. # +#------------------------------------------------------------------------------------------# +droughtmark="FALSE" # Should I plot a rectangle to show the drought? + # capital letters only: TRUE means yes, FALSE means no +droughtyeara=1605 # Year that the first drought instance happens (even if it is + # just the last bit) +droughtyearz=1609 # Year that the last drought instance happens (even if it + # partial) +monthsdrought="c(12,1,2,3)" # List of months that get drought, if it starts late in the + # year, put the last month first. +#------------------------------------------------------------------------------------------# + + +#----- Find the disk here to create the "there" path. -------------------------------------# +moi=`whoami` +namehere=`basename ${here}` +diskhere=`dirname ${here}` +while [ ${namehere} != ${moi} ] +do + namehere=`basename ${diskhere}` + diskhere=`dirname ${diskhere}` +done +if [ 'x'${diskthere} == 'x' ] +then + there=${here} +else + there=`echo ${here} | sed s@${diskhere}@${diskthere}@g` +fi +#------------------------------------------------------------------------------------------# #----- Determine the number of polygons to run. -------------------------------------------# let npolys=`wc -l ${lonlat} | awk '{print $1 }'`-3 echo 'Number of polygons: '${npolys}'...' +#------------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------------# # List all the R scripts you want to run. # @@ -45,63 +81,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# @@ -112,61 +167,80 @@ do hourz=`echo ${timez} | awk '{print substr($1,1,2)}'` minuz=`echo ${timez} | awk '{print substr($1,3,2)}'` + #----- Retrieve some information from ED2IN. -------------------------------------------# + iphysiol=`grep -i NL%IPHYSIOL ${here}/${polyname}/ED2IN | awk '{print $3}'` + iallom=`grep -i NL%IALLOM ${here}/${polyname}/ED2IN | awk '{print $3}'` + + if [ ${droughtmark} == "TRUE" ] + then + let yeara=${droughtyeara}-1 + let yearz=${droughtyearz}+1 + fi + for script in ${rscripts} do echo "Submitting script ${script} for polygon: ${polyname}..." case ${script} in plot_monthly.r) - let thisyeara=${yeara}+1 + let thisyeara=${yeara}+0 + thisdatea=${datea} epostout='pmon_epost.out' epostlsf='pmon_epost.lsf' epostjob='eb-pmon-'${polyiata} ;; plot_rk4.r) thisyeara=${yeara} + let thisdatea=${datea}+1 epostout='prk4_epost.out' epostlsf='prk4_epost.lsf' epostjob='eb-prk4-'${polyiata} ;; plot_rk4pc.r) thisyeara=${yeara} + let thisdatea=${datea}+1 epostout='prpc_epost.out' epostlsf='prpc_epost.lsf' epostjob='eb-prpc-'${polyiata} ;; plot_photo.r) thisyeara=${yeara} + let thisdatea=${datea}+1 epostout='ppht_epost.out' epostlsf='ppht_epost.lsf' epostjob='eb-ppht-'${polyiata} ;; patchprops.r) thisyeara=${yeara} + thisdatea=${datea} epostout='ppro_epost.out' epostlsf='ppro_epost.lsf' epostjob='eb-ppro-'${polyiata} ;; plot_daily.r) thisyeara=${yeara} + thisdatea=${datea} epostout='pday_epost.out' epostlsf='pday_epost.lsf' epostjob='eb-pday-'${polyiata} ;; plot_fast.r) thisyeara=${yeara} + thisdatea=${datea} epostout='pfst_epost.out' epostlsf='pfst_epost.lsf' epostjob='eb-pfst-'${polyiata} ;; reject_ed.r) thisyeara=${yeara} + thisdatea=${datea} epostout='prej_epost.out' epostlsf='prej_epost.lsf' epostjob='eb-prej-'${polyiata} ;; *) thisyeara=${yeara} + thisdatea=${datea} epostout='pidn_epost.out' epostlsf='pidn_epost.lsf' epostjob='eb-pidn-'${polyiata} @@ -178,21 +252,26 @@ do cp -f ${here}/Template/${script} ${here}/${polyname} #----- Switch the keywords by the current settings. ---------------------------------# - sed -i s@thispoly@${polyname}@g ${here}/${polyname}/${script} - sed -i s@thisoutroot@${outroot}@g ${here}/${polyname}/${script} - sed -i s@thispath@${here}@g ${here}/${polyname}/${script} - sed -i s@thisyeara@${thisyeara}@g ${here}/${polyname}/${script} - sed -i s@thismontha@${montha}@g ${here}/${polyname}/${script} - sed -i s@thisdatea@${datea}@g ${here}/${polyname}/${script} - sed -i s@thishoura@${houra}@g ${here}/${polyname}/${script} - sed -i s@thisminua@${minua}@g ${here}/${polyname}/${script} - sed -i s@thisyearz@${yearz}@g ${here}/${polyname}/${script} - sed -i s@thismonthz@${monthz}@g ${here}/${polyname}/${script} - sed -i s@thisdatez@${datez}@g ${here}/${polyname}/${script} - sed -i s@thishourz@${hourz}@g ${here}/${polyname}/${script} - sed -i s@thisminuz@${minuz}@g ${here}/${polyname}/${script} - sed -i s@myphysiol@${iphysiol}@g ${here}/${polyname}/${script} - sed -i s@myallom@${iallom}@g ${here}/${polyname}/${script} + sed -i s@thispoly@${polyname}@g ${here}/${polyname}/${script} + sed -i s@thisoutroot@${outroot}@g ${here}/${polyname}/${script} + sed -i s@thispath@${here}@g ${here}/${polyname}/${script} + sed -i s@thatpath@${there}@g ${here}/${polyname}/${script} + sed -i s@thisyeara@${thisyeara}@g ${here}/${polyname}/${script} + sed -i s@thismontha@${montha}@g ${here}/${polyname}/${script} + sed -i s@thisdatea@${thisdatea}@g ${here}/${polyname}/${script} + sed -i s@thishoura@${houra}@g ${here}/${polyname}/${script} + sed -i s@thisminua@${minua}@g ${here}/${polyname}/${script} + sed -i s@thisyearz@${yearz}@g ${here}/${polyname}/${script} + sed -i s@thismonthz@${monthz}@g ${here}/${polyname}/${script} + sed -i s@thisdatez@${datez}@g ${here}/${polyname}/${script} + sed -i s@thishourz@${hourz}@g ${here}/${polyname}/${script} + sed -i s@thisminuz@${minuz}@g ${here}/${polyname}/${script} + sed -i s@myphysiol@${iphysiol}@g ${here}/${polyname}/${script} + sed -i s@myallom@${iallom}@g ${here}/${polyname}/${script} + sed -i s@mydroughtmark@${droughtmark}@g ${here}/${polyname}/${script} + sed -i s@mydroughtyeara@${droughtyeara}@g ${here}/${polyname}/${script} + sed -i s@mydroughtyearz@${droughtyearz}@g ${here}/${polyname}/${script} + sed -i s@mymonthsdrought@${monthsdrought}@g ${here}/${polyname}/${script} #----- Run R to get the plots. ------------------------------------------------------# comm="R CMD BATCH ${here}/${polyname}/${script} ${here}/${polyname}/${epostout}" diff --git a/ED/Template/joborder.txt b/ED/Template/joborder.txt index 7972b5bce..311b06feb 100644 --- a/ED/Template/joborder.txt +++ b/ED/Template/joborder.txt @@ -1,88 +1,96 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ ISOIL NTEXT SAND CLAY DEPTH QUEUE MET_DRIVER DTLSM VMFACT MFACT KFACT GAMFACT D0FACT ALPHAFACT LWFACT BETAFLAG THIOFF USTMIN GGFACT WLIMIT BLYRCND IALLOM ICANTURB ISFCLYRM GAMM GAMH TPRANDTL VH2VR VH2DH RIBMAX MAXWHC RUNOFF ATMCO2 THCRIT SM_FIRE AGEFALL GRNDVAP CROWN_MOD QUANTUM ISOILBC IPERCOL IPHYSIOL ICANSWRAD IMETRAD IBRANCH ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -harvard hvd -72.170 42.540 1499 05 01 0000 2005 01 01 0000 2 2 -1.00 -1.00 E unrestricted_parallel Harvard 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 1.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -manaus_km34 m34 -60.209 -2.609 1500 01 01 0000 2005 01 01 0000 2 11 0.20 0.68 H unrestricted_parallel Manaus_KM34 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -caxiuana cax06 -51.458 -1.720 1500 01 01 0000 2005 01 01 0000 2 11 0.38 0.44 D unrestricted_parallel Caxiuana 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -santarem_km67 s67 -54.959 -2.857 1500 01 01 0000 2005 01 01 0000 2 11 0.02 0.90 H unrestricted_parallel Santarem_KM67 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -rebio_jaru rja -61.931 -10.083 1500 01 01 0000 2005 01 01 0000 2 2 0.80 0.10 B unrestricted_parallel Reserva_Jaru 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -pedegigante pdg -47.650 -21.619 1500 01 01 0000 2005 01 01 0000 2 2 0.85 0.03 F unrestricted_parallel Reserva_Pe-de-Gigante 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -bananal ban -50.159 -9.824 1500 01 01 0000 2005 01 01 0000 2 9 0.24 0.37 C unrestricted_parallel Bananal_Island 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -la_lorena lor-01 -69.991 -3.056 1500 01 01 0000 2005 01 01 0000 2 9 0.38 0.31 A unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -el_zafire zar-01 -69.902 -4.007 1500 01 01 0000 2005 01 01 0000 2 2 0.7475 0.006 B unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -allpahuayo alp-21 -73.437 -3.953 1500 01 01 0000 2005 01 01 0000 2 1 0.937 0.026 D unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -tambopata tam-05 -69.271 -12.830 1500 01 01 0000 2005 01 01 0000 2 11 0.4 0.43 B unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -fazendans fns -62.357 -10.762 1500 01 01 0000 2005 01 01 0000 2 2 0.80 0.10 G unrestricted_parallel Fazenda_NS 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 378. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -santarem_km77 s77 -54.537 -3.012 1500 01 01 0000 2005 01 01 0000 2 11 0.18 0.80 H unrestricted_parallel Santatem_KM77 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 378. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -alta_floresta afl -56.100 -9.867 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -angra_dos_reis aei -44.300 -22.970 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -araguaiana ayx -51.810 -15.710 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -araracuara arc -72.398 -0.601 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -asuncion asu -57.560 -25.300 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -barro_colorado bci -79.850 9.160 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -belo_horizonte cnf -43.950 -19.850 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -belem bel -48.480 -1.380 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -blumenau bnu -49.060 -26.920 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -boa_vista bvb -60.610 2.920 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -bogota bog -74.100 4.650 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -brasilia bsb -47.910 -15.860 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -cabo_frio cfb -42.070 -22.920 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -cajazeiras cjz -38.570 -6.900 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -calabozo clz -67.420 8.920 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -canarana qnr -52.250 -13.560 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -chaiten wch -72.500 -42.500 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 1.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -cochabamba cbb -66.170 -17.420 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -cuiaba cgb -56.100 -15.600 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -curitiba cwb -49.230 -25.410 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -diamantino dmt -56.620 -14.370 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -dourados dou -54.810 -22.220 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -el_triunfo etf -67.000 -13.500 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -erechim erm -52.240 -27.610 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -eunapolis enp -39.580 -16.330 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -fortaleza for -38.530 -3.780 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -iguape igp -47.590 -24.630 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -imperatriz imp -47.460 -5.530 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -iquique iqq -69.970 -20.240 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -itabaiana ibn -37.420 -10.680 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -itapeva ipv -48.880 -23.980 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -jacareacanga jcr -57.777 -6.233 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -jiparana jpr -61.980 -10.860 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -joao_pessoa jpa -34.910 -7.100 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -la_esmeralda lfe -65.540 3.170 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -la_planada lpn -77.994 1.116 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -la_selva lzv -84.010 10.430 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -labrea lbr -64.770 -7.280 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -lencois lec -41.350 -12.480 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -macapa mcp -51.090 0.330 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -malalcahuello zmh -71.580 -38.470 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 1.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -manaus mao -60.020 -3.110 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -manicore mnx -61.280 -5.820 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -maringa mgf -52.010 -23.470 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -montes_claros moc -43.820 -16.710 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -neuquen nqn -68.000 -39.000 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 1.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -oeiras oei -42.160 -7.020 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -palmas pmw -48.360 -10.290 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -paramaribo pbm -55.150 5.830 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -petrolina pnz -40.510 -9.390 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -porto_de_moz ptq -52.236 -1.741 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H moorcroft_6100b Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -pucallpa pcl -74.570 -8.380 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -puerto_suarez psz -58.090 -18.580 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -quibdo uib -76.640 5.690 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -recife rec -34.910 -8.070 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -redencao rdc -49.980 -8.030 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -ribeirao_preto rao -47.780 -21.140 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -rio_branco rbr -67.890 -9.870 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -salta sla -65.483 -24.850 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -san_pedro zpe -54.110 -26.630 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -sao_felix_araguaia zfx -50.690 -11.630 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -sao_felix_xingu sfx -51.950 -6.640 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -sao_luis slz -44.236 -2.586 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -sao_gabriel sjl -66.980 -0.140 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -santarem stm -54.959 -2.857 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -tefe tff -64.720 -3.380 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -teresina the -42.800 -5.090 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -tirios obi -55.940 2.220 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -vina_del_mar kna -71.480 -32.950 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -vilhena bvh -60.100 -12.730 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -vitoria vix -40.390 -20.310 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 -yasuni ysn -76.396 -0.686 1500 01 01 0000 2005 01 01 0000 1 1 -1.00 -1.00 H unrestricted_parallel Sheffield 240 1.20 1.125 3.00 0.75 1.25 0.875 1.00 2.00 0.00 0.010 1.00 1 0 4 2 3 13.0 13.0 0.74 0.13 0.63 2.00 0.11 3600. 278. 0.11 0.08 0.0 0 1 0 1 1 2 1 2 0 +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ ISOIL NTEXT SAND CLAY DEPTH COLOUR SLZRES QUEUE MET_DRIVER DTLSM VMFACT_C3 VMFACT_C4 MPHOTO_TRC3 MPHOTO_TEC3 MPHOTO_C4 BPHOTO_BLC3 BPHOTO_NLC3 BPHOTO_C4 KW_GRASS KW_TREE GAMMA_C3 GAMMA_C4 D0_GRASS D0_TREE ALPHA_C3 ALPHA_C4 KLOWCO2 RRFFACT GROWTHRESP LWIDTH_GRASS LWIDTH_BLTREE LWIDTH_NLTREE Q10_C3 Q10_C4 H2O_LIMIT ISFCLYRM ICANTURB UBMIN UGBMIN USTMIN GAMM GAMH TPRANDTL RIBMAX ATMCO2 THCRIT SM_FIRE ISOILBC IMETRAD IBRANCH ICANRAD CROWN_MOD LTRANS_VIS LREFLECT_VIS LTRANS_NIR LREFLECT_NIR ORIENT_TREE ORIENT_GRASS CLUMP_TREE CLUMP_GRASS IVEGTDYN IGNDVAP IPHEN IALLOM +-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 2 2 -1.0000 -1.000 E 2 0 camd Harvard 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 1 2 +manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 2 11 0.2000 0.680 H 2 0 camd Manaus_KM34 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 2 16 0.3800 0.440 D 2 0 camd Caxiuana 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 2 15 0.0200 0.900 H 2 0 camd Santarem_KM67 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 2 16 0.3900 0.590 H 2 0 camd Santarem_KM83 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 2 2 0.8000 0.100 D 2 0 camd Reserva_Jaru 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 2 2 0.8500 0.030 F 2 0 camd Reserva_Pe-de-Gigante 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 2 6 0.5620 0.345 E 2 0 camd Guyaflux 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 2 9 0.2400 0.370 C 2 0 camd Bananal_Island 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 2 9 0.3800 0.310 A 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 2 2 0.7475 0.006 B 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 2 1 0.9370 0.026 D 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 2 11 0.4000 0.430 B 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 2 2 0.8000 0.100 G 2 0 camd Fazenda_NS 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 2 11 0.1800 0.800 H 2 0 camd Santarem_KM77 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 2 3 0.7600 0.160 D 2 0 camd Santarem_KM77 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 2 17 0.2000 0.420 D 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +cardoso czi -47.957 -25.096 1200 01 01 0000 1700 01 01 0000 2 1 0.9500 0.010 C 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 2 6 0.5700 0.290 F 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 2 2 0.8400 0.120 E 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 2 4 0.2590 0.255 F 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +cabo_frio cfb -42.070 -22.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +petrolina pnz -40.510 -9.390 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 +xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 1 1 -1.0000 -1.000 H 2 0 camd Sheffield 240 1.25 1.00 9.0 7.2 5.0 10000. 1000. 8000. 300. 300. 0.015 0.036 0.015 0.015 0.080 0.053 4000. 1.000 0.333 0.05 0.10 0.05 2.2 2.2 2 3 4 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 0.07 1 2 1 0 1 0.050 0.100 0.270 0.540 0.150 -0.150 1.000 1.000 1 0 2 2 diff --git a/ED/Template/nc_check_run.sh b/ED/Template/nc_check_run.sh index 18eaf7ccc..b427e0753 100755 --- a/ED/Template/nc_check_run.sh +++ b/ED/Template/nc_check_run.sh @@ -23,63 +23,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_spawn.sh b/ED/Template/nc_spawn.sh index e73af7a0a..1ebe7a400 100755 --- a/ED/Template/nc_spawn.sh +++ b/ED/Template/nc_spawn.sh @@ -38,63 +38,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_submitter.sh b/ED/Template/nc_submitter.sh index 813ade353..518f82a68 100755 --- a/ED/Template/nc_submitter.sh +++ b/ED/Template/nc_submitter.sh @@ -22,63 +22,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/reset.sh b/ED/Template/reset.sh new file mode 100755 index 000000000..b7e67eb79 --- /dev/null +++ b/ED/Template/reset.sh @@ -0,0 +1,304 @@ +#!/bin/sh +here=`pwd` +moi=`whoami` +diskthere='/n/scratch2/moorcroft_lab' +lonlat=${here}'/joborder.txt' + +desc=`basename ${here}` + +#----- Executable name. -------------------------------------------------------------------# +execname='ed_2.1-opt' +execsrc=${HOME}'/EDBRAMS/ED/build' +#------------------------------------------------------------------------------------------# + + +#----- Find the output path (both local and remote paths will be cleaned). ----------------# +basehere=`basename ${here}` +dirhere=`dirname ${here}` +while [ ${basehere} != ${moi} ] +do + basehere=`basename ${dirhere}` + dirhere=`dirname ${dirhere}` +done +diskhere=${dirhere} +echo '-------------------------------------------------------------------------------' +echo ' - Simulation control on disk: '${diskhere} +echo ' - Output on disk: '${diskthere} +echo '-------------------------------------------------------------------------------' +there=`echo ${here} | sed s@${diskhere}@${diskthere}@g` +#------------------------------------------------------------------------------------------# + + +#----- Determine the number of polygons to run. -------------------------------------------# +let npolys=`wc -l ${lonlat} | awk '{print $1 }'`-3 +#------------------------------------------------------------------------------------------# + + +#----- Check that the user is aware that it will remove everything... ---------------------# +if [ 'x'${1} == 'x-d' ] +then + echo 'Are you sure you want to stop all jobs, and remove all files and folders? [y/N]' +else + echo 'Are you sure you want to stop all jobs, and remove all files? [y/N]' +fi +read proceed + +if [ ${proceed} != 'y' -a ${proceed} != 'Y' ] +then + exit +fi + +echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +echo ' ' +echo ' Look, this will really stop ALL your jobs and delete all files!!!' +echo ' Are you sure? [y/N]' +echo ' ' +echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +echo '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' +read proceed + +if [ ${proceed} != 'y' -a ${proceed} != 'Y' ] +then + exit +fi + +echo "Okay then, but if you regret later don't say that I did not warn you..." +echo "I'm giving you a few seconds to kill this script in case you change your mind..." +delfun=11 +while [ ${delfun} -gt 1 ] +do + delfun=`expr ${delfun} - 1` + echo ' - Job stopping will begin in '${delfun}' seconds...' + sleep 1 +done +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Loop over all polygons. # +#------------------------------------------------------------------------------------------# +ff=0 +while [ ${ff} -lt ${npolys} ] +do + let ff=${ff}+1 + let line=${ff}+3 + + #---------------------------------------------------------------------------------------# + # Read the ffth line of the polygon list. There must be smarter ways of doing # + # this, but this works. Here we obtain the polygon name, and its longitude and # + # latitude. # + #---------------------------------------------------------------------------------------# + oi=`head -${line} ${lonlat} | tail -1` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` + #---------------------------------------------------------------------------------------# + + bkill -J ${desc}-${polyname} -q ${queue} +done +#------------------------------------------------------------------------------------------# + + +delfun=16 +while [ ${delfun} -gt 1 ] +do + delfun=`expr ${delfun} - 1` + echo ' - Files will be deleted in '${delfun}' seconds...' + sleep 1 +done + + +#------------------------------------------------------------------------------------------# +# Loop over all polygons. # +#------------------------------------------------------------------------------------------# +ff=0 +while [ ${ff} -lt ${npolys} ] +do + let ff=${ff}+1 + let line=${ff}+3 + #---------------------------------------------------------------------------------------# + # Read the ffth line of the polygon list. There must be smarter ways of doing # + # this, but this works. Here we obtain the polygon name, and its longitude and # + # latitude. # + #---------------------------------------------------------------------------------------# + oi=`head -${line} ${lonlat} | tail -1` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` + #---------------------------------------------------------------------------------------# + + + + if [ 'x'${1} == 'x-d' ] + then + rm -frv ${here}'/'${polyname} + rm -frv ${there}'/'${polyname} + else + cd ${here}'/'${polyname} + ./purge.sh + cd ${there}'/'${polyname} + ./purge.sh + fi +done +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Replace the executable. # +#------------------------------------------------------------------------------------------# +cd ${here} +if [ -s ${here}/executable/${execname} ] +then + rm -frv ${here}/executable/${execname} + cp -fv ${execsrc}/${execname} ${here}/executable +fi +#------------------------------------------------------------------------------------------# diff --git a/ED/Template/spawn_poly.sh b/ED/Template/spawn_poly.sh index e9109d22f..c837615fb 100755 --- a/ED/Template/spawn_poly.sh +++ b/ED/Template/spawn_poly.sh @@ -1,48 +1,124 @@ #!/bin/sh +#==========================================================================================# +#==========================================================================================# +# Main settings: # +#------------------------------------------------------------------------------------------# +#----- Main path, usually set by `pwd` so you don't need to change it. --------------------# here=`pwd` -there=`echo ${here} | sed s@/n/Moorcroft_Lab/Users@/n/moorcroft_scratch@g` +#----- User name, usually set by `whoami` so you don't need to change it. -----------------# +moi=`whoami` +#----- Description of this simulation, used to create unique job names. -------------------# desc=`basename ${here}` -sitemet='/n/moorcroft_scratch/nlevine/data/ed2_data/site_met_driver' -hvdmet='/n/home11/aantonarakis/EDrelease65/run/' -bioinit='/n/moorcroft_data/mlongo/data/site_bio_data' -sheffield='SHEF_NCEP_DRIVER_DS314' +#----- Path where biomass initialisation files are: ---------------------------------------# +bioinit='/n/moorcroft_data/mlongo/data/ed2_data/site_bio_data' +#----- File containing the list of jobs and their settings: -------------------------------# lonlat=${here}'/joborder.txt' +#----- Should the output be in a disk other than the one set in "here"? -------------------# +outthere='y' +#----- Disk name (usually just the path until right before your own directory). -----------# +diskthere='/n/scratch2/moorcroft_lab' +#----- This is the default path with the met driver. --------------------------------------# +sitemetdef='/n/moorcroft_data/mlongo/data/ed2_data/site_met_driver' +#----- This is the header with the Sheffield data. ----------------------------------------# +shefhead='SHEF_NCEP_DRIVER_DS314' +#----- Should we use pseudo drought data? -------------------------------------------------# +pseudodrought='n' +#----- Path with default pseudo drought drivers. ------------------------------------------# +pdroughtpathdef='/n/moorcroft_data/mlongo/data/ed2_data/pseudo_drought' +#----- Should the met driver be copied to local scratch disks? ----------------------------# +copy2scratch='y' +#------------------------------------------------------------------------------------------# +# In case we should copy, this is the source where the data is organised to go. This # +# will override sitemetdef and pdroughtpath. # +#------------------------------------------------------------------------------------------# +packdatasrc='/n/data/moorcroft_lab/mlongo/stripe_1M_35' -#----- History run variables. -------------------------------------------------------------# -forcehisto=0 # Impose history start (0 = no, 1 = yes). The following variables will - # be used only whent forcehisto is 1. +#------------------------------------------------------------------------------------------# +# History run variables. # +#------------------------------------------------------------------------------------------# +#----- Force history run (0 = no, 1 = yes). -----------------------------------------------# +forcehisto=0 +#----- Path with the history file to be used. ---------------------------------------------# fullygrown='/n/moorcroftfs1/mlongo/EDBRAMS/debug/dbg_033/pdg_crash/histo/pedegigante' -yearh='1510' -monthh='07' -dateh='01' -timeh='0000' +#----- Time that we shall use. ------------------------------------------------------------# +yearh='1510' # Year +monthh='07' # Month +dateh='01' # Day +timeh='0000' # Hour +#----- Default tolerance. -----------------------------------------------------------------# +toldef='0.01' -toldef='0.001' +#------------------------------------------------------------------------------------------# +# ED initial mode: currently accepted values are: # +# -1 : true bare ground run. # +# 0 : near bare ground run. # +# 5 : ED-2.1 restart (make sure SFILIN is set correctly in the Template ED2IN # +# 6 : Biomass initialisation files (only for those that we have such data). # +#------------------------------------------------------------------------------------------# initmode=6 +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Name of the unrestricted_parallel scripts: # +# callunpa: script that calls callserial.sh for unrestricted_parallel runs. # +# unparun: script that is submitted to unrestricted_parallel. # +#------------------------------------------------------------------------------------------# callunpa=${here}'/callunpa.sh' unparun=${here}'/unparun.sh' -hostlist=${here}'/hostlist.txt' #----- Executable name. -------------------------------------------------------------------# execname='ed_2.1-opt' +#------------------------------------------------------------------------------------------# +#==========================================================================================# +#==========================================================================================# + + + + + +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +# Unless you are going to modify the way jobs are submitted, you don't need to change # +# anything beyond this point. # +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# +#==========================================================================================# + + +#----- Set the main path for the site, pseudo drought and Sheffield met drivers. ----------# +if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] +then + sitemet='/scratch/'${moi}'/met_driver/site_met_driver' + pdroughtpath='/scratch/'${moi}'/met_driver/pseudo_drought' + shefpath='/scratch/'${moi}'/met_driver/sheffield' +else + sitemet=${sitemetdef} + pdroughtpath=${pdroughtpathdef} + shefpath='' +fi +#------------------------------------------------------------------------------------------# + + #----- Determine the number of polygons to run. -------------------------------------------# let npolys=`wc -l ${lonlat} | awk '{print $1 }'`-3 echo 'Number of polygons: '${npolys}'...' +#------------------------------------------------------------------------------------------# + + #----- Start a new callunpa.sh. -----------------------------------------------------------# rm -f ${callunpa} echo '#!/bin/sh' > ${callunpa} - -#----- Start a new host list. -------------------------------------------------------------# -rm -f ${hostlist} -touch ${hostlist} #------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# # Check whether the executable is copied. If not, let the user know and stop the # # script. # @@ -53,7 +129,73 @@ then echo 'Copy the executable to the file before running this script!' exit 99 fi +#------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Check whether we must create the "there" directory. # +#------------------------------------------------------------------------------------------# +if [ ${outthere} == 'y' ] || [ ${outthere} == 'Y' ] +then + + basehere=`basename ${here}` + dirhere=`dirname ${here}` + while [ ${basehere} != ${moi} ] + do + basehere=`basename ${dirhere}` + dirhere=`dirname ${dirhere}` + done + diskhere=${dirhere} + echo '-------------------------------------------------------------------------------' + echo ' - Simulation control on disk: '${diskhere} + echo ' - Output on disk: '${diskthere} + echo '-------------------------------------------------------------------------------' + there=`echo ${here} | sed s@${diskhere}@${diskthere}@g` +else + basehere=`basename ${here}` + dirhere=`dirname ${here}` + while [ ${basehere} != ${moi} ] + do + basehere=`basename ${dirhere}` + dirhere=`dirname ${dirhere}` + done + diskhere=${dirhere} + diskthere=${dirhere} + echo '-------------------------------------------------------------------------------' + echo ' - Simulation control on disk: '${diskhere} + echo ' - Output on disk: '${diskthere} + echo '-------------------------------------------------------------------------------' + there=${here} +fi +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Make sure that the directory there exists, if not, create all parent directories # +# needed. # +#------------------------------------------------------------------------------------------# +while [ ! -s ${there} ] +do + namecheck=`basename ${there}` + dircheck=`dirname ${there}` + while [ ! -s ${dircheck} ] && [ ${namecheck} != '/' ] + do + namecheck=`basename ${dircheck}` + dircheck=`dirname ${dircheck}` + done + + if [ ${namecheck} == '/' ] + then + echo 'Invalid disk for variable there:' + echo ' DISK ='${diskhere} + exit 58 + else + echo 'Making directory: '${dircheck}/${namecheck} + mkdir ${dircheck}/${namecheck} + fi +done +#------------------------------------------------------------------------------------------# @@ -70,75 +212,108 @@ do let ff=${ff}+1 let line=${ff}+3 + #---------------------------------------------------------------------------------------# + # Find a unique waiting time for callserial.sh. # + #---------------------------------------------------------------------------------------# + if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] + then + let wtime=${ff}%8 + let wtime=${wtime}*20 + nudge=`date +%S` + if [ ${nudge} -lt 10 ] + then + nudge=`echo ${nudge} | awk '{print substr($1,2,1)}'` + fi + let nudge=${nudge}%15 + let wtime=${wtime}+${nudge} + let wtime=${wtime}+2 + else + wtime=999999 + fi + #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# # Read the ffth line of the polygon list. There must be smarter ways of doing # # this, but this works. Here we obtain the polygon name, and its longitude and # # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` - #---------------------------------------------------------------------------------------# - - - - #----- Find the actual beta power that goes to the namelist. ---------------------------# - bpower=`calc.sh ${betaflag}/2` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# @@ -149,7 +324,7 @@ do echo 'Order: '${ff}', updating a couple of files on '${here}/${polyname}'...' #----- Save the last tolerance in case we are going to make it more strict. ---------# - oldtol=`grep RK4_TOLERANCE ${here}/${polyname}/ED2IN | awk '{print $3}'` + oldtol=`grep NL%RK4_TOLERANCE ${here}/${polyname}/ED2IN | awk '{print $3}'` rm -f ${here}/${polyname}/ED2IN rm -f ${here}/${polyname}/callserial.sh rm -f ${here}/${polyname}/callunpa.sh @@ -190,31 +365,30 @@ do # we simply copy the template, and assume initial run. Otherwise, we must find out # # where the simulation was when it stopped. # #---------------------------------------------------------------------------------------# - if [ -s ${here}/${polyname} ] + if [ -s ${there}/${polyname} ] then #------------------------------------------------------------------------------------# # This step is necessary because we may have killed the run while it was # # writing, and as a result, the file may be corrupt. # #------------------------------------------------------------------------------------# - nhdf5=`ls -1 ${here}/${polyname}/histo/* 2> /dev/null | wc -l` + nhdf5=`ls -1 ${there}/${polyname}/histo/* 2> /dev/null | wc -l` if [ ${nhdf5} -gt 0 ] then - h5fine=0 - while [ $h5fine -eq 0 ] + while [ ${h5fine} -eq 0 ] do - lasthdf5=`ls -1 ${here}/${polyname}/histo/* | tail -1` + lasthdf5=`ls -1 ${there}/${polyname}/histo/* | tail -1` h5dump -H ${lasthdf5} 1> /dev/null 2> ${here}/badfile.txt if [ -s ${here}/badfile.txt ] then /bin/rm -fv ${lasthdf5} - nhdf5=`ls -1 ${here}/${polyname}/histo/* 2> /dev/null | wc -l` + nhdf5=`ls -1 ${there}/${polyname}/histo/* 2> /dev/null | wc -l` if [ ${nhdf5} -eq 0 ] then - hdf5fine=1 + h5fine=1 fi else h5fine=1 @@ -251,6 +425,13 @@ do #------------------------------------------------------------------------------------# else + + #----- Make a copy of the directory "there" in case here and there aren't the same. -# + if [ ${here} != ${there} ] + then + cp -r ${here}/Template ${there}/${polyname} + fi + sed -i s@thispoly@${polyname}@g ${here}/${polyname}/whichrun.r sed -i s@thisqueue@${queue}@g ${here}/${polyname}/whichrun.r sed -i s@pathhere@${here}@g ${here}/${polyname}/whichrun.r @@ -288,7 +469,7 @@ do crop=5 plantation=8 ;; - aei|asu|cnf|bnu|cwb|erm|igp|iqq|ipv|mgf|rao|sla|zpe|kna) + aei|asu|cnf|bnu|cwb|erm|iqq|ipv|mgf|rao|sla|zpe|kna) pfts='1,2,3,4,16,17' crop=16 plantation=17 @@ -315,147 +496,429 @@ do + if [ ${pseudodrought} != 'y' ] && [ ${pseudodrought} != 'Y' ] + then + #------------------------------------------------------------------------------------# + # Determine which meteorological data set to use. Default is the Sheffield/NCEP # + # dataset, otherwise the site-level tower data is used. # + #------------------------------------------------------------------------------------# + case ${metdriver} in + Bananal_Island) + metdriverdb=${sitemet}'/Bananal_Island/Bananal_HEADER' + metcyc1=2004 + metcycf=2006 + imetavg=1 + ;; + Caxiuana) + metdriverdb=${sitemet}'/Caxiuana/Caxiuana06_HEADER' + metcyc1=1999 + metcycf=2003 + imetavg=1 + ;; + Harvard) + metdriverdb=${sitemet}'/Harvard_Forest/Harvard_Forest_HEADER' + metcyc1=1993 + metcycf=2008 + imetavg=1 + ;; + Manaus_KM34) + metdriverdb=${sitemet}'/Manaus_KM34/Manaus_KM34_HEADER' + metcyc1=2002 + metcycf=2005 + imetavg=1 + ;; + Reserva_Jaru) + metdriverdb=${sitemet}'/Reserva_Jaru/Reserva_Jaru_HEADER' + metcyc1=2000 + metcycf=2002 + imetavg=1 + ;; + Reserva_Pe-de-Gigante) + metdriverdb=${sitemet}'/Reserva_Pe_de_Gigante/Reserva_Pe-de-Gigante_HEADER' + metcyc1=2001 + metcycf=2003 + imetavg=1 + ;; + Santarem_KM67) + metdriverdb=${sitemet}'/Santarem_KM67/Santarem_KM67_HEADER' + metcyc1=2002 + metcycf=2004 + imetavg=1 + ;; + Santarem_KM77) + metdriverdb=${sitemet}'/Santarem_KM77/Santarem_KM77_HEADER' + metcyc1=2001 + metcycf=2005 + imetavg=1 + ;; + Santarem_KM83) + metdriverdb=${sitemet}'/Santarem_KM83/Santarem_KM83_HEADER' + metcyc1=2001 + metcycf=2003 + imetavg=1 + ;; + Fazenda_NS) + metdriverdb=${sitemet}'/Fazenda_Nossa_Senhora/Fazenda_Nossa_Senhora_HEADER' + metcyc1=1999 + metcycf=2001 + imetavg=1 + ;; + Guyaflux) + metdriverdb=${sitemet}'/Guyaflux/Guyaflux_HEADER' + metcyc1=2007 + metcycf=2009 + imetavg=1 + ;; + Guyaflux_Natalia) + metdriverdb=${sitemet}'/Guyaflux_Natalia/Guyaflux_Natalia_HEADER' + metcyc1=2007 + metcycf=2009 + imetavg=1 + ;; + Sheffield) + if [ 'x'${shefpath} == 'x' ] + then + metdriverdb=${here}/${polyname}/${shefhead} + else + metdriverdb=${shefpath}/${shefhead} + fi + metcyc1=1969 + metcycf=2008 + imetavg=2 + ;; + *) + echo 'Met driver: '${metdriver} + echo 'Sorry, this met driver is not valid for regular runs' + exit 85 + ;; + esac + #------------------------------------------------------------------------------------# + else + #------------------------------------------------------------------------------------# + # Run a pseudo-drought simulation. Find which settings to use based on the # + # final part of the job name. # + #------------------------------------------------------------------------------------# + nchar=`echo ${polyname} | wc -m` + #------------------------------------------------------------------------------------# + # There are two ways to define the drought flag. If we define drought just as # + # a on/off flag, or if we turn on and off each of the drought components. We must # + # figure out which one we are doing here. # + #------------------------------------------------------------------------------------# + let dr0=${nchar}-9 + drought=`echo ${polyname} | awk '{print substr($1,'${dr0}',9)}'` + if [ ${drought} == 'drought00' ] + then + metdesc='tmp00_shv00_rad00_raf00' + elif [ ${drought} == 'drought01' ] + then + metdesc='tmp01_shv00_rad01_raf01' + else + let mda=${nchar}-23 + metdesc=`echo ${polyname} | awk '{print substr($1,'${mda}',23)}'` + fi + #------------------------------------------------------------------------------------# + case ${metdriver} in + Santarem_KM67) + metdriverdb=${pdroughtpath}'/Santarem_KM67/S67_'${metdesc}'_HEADER' + metcyc1=1600 + metcycf=1609 + imetavg=1 + ;; + Santarem_KM77) + metdriverdb=${pdroughtpath}'/Santarem_KM77/S77_'${metdesc}'_HEADER' + metcyc1=1600 + metcycf=1609 + imetavg=1 + ;; + Manaus_KM34) + metdriverdb=${pdroughtpath}'/Manaus_KM34/M34_'${metdesc}'_HEADER' + metcyc1=1600 + metcycf=1609 + imetavg=1 + ;; + *) + echo 'Met driver: '${metdriver} + echo 'Sorry, this met driver is not valid for pseudo drought runs' + exit 84 + ;; + esac + #------------------------------------------------------------------------------------# + fi #---------------------------------------------------------------------------------------# - # Determine which meteorological data set to use. Default is the Sheffield/NCEP # - # dataset, otherwise the site-level tower data is used. # - #---------------------------------------------------------------------------------------# - case ${metdriver} in - Bananal_Island) - metdriverdb=${sitemet}'/Bananal_Island/Bananal_HEADER' - metcyc1=2004 - metcycf=2006 - imetavg=1 - iphen=2 - ;; - Caxiuana) - metdriverdb=${sitemet}'/Caxiuana/Caxiuana06_HEADER' - metcyc1=1999 - metcycf=2003 - imetavg=1 - iphen=2 - ;; - Harvard) - metdriverdb=${hvdmet}'/HARVARD_MET_93_09' - metcyc1=1993 - metcycf=2008 - imetavg=1 - iphen=1 - ;; - Manaus_KM34) - metdriverdb=${sitemet}'/Manaus_KM34/Manaus_KM34_HEADER' - metcyc1=2002 - metcycf=2005 - imetavg=1 - iphen=2 - ;; - Reserva_Jaru) - metdriverdb=${sitemet}'/Reserva_Jaru/Reserva_Jaru_HEADER' - metcyc1=2000 - metcycf=2002 - imetavg=1 - iphen=2 - ;; - Reserva_Pe-de-Gigante) - metdriverdb=${sitemet}'/Reserva_Pe_de_Gigante/Reserva_Pe-de-Gigante_HEADER' - metcyc1=2001 - metcycf=2003 - imetavg=1 - iphen=2 - ;; - Santarem_KM67) - metdriverdb=${sitemet}'/Santarem_KM67/Santarem_KM67_HEADER' - metcyc1=2002 - metcycf=2004 - imetavg=1 - iphen=2 - ;; - Santarem_KM77) - metdriverdb=${sitemet}'/Fazenda_Nossa_Senhora/Santarem_KM77_HEADER' - metcyc1=2001 - metcycf=2005 - imetavg=1 - iphen=2 - ;; - Fazenda_NS) - metdriverdb=${sitemet}'/Fazenda_Nossa_Senhora/Fazenda_Nossa_Senhora_HEADER' - metcyc1=1999 - metcycf=2001 - imetavg=1 - iphen=2 - ;; - *) - metdriverdb=${here}/${polyname}/${sheffield} - metcyc1=1969 - metcycf=2008 - imetavg=2 - iphen=2 - ;; - esac - #---------------------------------------------------------------------------------------# - - #---------------------------------------------------------------------------------------# - # Determine which soil profile to use. We have eight categories (A-H) # + # Determine which soil profile to use. We have eight categories (A-H), and the # + # soil resolution. # #---------------------------------------------------------------------------------------# - case ${polydepth} in - A) - polynzg=16 - polyslz='-1.250,-1.135,-1.024,-0.917,-0.814,-0.715,-0.620,-0.530,-0.445,-0.364,-0.289,-0.221,-0.158,-0.103,-0.056,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - B) - polynzg=16 - polyslz='-2.000,-1.797,-1.602,-1.417,-1.240,-1.073,-0.916,-0.769,-0.632,-0.507,-0.392,-0.290,-0.200,-0.124,-0.063,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - C) - polynzg=16 - polyslz='-3.000,-2.670,-2.357,-2.061,-1.784,-1.524,-1.283,-1.061,-0.857,-0.673,-0.510,-0.367,-0.245,-0.146,-0.070,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - D) - polynzg=16 - polyslz='-4.000,-3.536,-3.099,-2.690,-2.308,-1.955,-1.629,-1.332,-1.064,-0.824,-0.614,-0.433,-0.283,-0.163,-0.075,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - E) - polynzg=16 - polyslz='-4.500,-3.967,-3.467,-3.000,-2.565,-2.164,-1.797,-1.462,-1.162,-0.895,-0.662,-0.464,-0.300,-0.171,-0.077,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - F) - polynzg=16 - polyslz='-6.000,-5.254,-4.559,-3.914,-3.320,-2.776,-2.282,-1.837,-1.442,-1.095,-0.798,-0.548,-0.346,-0.192,-0.083,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - G) - polynzg=16 - polyslz='-7.000,-6.108,-5.279,-4.514,-3.812,-3.172,-2.593,-2.076,-1.618,-1.221,-0.881,-0.600,-0.374,-0.204,-0.087,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' - ;; - H) - polynzg=16 - polyslz='-8.000,-6.959,-5.995,-5.108,-4.296,-3.560,-2.897,-2.307,-1.789,-1.340,-0.961,-0.648,-0.400,-0.215,-0.089,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + polyslz1='' + polyslz2='' + polyslz3='' + polyslz4='' + polyslz5='' + polyslz6='' + polyslz7='' + polyslm1='' + polyslm2='' + polyslm3='' + polyslm4='' + polyslm5='' + polyslm6='' + polyslm7='' + polyslt1='' + polyslt2='' + polyslt3='' + polyslt4='' + polyslt5='' + polyslt6='' + polyslt7='' + case ${slzres} in + 0) + case ${polydepth} in + A) + polynzg=16 + polyslz1='-1.250,-1.135,-1.024,-0.917,-0.814,-0.715,-0.620,-0.530,-0.445,-0.364,' + polyslz2='-0.289,-0.221,-0.158,-0.103,-0.056,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + B) + polynzg=16 + polyslz1='-2.000,-1.797,-1.602,-1.417,-1.240,-1.073,-0.916,-0.769,-0.632,-0.507,' + polyslz2='-0.392,-0.290,-0.200,-0.124,-0.063,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + C) + polynzg=16 + polyslz1='-3.000,-2.670,-2.357,-2.061,-1.784,-1.524,-1.283,-1.061,-0.857,-0.673,' + polyslz2='-0.510,-0.367,-0.245,-0.146,-0.070,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + D) + polynzg=16 + polyslz1='-4.000,-3.536,-3.099,-2.690,-2.308,-1.955,-1.629,-1.332,-1.064,-0.824,' + polyslz2='-0.614,-0.433,-0.283,-0.163,-0.075,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + E) + polynzg=16 + polyslz1='-4.500,-3.967,-3.467,-3.000,-2.565,-2.164,-1.797,-1.462,-1.162,-0.895,' + polyslz2='-0.662,-0.464,-0.300,-0.171,-0.077,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + F) + polynzg=16 + polyslz1='-6.000,-5.254,-4.559,-3.914,-3.320,-2.776,-2.282,-1.837,-1.442,-1.095,' + polyslz2='-0.798,-0.548,-0.346,-0.192,-0.083,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + G) + polynzg=16 + polyslz1='-7.000,-6.108,-5.279,-4.514,-3.812,-3.172,-2.593,-2.076,-1.618,-1.221,' + polyslz2='-0.881,-0.600,-0.374,-0.204,-0.087,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + H) + polynzg=16 + polyslz1='-8.000,-6.959,-5.995,-5.108,-4.296,-3.560,-2.897,-2.307,-1.789,-1.340,' + polyslz2='-0.961,-0.648,-0.400,-0.215,-0.089,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + *) + polynzg=16 + polyslz1='-8.000,-6.959,-5.995,-5.108,-4.296,-3.560,-2.897,-2.307,-1.789,-1.340,' + polyslz2='-0.961,-0.648,-0.400,-0.215,-0.089,-0.020' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + esac ;; - *) - polynzg=16 - polyslz='-8.000,-6.959,-5.995,-5.108,-4.296,-3.560,-2.897,-2.307,-1.789,-1.340,-0.961,-0.648,-0.400,-0.215,-0.089,-0.020' - polyslm=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' - polyslt=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + 1) + case ${polydepth} in + A) + polynzg='30' + polyslz1='-1.329,-1.246,-1.168,-1.093,-1.022,-0.955,-0.890,-0.829,-0.770,-0.714,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-0.661,-0.611,-0.563,-0.517,-0.473,-0.432,-0.392,-0.354,-0.318,-0.284,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-0.252,-0.221,-0.191,-0.163,-0.136,-0.111,-0.086,-0.063,-0.041,-0.020' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + B) + polynzg='37' + polyslz1='-2.033,-1.917,-1.806,-1.701,-1.601,-1.506,-1.415,-1.329,-1.246,-1.168,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-1.093,-1.022,-0.955,-0.890,-0.829,-0.770,-0.714,-0.661,-0.611,-0.563,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-0.517,-0.473,-0.432,-0.392,-0.354,-0.318,-0.284,-0.252,-0.221,-0.191,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-0.163,-0.136,-0.111,-0.086,-0.063,-0.041,-0.020' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + C) + polynzg='44' + polyslz1='-3.023,-2.860,-2.705,-2.557,-2.416,-2.282,-2.154,-2.033,-1.917,-1.806,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-1.701,-1.601,-1.506,-1.415,-1.329,-1.246,-1.168,-1.093,-1.022,-0.955,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-0.890,-0.829,-0.770,-0.714,-0.661,-0.611,-0.563,-0.517,-0.473,-0.432,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-0.392,-0.354,-0.318,-0.284,-0.252,-0.221,-0.191,-0.163,-0.136,-0.111,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-0.086,-0.063,-0.041,-0.020' + polyslm5=' 1.000, 1.000, 1.000, 1.000' + polyslt5=' 0.000, 0.000, 0.000, 0.000' + ;; + D) + polynzg='50' + polyslz1='-4.187,-3.969,-3.761,-3.562,-3.374,-3.194,-3.023,-2.860,-2.705,-2.557,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-2.416,-2.282,-2.154,-2.033,-1.917,-1.806,-1.701,-1.601,-1.506,-1.415,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-1.329,-1.246,-1.168,-1.093,-1.022,-0.955,-0.890,-0.829,-0.770,-0.714,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-0.661,-0.611,-0.563,-0.517,-0.473,-0.432,-0.392,-0.354,-0.318,-0.284,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-0.252,-0.221,-0.191,-0.163,-0.136,-0.111,-0.086,-0.063,-0.041,-0.020' + polyslm5=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt5=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + E) + polynzg='52' + polyslz1='-4.657,-4.416,-4.187,-3.969,-3.761,-3.562,-3.374,-3.194,-3.023,-2.860,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-2.705,-2.557,-2.416,-2.282,-2.154,-2.033,-1.917,-1.806,-1.701,-1.601,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-1.506,-1.415,-1.329,-1.246,-1.168,-1.093,-1.022,-0.955,-0.890,-0.829,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-0.770,-0.714,-0.661,-0.611,-0.563,-0.517,-0.473,-0.432,-0.392,-0.354,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-0.318,-0.284,-0.252,-0.221,-0.191,-0.163,-0.136,-0.111,-0.086,-0.063,' + polyslm5=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt5=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz6='-0.041,-0.020' + polyslm6=' 1.000, 1.000' + polyslt6=' 0.000, 0.000' + ;; + F) + polynzg='58' + polyslz1='-6.157,-5.907,-5.657,-5.407,-5.157,-4.907,-4.657,-4.416,-4.187,-3.969,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-3.761,-3.562,-3.374,-3.194,-3.023,-2.860,-2.705,-2.557,-2.416,-2.282,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-2.154,-2.033,-1.917,-1.806,-1.701,-1.601,-1.506,-1.415,-1.329,-1.246,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-1.168,-1.093,-1.022,-0.955,-0.890,-0.829,-0.770,-0.714,-0.661,-0.611,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-0.563,-0.517,-0.473,-0.432,-0.392,-0.354,-0.318,-0.284,-0.252,-0.221,' + polyslm5=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt5=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz6='-0.191,-0.163,-0.136,-0.111,-0.086,-0.063,-0.041,-0.020' + polyslm6=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt6=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + G) + polynzg='62' + polyslz1='-7.157,-6.907,-6.657,-6.407,-6.157,-5.907,-5.657,-5.407,-5.157,-4.907,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-4.657,-4.416,-4.187,-3.969,-3.761,-3.562,-3.374,-3.194,-3.023,-2.860,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-2.705,-2.557,-2.416,-2.282,-2.154,-2.033,-1.917,-1.806,-1.701,-1.601,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-1.506,-1.415,-1.329,-1.246,-1.168,-1.093,-1.022,-0.955,-0.890,-0.829,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-0.770,-0.714,-0.661,-0.611,-0.563,-0.517,-0.473,-0.432,-0.392,-0.354,' + polyslm5=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt5=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz6='-0.318,-0.284,-0.252,-0.221,-0.191,-0.163,-0.136,-0.111,-0.086,-0.063,' + polyslm6=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt6=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz7='-0.041,-0.020' + polyslm7=' 1.000, 1.000' + polyslt7=' 0.000, 0.000' + ;; + H) + polynzg='66' + polyslz1='-8.157,-7.907,-7.657,-7.407,-7.157,-6.907,-6.657,-6.407,-6.157,-5.907,' + polyslm1=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt1=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz2='-5.657,-5.407,-5.157,-4.907,-4.657,-4.416,-4.187,-3.969,-3.761,-3.562,' + polyslm2=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt2=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz3='-3.374,-3.194,-3.023,-2.860,-2.705,-2.557,-2.416,-2.282,-2.154,-2.033,' + polyslm3=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt3=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz4='-1.917,-1.806,-1.701,-1.601,-1.506,-1.415,-1.329,-1.246,-1.168,-1.093,' + polyslm4=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt4=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz5='-1.022,-0.955,-0.890,-0.829,-0.770,-0.714,-0.661,-0.611,-0.563,-0.517,' + polyslm5=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt5=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz6='-0.473,-0.432,-0.392,-0.354,-0.318,-0.284,-0.252,-0.221,-0.191,-0.163,' + polyslm6=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000, 1.000,' + polyslt6=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000, 0.000,' + polyslz7='-0.136,-0.111,-0.086,-0.063,-0.041,-0.020' + polyslm7=' 1.000, 1.000, 1.000, 1.000, 1.000, 1.000' + polyslt7=' 0.000, 0.000, 0.000, 0.000, 0.000, 0.000' + ;; + *) + ;; + esac ;; esac #---------------------------------------------------------------------------------------# @@ -507,19 +970,49 @@ do thissfilin=${fullygrown} case ${polyiata} in s67) - thissfilin=${bioinit}'/km67_ustein.' + thissfilin=${bioinit}'/km67_ustein_newallom.' + ;; + s83) + thissfilin=${bioinit}'/km67_ustein_newallom.' ;; m34) + thissfilin=${bioinit}'/k34_ustein_newallom.' + ;; + bdf) thissfilin=${bioinit}'/pBDFFP1_1983_ustein.' ;; pdg) - thissfilin=${bioinit}'/pdg_grass.' + thissfilin=${bioinit}'/pdg_ustein_newallom.' ;; fns) - thissfilin=${bioinit}'/fns.' + thissfilin=${bioinit}'/fns_c4.' + ;; + fns_c4) + thissfilin=${bioinit}'/fns_c4.' + ;; + fns_c3) + thissfilin=${bioinit}'/fns_c3.' + ;; + fns_34) + thissfilin=${bioinit}'/fns_c3c4.' ;; s77) - thissfilin=${bioinit}'/k77.' + thissfilin=${bioinit}'/km77_c3.' + ;; + s77_c3) + thissfilin=${bioinit}'/km77_c3.' + ;; + s77_c4) + thissfilin=${bioinit}'/km77_c4.' + ;; + s77_34) + thissfilin=${bioinit}'/km77_c3c4.' + ;; + cax) + thissfilin=${bioinit}'/cax06_ustein_newallom.' + ;; + rja) + thissfilin=${bioinit}'/rja_ustein_newallom.' ;; *) echo ' Polygon: '${polyname} @@ -529,100 +1022,140 @@ do ;; esac else - thissfilin=${here}/${polyname}/histo/${polyname} + thissfilin=${there}/${polyname}/histo/${polyname} fi #---------------------------------------------------------------------------------------# ED2IN=${here}'/'${polyname}'/ED2IN' - sed -i s@paththere@${there}@g ${ED2IN} - sed -i s@myyeara@${thisyeara}@g ${ED2IN} - sed -i s@mymontha@${montha}@g ${ED2IN} - sed -i s@mydatea@${datea}@g ${ED2IN} - sed -i s@mytimea@${timea}@g ${ED2IN} - sed -i s@myyearz@${thisyearz}@g ${ED2IN} - sed -i s@mymonthz@${monthz}@g ${ED2IN} - sed -i s@mydatez@${datez}@g ${ED2IN} - sed -i s@mytimez@${timez}@g ${ED2IN} - sed -i s@mydtlsm@${dtlsm}@g ${ED2IN} - sed -i s@thispoly@${polyname}@g ${ED2IN} - sed -i s@plonflag@${polylon}@g ${ED2IN} - sed -i s@platflag@${polylat}@g ${ED2IN} - sed -i s@timehhhh@${time}@g ${ED2IN} - sed -i s@datehhhh@${date}@g ${ED2IN} - sed -i s@monthhhh@${month}@g ${ED2IN} - sed -i s@yearhhhh@${year}@g ${ED2IN} - sed -i s@myinitmode@${initmode}@g ${ED2IN} - sed -i s@mysfilin@${thissfilin}@g ${ED2IN} - sed -i s@mytrees@${pfts}@g ${ED2IN} - sed -i s@mycrop@${crop}@g ${ED2IN} - sed -i s@myplantation@${plantation}@g ${ED2IN} - sed -i s@myiphen@${iphen}@g ${ED2IN} - sed -i s@myisoilflg@${polyisoil}@g ${ED2IN} - sed -i s@mynslcon@${polyntext}@g ${ED2IN} - sed -i s@myslxsand@${polysand}@g ${ED2IN} - sed -i s@myslxclay@${polyclay}@g ${ED2IN} - sed -i s@mynzg@${polynzg}@g ${ED2IN} - sed -i s@myslz@"${polyslz}"@g ${ED2IN} - sed -i s@myslmstr@"${polyslm}"@g ${ED2IN} - sed -i s@mystgoff@"${polyslt}"@g ${ED2IN} - sed -i s@mymetdriverdb@${metdriverdb}@g ${ED2IN} - sed -i s@mymetcyc1@${metcyc1}@g ${ED2IN} - sed -i s@mymetcycf@${metcycf}@g ${ED2IN} - sed -i s@mytoler@${toler}@g ${ED2IN} - sed -i s@RUNFLAG@${runt}@g ${ED2IN} - sed -i s@myvmfact@${vmfact}@g ${ED2IN} - sed -i s@mymfact@${mfact}@g ${ED2IN} - sed -i s@mykfact@${kfact}@g ${ED2IN} - sed -i s@mywlimit@${wlimit}@g ${ED2IN} - sed -i s@mygamfact@${gamfact}@g ${ED2IN} - sed -i s@myd0fact@${d0fact}@g ${ED2IN} - sed -i s@myalphafact@${alphafact}@g ${ED2IN} - sed -i s@mylwfact@${lwfact}@g ${ED2IN} - sed -i s@mythioff@${thioff}@g ${ED2IN} - sed -i s@myallom@${iallom}@g ${ED2IN} - sed -i s@myblyrcnd@${blyrcnd}@g ${ED2IN} - sed -i s@mybpower@${bpower}@g ${ED2IN} - sed -i s@myicanturb@${icanturb}@g ${ED2IN} - sed -i s@myisfclyrm@${isfclyrm}@g ${ED2IN} - sed -i s@myustmin@${ustmin}@g ${ED2IN} - sed -i s@myggfact@${ggfact}@g ${ED2IN} - sed -i s@mygamm@${gamm}@g ${ED2IN} - sed -i s@mygamh@${gamh}@g ${ED2IN} - sed -i s@mytprandtl@${tprandtl}@g ${ED2IN} - sed -i s@myvh2vr@${vh2vr}@g ${ED2IN} - sed -i s@myvh2dh@${vh2dh}@g ${ED2IN} - sed -i s@myribmax@${ribmax}@g ${ED2IN} - sed -i s@mymaxwhc@${maxwhc}@g ${ED2IN} - sed -i s@myrunoff@${runoff}@g ${ED2IN} - sed -i s@myatmco2@${atmco2}@g ${ED2IN} - sed -i s@mythcrit@${thcrit}@g ${ED2IN} - sed -i s@mysmfire@${smfire}@g ${ED2IN} - sed -i s@myagefall@${agefall}@g ${ED2IN} - sed -i s@mygrndvap@${grndvap}@g ${ED2IN} - sed -i s@mycrownmod@${crownmod}@g ${ED2IN} - sed -i s@mymetavg@${imetavg}@g ${ED2IN} - sed -i s@myquantum@${quantum}@g ${ED2IN} - sed -i s@mysoilbc@${isoilbc}@g ${ED2IN} - sed -i s@mypercol@${ipercol}@g ${ED2IN} - sed -i s@myphysiol@${iphysiol}@g ${ED2IN} - sed -i s@mycanswrad@${icanswrad}@g ${ED2IN} - sed -i s@mymetrad@${imetrad}@g ${ED2IN} - sed -i s@mybranch@${ibranch}@g ${ED2IN} + sed -i s@paththere@${there}@g ${ED2IN} + sed -i s@myyeara@${thisyeara}@g ${ED2IN} + sed -i s@mymontha@${montha}@g ${ED2IN} + sed -i s@mydatea@${datea}@g ${ED2IN} + sed -i s@mytimea@${timea}@g ${ED2IN} + sed -i s@myyearz@${thisyearz}@g ${ED2IN} + sed -i s@mymonthz@${monthz}@g ${ED2IN} + sed -i s@mydatez@${datez}@g ${ED2IN} + sed -i s@mytimez@${timez}@g ${ED2IN} + sed -i s@mydtlsm@${dtlsm}@g ${ED2IN} + sed -i s@thispoly@${polyname}@g ${ED2IN} + sed -i s@plonflag@${polylon}@g ${ED2IN} + sed -i s@platflag@${polylat}@g ${ED2IN} + sed -i s@timehhhh@${time}@g ${ED2IN} + sed -i s@datehhhh@${date}@g ${ED2IN} + sed -i s@monthhhh@${month}@g ${ED2IN} + sed -i s@yearhhhh@${year}@g ${ED2IN} + sed -i s@myinitmode@${initmode}@g ${ED2IN} + sed -i s@mysfilin@${thissfilin}@g ${ED2IN} + sed -i s@mytrees@${pfts}@g ${ED2IN} + sed -i s@mycrop@${crop}@g ${ED2IN} + sed -i s@myplantation@${plantation}@g ${ED2IN} + sed -i s@myiphen@${iphen}@g ${ED2IN} + sed -i s@myallom@${iallom}@g ${ED2IN} + sed -i s@myisoilflg@${polyisoil}@g ${ED2IN} + sed -i s@mynslcon@${polyntext}@g ${ED2IN} + sed -i s@myslxsand@${polysand}@g ${ED2IN} + sed -i s@myslxclay@${polyclay}@g ${ED2IN} + sed -i s@mysoilcol@${polycol}@g ${ED2IN} + sed -i s@mynzg@${polynzg}@g ${ED2IN} + sed -i s@mymetdriverdb@${metdriverdb}@g ${ED2IN} + sed -i s@mymetcyc1@${metcyc1}@g ${ED2IN} + sed -i s@mymetcycf@${metcycf}@g ${ED2IN} + sed -i s@mytoler@${toler}@g ${ED2IN} + sed -i s@RUNFLAG@${runt}@g ${ED2IN} + sed -i s@myvmfactc3@${vmfactc3}@g ${ED2IN} + sed -i s@myvmfactc4@${vmfactc4}@g ${ED2IN} + sed -i s@mymphototrc3@${mphototrc3}@g ${ED2IN} + sed -i s@mymphototec3@${mphototec3}@g ${ED2IN} + sed -i s@mymphotoc4@${mphotoc4}@g ${ED2IN} + sed -i s@mybphotoblc3@${bphotoblc3}@g ${ED2IN} + sed -i s@mybphotonlc3@${bphotonlc3}@g ${ED2IN} + sed -i s@mybphotoc4@${bphotoc4}@g ${ED2IN} + sed -i s@mykwgrass@${kwgrass}@g ${ED2IN} + sed -i s@mykwtree@${kwtree}@g ${ED2IN} + sed -i s@mygammac3@${gammac3}@g ${ED2IN} + sed -i s@mygammac4@${gammac4}@g ${ED2IN} + sed -i s@myd0grass@${d0grass}@g ${ED2IN} + sed -i s@myd0tree@${d0tree}@g ${ED2IN} + sed -i s@myalphac3@${alphac3}@g ${ED2IN} + sed -i s@myalphac4@${alphac4}@g ${ED2IN} + sed -i s@myklowco2@${klowco2}@g ${ED2IN} + sed -i s@myrrffact@${rrffact}@g ${ED2IN} + sed -i s@mygrowthresp@${growthresp}@g ${ED2IN} + sed -i s@mylwidthgrass@${lwidthgrass}@g ${ED2IN} + sed -i s@mylwidthbltree@${lwidthbltree}@g ${ED2IN} + sed -i s@mylwidthnltree@${lwidthnltree}@g ${ED2IN} + sed -i s@myq10c3@${q10c3}@g ${ED2IN} + sed -i s@myq10c4@${q10c4}@g ${ED2IN} + sed -i s@myh2olimit@${h2olimit}@g ${ED2IN} + sed -i s@mysfclyrm@${isfclyrm}@g ${ED2IN} + sed -i s@myicanturb@${icanturb}@g ${ED2IN} + sed -i s@myatmco2@${atmco2}@g ${ED2IN} + sed -i s@mythcrit@${thcrit}@g ${ED2IN} + sed -i s@mysmfire@${smfire}@g ${ED2IN} + sed -i s@mymetavg@${imetavg}@g ${ED2IN} + sed -i s@mysoilbc@${isoilbc}@g ${ED2IN} + sed -i s@mymetrad@${imetrad}@g ${ED2IN} + sed -i s@mybranch@${ibranch}@g ${ED2IN} + sed -i s@mycanrad@${icanrad}@g ${ED2IN} + sed -i s@mycrown@${crown}@g ${ED2IN} + sed -i s@myltransvis@${ltransvis}@g ${ED2IN} + sed -i s@myltransnir@${ltransnir}@g ${ED2IN} + sed -i s@mylreflectvis@${lreflectvis}@g ${ED2IN} + sed -i s@mylreflectnir@${lreflectnir}@g ${ED2IN} + sed -i s@myorienttree@${orienttree}@g ${ED2IN} + sed -i s@myorientgrass@${orientgrass}@g ${ED2IN} + sed -i s@myclumptree@${clumptree}@g ${ED2IN} + sed -i s@myclumpgrass@${clumpgrass}@g ${ED2IN} + sed -i s@myvegtdyn@${ivegtdyn}@g ${ED2IN} + sed -i s@myubmin@${ubmin}@g ${ED2IN} + sed -i s@myugbmin@${ugbmin}@g ${ED2IN} + sed -i s@myustmin@${ustmin}@g ${ED2IN} + sed -i s@mygamm@${gamm}@g ${ED2IN} + sed -i s@mygamh@${gamh}@g ${ED2IN} + sed -i s@mytprandtl@${tprandtl}@g ${ED2IN} + sed -i s@myribmax@${ribmax}@g ${ED2IN} + sed -i s@mygndvap@${igndvap}@g ${ED2IN} + + #------ Soil variables. ----------------------------------------------------------------# + sed -i s@myslz1@"${polyslz1}"@g ${ED2IN} + sed -i s@myslz2@"${polyslz2}"@g ${ED2IN} + sed -i s@myslz3@"${polyslz3}"@g ${ED2IN} + sed -i s@myslz4@"${polyslz4}"@g ${ED2IN} + sed -i s@myslz5@"${polyslz5}"@g ${ED2IN} + sed -i s@myslz6@"${polyslz6}"@g ${ED2IN} + sed -i s@myslz7@"${polyslz7}"@g ${ED2IN} + sed -i s@myslmstr1@"${polyslm1}"@g ${ED2IN} + sed -i s@myslmstr2@"${polyslm2}"@g ${ED2IN} + sed -i s@myslmstr3@"${polyslm3}"@g ${ED2IN} + sed -i s@myslmstr4@"${polyslm4}"@g ${ED2IN} + sed -i s@myslmstr5@"${polyslm5}"@g ${ED2IN} + sed -i s@myslmstr6@"${polyslm6}"@g ${ED2IN} + sed -i s@myslmstr7@"${polyslm7}"@g ${ED2IN} + sed -i s@mystgoff1@"${polyslt1}"@g ${ED2IN} + sed -i s@mystgoff2@"${polyslt2}"@g ${ED2IN} + sed -i s@mystgoff3@"${polyslt3}"@g ${ED2IN} + sed -i s@mystgoff4@"${polyslt4}"@g ${ED2IN} + sed -i s@mystgoff5@"${polyslt5}"@g ${ED2IN} + sed -i s@mystgoff6@"${polyslt6}"@g ${ED2IN} + sed -i s@mystgoff7@"${polyslt7}"@g ${ED2IN} + + #----- Change the srun.sh file. --------------------------------------------------------# srun=${here}'/'${polyname}'/srun.sh' - sed -i s@pathhere@${here}@g ${srun} - sed -i s@thispoly@${polyname}@g ${srun} - sed -i s@thisdesc@${desc}@g ${srun} + sed -i s@pathhere@${here}@g ${srun} + sed -i s@paththere@${there}@g ${srun} + sed -i s@thispoly@${polyname}@g ${srun} + sed -i s@thisdesc@${desc}@g ${srun} + sed -i s@zzzzzzzz@${wtime}@g ${srun} + sed -i s@myorder@${ff}@g ${srun} #----- Change the callserial.sh file. --------------------------------------------------# callserial=${here}'/'${polyname}'/callserial.sh' - sed -i s@thisroot@${here}@g ${callserial} - sed -i s@thispoly@${polyname}@g ${callserial} - - if [ ${queue} == 'GC3' ] - then - queue='long_serial' - fi + sed -i s@thisroot@${here}@g ${callserial} + sed -i s@thispoly@${polyname}@g ${callserial} + sed -i s@myexec@${execname}@g ${callserial} + sed -i s@myname@${moi}@g ${callserial} + sed -i s@mypackdata@${packdatasrc}@g ${callserial} if [ ${queue} == 'unrestricted_parallel' ] then @@ -633,47 +1166,63 @@ do fi #----- Make the shell script for the unrestricted_parallel. ----------------------------# - if [ ${queue} == 'unrestricted_parallel' ] && [ ${runt} == 'HISTORY' -o ${runt} == 'INITIAL' ] + if [ ${queue} == 'unrestricted_parallel' ] then - touch ${callunpa} - - #----- Add command to the node. -----------------------------------------------------# - let unpa=${unpa}+1 - let submit=${unpa}%8 # % is mod operator - let wtime=${submit}*15 - let wtime=${wtime}+2 - mycomm="${here}/${polyname}/callserial.sh ${wtime} &" - echo ${mycomm} >> ${callunpa} - - lastunpa=${polyname} - - #----- Finish the shell script and put it inside the node. --------------------------# - if [ ${submit} -eq 0 ] + if [ ${runt} == 'HISTORY' -o ${runt} == 'INITIAL' ] then - #----- Move callunpa to the polygon. ---------------------------------------------# - echo 'wait' >> ${callunpa} - chmod u+x ${callunpa} - mv ${callunpa} ${here}/${polyname} - - #----- Start a new callunpa. -----------------------------------------------------# - echo '#!/bin/sh' > ${callunpa} - - #----- Create the shell script that will call bsub. ------------------------------# - echo '#!/bin/sh' > ${unparun} - bsub='bsub -q unrestricted_parallel' - bsub=${bsub}' -J '${polyname} - bsub=${bsub}' -o '${here}'/'${polyname}'/serial_lsf.out -n '${unpa} - bsub=${bsub}' < '${here}'/'${polyname}'/'`basename ${callunpa}` - echo ${bsub} >> ${unparun} - chmod u+x ${unparun} - mv ${unparun} ${here}/${polyname} - - #----- Reset unpa for next job. --------------------------------------------------# - lastunpa='none' - unpa=0 + touch ${callunpa} + + #----- Add command to the node. --------------------------------------------------# + if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] + then + let unpa=${unpa}+1 + let submit=${unpa}%8 # % is mod operator + let wtime=${submit}*15 + let wtime=${wtime}+2 + else + wtime=999999 + fi + + mycomm="${here}/${polyname}/callserial.sh ${wtime} &" + echo ${mycomm} >> ${callunpa} + + lastunpa=${polyname} + + #----- Finish the shell script and put it inside the node. -----------------------# + if [ ${submit} -eq 0 ] + then + #----- Move callunpa to the polygon. ------------------------------------------# + echo 'wait' >> ${callunpa} + chmod u+x ${callunpa} + mv ${callunpa} ${here}/${polyname} + + #----- Start a new callunpa. --------------------------------------------------# + echo '#!/bin/sh' > ${callunpa} + + #----- Create the shell script that will call bsub. ---------------------------# + echo '#!/bin/sh' > ${unparun} + bsub='bsub -q unrestricted_parallel' + bsub=${bsub}' -J '${polyname} + bsub=${bsub}' -o '${here}'/'${polyname}'/serial_lsf.out -n '${unpa} + bsub=${bsub}' < '${here}'/'${polyname}'/'`basename ${callunpa}` + echo ${bsub} >> ${unparun} + chmod u+x ${unparun} + mv ${unparun} ${here}/${polyname} + + #----- Reset unpa for next job. -----------------------------------------------# + lastunpa='none' + unpa=0 + fi + #---------------------------------------------------------------------------------# fi + #------------------------------------------------------------------------------------# fi + #---------------------------------------------------------------------------------------# done +#------------------------------------------------------------------------------------------# + + + #----- Make sure that all jobs were submitted to unrestricted serial. ---------------------# if [ ${lastunpa} == 'none' ] @@ -699,3 +1248,4 @@ else lastunpa='none' unpa=0 fi +#------------------------------------------------------------------------------------------# diff --git a/ED/Template/stopalljobs.sh b/ED/Template/stopalljobs.sh index 714581a82..1e79bb2ee 100755 --- a/ED/Template/stopalljobs.sh +++ b/ED/Template/stopalljobs.sh @@ -54,63 +54,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# bkill -J ${desc}-${polyname} -q ${queue} diff --git a/ED/Template/submitter.sh b/ED/Template/submitter.sh index f5669e9d5..ebc41ada5 100755 --- a/ED/Template/submitter.sh +++ b/ED/Template/submitter.sh @@ -27,63 +27,82 @@ do # latitude. # #---------------------------------------------------------------------------------------# oi=`head -${line} ${lonlat} | tail -1` - polyname=`echo ${oi} | awk '{print $1 }'` - polyiata=`echo ${oi} | awk '{print $2 }'` - polylon=`echo ${oi} | awk '{print $3 }'` - polylat=`echo ${oi} | awk '{print $4 }'` - yeara=`echo ${oi} | awk '{print $5 }'` - montha=`echo ${oi} | awk '{print $6 }'` - datea=`echo ${oi} | awk '{print $7 }'` - timea=`echo ${oi} | awk '{print $8 }'` - yearz=`echo ${oi} | awk '{print $9 }'` - monthz=`echo ${oi} | awk '{print $10}'` - datez=`echo ${oi} | awk '{print $11}'` - timez=`echo ${oi} | awk '{print $12}'` - polyisoil=`echo ${oi} | awk '{print $13}'` - polyntext=`echo ${oi} | awk '{print $14}'` - polysand=`echo ${oi} | awk '{print $15}'` - polyclay=`echo ${oi} | awk '{print $16}'` - polydepth=`echo ${oi} | awk '{print $17}'` - queue=`echo ${oi} | awk '{print $18}'` - metdriver=`echo ${oi} | awk '{print $19}'` - dtlsm=`echo ${oi} | awk '{print $20}'` - vmfact=`echo ${oi} | awk '{print $21}'` - mfact=`echo ${oi} | awk '{print $22}'` - kfact=`echo ${oi} | awk '{print $23}'` - gamfact=`echo ${oi} | awk '{print $24}'` - d0fact=`echo ${oi} | awk '{print $25}'` - alphafact=`echo ${oi} | awk '{print $26}'` - lwfact=`echo ${oi} | awk '{print $27}'` - betaflag=`echo ${oi} | awk '{print $28}'` - thioff=`echo ${oi} | awk '{print $29}'` - ustmin=`echo ${oi} | awk '{print $30}'` - ggfact=`echo ${oi} | awk '{print $31}'` - wlimit=`echo ${oi} | awk '{print $32}'` - blyrcnd=`echo ${oi} | awk '{print $33}'` - iallom=`echo ${oi} | awk '{print $34}'` - icanturb=`echo ${oi} | awk '{print $35}'` - isfclyrm=`echo ${oi} | awk '{print $36}'` - gamm=`echo ${oi} | awk '{print $37}'` - gamh=`echo ${oi} | awk '{print $38}'` - tprandtl=`echo ${oi} | awk '{print $39}'` - vh2vr=`echo ${oi} | awk '{print $40}'` - vh2dh=`echo ${oi} | awk '{print $41}'` - ribmax=`echo ${oi} | awk '{print $42}'` - maxwhc=`echo ${oi} | awk '{print $43}'` - runoff=`echo ${oi} | awk '{print $44}'` - atmco2=`echo ${oi} | awk '{print $45}'` - thcrit=`echo ${oi} | awk '{print $46}'` - smfire=`echo ${oi} | awk '{print $47}'` - agefall=`echo ${oi} | awk '{print $48}'` - grndvap=`echo ${oi} | awk '{print $49}'` - crownmod=`echo ${oi} | awk '{print $50}'` - quantum=`echo ${oi} | awk '{print $51}'` - isoilbc=`echo ${oi} | awk '{print $52}'` - ipercol=`echo ${oi} | awk '{print $53}'` - iphysiol=`echo ${oi} | awk '{print $54}'` - icanswrad=`echo ${oi} | awk '{print $55}'` - imetrad=`echo ${oi} | awk '{print $56}'` - ibranch=`echo ${oi} | awk '{print $57}'` + polyname=`echo ${oi} | awk '{print $1 }'` + polyiata=`echo ${oi} | awk '{print $2 }'` + polylon=`echo ${oi} | awk '{print $3 }'` + polylat=`echo ${oi} | awk '{print $4 }'` + yeara=`echo ${oi} | awk '{print $5 }'` + montha=`echo ${oi} | awk '{print $6 }'` + datea=`echo ${oi} | awk '{print $7 }'` + timea=`echo ${oi} | awk '{print $8 }'` + yearz=`echo ${oi} | awk '{print $9 }'` + monthz=`echo ${oi} | awk '{print $10}'` + datez=`echo ${oi} | awk '{print $11}'` + timez=`echo ${oi} | awk '{print $12}'` + polyisoil=`echo ${oi} | awk '{print $13}'` + polyntext=`echo ${oi} | awk '{print $14}'` + polysand=`echo ${oi} | awk '{print $15}'` + polyclay=`echo ${oi} | awk '{print $16}'` + polydepth=`echo ${oi} | awk '{print $17}'` + polycol=`echo ${oi} | awk '{print $18}'` + slzres=`echo ${oi} | awk '{print $19}'` + queue=`echo ${oi} | awk '{print $20}'` + metdriver=`echo ${oi} | awk '{print $21}'` + dtlsm=`echo ${oi} | awk '{print $22}'` + vmfactc3=`echo ${oi} | awk '{print $23}'` + vmfactc4=`echo ${oi} | awk '{print $24}'` + mphototrc3=`echo ${oi} | awk '{print $25}'` + mphototec3=`echo ${oi} | awk '{print $26}'` + mphotoc4=`echo ${oi} | awk '{print $27}'` + bphotoblc3=`echo ${oi} | awk '{print $28}'` + bphotonlc3=`echo ${oi} | awk '{print $29}'` + bphotoc4=`echo ${oi} | awk '{print $30}'` + kwgrass=`echo ${oi} | awk '{print $31}'` + kwtree=`echo ${oi} | awk '{print $32}'` + gammac3=`echo ${oi} | awk '{print $33}'` + gammac4=`echo ${oi} | awk '{print $34}'` + d0grass=`echo ${oi} | awk '{print $35}'` + d0tree=`echo ${oi} | awk '{print $36}'` + alphac3=`echo ${oi} | awk '{print $37}'` + alphac4=`echo ${oi} | awk '{print $38}'` + klowco2=`echo ${oi} | awk '{print $39}'` + rrffact=`echo ${oi} | awk '{print $40}'` + growthresp=`echo ${oi} | awk '{print $41}'` + lwidthgrass=`echo ${oi} | awk '{print $42}'` + lwidthbltree=`echo ${oi} | awk '{print $43}'` + lwidthnltree=`echo ${oi} | awk '{print $44}'` + q10c3=`echo ${oi} | awk '{print $45}'` + q10c4=`echo ${oi} | awk '{print $46}'` + h2olimit=`echo ${oi} | awk '{print $47}'` + isfclyrm=`echo ${oi} | awk '{print $48}'` + icanturb=`echo ${oi} | awk '{print $49}'` + ubmin=`echo ${oi} | awk '{print $50}'` + ugbmin=`echo ${oi} | awk '{print $51}'` + ustmin=`echo ${oi} | awk '{print $52}'` + gamm=`echo ${oi} | awk '{print $53}'` + gamh=`echo ${oi} | awk '{print $54}'` + tprandtl=`echo ${oi} | awk '{print $55}'` + ribmax=`echo ${oi} | awk '{print $56}'` + atmco2=`echo ${oi} | awk '{print $57}'` + thcrit=`echo ${oi} | awk '{print $58}'` + smfire=`echo ${oi} | awk '{print $59}'` + isoilbc=`echo ${oi} | awk '{print $60}'` + imetrad=`echo ${oi} | awk '{print $61}'` + ibranch=`echo ${oi} | awk '{print $62}'` + icanrad=`echo ${oi} | awk '{print $63}'` + crown=`echo ${oi} | awk '{print $64}'` + ltransvis=`echo ${oi} | awk '{print $65}'` + lreflectvis=`echo ${oi} | awk '{print $66}'` + ltransnir=`echo ${oi} | awk '{print $67}'` + lreflectnir=`echo ${oi} | awk '{print $68}'` + orienttree=`echo ${oi} | awk '{print $69}'` + orientgrass=`echo ${oi} | awk '{print $70}'` + clumptree=`echo ${oi} | awk '{print $71}'` + clumpgrass=`echo ${oi} | awk '{print $72}'` + ivegtdyn=`echo ${oi} | awk '{print $73}'` + igndvap=`echo ${oi} | awk '{print $74}'` + iphen=`echo ${oi} | awk '{print $75}'` + iallom=`echo ${oi} | awk '{print $76}'` #---------------------------------------------------------------------------------------# diff --git a/ED/build/bin/2ndcomp.sh b/ED/build/bin/2ndcomp.sh index aed2dc0fd..d313d66b2 100755 --- a/ED/build/bin/2ndcomp.sh +++ b/ED/build/bin/2ndcomp.sh @@ -74,6 +74,7 @@ rm -fv lsm_hyd.o lsm_hyd.mod rm -fv mem_polygons.o mem_polygons.mod rm -fv met_driver_coms.o met_driver_coms.mod rm -fv mortality.o mortality.mod +rm -fv multiple_scatter.o multilple_scatter.mod rm -fv numutils.o numutils.mod rm -fv optimiz_coms.o optimiz_coms.mod rm -fv phenology_aux.o phenology_aux.mod diff --git a/ED/build/bin/dependency.mk b/ED/build/bin/dependency.mk index e69de29bb..ed2a6a277 100644 --- a/ED/build/bin/dependency.mk +++ b/ED/build/bin/dependency.mk @@ -0,0 +1,280 @@ +# DO NOT DELETE THIS LINE - used by make depend +ed_1st.o: ed_misc_coms.mod ed_para_coms.mod ed_state_vars.mod +ed_driver.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_driver.o: fuse_fiss_utils.mod grid_coms.mod soil_coms.mod +ed_met_driver.o: canopy_air_coms.mod canopy_radiation_coms.mod consts_coms.mod +ed_met_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_met_driver.o: ed_state_vars.mod grid_coms.mod hdf5_utils.mod mem_polygons.mod +ed_met_driver.o: met_driver_coms.mod pft_coms.mod therm_lib.mod +ed_model.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod ed_node_coms.mod +ed_model.o: ed_state_vars.mod grid_coms.mod mem_polygons.mod rk4_coms.mod +ed_model.o: rk4_driver.mod +canopy_struct_dynamics.o: allometry.mod canopy_air_coms.mod +canopy_struct_dynamics.o: canopy_layer_coms.mod consts_coms.mod +canopy_struct_dynamics.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod +canopy_struct_dynamics.o: pft_coms.mod physiology_coms.mod rk4_coms.mod +canopy_struct_dynamics.o: soil_coms.mod +disturbance.o: allometry.mod consts_coms.mod decomp_coms.mod disturb_coms.mod +disturbance.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +disturbance.o: ed_therm_lib.mod fuse_fiss_utils.mod grid_coms.mod +disturbance.o: mem_polygons.mod pft_coms.mod phenology_coms.mod +euler_driver.o: canopy_air_coms.mod canopy_struct_dynamics.mod consts_coms.mod +euler_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +euler_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod +euler_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod +events.o: allometry.mod consts_coms.mod decomp_coms.mod disturbance_utils.mod +events.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod +events.o: fuse_fiss_utils.mod grid_coms.mod pft_coms.mod therm_lib.mod +farq_leuning.o: c34constants.mod consts_coms.mod pft_coms.mod phenology_coms.mod +farq_leuning.o: physiology_coms.mod rk4_coms.mod therm_lib8.mod +fire.o: allometry.mod consts_coms.mod disturb_coms.mod ed_misc_coms.mod +fire.o: ed_state_vars.mod grid_coms.mod soil_coms.mod +forestry.o: allometry.mod disturb_coms.mod disturbance_utils.mod ed_max_dims.mod +forestry.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod +growth_balive.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod +growth_balive.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod +growth_balive.o: grid_coms.mod mortality.mod pft_coms.mod physiology_coms.mod +heun_driver.o: canopy_air_coms.mod canopy_struct_dynamics.mod consts_coms.mod +heun_driver.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod +heun_driver.o: rk4_driver.mod rk4_stepper.mod soil_coms.mod +lsm_hyd.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +lsm_hyd.o: grid_coms.mod hydrology_coms.mod hydrology_constants.mod pft_coms.mod +lsm_hyd.o: soil_coms.mod therm_lib.mod +mortality.o: consts_coms.mod disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod +mortality.o: ed_state_vars.mod pft_coms.mod +multiple_scatter.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +multiple_scatter.o: rk4_coms.mod +phenology_aux.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +phenology_aux.o: ed_state_vars.mod ed_therm_lib.mod grid_coms.mod pft_coms.mod +phenology_aux.o: phenology_coms.mod soil_coms.mod +phenology_driv.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod +phenology_driv.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod +phenology_driv.o: grid_coms.mod pft_coms.mod phenology_coms.mod soil_coms.mod +photosyn_driv.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +photosyn_driv.o: ed_state_vars.mod farq_leuning.mod met_driver_coms.mod +photosyn_driv.o: pft_coms.mod phenology_coms.mod physiology_coms.mod +photosyn_driv.o: soil_coms.mod +radiate_driver.o: allometry.mod canopy_layer_coms.mod canopy_radiation_coms.mod +radiate_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +radiate_driver.o: ed_state_vars.mod grid_coms.mod soil_coms.mod +reproduction.o: allometry.mod consts_coms.mod decomp_coms.mod ed_max_dims.mod +reproduction.o: ed_state_vars.mod ed_therm_lib.mod fuse_fiss_utils.mod +reproduction.o: grid_coms.mod mem_polygons.mod pft_coms.mod phenology_coms.mod +rk4_derivs.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod +rk4_derivs.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod +rk4_derivs.o: physiology_coms.mod rk4_coms.mod soil_coms.mod therm_lib8.mod +rk4_driver.o: allometry.mod canopy_air_coms.mod canopy_struct_dynamics.mod +rk4_driver.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod +rk4_driver.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod +rk4_driver.o: phenology_coms.mod rk4_coms.mod soil_coms.mod therm_lib.mod +rk4_integ_utils.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod +rk4_integ_utils.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +rk4_integ_utils.o: hydrology_coms.mod rk4_coms.mod rk4_stepper.mod soil_coms.mod +rk4_integ_utils.o: therm_lib8.mod +rk4_misc.o: canopy_struct_dynamics.mod consts_coms.mod ed_max_dims.mod +rk4_misc.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod grid_coms.mod +rk4_misc.o: rk4_coms.mod soil_coms.mod therm_lib8.mod +rk4_stepper.o: ed_state_vars.mod grid_coms.mod rk4_coms.mod soil_coms.mod +soil_respiration.o: consts_coms.mod decomp_coms.mod ed_state_vars.mod +soil_respiration.o: farq_leuning.mod pft_coms.mod physiology_coms.mod +soil_respiration.o: rk4_coms.mod soil_coms.mod +structural_growth.o: allometry.mod consts_coms.mod decomp_coms.mod +structural_growth.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +structural_growth.o: ed_therm_lib.mod pft_coms.mod +twostream_rad.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +twostream_rad.o: rk4_coms.mod +vegetation_dynamics.o: consts_coms.mod disturb_coms.mod disturbance_utils.mod +vegetation_dynamics.o: ed_misc_coms.mod ed_state_vars.mod fuse_fiss_utils.mod +vegetation_dynamics.o: grid_coms.mod growth_balive.mod mem_polygons.mod +ed_init.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_init.o: ed_state_vars.mod ed_work_vars.mod grid_coms.mod mem_polygons.mod +ed_init.o: phenology_coms.mod phenology_startup.mod rk4_coms.mod soil_coms.mod +ed_init_atm.o: canopy_struct_dynamics.mod consts_coms.mod ed_misc_coms.mod +ed_init_atm.o: ed_node_coms.mod ed_state_vars.mod ed_therm_lib.mod +ed_init_atm.o: fuse_fiss_utils.mod grid_coms.mod met_driver_coms.mod +ed_init_atm.o: pft_coms.mod soil_coms.mod therm_lib.mod +ed_nbg_init.o: allometry.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +ed_nbg_init.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod pft_coms.mod +ed_nbg_init.o: physiology_coms.mod +ed_params.o: allometry.mod canopy_air_coms.mod canopy_layer_coms.mod +ed_params.o: canopy_radiation_coms.mod consts_coms.mod decomp_coms.mod +ed_params.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod +ed_params.o: fusion_fission_coms.mod grid_coms.mod hydrology_coms.mod +ed_params.o: met_driver_coms.mod pft_coms.mod phenology_coms.mod +ed_params.o: physiology_coms.mod rk4_coms.mod soil_coms.mod +ed_type_init.o: allometry.mod canopy_air_coms.mod consts_coms.mod +ed_type_init.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +ed_type_init.o: ed_therm_lib.mod grid_coms.mod pft_coms.mod phenology_coms.mod +ed_type_init.o: soil_coms.mod therm_lib.mod +init_hydro_sites.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +init_hydro_sites.o: grid_coms.mod mem_polygons.mod soil_coms.mod +landuse_init.o: consts_coms.mod disturb_coms.mod ed_max_dims.mod +landuse_init.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +phenology_startup.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +phenology_startup.o: grid_coms.mod phenology_coms.mod +average_utils.o: allometry.mod canopy_radiation_coms.mod consts_coms.mod +average_utils.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +average_utils.o: grid_coms.mod pft_coms.mod therm_lib.mod +ed_init_full_history.o: allometry.mod c34constants.mod consts_coms.mod +ed_init_full_history.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_init_full_history.o: ed_state_vars.mod fusion_fission_coms.mod grid_coms.mod +ed_init_full_history.o: hdf5_coms.mod phenology_startup.mod +ed_init_full_history.o: soil_coms.mod therm_lib.mod +ed_load_namelist.o: canopy_air_coms.mod canopy_layer_coms.mod +ed_load_namelist.o: canopy_radiation_coms.mod consts_coms.mod decomp_coms.mod +ed_load_namelist.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod +ed_load_namelist.o: ed_para_coms.mod ename_coms.mod grid_coms.mod +ed_load_namelist.o: mem_polygons.mod met_driver_coms.mod optimiz_coms.mod +ed_load_namelist.o: pft_coms.mod phenology_coms.mod physiology_coms.mod +ed_load_namelist.o: rk4_coms.mod soil_coms.mod +ed_opspec.o: canopy_air_coms.mod canopy_layer_coms.mod canopy_radiation_coms.mod +ed_opspec.o: consts_coms.mod decomp_coms.mod disturb_coms.mod ed_max_dims.mod +ed_opspec.o: ed_misc_coms.mod ed_para_coms.mod grid_coms.mod mem_polygons.mod +ed_opspec.o: met_driver_coms.mod pft_coms.mod phenology_coms.mod +ed_opspec.o: physiology_coms.mod rk4_coms.mod soil_coms.mod +ed_print.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_print.o: ed_var_tables.mod +ed_read_ed10_20_history.o: allometry.mod consts_coms.mod disturb_coms.mod +ed_read_ed10_20_history.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +ed_read_ed10_20_history.o: fuse_fiss_utils.mod grid_coms.mod mem_polygons.mod +ed_read_ed10_20_history.o: pft_coms.mod +ed_read_ed21_history.o: allometry.mod consts_coms.mod disturb_coms.mod +ed_read_ed21_history.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod +ed_read_ed21_history.o: fuse_fiss_utils.mod grid_coms.mod hdf5_coms.mod +ed_read_ed21_history.o: pft_coms.mod soil_coms.mod +ed_xml_config.o: canopy_radiation_coms.mod decomp_coms.mod disturb_coms.mod +ed_xml_config.o: ed_max_dims.mod ed_misc_coms.mod fusion_fission_coms.mod +ed_xml_config.o: grid_coms.mod hydrology_coms.mod met_driver_coms.mod +ed_xml_config.o: pft_coms.mod phenology_coms.mod physiology_coms.mod +ed_xml_config.o: rk4_coms.mod soil_coms.mod +edio.o: c34constants.mod consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +edio.o: ed_node_coms.mod ed_state_vars.mod grid_coms.mod pft_coms.mod +edio.o: soil_coms.mod therm_lib.mod +h5_output.o: an_header.mod c34constants.mod ed_max_dims.mod ed_misc_coms.mod +h5_output.o: ed_node_coms.mod ed_state_vars.mod ed_var_tables.mod +h5_output.o: fusion_fission_coms.mod grid_coms.mod hdf5_coms.mod +leaf_database.o: grid_coms.mod hdf5_utils.mod soil_coms.mod +canopy_air_coms.o: consts_coms.mod therm_lib.mod therm_lib8.mod +canopy_radiation_coms.o: ed_max_dims.mod +consts_coms.o: +decomp_coms.o: ed_max_dims.mod +disturb_coms.o: ed_max_dims.mod +ed_max_dims.o: +ed_mem_alloc.o: ed_max_dims.mod ed_mem_grid_dim_defs.mod ed_node_coms.mod +ed_mem_alloc.o: ed_state_vars.mod ed_work_vars.mod grid_coms.mod +ed_mem_alloc.o: mem_polygons.mod +ed_misc_coms.o: ed_max_dims.mod +ed_state_vars.o: c34constants.mod disturb_coms.mod ed_max_dims.mod +ed_state_vars.o: ed_misc_coms.mod ed_node_coms.mod ed_var_tables.mod +ed_state_vars.o: fusion_fission_coms.mod grid_coms.mod met_driver_coms.mod +ed_state_vars.o: phenology_coms.mod soil_coms.mod +ed_var_tables.o: ed_max_dims.mod +ed_work_vars.o: ed_max_dims.mod +ename_coms.o: ed_max_dims.mod +fusion_fission_coms.o: ed_max_dims.mod +grid_coms.o: ed_max_dims.mod +hdf5_coms.o: +mem_polygons.o: ed_max_dims.mod +met_driver_coms.o: ed_max_dims.mod +optimiz_coms.o: ed_max_dims.mod +pft_coms.o: ed_max_dims.mod +phenology_coms.o: ed_max_dims.mod +physiology_coms.o: ed_max_dims.mod +rk4_coms.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod grid_coms.mod +rk4_coms.o: soil_coms.mod therm_lib8.mod +soil_coms.o: ed_max_dims.mod grid_coms.mod +ed_mpass_init.o: canopy_air_coms.mod canopy_layer_coms.mod +ed_mpass_init.o: canopy_radiation_coms.mod decomp_coms.mod disturb_coms.mod +ed_mpass_init.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_mpass_init.o: ed_para_coms.mod ed_state_vars.mod ed_work_vars.mod +ed_mpass_init.o: grid_coms.mod mem_polygons.mod met_driver_coms.mod +ed_mpass_init.o: optimiz_coms.mod pft_coms.mod phenology_coms.mod +ed_mpass_init.o: physiology_coms.mod rk4_coms.mod soil_coms.mod +ed_node_coms.o: ed_max_dims.mod +ed_para_coms.o: ed_max_dims.mod +ed_para_init.o: ed_max_dims.mod ed_misc_coms.mod ed_node_coms.mod +ed_para_init.o: ed_para_coms.mod ed_work_vars.mod grid_coms.mod +ed_para_init.o: hdf5_coms.mod mem_polygons.mod soil_coms.mod +allometry.o: consts_coms.mod ed_misc_coms.mod grid_coms.mod pft_coms.mod +allometry.o: rk4_coms.mod soil_coms.mod +budget_utils.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod +budget_utils.o: ed_state_vars.mod grid_coms.mod rk4_coms.mod soil_coms.mod +dateutils.o: consts_coms.mod +ed_filelist.o: ed_max_dims.mod +ed_grid.o: consts_coms.mod ed_max_dims.mod ed_node_coms.mod grid_coms.mod +ed_therm_lib.o: allometry.mod canopy_air_coms.mod consts_coms.mod +ed_therm_lib.o: ed_max_dims.mod ed_misc_coms.mod ed_state_vars.mod grid_coms.mod +ed_therm_lib.o: pft_coms.mod rk4_coms.mod soil_coms.mod therm_lib.mod +ed_therm_lib.o: therm_lib8.mod +fatal_error.o: ed_node_coms.mod +fuse_fiss_utils.o: allometry.mod canopy_layer_coms.mod consts_coms.mod +fuse_fiss_utils.o: decomp_coms.mod disturb_coms.mod ed_max_dims.mod +fuse_fiss_utils.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +fuse_fiss_utils.o: fusion_fission_coms.mod grid_coms.mod mem_polygons.mod +fuse_fiss_utils.o: pft_coms.mod soil_coms.mod therm_lib.mod +great_circle.o: consts_coms.mod +hdf5_utils.o: hdf5_coms.mod +invmondays.o: ed_misc_coms.mod +lapse.o: consts_coms.mod ed_misc_coms.mod ed_state_vars.mod met_driver_coms.mod +numutils.o: consts_coms.mod therm_lib.mod +radiate_utils.o: canopy_radiation_coms.mod consts_coms.mod ed_max_dims.mod +radiate_utils.o: ed_misc_coms.mod ed_state_vars.mod met_driver_coms.mod +stable_cohorts.o: ed_max_dims.mod ed_state_vars.mod pft_coms.mod +stable_cohorts.o: phenology_coms.mod +therm_lib.o: consts_coms.mod +therm_lib8.o: consts_coms.mod therm_lib.mod +update_derived_props.o: allometry.mod canopy_air_coms.mod consts_coms.mod +update_derived_props.o: ed_misc_coms.mod ed_state_vars.mod ed_therm_lib.mod +update_derived_props.o: fuse_fiss_utils.mod grid_coms.mod soil_coms.mod +update_derived_props.o: therm_lib.mod +utils_c.o: /n/moorcroft_data/nlevine/repository/EDBRAMS/ED/src/include/utils_sub_names.h +utils_c.o: +allometry.mod: allometry.o +an_header.mod: an_header.o +c34constants.mod: c34constants.o +canopy_air_coms.mod: canopy_air_coms.o +canopy_layer_coms.mod: canopy_layer_coms.o +canopy_radiation_coms.mod: canopy_radiation_coms.o +canopy_struct_dynamics.mod: canopy_struct_dynamics.o +consts_coms.mod: consts_coms.o +decomp_coms.mod: decomp_coms.o +disturb_coms.mod: disturb_coms.o +disturbance_utils.mod: disturbance.o +ed_max_dims.mod: ed_max_dims.o +ed_mem_grid_dim_defs.mod: ed_mem_grid_dim_defs.o +ed_misc_coms.mod: ed_misc_coms.o +ed_node_coms.mod: ed_node_coms.o +ed_para_coms.mod: ed_para_coms.o +ed_state_vars.mod: ed_state_vars.o +ed_therm_lib.mod: ed_therm_lib.o +ed_var_tables.mod: ed_var_tables.o +ed_work_vars.mod: ed_work_vars.o +ename_coms.mod: ename_coms.o +farq_leuning.mod: farq_leuning.o +fuse_fiss_utils.mod: fuse_fiss_utils.o +fusion_fission_coms.mod: fusion_fission_coms.o +grid_coms.mod: grid_coms.o +growth_balive.mod: growth_balive.o +hdf5_coms.mod: hdf5_coms.o +hdf5_utils.mod: hdf5_utils.o +hydrology_coms.mod: hydrology_coms.o +hydrology_constants.mod: hydrology_constants.o +libxml2f90_interface_module.mod: libxml2f90.f90_pp.o +libxml2f90_module.mod: libxml2f90.f90_pp.o +libxml2f90_strings_module.mod: libxml2f90.f90_pp.o +ll_module.mod: libxml2f90.f90_pp.o +mem_polygons.mod: mem_polygons.o +met_driver_coms.mod: met_driver_coms.o +mortality.mod: mortality.o +optimiz_coms.mod: optimiz_coms.o +pft_coms.mod: pft_coms.o +phenology_coms.mod: phenology_coms.o +phenology_startup.mod: phenology_startup.o +physiology_coms.mod: physiology_coms.o +rk4_coms.mod: rk4_coms.o +rk4_driver.mod: rk4_driver.o +rk4_stepper.mod: rk4_stepper.o +soil_coms.mod: soil_coms.o +therm_lib.mod: therm_lib.o +therm_lib8.mod: therm_lib8.o diff --git a/ED/build/bin/objects.mk b/ED/build/bin/objects.mk index 529eeaedb..8c015676e 100644 --- a/ED/build/bin/objects.mk +++ b/ED/build/bin/objects.mk @@ -83,6 +83,7 @@ OBJ_MODEL = \ mem_polygons.o \ met_driver_coms.o \ mortality.o \ + multiple_scatter.o \ numutils.o \ optimiz_coms.o \ phenology_aux.o \ diff --git a/ED/build/bin/rules.mk b/ED/build/bin/rules.mk index da938d18d..34c12d5f5 100644 --- a/ED/build/bin/rules.mk +++ b/ED/build/bin/rules.mk @@ -368,6 +368,11 @@ mortality.o : $(ED_DYNAMICS)/mortality.f90 $(F90_COMMAND) $( Root depth equation based on ! - ! Kenzo et al. (2009) for a secondary forest in Malaysia. Roots will ! - ! be shallow, though... ! - ! 4. Same as 2, but with an experimental root depth that makes canopy trees ! - ! to have root depths of 5m and grasses/seedlings at 0.5 to have root ! - ! depth of 0.5 m. ! + ! 1. a. The coefficients for structural biomass are set so the total AGB ! + ! is similar to Baker et al. (2004), equation 2. Balive is the ! + ! default ED-2.1; ! + ! b. Experimental root depth that makes canopy trees to have root depths ! + ! of 5m and grasses/seedlings at 0.5 to have root depth of 0.5 m. ! + ! c. Crown area defined as in Poorter et al. (2006), imposing maximum ! + ! crown area ! + ! 2. Similar to 1, but with a few extra changes. ! + ! a. Height -> DBH allometry as in Poorter et al. (2006) ! + ! b. Balive is retuned, using a few leaf biomass allometric equations for ! + ! a few genuses in Costa Rica. References: ! + ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! !---------------------------------------------------------------------------------------! NL%IALLOM = 4 + !---------------------------------------------------------------------------------------! @@ -695,28 +737,51 @@ $ED_NL ! cohorts are stacked on the top of each other. ! ! 1. Dietze (2008) model. Cohorts have a finite radius, and cohorts are ! ! stacked on the top of each other. ! - ! 2. Cohorts have a finite radius with horizontal, but they are no longer ! - ! organised by cohort index. Instead, cohorts of the same height ! - ! compete for light as the radiation is solved layer by layer rather ! - ! than cohort by cohort. This is still under development, ideas are ! - ! welcome. ! !---------------------------------------------------------------------------------------! NL%CROWN_MOD = 1 !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! ICAN_SWRAD -- This variable specifies which canopy radiation model to use for short- ! - ! wave radiation within the canopy: ! - ! 0. Beers law. Added back just for theroretical tests, don't use it if ! - ! you are unsure. This cannot be used with CROWN_MOD = 2. ! - ! 1. Two-stream model. The default and recommended method. ! + ! The following variables control the canopy radiation solver. ! ! ! - ! In either case longwave will be solved using two-stream model. ! - !---------------------------------------------------------------------------------------! - NL%ICAN_SWRAD = 1 + ! ICANRAD -- Specifies how canopy radiation is solved. This variable sets both ! + ! shortwave and longwave. ! + ! 0. Two-stream model (Medvigy 2006), with the possibility to apply ! + ! finite crown area to direct shortwave radiation. ! + ! 1. Multiple-scattering model (Zhao and Qualls 2005,2006), with the ! + ! possibility to apply finite crown area to all radiation fluxes. ! + ! LTRANS_VIS -- Leaf transmittance for tropical plants - Visible/PAR ! + ! LTRANS_NIR -- Leaf transmittance for tropical plants - Near Infrared ! + ! LREFLECT_VIS -- Leaf reflectance for tropical plants - Visible/PAR ! + ! LREFLECT_NIR -- Leaf reflectance for tropical plants - Near Infrared ! + ! ORIENT_TREE -- Leaf orientation factor for tropical trees. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! ORIENT_GRASS -- Leaf orientation factor for tropical grasses. Extremes are: ! + ! -1. All leaves are oriented in the vertical ! + ! 0. Leaf orientation is perfectly random ! + ! 1. All leaves are oriented in the horizontal ! + ! In practice, acceptable values range from -0.4 and 0.6 ! + ! CLUMP_TREE -- Clumping factor for tropical trees. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + ! CLUMP_GRASS -- Clumping factor for tropical grasses. Extremes are: ! + ! lim -> 0. Black hole (0 itself is unacceptable) ! + ! 1. Homogeneously spread over the layer (i.e., no clumping) ! + !---------------------------------------------------------------------------------------! + NL%ICANRAD = 0 + NL%LTRANS_VIS = 0.050 + NL%LTRANS_NIR = 0.270 + NL%LREFLECT_VIS = 0.150 + NL%LREFLECT_NIR = 0.540 + NL%ORIENT_TREE = 0.150 + NL%ORIENT_GRASS = -0.150 + NL%CLUMP_TREE = 1.000 + NL%CLUMP_GRASS = 1.000 !---------------------------------------------------------------------------------------! @@ -735,49 +800,107 @@ $ED_NL !---------------------------------------------------------------------------------------! ! H2O_PLANT_LIM -- this determines whether plant photosynthesis can be limited by ! - ! soil moisture, the FSW term: ! - ! 0. No soil moisture limitation, FSW = 1 ! - ! 1. Original ED-1.0/ED-2.0 method, where ! - ! FSW = Supply / (Demand + Supply) ! - ! 2. Alternative and experimental method based on CLM. It checks ! - ! the water potential only, with all contribution of transpiration ! - ! accounted by gsw. It also ignores root biomass. ! + ! soil moisture, the FSW, defined as FSW = Supply / (Demand + Supply). ! + ! ! + ! Demand is always the transpiration rates in case soil moisture is ! + ! not limiting (the psi_0 term times LAI). The supply is determined ! + ! by Kw * nplant * Broot * Available_Water, and the definition of ! + ! available water changes depending on H2O_PLANT_LIM: ! + ! 0. Force FSW = 1 (effectively available water is infinity). ! + ! 1. Available water is the total soil water above wilting point, ! + ! integrated across all layers within the rooting zone. ! + ! 2. Available water is the soil water at field capacity minus ! + ! wilting point, scaled by the so-called wilting factor: ! + ! (psi(k) - (H - z(k)) - psi_wp) / (psi_fc - psi_wp) ! + ! where psi is the matric potentital at layer k, z is the layer ! + ! depth, H it the crown height and psi_fc and psi_wp are the ! + ! matric potentials at wilting point and field capacity. ! !---------------------------------------------------------------------------------------! NL%H2O_PLANT_LIM = 1 !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! These following variables are factors that multiply some of the ED-2.1 default ! - ! parameters. Setting them to 1.0 will make them the default. These are applied ! - ! mostly to tropical C3 plants. ! + ! The following variables are factors that control photosynthesis and respiration. ! + ! Notice that some of them are relative values whereas others are absolute. ! ! ! - ! VMFACT -- Factor multiplying the default Vm0 ! - ! MFACT -- Factor multiplying the stomatal slope M. ! - ! KFACT -- Factor multiplying the water conductance Kw. This is used only when ! - ! H2O_PLANT_LIM = 1. ! - ! GAMFACT -- Factor multiplying the dark respiration factor (gamma) ! - ! D0FACT -- Factor multiplying the transpiration control in gsw (D0) ! - ! ALPHAFACT -- Factor for changing the quantum yield of C3 plants. This is only ! - ! applied when QUANTUM_EFFICIENCY_T = 0. ! - ! THETACRIT -- Leaf drought phenology threshold. This is the relative soil moisture ! - ! above the wilting point below which the drought-deciduous plants will ! - ! start shedding their leaves ! - ! LWFACT -- Factor for changing the leaf width (w) ! - ! THIOFF -- Offset to be added to the Vm_high_temp ! - ! GGFACT -- factor to multiply the ground to canopy conductance. Default value ! - ! is 1.0. ! - !---------------------------------------------------------------------------------------! - NL%VMFACT = 1.40 - NL%MFACT = 1.125 - NL%KFACT = 3.00 - NL%GAMFACT = 0.75 - NL%D0FACT = 1.50 - NL%ALPHAFACT = 0.875 - NL%THETACRIT = 0.11 - NL%LWFACT = 1.00 - NL%THIOFF = 0.00 - NL%GGFACT = 1.00 + ! VMFACT_C3 -- Factor multiplying the default Vm0 for C3 plants (1.0 = default). ! + ! VMFACT_C4 -- Factor multiplying the default Vm0 for C4 plants (1.0 = default). ! + ! MPHOTO_TRC3 -- Stomatal slope (M) for tropical C3 plants ! + ! MPHOTO_TEC3 -- Stomatal slope (M) for conifers and temperate C3 plants ! + ! MPHOTO_C4 -- Stomatal slope (M) for C4 plants. ! + ! BPHOTO_BLC3 -- cuticular conductance for broadleaf C3 plants [umol/m2/s] ! + ! BPHOTO_NLC3 -- cuticular conductance for needleleaf C3 plants [umol/m2/s] ! + ! BPHOTO_C4 -- cuticular conductance for C4 plants [umol/m2/s] ! + ! KW_GRASS -- Water conductance for trees, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! KW_TREE -- Water conductance for grasses, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! GAMMA_C3 -- The dark respiration factor (gamma) for C3 plants. Subtropical ! + ! conifers will be scaled by GAMMA_C3 * 0.028 / 0.02 ! + ! GAMMA_C4 -- The dark respiration factor (gamma) for C4 plants. ! + ! D0_GRASS -- The transpiration control in gsw (D0) for ALL grasses. ! + ! D0_TREE -- The transpiration control in gsw (D0) for ALL trees. ! + ! ALPHA_C3 -- Quantum yield of ALL C3 plants. This is only applied when ! + ! QUANTUM_EFFICIENCY_T = 0. ! + ! ALPHA_C4 -- Quantum yield of C4 plants. This is always applied. ! + ! KLOWCO2IN -- The coefficient that controls the PEP carboxylase limited rate of ! + ! carboxylation for C4 plants. ! + ! RRFFACT -- Factor multiplying the root respiration factor for ALL PFTs. ! + ! (1.0 = default). ! + ! GROWTHRESP -- The actual growth respiration factor (C3/C4 tropical PFTs only). ! + ! (1.0 = default). ! + ! LWIDTH_GRASS -- Leaf width for grasses, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). ! + ! LWIDTH_BLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to broadleaf trees ! + ! only. ! + ! LWIDTH_NLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to conifer trees ! + ! only. ! + ! Q10_C3 -- Q10 factor for C3 plants (used only if IPHYSIOL is set to 2 or 3). ! + ! Q10_C4 -- Q10 factor for C4 plants (used only if IPHYSIOL is set to 2 or 3). ! + !---------------------------------------------------------------------------------------! + NL%VMFACT_C3 = 1.25 + NL%VMFACT_C4 = 1.00 + NL%MPHOTO_TRC3 = 9.0 + NL%MPHOTO_TEC3 = 7.2 + NL%MPHOTO_C4 = 5.0 + NL%BPHOTO_BLC3 = 10000. + NL%BPHOTO_NLC3 = 1000. + NL%BPHOTO_C4 = 8000. + NL%KW_GRASS = 300. + NL%KW_TREE = 300. + NL%GAMMA_C3 = 0.015 + NL%GAMMA_C4 = 0.036 + NL%D0_GRASS = 0.015 + NL%D0_TREE = 0.015 + NL%ALPHA_C3 = 0.080 + NL%ALPHA_C4 = 0.053 + NL%KLOWCO2IN = 4000. + NL%RRFFACT = 1.000 + NL%GROWTHRESP = 0.33333333333 + NL%LWIDTH_GRASS = 0.05 + NL%LWIDTH_BLTREE = 0.10 + NL%LWIDTH_NLTREE = 0.05 + NL%Q10_C3 = 2.4 + NL%Q10_C4 = 2.4 + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! THETACRIT -- Leaf drought phenology threshold. The sign matters here: ! + ! >= 0. -- This is the relative soil moisture above the wilting point ! + ! below which the drought-deciduous plants will start shedding ! + ! their leaves ! + ! < 0. -- This is the soil potential in MPa below which the drought- ! + ! -deciduous plants will start shedding their leaves. The wilt- ! + ! ing point is by definition -1.5MPa, so make sure that the value ! + ! is above -1.5. ! + !---------------------------------------------------------------------------------------! + NL%THETACRIT = -1.20 !---------------------------------------------------------------------------------------! @@ -825,12 +948,16 @@ $ED_NL ! often will never allow fires. ! ! 2. Fire will be triggered with enough biomass and the total soil ! ! water at the top 75 cm falls below a threshold. ! - ! SM_FIRE -- Threshold to define the relative soil moisture above dry air of the ! - ! top 75cm that will trigger fires. Used only when include_fire is ! - ! set to 2. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2. The sign here matters. ! + ! >= 0. - Minimum relative soil moisture above dry air of the top 75cm ! + ! that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top 75 cm ! + ! that will prevent fires to happen. The dry air soil ! + ! potential is defined as -3.1 MPa, so make sure SM_FIRE is ! + ! greater than this value. ! !---------------------------------------------------------------------------------------! NL%INCLUDE_FIRE = 2 - NL%SM_FIRE = 0.08 + NL%SM_FIRE = 0.07 !---------------------------------------------------------------------------------------! @@ -858,41 +985,27 @@ $ED_NL ! sheltering factor. ! ! 3. This is also based on Massman (1997), but with the option of varying ! ! the drag and sheltering within the canopy. ! + ! 4. Same as 0, but if finds the ground conductance following CLM ! + ! technical note (equations 5.98-5.100). ! !---------------------------------------------------------------------------------------! - NL%ICANTURB = 2 - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! I_BLYR_CONDCT -- This flag controls the boundary layer conductance. This is for ! - ! tests only and should be removed soon, so unless you know what you ! - ! are doing, leave it as zero. ! - ! 0. The Nusselt number for forced convection is estimated using the ! - ! average winds, with no corrections ! - ! 1. The actual Nusselt number for forced convection is multiplied by ! - ! 2.5 as the Reynolds number gets close or greater than 10,000. ! - ! 2. The actual Nusselt number for forced convection is multiplied by ! - ! 10. as the Reynolds number gets close or greater than 10,000. ! - !---------------------------------------------------------------------------------------! - NL%I_BLYR_CONDCT = 0 + NL%ICANTURB = 4 !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! ISFCLYRM -- Similarity theory model. The model that computes u*, T*, etc... ! - ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to estimate ! - ! the flux based on the bulk Richardson number ! - ! 2. Oncley and Dudhia (1995) model, based on MM5. It uses an empirical relation ! - ! between bulk Richardson number and z/L, then computes the flux functions. ! - ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it finds z/L using a ! - ! root-finding method, and it has a different parametrisation for stable layers ! - ! that works better during night time. This is the default and recommended ! - ! method. ! - ! 4. The parametrisation of Beljaars and Holtslag, but using z/L estimation as in ! - ! Oncley and Dudhia. ! - ! 5. The parametrisation of Oncley and Dudhia, but using z/L estimation as in ! - ! Beljaars and Holtslag. ! + ! 1. BRAMS default, based on Louis (1979). It uses empirical relations to ! + ! estimate the flux based on the bulk Richardson number ! + ! ! + ! All models below use an interative method to find z/L, and the only change ! + ! is the functional form of the psi functions. ! + ! ! + ! 2. Oncley and Dudhia (1995) model, based on MM5. ! + ! 3. Beljaars and Holtslag (1991) model. Similar to 2, but it uses an alternative ! + ! method for the stable case that mixes more than the OD95. ! + ! 4. CLM (2004). Similar to 2 and 3, but they have special functions to deal with ! + ! very stable and very stable cases. ! !---------------------------------------------------------------------------------------! NL%ISFCLYRM = 3 !---------------------------------------------------------------------------------------! @@ -908,6 +1021,7 @@ $ED_NL ! 2. Test # 2 of Mahfouf and Noilhan (1991) ! ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! ! 4. Test # 4 of Mahfouf and Noilhan (1991) ! + ! 5. Combination of test #1 (alpha) and test #2 (soil resistance). ! ! In all cases the beta term is modified so it approaches zero as soil moisture goes ! ! to dry air soil. ! !---------------------------------------------------------------------------------------! @@ -926,19 +1040,13 @@ $ED_NL ! Ignored when ISTAR = 1 ! ! TPRANDTL -- Turbulent Prandtl number ! ! Ignored when ISTAR = 1 ! - ! VH2VR -- Ratio between vegetation roughness and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! - ! VH2DH -- Ratio between 0-plane displacement height and vegetation height. ! - ! Ignored when ISFCL = 5 and ICANTURB = 2 or 3. ! ! RIBMAX -- maximum bulk Richardson number. ! ! LEAF_MAXWHC -- Maximum water that can be intercepted by leaves, in kg/m2leaf. ! !---------------------------------------------------------------------------------------! NL%GAMM = 13.0 NL%GAMH = 13.0 NL%TPRANDTL = 0.74 - NL%VH2VR = 0.13 - NL%VH2DH = 0.63 - NL%RIBMAX = 1.00 + NL%RIBMAX = 0.50 NL%LEAF_MAXWHC = 0.11 !---------------------------------------------------------------------------------------! @@ -1026,7 +1134,7 @@ $ED_NL ! MIN_SITE_AREA -- This is the minimum fraction area of a given soil type that allows a ! ! site to be created (ignored if IED_INIT_MODE is set to 3). ! !---------------------------------------------------------------------------------------! - NL%MAXSITE = 6 + NL%MAXSITE = 1 NL%MAXPATCH = 20 NL%MAXCOHORT = 80 NL%MIN_SITE_AREA = 0.005 @@ -1074,20 +1182,19 @@ $ED_NL - !---------------------------------------------------------------------------------------! - ! BETAPOWER -- power to apply in the ground evaporation model (see IED_GRNDVAP ! - ! references). Default value is 1.0. ! - !---------------------------------------------------------------------------------------! - NL%BETAPOWER = 1.0 - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! USTMIN -- minimum friction velocity, u*, in m/s. ! + ! The following variables control the minimum values of various velocities in the ! + ! canopy. This is needed to avoid the air to be extremely still, or to avoid singular- ! + ! ities. When defining the values, keep in mind that UBMIN >= UGBMIN >= USTMIN. ! + ! ! + ! UBMIN -- minimum wind speed at the top of the canopy air space [ m/s] ! + ! UGBMIN -- minimum wind speed at the leaf level [ m/s] ! + ! USTMIN -- minimum friction velocity, u*, in m/s. [ m/s] ! !---------------------------------------------------------------------------------------! - NL%USTMIN = 0.0100 + NL%UBMIN = 0.65 + NL%UGBMIN = 0.25 + NL%USTMIN = 0.05 !---------------------------------------------------------------------------------------! @@ -1136,7 +1243,10 @@ $ED_NL ! the model is run. ! ! IMETCYC1 -- First year with meteorological information ! ! IMETCYCF -- Last year with meteorological information ! - ! IMETAVG -- How the input radiation was originally averaged. ! + ! IMETAVG -- How the input radiation was originally averaged. You must tell this ! + ! because ED-2.1 can make a interpolation accounting for the cosine of ! + ! zenith angle. ! + ! -1. I don't know, use linear interpolation. ! ! 0. No average, the values are instantaneous ! ! 1. Averages ending at the reference time ! ! 2. Averages beginning at the reference time ! @@ -1157,8 +1267,8 @@ $ED_NL NL%ISHUFFLE = 0 NL%METCYC1 = 2002 NL%METCYCF = 2005 - NL%IMETAVG = 0 - NL%IMETRAD = 0 + NL%IMETAVG = 1 + NL%IMETRAD = 2 NL%INITIAL_CO2 = 278.0 !---------------------------------------------------------------------------------------! diff --git a/ED/src/driver/ed_1st.f90 b/ED/src/driver/ed_1st.f90 index f07666ccb..57fa51ac7 100644 --- a/ED/src/driver/ed_1st.f90 +++ b/ED/src/driver/ed_1st.f90 @@ -175,9 +175,6 @@ subroutine ed_1st_node(init) call ed_nodeget_processid(1) call ed_nodeget_nl - !----- Load ecosystem parameters, now that the namelist is loaded. ---------------------! - call load_ed_ecosystem_params() - !----- Get the meteorological driver header. -------------------------------------------! call ed_nodeget_met_header() call MPI_Barrier(MPI_COMM_WORLD,ierr) diff --git a/ED/src/driver/ed_driver.f90 b/ED/src/driver/ed_driver.f90 index 741ad5f11..6633a9e93 100644 --- a/ED/src/driver/ed_driver.f90 +++ b/ED/src/driver/ed_driver.f90 @@ -245,11 +245,13 @@ subroutine ed_driver() !---------------------------------------------------------------------------------------! call timing(1,t1) w2 = walltime(wtime_start) - write(c0,'(f12.2)') t1 - write(c1,'(f12.2)') w2-w1 - write(*,'(/,a,/)') ' === Finish initialization; CPU(sec)='//& - trim(adjustl(c0))//'; Wall(sec)='//trim(adjustl(c1))//& - '; Time integration starts (ed_master) ===' + if (mynum == nnodetot) then + write(c0,'(f12.2)') t1 + write(c1,'(f12.2)') w2-w1 + write(unit=*,fmt='(/,a,/)') ' === Finish initialization; CPU(sec)='// & + trim(adjustl(c0))//'; Wall(sec)='//trim(adjustl(c1))// & + '; Time integration starts (ed_master) ===' + end if !---------------------------------------------------------------------------------------! diff --git a/ED/src/driver/ed_met_driver.f90 b/ED/src/driver/ed_met_driver.f90 index da28fa32d..7b1eea9b0 100644 --- a/ED/src/driver/ed_met_driver.f90 +++ b/ED/src/driver/ed_met_driver.f90 @@ -322,6 +322,7 @@ subroutine read_met_drivers_init , imonthz ! ! intent(in) use grid_coms , only : ngrids ! ! intent(in) use consts_coms , only : day_sec ! ! intent(in) + use ed_node_coms , only : mynum ! ! intent(in) implicit none !----- Local variables -----------------------------------------------------------------! type(edtype) , pointer :: cgrid @@ -397,13 +398,14 @@ subroutine read_met_drivers_init i1stfull = metcyc1 - nfullcyc * ncyc year_use = metcycf - (i1stfull - iyeara) - - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 - write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf - write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 + write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf + write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + end if do iyear=1,nyears if (year_use == metcycf) then year_use = metcyc1 @@ -411,10 +413,14 @@ subroutine read_met_drivers_init year_use = year_use + 1 end if metyears(iyear) = year_use - write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + if (mynum == 1) then + write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + end if end do - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a)' ) ' ' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a)' ) ' ' + end if !------------------------------------------------------------------------------------! ! For years outside the met driver range, we pick up a random year. Because we ! @@ -423,12 +429,14 @@ subroutine read_met_drivers_init !------------------------------------------------------------------------------------! case (1) - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 - write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf - write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 + write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf + write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + end if do year_use=iyeara,iyearz iyear=year_use-iyeara+1 if (year_use < metcyc1 .or. year_use > metcycf) then @@ -437,10 +445,14 @@ subroutine read_met_drivers_init else metyears(iyear) = year_use end if - write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + if (mynum == 1) then + write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + end if end do - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a)' ) ' ' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a)' ) ' ' + end if !------------------------------------------------------------------------------------! ! For years outside the met driver range, we pick up a random year. We skip some ! @@ -449,12 +461,14 @@ subroutine read_met_drivers_init !------------------------------------------------------------------------------------! case (2) - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 - write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf - write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a,1x,i12)') ' - METCYC1 =',metcyc1 + write (unit=*,fmt='(a,1x,i12)') ' - METCYCF =',metcycf + write (unit=*,fmt='(a,1x,i12)') ' - NYEARS =',nyears + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(2(1x,a))') ' IYEAR',' YEAR_USE' + end if do year_use=iyeara,iyearz iyear=year_use-iyeara+1 if (year_use < metcyc1 .or. year_use > metcycf) then @@ -466,10 +480,14 @@ subroutine read_met_drivers_init else metyears(iyear) = year_use end if - write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + if (mynum == 1) then + write (unit=*,fmt='(2(1x,i12))') iyear,metyears(iyear) + end if end do - write (unit=*,fmt='(a)' ) '------------------------------' - write (unit=*,fmt='(a)' ) ' ' + if (mynum == 1) then + write (unit=*,fmt='(a)' ) '------------------------------' + write (unit=*,fmt='(a)' ) ' ' + end if end select end if !---------------------------------------------------------------------------------------! @@ -779,7 +797,8 @@ subroutine update_met_drivers(cgrid) , prec_slope & ! intent(in) , humid_scenario & ! intent(in) , atm_rhv_min & ! intent(in) - , atm_rhv_max ! ! intent(in) + , atm_rhv_max & ! intent(in) + , print_radinterp ! ! intent(in) use ed_misc_coms , only : simtime & ! intent(in) , current_time & ! intent(in) , dtlsm ! ! intent(in) @@ -882,9 +901,11 @@ subroutine update_met_drivers(cgrid) select case(met_interp(iformat,iv)) case (2,4) !---------------------------------------------------------------------------! - ! Time independent variables, set mprev to 1. ! + ! Time independent variables, set mprev to 1 and the previous time to ! + ! the current time. ! !---------------------------------------------------------------------------! mprev = 1 + prevmet_timea = current_time case (0,3) @@ -894,30 +915,495 @@ subroutine update_met_drivers(cgrid) ndays_elapsed = current_time%date - 1 nseconds_elapsed = nint(current_time%time) + ndays_elapsed * nint(day_sec) mprev = int(float(nseconds_elapsed) / met_frq(iformat,iv)) + 1 + dtprev = floor(real(nseconds_elapsed)/met_frq(iformat,iv)) & + * met_frq(iformat,iv) - real(nseconds_elapsed) + + + + !---------------------------------------------------------------------------! + ! Find the actual time of the previous and the upcoming met ! + ! information. We need this to find the integral of the secant of the ! + ! zenith angle, which is used to make a time interpolation that preserves ! + ! the diurnal cycle consistent. This is particularly important for ! + ! tropical regions because the zenith angle changes very quickly and the ! + ! radiation could be too skewed even with hourly data. ! + !---------------------------------------------------------------------------! + prevmet_timea = current_time + nextmet_timea = current_time ! we won't use it, though. + select case (imetavg) + case (0) + !----- Instantaneous averages. ------------------------------------------! + call update_model_time_dm(prevmet_timea,dtprev) + !------------------------------------------------------------------------! + + case (1) + !----- Averages ending at the reference time. ---------------------------! + call update_model_time_dm(prevmet_timea,dtprev - met_frq(iformat,iv)) + !------------------------------------------------------------------------! + + case (2) + !----- Averages beginning at the reference time. ------------------------! + call update_model_time_dm(prevmet_timea,dtprev) + !------------------------------------------------------------------------! + + case (3) + !----- Averages centred at the reference time. --------------------------! + call update_model_time_dm(prevmet_timea & + ,dtprev - 0.5 * met_frq(iformat,iv)) + !------------------------------------------------------------------------! + + end select + !------------------------------------------------------------------------------! end select - + !----- Find which variable it is, and then fill the polygons. -----------------! select case (trim(met_vars(iformat,iv))) case('nbdsf') !----- Near IR beam downward shortwave flux. ------ [ W/mē] -! - do ipy = 1,cgrid%npolygons - cgrid%met(ipy)%nir_beam = cgrid%metinput(ipy)%nbdsf(mprev) - end do + + !---------------------------------------------------------------------------! + ! Decide whether to interpolate or not. ! + !---------------------------------------------------------------------------! + if ( imetavg == -1 .or. met_interp(iformat,iv) == 2 .or. & + met_interp(iformat,iv) == 4 ) then + !----- Constant, do not attempt to do any interpolation. ----------------! + do ipy = 1,cgrid%npolygons + cgrid%met(ipy)%nir_beam = cgrid%metinput(ipy)%nbdsf(mprev) + end do + else + do ipy = 1,cgrid%npolygons + !---------------------------------------------------------------------! + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! + !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! + + + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on both the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_beam = 0. + else + !---------------------------------------------------------------! + ! Daytime: we scale the current time using the previous ! + ! secant and scaling back with the current cosine of zenith ! + ! angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) * secz_prev + cgrid%met(ipy)%nir_beam = fperp_prev * cgrid%cosz(ipy) + end if + !------------------------------------------------------------------! + + + + !----- Assume all future stuff to be zero, we won't use them. -----! + secz_next = 0. + night_next = .true. + fperp_next = 0. + wprev = 1.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_beam = 0.0 + wprev = 0.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + end if + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! Print the debugging information if the user wants so. ! + !---------------------------------------------------------------------! + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'nbdsf') + end if + !---------------------------------------------------------------------! + end do + end if + !---------------------------------------------------------------------------! case('nddsf') !----- Near IR diffuse downward shortwave flux. --- [ W/mē] -! - do ipy = 1,cgrid%npolygons - cgrid%met(ipy)%nir_diffuse = cgrid%metinput(ipy)%nddsf(mprev) - end do + + !---------------------------------------------------------------------------! + ! Decide whether to interpolate or not. ! + !---------------------------------------------------------------------------! + if ( imetavg == -1 .or. met_interp(iformat,iv) == 2 .or. & + met_interp(iformat,iv) == 4 ) then + !----- Constant, do not attempt to do any interpolation. ----------------! + do ipy = 1,cgrid%npolygons + cgrid%met(ipy)%nir_diffuse = cgrid%metinput(ipy)%nddsf(mprev) + end do + else + do ipy = 1,cgrid%npolygons + + !---------------------------------------------------------------------! + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! + !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! + + + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on both the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_diffuse = 0. + else + !---------------------------------------------------------------! + ! Daytime: we scale the current time using the previous ! + ! secant and scaling back with the current cosine of zenith ! + ! angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) * secz_prev + cgrid%met(ipy)%nir_diffuse = fperp_prev * cgrid%cosz(ipy) + end if + !------------------------------------------------------------------! + + + + !----- Assume all future stuff to be zero, we won't use them. -----! + secz_next = 0. + night_next = .true. + fperp_next = 0. + wprev = 1.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_diffuse = 0.0 + wprev = 0.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + end if + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! Print the debugging information if the user wants so. ! + !---------------------------------------------------------------------! + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'nddsf') + end if + !---------------------------------------------------------------------! + end do + end if + !---------------------------------------------------------------------------! case('vbdsf') !----- Visible beam downward shortwave flux. ------ [ W/mē] -! - do ipy = 1,cgrid%npolygons - cgrid%met(ipy)%par_beam = cgrid%metinput(ipy)%vbdsf(mprev) - end do + !---------------------------------------------------------------------------! + ! Decide whether to interpolate or not. ! + !---------------------------------------------------------------------------! + if ( imetavg == -1 .or. met_interp(iformat,iv) == 2 .or. & + met_interp(iformat,iv) == 4 ) then + !----- Constant, do not attempt to do any interpolation. ----------------! + do ipy = 1,cgrid%npolygons + cgrid%met(ipy)%par_beam = cgrid%metinput(ipy)%vbdsf(mprev) + end do + else + do ipy = 1,cgrid%npolygons + + !---------------------------------------------------------------------! + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! + !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! + + + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on both the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_beam = 0. + else + !---------------------------------------------------------------! + ! Daytime: we scale the current time using the previous ! + ! secant and scaling back with the current cosine of zenith ! + ! angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) * secz_prev + cgrid%met(ipy)%par_beam = fperp_prev * cgrid%cosz(ipy) + end if + !------------------------------------------------------------------! + + + + !----- Assume all future stuff to be zero, we won't use them. -----! + secz_next = 0. + night_next = .true. + fperp_next = 0. + wprev = 1.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_beam = 0.0 + wprev = 0.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + end if + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! Print the debugging information if the user wants so. ! + !---------------------------------------------------------------------! + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'vbdsf') + end if + !---------------------------------------------------------------------! + end do + end if + !---------------------------------------------------------------------------! case('vddsf') !----- Visible diffuse downward shortwave flux. --- [ W/mē] -! - do ipy = 1,cgrid%npolygons - cgrid%met(ipy)%par_diffuse = cgrid%metinput(ipy)%vddsf(mprev) - end do + + !---------------------------------------------------------------------------! + ! Decide whether to interpolate or not. ! + !---------------------------------------------------------------------------! + if ( imetavg == -1 .or. met_interp(iformat,iv) == 2 .or. & + met_interp(iformat,iv) == 4 ) then + !----- Constant, do not attempt to do any interpolation. ----------------! + do ipy = 1,cgrid%npolygons + cgrid%met(ipy)%par_diffuse = cgrid%metinput(ipy)%vddsf(mprev) + end do + else + do ipy = 1,cgrid%npolygons + + !---------------------------------------------------------------------! + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! + !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! + + + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on both the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_diffuse = 0. + else + !---------------------------------------------------------------! + ! Daytime: we scale the current time using the previous ! + ! secant and scaling back with the current cosine of zenith ! + ! angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) * secz_prev + cgrid%met(ipy)%par_diffuse = fperp_prev * cgrid%cosz(ipy) + end if + !------------------------------------------------------------------! + + + + !----- Assume all future stuff to be zero, we won't use them. -----! + secz_next = 0. + night_next = .true. + fperp_next = 0. + wprev = 1.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_diffuse = 0.0 + wprev = 0.0 + wnext = 0.0 + mnext = mprev + !------------------------------------------------------------------! + end if + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! Print the debugging information if the user wants so. ! + !---------------------------------------------------------------------! + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'vddsf') + end if + !---------------------------------------------------------------------! + end do + end if + !---------------------------------------------------------------------------! case('prate') !----- Precipitation rate. ------------------------ [kg/mē/s] -! do ipy = 1,cgrid%npolygons @@ -1225,390 +1711,496 @@ subroutine update_met_drivers(cgrid) end do case('nbdsf') !----- Near IR beam downward shortwave flux. ------ [ W/mē] -! - do ipy= 1,cgrid%npolygons - !------------------------------------------------------------------------! - ! Check whether this is day time or night time. We should only ! - ! do the full interpolation thing during the day, the night should have ! - ! no incoming radiation until we incorporate fireflies (or a good ! - ! twilight scheme) in the model. ! - !------------------------------------------------------------------------! - if (imetavg == -1) then - fperp_next = cgrid%metinput(ipy)%nbdsf(mnext) - fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) - cgrid%met(ipy)%nir_beam = fperp_next * wnext & - + fperp_prev * wprev - - elseif (cgrid%cosz(ipy) > cosz_min) then + select case (imetavg) + case (-1) + do ipy=1,cgrid%npolygons + cgrid%met(ipy)%nir_beam = cgrid%metinput(ipy)%nbdsf(mnext) * wnext & + + cgrid%metinput(ipy)%nbdsf(mprev) * wprev + end do + case default + + do ipy= 1,cgrid%npolygons !---------------------------------------------------------------------! - ! Define the normalisation factors for the previous and the next ! - ! time. ! - !---------------------------------------------------------------------! - select case (imetavg) - case (0) - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp,0.) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp,0.) - - case default - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - end select + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! - !---------------------------------------------------------------------! - ! Decide whether we want to use the previous or the next data ! - ! based on both both the flux and the zenith angle. We must consider ! - ! the flux because the sun sets a 90 degrees only in a flat surface. ! - !---------------------------------------------------------------------! - night_prev = secz_prev == 0. .or. & - cgrid%metinput(ipy)%nbdsf(mprev) == 0. - night_next = secz_next == 0. .or. & - cgrid%metinput(ipy)%nbdsf(mnext) == 0. - !---------------------------------------------------------------------! + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + night_next = secz_next == 0. + !------------------------------------------------------------------! - !---------------------------------------------------------------------! - ! Decide what to do based on the weighting factors. This is to ! - ! avoid putting too little or too much energy at noon, dawn, and ! - ! dusk. ! - !---------------------------------------------------------------------! - if (night_prev .and. night_next) then - !----- Middle of the night, set the value to zero. ----------------! - cgrid%met(ipy)%nir_beam = 0. - elseif (night_prev) then - !------------------------------------------------------------------! - ! Dawn time, the previous is zero so we only have meaningful ! - ! information for the next time: we scale the next time using the ! - ! next secant and scaling back with the current cosine of zenith ! - ! angle. ! - !------------------------------------------------------------------! - fperp_next = cgrid%metinput(ipy)%nbdsf(mnext) * secz_next - cgrid%met(ipy)%nir_beam = fperp_next * cgrid%cosz(ipy) - elseif (night_next) then - !------------------------------------------------------------------! - ! Dusk time, the next time is zero so we only have meaningful ! - ! information for the previous time: we scale the next time using ! - ! the previous secant and scaling back with the current cosine of ! - ! zenith angle. ! - !------------------------------------------------------------------! - fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) * secz_prev - cgrid%met(ipy)%nir_beam = fperp_prev * cgrid%cosz(ipy) + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev .and. night_next) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_beam = 0. + elseif (night_prev) then + !---------------------------------------------------------------! + ! Dawn time, the previous is zero so we only have meaning- ! + ! ful information for the next time: we scale the next time ! + ! using the next secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = 0. + fperp_next = cgrid%metinput(ipy)%nbdsf(mnext) * secz_next + cgrid%met(ipy)%nir_beam = fperp_next * cgrid%cosz(ipy) + elseif (night_next) then + !---------------------------------------------------------------! + ! Dusk time, the next time is zero so we only have meaning- ! + ! ful information for the previous time: we scale the next time ! + ! using the previous secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) * secz_prev + fperp_next = 0. + cgrid%met(ipy)%nir_beam = fperp_prev * cgrid%cosz(ipy) + else + !----- Middle of the day, use both previous and next values. ---! + fperp_next = cgrid%metinput(ipy)%nbdsf(mnext) * secz_next + fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) * secz_prev + cgrid%met(ipy)%nir_beam = cgrid%cosz(ipy) & + * ( fperp_next * wnext & + + fperp_prev * wprev ) + end if + !------------------------------------------------------------------! else - !----- Middle of the day, use both previous and next values. ------! - fperp_next = cgrid%metinput(ipy)%nbdsf(mnext) * secz_next - fperp_prev = cgrid%metinput(ipy)%nbdsf(mprev) * secz_prev - cgrid%met(ipy)%nir_beam = cgrid%cosz(ipy) & - * ( fperp_next * wnext & - + fperp_prev * wprev ) + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_beam = 0.0 + + !------------------------------------------------------------------! end if !---------------------------------------------------------------------! - else - !----- Night time, assign it zero. -----------------------------------! - cgrid%met(ipy)%nir_beam = 0.0 + + + + !---------------------------------------------------------------------! + ! Print the debugging information if the user wants so. ! + !---------------------------------------------------------------------! + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'nbdsf') + end if !---------------------------------------------------------------------! - end if + end do !------------------------------------------------------------------------! - - end do + end select !---------------------------------------------------------------------------! case('nddsf') !----- Near IR diffuse downward shortwave flux. --- [ W/mē] -! - do ipy= 1,cgrid%npolygons - !------------------------------------------------------------------------! - ! Check whether this is day time or night time. We should only ! - ! do the full interpolation thing during the day, the night should have ! - ! no incoming radiation until we incorporate fireflies (or a good ! - ! twilight scheme) in the model. ! - !------------------------------------------------------------------------! - if (imetavg == -1) then - fperp_next = cgrid%metinput(ipy)%nddsf(mnext) - fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) - cgrid%met(ipy)%nir_diffuse = fperp_next * wnext & - + fperp_prev * wprev - - - elseif (cgrid%cosz(ipy) > cosz_min) then - !---------------------------------------------------------------------! - ! Define the normalisation factors for the previous and the next ! - ! time. ! + select case (imetavg) + case (-1) + do ipy=1,cgrid%npolygons + cgrid%met(ipy)%nir_diffuse = cgrid%metinput(ipy)%nddsf(mnext) * wnext & + + cgrid%metinput(ipy)%nddsf(mprev) * wprev + end do + case default + + + do ipy= 1,cgrid%npolygons !---------------------------------------------------------------------! - select case (imetavg) - case (0) - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp,0.) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp,0.) - case default - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - end select + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! - !---------------------------------------------------------------------! - ! Decide whether we want to use the previous or the next data ! - ! based on both both the flux and the zenith angle. We must consider ! - ! the flux because the sun sets a 90 degrees only in a flat surface. ! - !---------------------------------------------------------------------! - night_prev = secz_prev == 0. .or. & - cgrid%metinput(ipy)%nddsf(mprev) == 0. - night_next = secz_next == 0. .or. & - cgrid%metinput(ipy)%nddsf(mnext) == 0. + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + night_next = secz_next == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev .and. night_next) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_diffuse = 0. + elseif (night_prev) then + !---------------------------------------------------------------! + ! Dawn time, the previous is zero so we only have meaning- ! + ! ful information for the next time: we scale the next time ! + ! using the next secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = 0. + fperp_next = cgrid%metinput(ipy)%nddsf(mnext) * secz_next + cgrid%met(ipy)%nir_diffuse = fperp_next * cgrid%cosz(ipy) + elseif (night_next) then + !---------------------------------------------------------------! + ! Dusk time, the next time is zero so we only have meaning- ! + ! ful information for the previous time: we scale the next time ! + ! using the previous secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) * secz_prev + fperp_next = 0. + cgrid%met(ipy)%nir_diffuse = fperp_prev * cgrid%cosz(ipy) + else + !----- Middle of the day, use both previous and next values. ---! + fperp_next = cgrid%metinput(ipy)%nddsf(mnext) * secz_next + fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) * secz_prev + cgrid%met(ipy)%nir_diffuse = cgrid%cosz(ipy) & + * ( fperp_next * wnext & + + fperp_prev * wprev ) + end if + !------------------------------------------------------------------! + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%nir_diffuse = 0.0 + + !------------------------------------------------------------------! + end if !---------------------------------------------------------------------! !---------------------------------------------------------------------! - ! Decide what to do based on the weighting factors. This is to ! - ! avoid putting too little or too much energy at noon, dawn, and ! - ! dusk. ! + ! Print the debugging information if the user wants so. ! !---------------------------------------------------------------------! - if (night_prev .and. night_next) then - !----- Middle of the night, set the value to zero. ----------------! - cgrid%met(ipy)%nir_diffuse = 0. - elseif (night_prev) then - !------------------------------------------------------------------! - ! Dawn time, the previous is zero so we only have meaningful ! - ! information for the next time: we scale the next time using the ! - ! next secant and scaling back with the current cosine of zenith ! - ! angle. ! - !------------------------------------------------------------------! - fperp_next = cgrid%metinput(ipy)%nddsf(mnext) * secz_next - cgrid%met(ipy)%nir_diffuse = fperp_next * cgrid%cosz(ipy) - elseif (night_next) then - !------------------------------------------------------------------! - ! Dusk time, the next time is zero so we only have meaningful ! - ! information for the previous time: we scale the next time using ! - ! the previous secant and scaling back with the current cosine of ! - ! zenith angle. ! - !------------------------------------------------------------------! - fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) * secz_prev - cgrid%met(ipy)%nir_diffuse = fperp_prev * cgrid%cosz(ipy) - else - !----- Middle of the day, use both previous and next values. ------! - fperp_next = cgrid%metinput(ipy)%nddsf(mnext) * secz_next - fperp_prev = cgrid%metinput(ipy)%nddsf(mprev) * secz_prev - cgrid%met(ipy)%nir_diffuse = cgrid%cosz(ipy) & - * ( fperp_next * wnext & - + fperp_prev * wprev ) + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'nddsf') end if !---------------------------------------------------------------------! - else - !----- Night time, assign it zero. -----------------------------------! - cgrid%met(ipy)%nir_diffuse = 0.0 - !---------------------------------------------------------------------! - end if + end do !------------------------------------------------------------------------! - end do + end select !---------------------------------------------------------------------------! - case('vbdsf') !----- Visible beam downward shortwave flux. ------ [ W/mē] -! - do ipy= 1,cgrid%npolygons - !------------------------------------------------------------------------! - ! Check whether this is day time or night time. We should only ! - ! do the full interpolation thing during the day, the night should have ! - ! no incoming radiation until we incorporate fireflies (or a good ! - ! twilight scheme) in the model. ! - !------------------------------------------------------------------------! - !------------------------------------------------------------------------! - if (imetavg == -1) then - fperp_next = cgrid%metinput(ipy)%vbdsf(mnext) - fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) - cgrid%met(ipy)%par_beam = fperp_next * wnext & - + fperp_prev * wprev + select case (imetavg) + case (-1) + do ipy=1,cgrid%npolygons + cgrid%met(ipy)%par_beam = cgrid%metinput(ipy)%vbdsf(mnext) * wnext & + + cgrid%metinput(ipy)%vbdsf(mprev) * wprev + end do + case default - elseif (cgrid%cosz(ipy) > cosz_min) then - !---------------------------------------------------------------------! - ! Define the normalisation factors for the previous and the next ! - ! time. ! + + do ipy= 1,cgrid%npolygons !---------------------------------------------------------------------! - select case (imetavg) - case (0) - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp,0.) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp,0.) - case default - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - end select + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! - !---------------------------------------------------------------------! - ! Decide whether we want to use the previous or the next data ! - ! based on both both the flux and the zenith angle. We must consider ! - ! the flux because the sun sets a 90 degrees only in a flat surface. ! - !---------------------------------------------------------------------! - night_prev = secz_prev == 0. .or. & - cgrid%metinput(ipy)%vbdsf(mprev) == 0. - night_next = secz_next == 0. .or. & - cgrid%metinput(ipy)%vbdsf(mnext) == 0. + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + night_next = secz_next == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev .and. night_next) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_beam = 0. + elseif (night_prev) then + !---------------------------------------------------------------! + ! Dawn time, the previous is zero so we only have meaning- ! + ! ful information for the next time: we scale the next time ! + ! using the next secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = 0. + fperp_next = cgrid%metinput(ipy)%vbdsf(mnext) * secz_next + cgrid%met(ipy)%par_beam = fperp_next * cgrid%cosz(ipy) + elseif (night_next) then + !---------------------------------------------------------------! + ! Dusk time, the next time is zero so we only have meaning- ! + ! ful information for the previous time: we scale the next time ! + ! using the previous secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) * secz_prev + fperp_next = 0. + cgrid%met(ipy)%par_beam = fperp_prev * cgrid%cosz(ipy) + else + !----- Middle of the day, use both previous and next values. ---! + fperp_next = cgrid%metinput(ipy)%vbdsf(mnext) * secz_next + fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) * secz_prev + cgrid%met(ipy)%par_beam = cgrid%cosz(ipy) & + * ( fperp_next * wnext & + + fperp_prev * wprev ) + end if + !------------------------------------------------------------------! + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_beam = 0.0 + + !------------------------------------------------------------------! + end if !---------------------------------------------------------------------! !---------------------------------------------------------------------! - ! Decide what to do based on the weighting factors. This is to ! - ! avoid putting too little or too much energy at noon, dawn, and ! - ! dusk. ! + ! Print the debugging information if the user wants so. ! !---------------------------------------------------------------------! - if (night_prev .and. night_next) then - !----- Middle of the night, set the value to zero. ----------------! - cgrid%met(ipy)%par_beam = 0. - elseif (night_prev) then - !------------------------------------------------------------------! - ! Dawn time, the previous is zero so we only have meaningful ! - ! information for the next time: we scale the next time using the ! - ! next secant and scaling back with the current cosine of zenith ! - ! angle. ! - !------------------------------------------------------------------! - fperp_next = cgrid%metinput(ipy)%vbdsf(mnext) * secz_next - cgrid%met(ipy)%par_beam = fperp_next * cgrid%cosz(ipy) - elseif (night_next) then - !------------------------------------------------------------------! - ! Dusk time, the next time is zero so we only have meaningful ! - ! information for the previous time: we scale the next time using ! - ! the previous secant and scaling back with the current cosine of ! - ! zenith angle. ! - !------------------------------------------------------------------! - fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) * secz_prev - cgrid%met(ipy)%par_beam = fperp_prev * cgrid%cosz(ipy) - else - !----- Middle of the day, use both previous and next values. ------! - fperp_next = cgrid%metinput(ipy)%vbdsf(mnext) * secz_next - fperp_prev = cgrid%metinput(ipy)%vbdsf(mprev) * secz_prev - cgrid%met(ipy)%par_beam = cgrid%cosz(ipy) & - * ( fperp_next * wnext & - + fperp_prev * wprev ) + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'vbdsf') end if !---------------------------------------------------------------------! - else - !----- Night time, assign it zero. -----------------------------------! - cgrid%met(ipy)%par_beam = 0.0 - !---------------------------------------------------------------------! - end if + end do !------------------------------------------------------------------------! - end do + end select !---------------------------------------------------------------------------! + case('vddsf') !----- Visible diffuse downward shortwave flux. --- [ W/mē] -! - do ipy= 1,cgrid%npolygons - !------------------------------------------------------------------------! - ! Check whether this is day time or night time. We should only ! - ! do the full interpolation thing during the day, the night should have ! - ! no incoming radiation until we incorporate fireflies (or a good ! - ! twilight scheme) in the model. ! - !------------------------------------------------------------------------! - if (imetavg == -1) then - fperp_next = cgrid%metinput(ipy)%vddsf(mnext) - fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) - cgrid%met(ipy)%par_diffuse = fperp_next * wnext & - + fperp_prev * wprev - elseif (cgrid%cosz(ipy) > cosz_min) then - !---------------------------------------------------------------------! - ! Define the normalisation factors for the previous and the next ! - ! time. ! + select case (imetavg) + case (-1) + do ipy=1,cgrid%npolygons + cgrid%met(ipy)%par_diffuse = cgrid%metinput(ipy)%vddsf(mnext) * wnext & + + cgrid%metinput(ipy)%vddsf(mprev) * wprev + end do + case default + + do ipy= 1,cgrid%npolygons !---------------------------------------------------------------------! - select case (imetavg) - case (0) - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp,0.) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp,0.) - case default - secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,prevmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & - ,nextmet_timea,dt_radinterp & - ,met_frq(iformat,iv)) - end select + ! Check whether this is day time or night time. We should only ! + ! do the full interpolation thing during the day, the night should ! + ! have no incoming radiation until we incorporate fireflies (or a ! + ! good twilight scheme) in the model. ! !---------------------------------------------------------------------! + if (cgrid%cosz(ipy) > cosz_min) then + !------------------------------------------------------------------! + ! Define the normalisation factors for the previous and the ! + ! next time. ! + !------------------------------------------------------------------! + select case (imetavg) + case (0) + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp,0.) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp,0.) + case default + secz_prev = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,prevmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + secz_next = mean_daysecz(cgrid%lon(ipy),cgrid%lat(ipy) & + ,nextmet_timea,dt_radinterp & + ,met_frq(iformat,iv)) + end select + !------------------------------------------------------------------! - !---------------------------------------------------------------------! - ! Decide whether we want to use the previous or the next data ! - ! based on both both the flux and the zenith angle. We must consider ! - ! the flux because the sun sets a 90 degrees only in a flat surface. ! - !---------------------------------------------------------------------! - night_prev = secz_prev == 0. .or. & - cgrid%metinput(ipy)%vddsf(mprev) == 0. - night_next = secz_next == 0. .or. & - cgrid%metinput(ipy)%vddsf(mnext) == 0. + + !------------------------------------------------------------------! + ! Decide whether we want to use the previous or the next data ! + ! based on the zenith angle. ! + !------------------------------------------------------------------! + night_prev = secz_prev == 0. + night_next = secz_next == 0. + !------------------------------------------------------------------! + + + + + !------------------------------------------------------------------! + ! Decide what to do based on the weighting factors. This is ! + ! to avoid putting too little or too much energy at noon, dawn, ! + ! and dusk. ! + !------------------------------------------------------------------! + if (night_prev .and. night_next) then + !----- Middle of the night, set the value to zero. -------------! + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_diffuse = 0. + elseif (night_prev) then + !---------------------------------------------------------------! + ! Dawn time, the previous is zero so we only have meaning- ! + ! ful information for the next time: we scale the next time ! + ! using the next secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = 0. + fperp_next = cgrid%metinput(ipy)%vddsf(mnext) * secz_next + cgrid%met(ipy)%par_diffuse = fperp_next * cgrid%cosz(ipy) + elseif (night_next) then + !---------------------------------------------------------------! + ! Dusk time, the next time is zero so we only have meaning- ! + ! ful information for the previous time: we scale the next time ! + ! using the previous secant and scaling back with the current ! + ! cosine of zenith angle. ! + !---------------------------------------------------------------! + fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) * secz_prev + fperp_next = 0. + cgrid%met(ipy)%par_diffuse = fperp_prev * cgrid%cosz(ipy) + else + !----- Middle of the day, use both previous and next values. ---! + fperp_next = cgrid%metinput(ipy)%vddsf(mnext) * secz_next + fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) * secz_prev + cgrid%met(ipy)%par_diffuse = cgrid%cosz(ipy) & + * ( fperp_next * wnext & + + fperp_prev * wprev ) + end if + !------------------------------------------------------------------! + else + !----- Night time, assign it zero. --------------------------------! + secz_prev = 0. + secz_next = 0. + night_prev = .true. + night_next = .true. + fperp_prev = 0. + fperp_next = 0. + cgrid%met(ipy)%par_diffuse = 0.0 + + !------------------------------------------------------------------! + end if !---------------------------------------------------------------------! !---------------------------------------------------------------------! - ! Decide what to do based on the weighting factors. This is to ! - ! avoid putting too little or too much energy at noon, dawn, and ! - ! dusk. ! + ! Print the debugging information if the user wants so. ! !---------------------------------------------------------------------! - if (night_prev .and. night_next) then - !----- Middle of the night, set the value to zero. ----------------! - cgrid%met(ipy)%par_diffuse = 0. - elseif (night_prev) then - !------------------------------------------------------------------! - ! Dawn time, the previous is zero so we only have meaningful ! - ! information for the next time: we scale the next time using the ! - ! next secant and scaling back with the current cosine of zenith ! - ! angle. ! - !------------------------------------------------------------------! - fperp_next = cgrid%metinput(ipy)%vddsf(mnext) * secz_next - cgrid%met(ipy)%par_diffuse = fperp_next * cgrid%cosz(ipy) - elseif (night_next) then - !------------------------------------------------------------------! - ! Dusk time, the next time is zero so we only have meaningful ! - ! information for the previous time: we scale the next time using ! - ! the previous secant and scaling back with the current cosine of ! - ! zenith angle. ! - !------------------------------------------------------------------! - fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) * secz_prev - cgrid%met(ipy)%par_diffuse = fperp_prev * cgrid%cosz(ipy) - else - !----- Middle of the day, use both previous and next values. ------! - fperp_next = cgrid%metinput(ipy)%vddsf(mnext) * secz_next - fperp_prev = cgrid%metinput(ipy)%vddsf(mprev) * secz_prev - cgrid%met(ipy)%par_diffuse = cgrid%cosz(ipy) & - * ( fperp_next * wnext & - + fperp_prev * wprev ) + if (print_radinterp) then + call dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea & + ,nextmet_timea,met_frq(iformat,iv),wprev,wnext & + ,secz_prev,secz_next,fperp_prev,fperp_next & + ,night_prev,night_next,'vddsf') end if !---------------------------------------------------------------------! - else - !----- Night time, assign it zero. -----------------------------------! - cgrid%met(ipy)%par_diffuse = 0.0 - !---------------------------------------------------------------------! - end if + end do !------------------------------------------------------------------------! - end do + end select !---------------------------------------------------------------------------! case('co2') !----- CO2 mixing ratio. -------------------------- [ ppm] -! diff --git a/ED/src/driver/ed_model.f90 b/ED/src/driver/ed_model.f90 index 44867eeea..df91e6cda 100644 --- a/ED/src/driver/ed_model.f90 +++ b/ED/src/driver/ed_model.f90 @@ -4,7 +4,8 @@ !------------------------------------------------------------------------------------------! subroutine ed_model() - use ed_misc_coms , only : integration_scheme & ! intent(in) + use ed_misc_coms , only : ivegt_dynamics & ! intent(in) + , integration_scheme & ! intent(in) , current_time & ! intent(in) , frqfast & ! intent(in) , frqstate & ! intent(in) @@ -363,8 +364,31 @@ subroutine ed_model() call reset_integ_err() end if - !----- Do phenology, growth, mortality, recruitment, disturbance. ----------------! - call vegetation_dynamics(new_month,new_year) + + !---------------------------------------------------------------------------------! + ! Compute phenology, growth, mortality, recruitment, disturbance, and check ! + ! whether we will apply them to the ecosystem or not. ! + !---------------------------------------------------------------------------------! + select case (ivegt_dynamics) + case (0) + !------------------------------------------------------------------------------! + ! Dummy vegetation dynamics, we compute the tendencies but we don't really ! + ! apply to the vegetation, so they will remain constant throughout the entire ! + ! simulation. ! + !------------------------------------------------------------------------------! + call vegetation_dynamics_eq_0(new_month,new_year) + !------------------------------------------------------------------------------! + + case (1) + !------------------------------------------------------------------------------! + ! Actual vegetation dynamics, we compute the tendencies and apply to the ! + ! vegetation. ! + !------------------------------------------------------------------------------! + call vegetation_dynamics(new_month,new_year) + !------------------------------------------------------------------------------! + + end select + !---------------------------------------------------------------------------------! !----- First day of a month. -----------------------------------------------------! if (new_month) then diff --git a/ED/src/dynamics/canopy_struct_dynamics.f90 b/ED/src/dynamics/canopy_struct_dynamics.f90 index f74622fb8..086112c4e 100644 --- a/ED/src/dynamics/canopy_struct_dynamics.f90 +++ b/ED/src/dynamics/canopy_struct_dynamics.f90 @@ -68,6 +68,14 @@ module canopy_struct_dynamics ! above plant canopies of arbitrary structure. Boundary Layer Meteorology, 91, ! ! 81-107. ! ! ! + ! 4. This option is almost the same as option 1, except that the ground conductance ! + ! beneath a vegetated canopy is found in a similar way as the CLM technical note, ! + ! equations (5.98-5.100). The conductance for bare ground is still found the same ! + ! way as in the similarity theory. ! + ! ! + ! Oleson, K. W., et al.; Technical description of version 4.0 of the community land ! + ! model (CLM) NCAR Technical Note NCAR/TN-478+STR, Boulder, CO, April 2010. ! + ! ! ! Ultimately, this routine solves for the resistance of water vapor and sensible ! ! heat from the soil surface to canopy air space and from the leaf surfaces to canopy ! ! air space. ! @@ -77,6 +85,7 @@ subroutine canopy_turbulence(cpoly,isi,ipa) , sitetype & ! structure , patchtype ! ! structure use met_driver_coms , only : met_driv_state ! ! structure + use grid_coms , only : nzg ! ! intent(in) use rk4_coms , only : ibranch_thermo ! ! intent(in) use canopy_air_coms , only : icanturb & ! intent(in), can. turb. scheme , ustmin & ! intent(in) @@ -95,13 +104,13 @@ subroutine canopy_turbulence(cpoly,isi,ipa) , infunc & ! intent(in) , gamma_mw99 & ! intent(in) , nu_mw99 & ! intent(in) + , cs_dense0 & ! intent(in) + , gamma_clm4 & ! intent(in) , rb_inter & ! intent(in) , rb_slope & ! intent(in) - , ggfact & ! intent(in) , tprandtl & ! intent(in) , zoobukhov ! ! function - use canopy_layer_coms, only : crown_mod & ! intent(in) - , ncanlyr & ! intent(in) + use canopy_layer_coms, only : ncanlyr & ! intent(in) , dzcan & ! intent(in) , zztop0i & ! intent(in) , ehgti & ! intent(in) @@ -144,6 +153,7 @@ subroutine canopy_turbulence(cpoly,isi,ipa) integer :: ico ! Cohort loop integer :: ipft ! PFT alias integer :: k ! Elevation index + integer :: ksn ! Number of temporary sfc. water layers [ ---] integer :: kk ! Counter [ ---] integer :: zcan ! Index of canopy top elevation integer :: zels ! Index of roughness height @@ -205,6 +215,8 @@ subroutine canopy_turbulence(cpoly,isi,ipa) real :: sigma_wou2 ! Square of (sigma w / u) [ ---] real :: turbi ! Mean turbulent intensity [ m/s] real :: can_reynolds ! Reynolds number of the Sfc. mixing layer [ ---] + real :: ground_temp ! Ground temperature [ ---] + real :: stab_clm4 ! Stability parameter (CLM4, eq. 5.104) [ ---] !----- External functions. ----------------------------------------------------------! real(kind=4), external :: cbrt ! Cubic root that works for negative numbers !------------------------------------------------------------------------------------! @@ -256,7 +268,7 @@ subroutine canopy_turbulence(cpoly,isi,ipa) ! zero to the conductance, but it shouldn't be used at all. ! !---------------------------------------------------------------------------------! csite%ggveg(ipa) = 0.0 - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) + csite%ggnet(ipa) = csite%ggbare(ipa) !---------------------------------------------------------------------------------! @@ -299,12 +311,14 @@ subroutine canopy_turbulence(cpoly,isi,ipa) select case (icanturb) !------------------------------------------------------------------------------------! - ! LEAF-3 Case: This approach is very similar to older implementations of ED-2, and ! - ! it is very similar to LEAF-3, and to option 1, except that option 1 ! - ! computes the vegetated ground conductance and wind profile different- ! - ! ly. ! + ! 0. LEAF-3 Case: This approach is very similar to older implementations of ED-2, ! + ! and it is very similar to LEAF-3, and to option 1, except that option 1 ! + ! computes the vegetated ground conductance and wind profile differently. ! + ! 4. CLM-4 Case: This is the same as option 0., except that the ground conductance ! + ! is found using equations (5.99-5.104) from CLM technical note (except the bare ! + ! ground, which is still found using the similarity theory). ! !------------------------------------------------------------------------------------! - case (0) + case (0,4) !---------------------------------------------------------------------------------! ! Find the roughness as the average between the bare ground and vegetated ! @@ -339,17 +353,52 @@ subroutine canopy_turbulence(cpoly,isi,ipa) ,csite%rough(ipa),csite%ustar(ipa),csite%tstar(ipa),estar & ,csite%qstar(ipa),csite%cstar(ipa),csite%zeta(ipa),csite%ribulk(ipa) & ,csite%ggbare(ipa)) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Find the aerodynamic resistance due to vegetated ground. ! + !---------------------------------------------------------------------------------! if (csite%snowfac(ipa) < 0.9) then - factv = log((cmet%geoht - csite%veg_displace(ipa)) / csite%rough(ipa)) & - / (vonk * vonk * cmet%vels) - aux = exp(exar * (1. - (csite%veg_displace(ipa) + csite%rough(ipa)) & - / csite%veg_height(ipa)) ) - csite%ggveg(ipa) = (exar * (csite%veg_height(ipa) - csite%veg_displace(ipa) )) & - / (factv * csite%veg_height(ipa) * (exp(exar) - aux)) - else + select case (icanturb) + case (0) + !----- LEAF-3 method. ------------------------------------------------------! + factv = log((cmet%geoht - csite%veg_displace(ipa)) / csite%rough(ipa)) & + / (vonk * vonk * cmet%vels) + aux = exp(exar * (1. - (csite%veg_displace(ipa) + csite%rough(ipa)) & + / csite%veg_height(ipa)) ) + csite%ggveg(ipa) = (exar * (csite%veg_height(ipa)-csite%veg_displace(ipa))) & + / (factv * csite%veg_height(ipa) * (exp(exar) - aux)) + case (4) + !---------------------------------------------------------------------------! + ! Similar to CLM-4, although we use the ground conductance for bare ! + ! ground from the similarity theory and the fraction of open canopy to ! + ! determine the weights. The conductance for dense canopy is simply ! + ! Cs_dense * u*, but Cs_dense depends on the stability. ! + !---------------------------------------------------------------------------! + !----- Find which ground temperature to use. -------------------------------! + ksn = csite%nlev_sfcwater(ipa) + if (ksn == 0) then + ground_temp = csite%soil_tempk(nzg,ipa) + else + ground_temp = csite%sfcwater_tempk(ksn,ipa) + end if + !----- Stability factor (0 when it is unstable). ---------------------------! + stab_clm4 = max( 0.0 & + , min(10., 2.0 * grav * csite%veg_height(ipa) & + * ( csite%can_temp(ipa) - ground_temp ) & + / ( ( csite%can_temp(ipa) + ground_temp) & + * csite%ustar(ipa) * csite%ustar(ipa) ) ) ) + !----- The "veg" conductance is equivalent to CLM4 dense canopy. -----------! + csite%ggveg(ipa) = cs_dense0 * csite%ustar(ipa) & + / (1.0 + gamma_clm4 * stab_clm4) + end select + else csite%ggveg(ipa) = 0. end if + !---------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------! @@ -360,210 +409,27 @@ subroutine canopy_turbulence(cpoly,isi,ipa) !----- Find the wind at the top of the canopy. -----------------------------------! uh = reduced_wind(csite%ustar(ipa),csite%zeta(ipa),csite%ribulk(ipa),cmet%geoht & ,csite%veg_displace(ipa),cpatch%hite(1),csite%rough(ipa)) - select case (crown_mod) - case (0) - !------------------------------------------------------------------------------! - ! This is the Leuning et al. (1995) with no modification, except that we ! - ! assume each cohort to be on top of each other (no ties), with very thin ! - ! depth and full patch coverage. ! - !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - !----- Find the extinction coefficients. -----------------------------------! - extinct_half = exp(- 0.25 * cpatch%lai(ico) / cpatch%crown_area(ico)) - extinct_full = exp(- 0.50 * cpatch%lai(ico) / cpatch%crown_area(ico)) - - !----- Assume that wind is at the middle of the thin crown. ----------------! - cpatch%veg_wind(ico) = max(ugbmin, uh * extinct_half) - uh = uh * extinct_full - end do - !------------------------------------------------------------------------------! - - case (1) - !------------------------------------------------------------------------------! - ! In this version we still base ourselves on the Leuning et al. (1995) ! - ! model, but we assume extinction to be limited to the finite crown area. ! - ! Ties are not allowed in this case either. ! - !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - !----- Find the extinction coefficients. -----------------------------------! - extinct_half = cpatch%crown_area(ico) & - * exp(- 0.25 * cpatch%lai(ico) / cpatch%crown_area(ico)) & - + (1. - cpatch%crown_area(ico)) - extinct_full = cpatch%crown_area(ico) & - * exp(- 0.50 * cpatch%lai(ico) / cpatch%crown_area(ico)) & - + (1. - cpatch%crown_area(ico)) - - !----- Assume that wind is at the middle of the thin crown. ----------------! - cpatch%veg_wind(ico) = max(ugbmin, uh * extinct_half) - uh = uh * extinct_full - end do - !------------------------------------------------------------------------------! - - case (2) - !------------------------------------------------------------------------------! - ! In this version we use Leuning et al. (1995) as the starting point, but ! - ! now we assume that the cohorts may not be on top of each other (ties are ! - ! allowed and that the extinction is limited to the finite crown area. Be- ! - ! cause cohorts may coexist at a given height, we must split the canopy into ! - ! several layers first, then we compute the average assuming that the leaf ! - ! area density is constant. ! - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the top layer and the top height. ! - !------------------------------------------------------------------------------! - zcan = max(1,min(ncanlyr,ceiling((cpatch%hite(1) * zztop0i)**ehgti))) - htop = zztop(zcan) - !------------------------------------------------------------------------------! - - - - !----- Use the default wood area index. ---------------------------------------! - windext_half(:) = 0.0 - windext_full(:) = 0.0 - opencan (:) = 0.0 !----- This will be closed canopy inside this loop. -----! - do ico=1,cpatch%ncohorts - ipft = cpatch%pft(ico) - - !---------------------------------------------------------------------------! - ! Find the heights, and compute the LAD of this cohort. ! - !---------------------------------------------------------------------------! - htopcrown = cpatch%hite(ico) - hbotcrown = h2crownbh(cpatch%hite(ico),ipft) - ladcohort = (cpatch%lai(ico) + cpatch%wai(ico)) / (htopcrown - hbotcrown) - kapartial = min(ncanlyr,floor ((hbotcrown * zztop0i)**ehgti) + 1) - kafull = min(ncanlyr,ceiling((hbotcrown * zztop0i)**ehgti) + 1) - kzpartial = min(ncanlyr,ceiling((htopcrown * zztop0i)**ehgti)) - kzfull = min(ncanlyr,floor ((htopcrown * zztop0i)**ehgti)) - !---------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------! - ! Add the LAD for the full layers. ! - !---------------------------------------------------------------------------! - do k = kafull,kzfull - this_lai = ladcohort * dzcan(k) - opencan(k) = opencan(k) + cpatch%crown_area(ico) - windext_full(k) = windext_full(k) + cpatch%crown_area(ico) & - * exp(- 0.50 * this_lai / cpatch%crown_area(ico)) - windext_half(k) = windext_half(k) + cpatch%crown_area(ico) & - * exp(- 0.25 * this_lai / cpatch%crown_area(ico)) - end do - !---------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------! - ! Add the LAD for the partial layers. The only special case is when ! - ! they are both the same layer, which must be done separately. ! - !---------------------------------------------------------------------------! - if (kapartial == kzpartial) then - k = kapartial - this_lai = ladcohort * (htopcrown - hbotcrown) - opencan(k) = opencan(k) + cpatch%crown_area(ico) - windext_full(k) = windext_full(k) + cpatch%crown_area(ico) & - * exp(- 0.50 * this_lai / cpatch%crown_area(ico)) - windext_half(k) = windext_half(k) + cpatch%crown_area(ico) & - * exp(- 0.25 * this_lai / cpatch%crown_area(ico)) - else - !------ Bottom partial layer. -------------------------------------------! - k = kapartial - this_lai = ladcohort * (zztop(kapartial) - hbotcrown) - opencan(k) = opencan(k) + cpatch%crown_area(ico) - windext_full(k) = windext_full(k) + cpatch%crown_area(ico) & - * exp(- 0.50 * this_lai / cpatch%crown_area(ico)) - windext_half(k) = windext_half(k) + cpatch%crown_area(ico) & - * exp(- 0.25 * this_lai / cpatch%crown_area(ico)) - !------ Top partial layer. ----------------------------------------------! - k = kzpartial - this_lai = ladcohort * (htopcrown - zzbot(kzpartial)) - opencan(k) = opencan(k) + cpatch%crown_area(ico) - windext_full(k) = windext_full(k) + cpatch%crown_area(ico) & - * exp(- 0.50 * this_lai / cpatch%crown_area(ico)) - windext_half(k) = windext_half(k) + cpatch%crown_area(ico) & - * exp(- 0.25 * this_lai / cpatch%crown_area(ico)) - end if - !---------------------------------------------------------------------------! - end do - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! At this point opencan is actually closed canopy fraction. In case it ! - ! exceeds one, we have to scale down the wind extinction coefficients before ! - ! we convert to open canopy fraction (kind of clumping effect, or squeezing ! - ! effect). ! - !------------------------------------------------------------------------------! - where (opencan(:) > 1.0) - windext_full(:) = windext_full(:) / opencan(:) - windext_half(:) = windext_half(:) / opencan(:) - opencan(:) = 0.0 - elsewhere - opencan(:) = 1.0 - opencan(:) - end where - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Add the "open canopy effect" to the extinction. This can be though as ! - ! the contribution of the remaining area as having LAI=0. ! - !------------------------------------------------------------------------------! - windext_full(:) = windext_full(:) + opencan(:) - windext_half(:) = windext_half(:) + opencan(:) - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the wind profile with the given wxtinctions. ! - !------------------------------------------------------------------------------! - windlyr(:) = 0.0 - do k=1,zcan - !----- Assume that wind is at the middle of the thin crown. ----------------! - windlyr(k) = max(ugbmin, uh * windext_half(k)) - uh = uh * windext_full(k) - end do - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the wind as the average amongst all layers where the crown is ! - ! defined. ! + !---------------------------------------------------------------------------------! + ! In this version we still base ourselves on the Leuning et al. (1995) model, ! + ! assuming each cohort to be on top of each other (i.e. no ties). We also assume ! + ! extinction to be limited to the finite crown area, so the bottom can get a bit ! + ! windier. ! + !---------------------------------------------------------------------------------! + do ico=1,cpatch%ncohorts + !----- Find the extinction coefficients. --------------------------------------! + extinct_half = cpatch%crown_area(ico) & + * exp(- 0.25 * cpatch%lai(ico) / cpatch%crown_area(ico)) & + + (1. - cpatch%crown_area(ico)) + extinct_full = cpatch%crown_area(ico) & + * exp(- 0.50 * cpatch%lai(ico) / cpatch%crown_area(ico)) & + + (1. - cpatch%crown_area(ico)) !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - ipft = cpatch%pft(ico) - - - !---------------------------------------------------------------------------! - ! Find the heights, and compute the bounds. ! - !---------------------------------------------------------------------------! - htopcrown = cpatch%hite(ico) - hbotcrown = h2crownbh(cpatch%hite(ico),ipft) - kapartial = min(ncanlyr,floor ((hbotcrown * zztop0i)**ehgti) + 1) - kzpartial = min(ncanlyr,ceiling((htopcrown * zztop0i)**ehgti)) - !---------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------! - ! We simplify things here and just average between the partial layers. ! - !---------------------------------------------------------------------------! - cpatch%veg_wind(ico) = 0.0 - do k=kapartial,kzpartial - cpatch%veg_wind(ico) = cpatch%veg_wind(ico) + windlyr(k) * dzcan(k) - end do - cpatch%veg_wind(ico) = cpatch%veg_wind(ico) & - / (zztop(kzpartial) - zzbot(kapartial)) - end do + !----- Assume that wind is at the middle of the thin crown. -------------------! + cpatch%veg_wind(ico) = max(ugbmin, uh * extinct_half) + uh = uh * extinct_full !------------------------------------------------------------------------------! - - end select + end do !---------------------------------------------------------------------------------! @@ -634,9 +500,9 @@ subroutine canopy_turbulence(cpoly,isi,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (csite%opencan_frac(ipa) > 0.999 .or. csite%snowfac(ipa) >= 0.9) then - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) + csite%ggnet(ipa) = csite%ggbare(ipa) else - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) * csite%ggveg(ipa) & + csite%ggnet(ipa) = csite%ggbare(ipa) * csite%ggveg(ipa) & / ( csite%ggveg(ipa) + (1. - csite%opencan_frac(ipa)) & * csite%ggbare(ipa)) end if @@ -800,9 +666,9 @@ subroutine canopy_turbulence(cpoly,isi,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (csite%opencan_frac(ipa) > 0.999 .or. csite%snowfac(ipa) >= 0.9) then - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) + csite%ggnet(ipa) = csite%ggbare(ipa) else - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) * csite%ggveg(ipa) & + csite%ggnet(ipa) = csite%ggbare(ipa) * csite%ggveg(ipa) & / ( csite%ggveg(ipa) + (1. - csite%opencan_frac(ipa)) & * csite%ggbare(ipa) ) end if @@ -1289,9 +1155,9 @@ subroutine canopy_turbulence(cpoly,isi,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (csite%opencan_frac(ipa) > 0.999 .or. csite%snowfac(ipa) >= 0.9) then - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) + csite%ggnet(ipa) = csite%ggbare(ipa) else - csite%ggnet(ipa) = ggfact * csite%ggbare(ipa) * csite%ggveg(ipa) & + csite%ggnet(ipa) = csite%ggbare(ipa) * csite%ggveg(ipa) & / ( csite%ggveg(ipa) + (1. - csite%opencan_frac(ipa)) & * csite%ggbare(ipa)) end if @@ -1376,6 +1242,12 @@ end subroutine canopy_turbulence ! above plant canopies of arbitrary structure. Boundary Layer Meteorology, 91, ! ! 81-107. ! ! ! + ! 4. This option is almost the same as option 1, except that the ground conductance is ! + ! found following the CLM technical note, equations (5.98-5.100). ! + ! ! + ! Oleson, K. W., et al.; Technical description of the community land model (CLM) ! + ! NCAR Technical Note NCAR/TN-461+STR, Boulder, CO, May 2004. ! + ! ! ! Ultimately, this routine solves for the resistance of water vapor and sensible ! ! heat from the soil surface to canopy air space and from the leaf surfaces to canopy ! ! air space. ! @@ -1392,6 +1264,7 @@ subroutine canopy_turbulence8(csite,initp,ipa) , wcapcani & ! intent(out) , hcapcani & ! intent(out) , ccapcani ! ! intent(out) + use grid_coms , only : nzg ! ! intent(in) use canopy_air_coms , only : icanturb & ! intent(in), can. turb. scheme , ustmin8 & ! intent(in) , ugbmin8 & ! intent(in) @@ -1411,11 +1284,11 @@ subroutine canopy_turbulence8(csite,initp,ipa) , nu_mw99_8 & ! intent(in) , rb_inter & ! intent(in) , rb_slope & ! intent(in) - , ggfact8 & ! intent(in) + , cs_dense08 & ! intent(in) + , gamma_clm48 & ! intent(in) , tprandtl8 & ! intent(in) , zoobukhov8 ! ! intent(in) - use canopy_layer_coms, only : crown_mod & ! intent(in) - , ncanlyr & ! intent(in) + use canopy_layer_coms, only : ncanlyr & ! intent(in) , dzcan8 & ! intent(in) , zztop0i8 & ! intent(in) , ehgti8 & ! intent(in) @@ -1455,6 +1328,7 @@ subroutine canopy_turbulence8(csite,initp,ipa) integer :: ico ! Cohort loop integer :: ipft ! PFT alias integer :: k ! Elevation index + integer :: ksn ! Number of temporary sfc. water layers [ ---] integer :: zcan ! Index of canopy top elevation integer :: kafull ! First layer fully occupied by crown integer :: kzfull ! Last layer fully occupied by crown @@ -1511,6 +1385,8 @@ subroutine canopy_turbulence8(csite,initp,ipa) real(kind=8) :: sigma_wou2 ! Square of (sigma w / u) [ ---] real(kind=8) :: turbi ! Mean turbulent intensity [ m/s] real(kind=8) :: can_reynolds ! Reynolds number of the sfc. mixing layer [ ---] + real(kind=8) :: ground_temp ! Ground temperature [ ---] + real(kind=8) :: stab_clm4 ! Stability parameter (CLM4, eq. 5.104) [ ---] !------ External procedures ---------------------------------------------------------! real(kind=8), external :: cbrt8 ! Cubic root that works for negative numbers real(kind=4), external :: sngloff ! Safe double -> simple precision. @@ -1556,7 +1432,7 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! ground. ! !---------------------------------------------------------------------------------! initp%ggveg = 0.d0 - initp%ggnet = ggfact8 * initp%ggbare + initp%ggnet = initp%ggbare !---------------------------------------------------------------------------------! @@ -1593,16 +1469,15 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! resistance. ! !------------------------------------------------------------------------------------! select case (icanturb) - - - !------------------------------------------------------------------------------------! - ! LEAF-3 Case: This approach is very similar to older implementations of ED-2, and ! - ! it is very similar to LEAF-3, and to option 1, except that option 1 ! - ! computes the vegetated ground conductance and wind profile different- ! - ! ly. ! + ! 0. LEAF-3 Case: This approach is very similar to older implementations of ED-2, ! + ! and it is very similar to LEAF-3, and to option 1, except that option 1 ! + ! computes the vegetated ground conductance and wind profile differently. ! + ! 4. CLM-4 Case: This is the same as option 0., except that the ground conductance ! + ! is found using equations (5.99-5.104) from CLM technical note (except the bare ! + ! ground, which is still found using the similarity theory). ! !------------------------------------------------------------------------------------! - case (0) + case (0,4) !---------------------------------------------------------------------------------! ! The roughness is found by combining two weighted averages. The first one ! @@ -1628,16 +1503,47 @@ subroutine canopy_turbulence8(csite,initp,ipa) ,initp%cstar,initp%zeta,initp%ribulk,initp%ggbare) !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Find the aerodynamic resistance due to vegetated ground. ! + !---------------------------------------------------------------------------------! if (initp%snowfac < 9.d-1) then - factv = log((rk4site%geoht-initp%veg_displace) / initp%rough) & - / (vonk8 * vonk8 * rk4site%vels) - aux = exp(exar8 * (1.d0 - (initp%veg_displace + initp%rough) & - / initp%veg_height) ) - initp%ggveg = (exar8 * (initp%veg_height - initp%veg_displace)) & - / (factv * initp%veg_displace * (exp(exar8) - aux)) + select case (icanturb) + case (0) + !----- LEAF-3 method. ------------------------------------------------------! + factv = log((rk4site%geoht-initp%veg_displace) / initp%rough) & + / (vonk8 * vonk8 * rk4site%vels) + aux = exp(exar8 * (1.d0 - (initp%veg_displace + initp%rough) & + / initp%veg_height) ) + initp%ggveg = (exar8 * (initp%veg_height - initp%veg_displace)) & + / (factv * initp%veg_displace * (exp(exar8) - aux)) + case (4) + !---------------------------------------------------------------------------! + ! Similar to CLM-4, although we use the ground conductance for bare ! + ! ground from the similarity theory and the fraction of open canopy to ! + ! determine the weights. The conductance for dense canopy is simply ! + ! Cs_dense * u*, but Cs_dense depends on the stability. ! + !---------------------------------------------------------------------------! + !----- Find which ground temperature to use. -------------------------------! + ksn = csite%nlev_sfcwater(ipa) + if (ksn == 0) then + ground_temp = csite%soil_tempk(nzg,ipa) + else + ground_temp = csite%sfcwater_tempk(ksn,ipa) + end if + !----- Stability factor (0 when it is unstable). ---------------------------! + stab_clm4 = max( 0.d0, min(1.d1, 2.d0 * grav8 * initp%veg_height & + * ( initp%can_temp - ground_temp ) & + / ( ( initp%can_temp + ground_temp) & + * initp%ustar * initp%ustar ) ) ) + !----- The "veg" conductance is equivalent to CLM4 dense canopy. -----------! + initp%ggveg = cs_dense08 * initp%ustar / (1.d0 + gamma_clm48 * stab_clm4) + end select else initp%ggveg = 0.d0 end if + !---------------------------------------------------------------------------------! !---------------------------------------------------------------------------------! @@ -1649,206 +1555,24 @@ subroutine canopy_turbulence8(csite,initp,ipa) uh = reduced_wind8(initp%ustar,initp%zeta,initp%ribulk,rk4site%geoht & ,initp%veg_displace,dble(cpatch%hite(1)),initp%rough) - select case (crown_mod) - case (0) - !------------------------------------------------------------------------------! - ! This is the Leuning et al. (1995) with no modification, except that we ! - ! assume each cohort to be on top of each other (no ties), with very thin ! - ! depth and full patch coverage. ! - !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - !----- Find the extinction coefficients. -----------------------------------! - extinct_half = exp(- 2.5d-1 * initp%lai(ico) / initp%crown_area(ico)) - extinct_full = exp(- 5.0d-1 * initp%lai(ico) / initp%crown_area(ico)) - - !----- Assume that wind is at the middle of the thin crown. ----------------! - initp%veg_wind(ico) = max(ugbmin8, uh * extinct_half) - uh = uh * extinct_full - end do - - case (1) - !------------------------------------------------------------------------------! - ! In this version we still base ourselves on the Leuning et al. (1995) ! - ! model, but we assume extinction to be limited to the finite crown area. ! - ! Ties are not allowed in this case either. ! - !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - !----- Find the extinction coefficients. -----------------------------------! - extinct_half = initp%crown_area(ico) & - * exp(- 2.5d-1 * initp%lai(ico) / initp%crown_area(ico)) & - + (1.d0 - initp%crown_area(ico)) - extinct_full = initp%crown_area(ico) & - * exp(- 5.d-1 * initp%lai(ico) / initp%crown_area(ico)) & - + (1.d0 - initp%crown_area(ico)) - !----- Assume that wind is at the middle of the thin crown. ----------------! - initp%veg_wind(ico) = max(ugbmin8, uh * extinct_half) - uh = uh * extinct_full - end do - - case (2) - !------------------------------------------------------------------------------! - ! In this version we use Leuning et al. (1995) as the starting point, but ! - ! now we assume that the cohorts may not be on top of each other (ties are ! - ! allowed and that the extinction is limited to the finite crown area. Be- ! - ! cause cohorts may coexist at a given height, we must split the canopy into ! - ! several layers first, then we compute the average assuming that the leaf ! - ! area density is constant. ! - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the top layer and the top height. ! - !------------------------------------------------------------------------------! - zcan = max(1,min(ncanlyr,ceiling((dble(cpatch%hite(1)) * zztop0i8)**ehgti8))) - htop = zztop8(zcan) - !------------------------------------------------------------------------------! - - - - !----- Use the default wood area index. ---------------------------------------! - windext_half8(:) = 0.d0 - windext_full8(:) = 0.d0 - opencan8 (:) = 0.d0 !----- This will be closed canopy inside this loop. ---! - do ico=1,cpatch%ncohorts - ipft = cpatch%pft(ico) - - !---------------------------------------------------------------------------! - ! Find the heights, and compute the LAD of this cohort. ! - !---------------------------------------------------------------------------! - htopcrown = dble(cpatch%hite(ico)) - hbotcrown = dble(h2crownbh(cpatch%hite(ico),ipft)) - ladcohort = (initp%lai(ico) + initp%wai(ico)) / (htopcrown - hbotcrown) - kapartial = min(ncanlyr,floor ((hbotcrown * zztop0i8)**ehgti8) + 1) - kafull = min(ncanlyr,ceiling((hbotcrown * zztop0i8)**ehgti8) + 1) - kzpartial = min(ncanlyr,ceiling((htopcrown * zztop0i8)**ehgti8)) - kzfull = min(ncanlyr,floor ((htopcrown * zztop0i8)**ehgti8)) - !---------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------! - ! Add the LAD for the full layers. ! - !---------------------------------------------------------------------------! - do k = kafull,kzfull - this_lai = ladcohort * dzcan8(k) - opencan8(k) = opencan8(k) + initp%crown_area(ico) - windext_full8(k) = windext_full8(k) + initp%crown_area(ico) & - * exp(- 5.0d-1 * this_lai / initp%crown_area(ico)) - windext_half8(k) = windext_half8(k) + initp%crown_area(ico) & - * exp(- 2.5d-1 * this_lai / initp%crown_area(ico)) - end do - !---------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------! - ! Add the LAD for the partial layers. The only special case is when ! - ! they are both the same layer, which must be done separately. ! - !---------------------------------------------------------------------------! - if (kapartial == kzpartial) then - k = kapartial - this_lai = ladcohort * (htopcrown - hbotcrown) - opencan8(k) = opencan8(k) + initp%crown_area(ico) - windext_full8(k) = windext_full8(k) + initp%crown_area(ico) & - * exp(- 5.0d-1 * this_lai / initp%crown_area(ico)) - windext_half8(k) = windext_half8(k) + initp%crown_area(ico) & - * exp(- 2.5d-1 * this_lai / initp%crown_area(ico)) - else - !------ Bottom partial layer. -------------------------------------------! - k = kapartial - this_lai = ladcohort * (zztop8(kapartial) - hbotcrown) - opencan8(k) = opencan8(k) + initp%crown_area(ico) - windext_full8(k) = windext_full8(k) + initp%crown_area(ico) & - * exp(- 5.0d-1 * this_lai / initp%crown_area(ico)) - windext_half8(k) = windext_half8(k) + initp%crown_area(ico) & - * exp(- 2.5d-1 * this_lai / initp%crown_area(ico)) - !------ Top partial layer. ----------------------------------------------! - k = kzpartial - this_lai = ladcohort * (htopcrown - zzbot8(kzpartial)) - opencan8(k) = opencan8(k) + initp%crown_area(ico) - windext_full8(k) = windext_full8(k) + initp%crown_area(ico) & - * exp(- 5.0d-1 * this_lai / initp%crown_area(ico)) - windext_half8(k) = windext_half8(k) + initp%crown_area(ico) & - * exp(- 2.5d-1 * this_lai / initp%crown_area(ico)) - end if - !---------------------------------------------------------------------------! - end do - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! At this point opencan is actually closed canopy fraction. In case it ! - ! exceeds one, we have to scale down the wind extinction coefficients before ! - ! we convert to open canopy fraction (kind of clumping effect, or squeezing ! - ! effect). ! - !------------------------------------------------------------------------------! - where (opencan8(:) > 1.d0) - windext_full8(:) = windext_full8(:) / opencan8(:) - windext_half8(:) = windext_half8(:) / opencan8(:) - opencan8(:) = 0.d0 - elsewhere - opencan8(:) = 1.d0 - opencan8(:) - end where - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Add the "open canopy effect" to the extinction. This can be though as ! - ! the contribution of the remaining area as having LAI=0. ! - !------------------------------------------------------------------------------! - windext_full8(:) = windext_full8(:) + opencan8(:) - windext_half8(:) = windext_half8(:) + opencan8(:) - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the wind profile with the given wxtinctions. ! - !------------------------------------------------------------------------------! - windlyr8(:) = 0.0 - do k=1,zcan - !----- Assume that wind is at the middle of the thin crown. ----------------! - windlyr8(k) = max(ugbmin8, uh * windext_half8(k)) - uh = uh * windext_full8(k) - end do - !------------------------------------------------------------------------------! - - - - !------------------------------------------------------------------------------! - ! Find the wind as the average amongst all layers where the crown is ! - ! defined. ! - !------------------------------------------------------------------------------! - do ico=1,cpatch%ncohorts - ipft = cpatch%pft(ico) - - - !---------------------------------------------------------------------------! - ! Find the heights, and compute the bounds. ! - !---------------------------------------------------------------------------! - htopcrown = dble(cpatch%hite(ico)) - hbotcrown = dble(h2crownbh(cpatch%hite(ico),ipft)) - kapartial = min(ncanlyr,floor ((hbotcrown * zztop0i8)**ehgti8) + 1) - kzpartial = min(ncanlyr,ceiling((htopcrown * zztop0i8)**ehgti8)) - !---------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------! - ! We simplify things here and just average between the partial layers. ! - !---------------------------------------------------------------------------! - initp%veg_wind(ico) = 0.d0 - do k=kapartial,kzpartial - initp%veg_wind(ico) = initp%veg_wind(ico) + windlyr8(k) * dzcan8(k) - end do - initp%veg_wind(ico) = initp%veg_wind(ico) & - / (zztop8(kzpartial) - zzbot8(kapartial)) - end do - !------------------------------------------------------------------------------! - end select + !---------------------------------------------------------------------------------! + ! In this version we still base ourselves on the Leuning et al. (1995) model, ! + ! assuming each cohort to be on top of each other (i.e. no ties). We also assume ! + ! extinction to be limited to the finite crown area, so the bottom can get a bit ! + ! windier. ! + !---------------------------------------------------------------------------------! + do ico=1,cpatch%ncohorts + !----- Find the extinction coefficients. --------------------------------------! + extinct_half = initp%crown_area(ico) & + * exp(- 2.5d-1 * initp%lai(ico) / initp%crown_area(ico)) & + + (1.d0 - initp%crown_area(ico)) + extinct_full = initp%crown_area(ico) & + * exp(- 5.d-1 * initp%lai(ico) / initp%crown_area(ico)) & + + (1.d0 - initp%crown_area(ico)) + !----- Assume that wind is at the middle of the thin crown. -------------------! + initp%veg_wind(ico) = max(ugbmin8, uh * extinct_half) + uh = uh * extinct_full + end do !---------------------------------------------------------------------------------! @@ -1935,9 +1659,9 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (initp%opencan_frac > 9.99d-1 .or. initp%snowfac >= 9.d-1) then - initp%ggnet = ggfact8 * initp%ggbare + initp%ggnet = initp%ggbare else - initp%ggnet = ggfact8 * initp%ggbare * initp%ggveg & + initp%ggnet = initp%ggbare * initp%ggveg & / ( initp%ggveg + (1.d0 - initp%opencan_frac) * initp%ggbare ) end if !---------------------------------------------------------------------------------! @@ -2097,9 +1821,9 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (initp%opencan_frac > 9.99d-1 .or. initp%snowfac >= 9.d-1) then - initp%ggnet = ggfact8 * initp%ggbare + initp%ggnet = initp%ggbare else - initp%ggnet = ggfact8 * initp%ggbare * initp%ggveg & + initp%ggnet = initp%ggbare * initp%ggveg & / (initp%ggveg + (1.d0 - initp%opencan_frac) * initp%ggbare ) end if !---------------------------------------------------------------------------------! @@ -2587,9 +2311,9 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! bare and vegetated grounds. ! !---------------------------------------------------------------------------------! if (initp%opencan_frac > 9.99d-1 .or. initp%snowfac >= 9.d-1) then - initp%ggnet = ggfact8 * initp%ggbare + initp%ggnet = initp%ggbare else - initp%ggnet = ggfact8 * initp%ggbare * initp%ggveg & + initp%ggnet = initp%ggbare * initp%ggveg & / (initp%ggveg + (1.d0 - initp%opencan_frac) * initp%ggbare ) end if !---------------------------------------------------------------------------------! @@ -2629,10 +2353,14 @@ end subroutine canopy_turbulence8 ! variable ISFCLYRM in ED2IN (if running the coupled model, this is done in ISTAR). ! ! ! ! 1. Based on L79; ! - ! 2. Based on OD95, but not assuming that z>>z0, so the zeta0 terms shall be computed ! - ! as presented in L79 and B71 to avoid singularities. ! + ! 2. Based on: OD95, but with some terms computed as in L79 and B71 to avoid singular- ! + ! ities (now using the iterative method to find zeta). ! ! 3. Based on BH91, using an iterative method to find zeta, and using the modified ! ! equation for stable layers. ! + ! 4. Based on CLM04, with special functions for very stable and very stable case, even ! + ! though we use a different functional form for very unstable case for momentum. ! + ! This is ensure that phi_m decreases monotonically as zeta becomes more negative. ! + ! We use a power law of order of -1/6 instead. ! ! ! ! References: ! ! B71. BUSINGER, J.A, et. al; Flux-Profile relationships in the atmospheric surface ! @@ -2643,6 +2371,9 @@ end subroutine canopy_turbulence8 ! for atmospheric models. J. Appl. Meteor., 30, 327-341, 1991. ! ! OD95. ONCLEY, S.P.; DUDHIA, J.; Evaluation of surface fluxes from MM5 using observa- ! ! tions. Mon. Wea. Rev., 123, 3344-3357, 1995. ! + ! CLM04. OLESON, K. W., et al.; Technical description of the community land model (CLM) ! + ! NCAR Technical Note NCAR/TN-461+STR, Boulder, CO, May 2004. ! + ! ! !---------------------------------------------------------------------------------------! subroutine ed_stars(theta_atm,theiv_atm,shv_atm,co2_atm,theta_can,theiv_can & ,shv_can,co2_can,zref,dheight,uref,rough,ustar,tstar,estar,qstar & @@ -2664,6 +2395,7 @@ subroutine ed_stars(theta_atm,theiv_atm,shv_atm,co2_atm,theta_can,theiv_can , psim & ! function , psih & ! function , zoobukhov ! ! function + use rk4_coms , only : rk4_tolerance ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! real, intent(in) :: theta_atm ! Above canopy air pot. temperature [ K] @@ -2703,23 +2435,39 @@ subroutine ed_stars(theta_atm,theiv_atm,shv_atm,co2_atm,theta_can,theiv_can real :: cm ! c coefficient times |Rib|^1/2 for momentum. real :: ch ! c coefficient times |Rib|^1/2 for heat. real :: ee ! (z/z0)^1/3 -1. for eqn. 20 w/o assuming z/z0 >> 1. - !----- Local variables, used by OD95. -----------------------------------------------! + !----- Local variables, used by others. ---------------------------------------------! real :: zeta0m ! roughness(momentum)/(Obukhov length). real :: zeta0h ! roughness(heat)/(Obukhov length). + real :: utotal ! Total wind (actual + convective) + real :: uconv ! Convective velocity + real :: uconv_prev ! Previous convective velocity + real :: change ! Difference in convective velocity + integer :: icnt ! Iteration counter !----- Aux. environment conditions. -------------------------------------------------! real :: thetav_atm ! Atmos. virtual potential temperature [ K] real :: thetav_can ! Canopy air virtual pot. temperature [ K] !----- External functions. ----------------------------------------------------------! - real, external :: cbrt ! Cubic root + real, external :: cbrt ! Cubic root !------------------------------------------------------------------------------------! - !----- Finding the variables common to both methods. --------------------------------! + + + !----- Find the variables common to both methods. -----------------------------------! thetav_atm = theta_atm * (1. + epim1 * shv_atm) thetav_can = theta_can * (1. + epim1 * shv_can) zoz0m = (zref-dheight)/rough lnzoz0m = log(zoz0m) zoz0h = z0moz0h * zoz0m lnzoz0h = log(zoz0h) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the Bulk Richardson number. For stable cases, and for L79 in both cases, ! + ! this will be the definitive RiB, whilst this is the first guess, which will be ! + ! corrected by the convective velocity in the other unstable cases. ! + !------------------------------------------------------------------------------------! rib = 2.0 * grav * (zref-dheight-rough) * (thetav_atm-thetav_can) & / ( (thetav_atm+thetav_can) * uref * uref) stable = thetav_atm >= thetav_can @@ -2729,11 +2477,10 @@ subroutine ed_stars(theta_atm,theiv_atm,shv_atm,co2_atm,theta_can,theiv_can !------------------------------------------------------------------------------------! - ! Correct the bulk Richardson number in case it's too stable and we are not run- ! - ! ning the L79 model. We also define a stable case correction to make u* consistent ! - ! with the Richardson number. ! + ! Correct the bulk Richardson number in case it's too stable. We also define a ! + ! stable case correction to make u* consistent with the Richardson number. ! !------------------------------------------------------------------------------------! - if (rib > ribmax .and. isfclyrm /= 1) then + if (rib > ribmax) then uuse = sqrt(rib / ribmax) * uref rib = ribmax else @@ -2786,60 +2533,113 @@ subroutine ed_stars(theta_atm,theiv_atm,shv_atm,co2_atm,theta_can,theiv_can zeta = grav * vonk * c3 * (thetav_atm - thetav_can) / (thetav_atm * ustar * ustar) - case (2,4) + case default !---------------------------------------------------------------------------------! ! 2. Here we use the model proposed by OD95, the standard for MM5, but with some ! - ! terms that were computed in B71 (namely, the "0" terms). which prevent sin- ! - ! gularities. We use OD95 to estimate zeta, which avoids the computation ! - ! of the Obukhov length L , we can't compute zeta0 by its definition(z0/L). ! + ! terms that were computed in B71 (namely, the "0" terms), which prevent sin- ! + ! gularities. ! ! However we know zeta, so zeta0 can be written as z0/z * zeta. ! - ! 4. We use the model proposed by BH91, but we find zeta using the approximation ! - ! given by OD95. ! - !---------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ------------------------! + ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! + ! method, except that the stable functions are computed in a more generic way. ! + ! BH91 claim that the oft-used approximation (-beta*zeta) can cause poor ! + ! ventilation of the stable layer, leading to decoupling between the atmo- ! + ! sphere and the canopy air space and excessive cooling ! + ! 4. Here we use a similar approach as in CLM04, excepth that the momentum flux ! + ! gradient function for the unstable case for momentum is switched by a power ! + ! of -1/6 (kind of the square of the heat one). This is to guarantee that ! + ! the psi function doesn't have local maxima/minima. ! + !---------------------------------------------------------------------------------! + !----- Initialise uconv. ---------------------------------------------------------! + uconv = 0.0 + !----- Check if we need to go through the iterative process. ---------------------! if (stable) then - !----- Stable case. -----------------------------------------------------------! - zeta = rib * lnzoz0m / (1.1 - 5.0 * rib) + !------------------------------------------------------------------------------! + ! Stable case, we don't need to find convective velocity, so we don't need ! + ! the iterative case. ! + !------------------------------------------------------------------------------! + !----- We now compute the stability correction functions. ---------------------! + zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) + zeta0m = rough * zeta / (zref-dheight) + zeta0h = z0hoz0m * zeta0m + + !----- Find the coefficient to scale the other stars. -------------------------! + zeta0m = rough * zeta / (zref-dheight) + zeta0h = z0hoz0m * zeta0m + + !----- Find ustar, making sure it is not too small. ---------------------------! + ustar = max (ustmin, vonk * uuse & + / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !------------------------------------------------------------------------------! + + + !----- Find the coefficient to scale the other stars. -------------------------! + c3 = vonk / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) + !------------------------------------------------------------------------------! + else - !----- Unstable case. ---------------------------------------------------------! - zeta = rib * lnzoz0m - end if - zeta0m = rough * zeta / (zref - dheight) + !------------------------------------------------------------------------------! + ! Unstable case. Here we run a few iterations to make sure we correct the ! + ! bulk Richardson number. This is really a simple correction, so we don't ! + ! need uconv to be totally in equilibrium. ! + !------------------------------------------------------------------------------! + unstable: do icnt=1,6 + !----- Update total winds. -------------------------------------------------! + uconv_prev = uconv + utotal = sqrt(uuse*uuse + uconv_prev * uconv_prev) + !---------------------------------------------------------------------------! - !----- Finding ustar, making sure it is not too small. ---------------------------! - ustar = max (ustmin, vonk * uuse & - / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) - !----- Finding the coefficient to scale the other stars. -------------------------! - c3 = vonk / (tprandtl * (lnzoz0m - psih(zeta,stable) + psih(zeta0m,stable))) + !----- Update the Bulk Richardson number. ----------------------------------! + rib = 2.0 * grav * (zref-dheight-rough) * (thetav_atm-thetav_can) & + / ( (thetav_atm+thetav_can) * utotal) + !---------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! + !----- We now compute the stability correction functions. ------------------! + zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) + !---------------------------------------------------------------------------! - case (3,5) - !---------------------------------------------------------------------------------! - ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! - ! method, with the two following (important) differences. ! - ! a. Zeta (z/L) is actually found using the iterative method. ! - ! b. Stable functions are computed in a more generic way. BH91 claim that the ! - ! oft-used approximation (-beta*zeta) can cause poor ventilation of the ! - ! stable layer, leading to decoupling between the atmosphere and the canopy ! - ! air space and excessive cooling. ! - ! 5. Similar as 3, but we compute the stable functions the same way as OD95. ! - !---------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ------------------------! - zeta = zoobukhov(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) - zeta0m = rough * zeta / (zref-dheight) - zeta0h = z0hoz0m * zeta0m - !----- Finding ustar, making sure it is not too small. ---------------------------! - ustar = max (ustmin, vonk * uuse & - / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !----- Find the coefficient to scale the other stars. ----------------------! + zeta0m = rough * zeta / (zref-dheight) + zeta0h = z0hoz0m * zeta0m + !---------------------------------------------------------------------------! - !----- Finding the coefficient to scale the other stars. -------------------------! - c3 = vonk / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) - !---------------------------------------------------------------------------------! + !----- Find ustar, making sure it is not too small. ------------------------! + ustar = max (ustmin, vonk * uuse & + / (lnzoz0m - psim(zeta,stable) + psim(zeta0m,stable))) + !---------------------------------------------------------------------------! + + + !----- Find the coefficient to scale the other stars. ----------------------! + c3 = vonk & + / (tprandtl * (lnzoz0h - psih(zeta,stable) + psih(zeta0h,stable))) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Use potential virtual temperature here because convection is related ! + ! to buoyancy. ! + !---------------------------------------------------------------------------! + tstar = c3 * (thetav_atm - thetav_can ) + !---------------------------------------------------------------------------! + + + !----- Estimate the convective velocity. -----------------------------------! + uconv = vertical_vel_flux(zeta,tstar,ustar) / ustar + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! We are only after a rough estimate of this velocity, so if the ! + ! difference is less than the RK4 tolerance, then it's enough. ! + !---------------------------------------------------------------------------! + change = 2.0 * abs(uconv-uconv_prev) / (abs(uconv) + abs(uconv_prev)) + if (change < rk4_tolerance) exit unstable + !---------------------------------------------------------------------------! + end do unstable + end if end select !----- Compute the other scales. ----------------------------------------------------! @@ -2883,9 +2683,13 @@ end subroutine ed_stars ! ! ! 1. Based on L79; ! ! 2. Based on: OD95, but with some terms computed as in L79 and B71 to avoid singular- ! - ! ities. ! + ! ities (now using the iterative method to find zeta). ! ! 3. Based on BH91, using an iterative method to find zeta, and using the modified ! ! equation for stable layers. ! + ! 4. Based on CLM04, with special functions for very stable and very stable case, even ! + ! though we use a different functional form for very unstable case for momentum. ! + ! This is ensure that phi_m decreases monotonically as zeta becomes more negative. ! + ! We use a power law of order of -1/6 instead. ! ! ! ! References: ! ! B71. BUSINGER, J.A, et. al; Flux-Profile relationships in the atmospheric surface ! @@ -2896,6 +2700,9 @@ end subroutine ed_stars ! for atmospheric models. J. Appl. Meteor., 30, 327-341, 1991. ! ! OD95. ONCLEY, S.P.; DUDHIA, J.; Evaluation of surface fluxes from MM5 using observa- ! ! tions. Mon. Wea. Rev., 123, 3344-3357, 1995. ! + ! CLM04. OLESON, K. W., et al.; Technical description of the community land model (CLM) ! + ! NCAR Technical Note NCAR/TN-461+STR, Boulder, CO, May 2004. ! + ! ! !---------------------------------------------------------------------------------------! subroutine ed_stars8(theta_atm,theiv_atm,shv_atm,co2_atm & ,theta_can,theiv_can,shv_can,co2_can & @@ -2918,6 +2725,7 @@ subroutine ed_stars8(theta_atm,theiv_atm,shv_atm,co2_atm , psim8 & ! function , psih8 & ! function , zoobukhov8 ! ! function + use rk4_coms , only : rk4eps ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! real(kind=8), intent(in) :: theta_atm ! Above canopy air pot. temp. [ K] @@ -2957,23 +2765,38 @@ subroutine ed_stars8(theta_atm,theiv_atm,shv_atm,co2_atm real(kind=8) :: cm ! c coeff. times |Rib|^1/2 for momentum. real(kind=8) :: ch ! c coefficient times |Rib|^1/2 for heat. real(kind=8) :: ee ! (z/z0)^1/3 -1. for eqn. 20 - !----- Local variables, used by OD95. -----------------------------------------------! + !----- Local variables, used by others. ---------------------------------------------! real(kind=8) :: zeta0m ! roughness(momentum)/(Obukhov length). real(kind=8) :: zeta0h ! roughness(heat)/(Obukhov length). + real(kind=8) :: utotal ! Total wind (actual + convective) + real(kind=8) :: uconv ! Convective velocity + real(kind=8) :: uconv_prev ! Previous convective velocity + real(kind=8) :: change ! Difference in convective velocity + integer :: icnt ! Iteration counter !----- Aux. environment conditions. -------------------------------------------------! real(kind=8) :: thetav_atm ! Atmos. virtual pot. temp. [ K] real(kind=8) :: thetav_can ! Canopy air virtual pot. temp. [ K] !----- External functions. ----------------------------------------------------------! - real(kind=8), external :: cbrt8 ! Cubic root + real(kind=8), external :: cbrt8 ! Cubic root !------------------------------------------------------------------------------------! - !----- Finding the variables common to both methods. --------------------------------! + + !----- Find the variables common to both methods. -----------------------------------! thetav_atm = theta_atm * (1.d0 + epim18 * shv_atm) thetav_can = theta_can * (1.d0 + epim18 * shv_can) zoz0m = (zref-dheight)/rough lnzoz0m = log(zoz0m) zoz0h = z0moz0h8 * zoz0m lnzoz0h = log(zoz0h) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the Bulk Richardson number. For stable cases, and for L79 in both cases, ! + ! this will be the definitive RiB, whilst this is the first guess, which will be ! + ! corrected by the convective velocity in the other unstable cases. ! + !------------------------------------------------------------------------------------! rib = 2.d0 * grav8 * (zref-dheight-rough) * (thetav_atm-thetav_can) & / ( (thetav_atm+thetav_can) * uref * uref) stable = thetav_atm >= thetav_can @@ -2983,12 +2806,11 @@ subroutine ed_stars8(theta_atm,theiv_atm,shv_atm,co2_atm !------------------------------------------------------------------------------------! - ! Correct the bulk Richardson number in case it's too stable and we are not run- ! - ! ning the L79 model. We also define a stable case correction to bring down the ! - ! stars other than ustar, so the flux doesn't increase for stabler cases (it remains ! - ! constant). ! + ! Correct the bulk Richardson number in case it's too stable. We also define a ! + ! stable case correction to bring down the stars other than ustar, so the flux ! + ! doesn't increase for stabler cases (it remains constant). ! !------------------------------------------------------------------------------------! - if (rib > ribmax8 .and. isfclyrm /= 1) then + if (rib > ribmax8) then uuse = sqrt(rib / ribmax8) * uref rib = ribmax8 else @@ -3041,65 +2863,116 @@ subroutine ed_stars8(theta_atm,theiv_atm,shv_atm,co2_atm / (thetav_atm * ustar * ustar) - case (2,4) + case default !---------------------------------------------------------------------------------! ! 2. Here we use the model proposed by OD95, the standard for MM5, but with some ! - ! terms that were computed in B71 (namely, the "0" terms). which prevent sin- ! - ! gularities. We use OD95 to estimate zeta, which avoids the computation ! - ! of the Obukhov length L , we can't compute zeta0 by its definition(z0/L). ! + ! terms that were computed in B71 (namely, the "0" terms), which prevent sin- ! + ! gularities. ! ! However we know zeta, so zeta0 can be written as z0/z * zeta. ! - ! 4. We use the model proposed by BH91, but we find zeta using the approximation ! - ! given by OD95. ! - !---------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ------------------------! + ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! + ! method, except that the stable functions are computed in a more generic way. ! + ! BH91 claim that the oft-used approximation (-beta*zeta) can cause poor ! + ! ventilation of the stable layer, leading to decoupling between the atmo- ! + ! sphere and the canopy air space and excessive cooling ! + ! 4. Here we use a similar approach as in CLM04, excepth that the momentum flux ! + ! gradient function for the unstable case for momentum is switched by a power ! + ! of -1/6 (kind of the square of the heat one). This is to guarantee that ! + ! the psi function doesn't have local maxima/minima. ! + !---------------------------------------------------------------------------------! + !----- Initialise uconv. ---------------------------------------------------------! + uconv = 0.0 + !----- Check if we need to go through the iterative process. ---------------------! if (stable) then - !----- Stable case. -----------------------------------------------------------! - zeta = rib * lnzoz0m / (1.1d0 - 5.0d0 * rib) + !------------------------------------------------------------------------------! + ! Stable case, we don't need to find convective velocity, so we don't need ! + ! the iterative case. ! + !------------------------------------------------------------------------------! + !----- We now compute the stability correction functions. ---------------------! + zeta = zoobukhov8(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) + zeta0m = rough * zeta / (zref - dheight) + zeta0h = z0hoz0m8 * zeta0m + + !----- Finding ustar, making sure it is not too small. ------------------------! + ustar = max (ustmin8, vonk8 * uuse & + / (lnzoz0m - psim8(zeta,stable) + psim8(zeta0m,stable))) + + !----- Finding the coefficient to scale the other stars. ----------------------! + c3 = vonk8 & + / (tprandtl8 * (lnzoz0h - psih8(zeta,stable) + psih8(zeta0h,stable))) + !------------------------------------------------------------------------------! else - !----- Unstable case. ---------------------------------------------------------! - zeta = rib * lnzoz0m - end if + !------------------------------------------------------------------------------! + ! Unstable case. Here we run a few iterations to make sure we correct the ! + ! bulk Richardson number. This is really a simple correction, so we don't ! + ! need uconv to be totally in equilibrium. ! + !------------------------------------------------------------------------------! + unstable: do icnt=1,6 + !----- Update total winds. -------------------------------------------------! + uconv_prev = uconv + utotal = sqrt(uuse*uuse + uconv_prev * uconv_prev) + !---------------------------------------------------------------------------! - zeta0m = rough * zeta / (zref - dheight) - !----- Finding ustar, making sure it is not too small. ---------------------------! - ustar = max (ustmin8, vonk8 * uuse & - / (lnzoz0m - psim8(zeta,stable) + psim8(zeta0m,stable))) - !----- Finding the coefficient to scale the other stars. -------------------------! - c3 = vonk8 / (tprandtl8 * (lnzoz0m - psih8(zeta,stable) + psih8(zeta0m,stable))) + !----- Update the Bulk Richardson number. ----------------------------------! + rib = 2.d0 * grav8 * (zref-dheight-rough) * (thetav_atm-thetav_can) & + / ( (thetav_atm+thetav_can) * utotal * utotal) + !---------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! + !----- We now compute the stability correction functions. ------------------! + zeta = zoobukhov8(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h & + ,stable) + !---------------------------------------------------------------------------! - case (3,5) - !---------------------------------------------------------------------------------! - ! 3. Here we use the model proposed by BH91, which is almost the same as the OD95 ! - ! method, with the two following (important) differences. ! - ! a. Zeta (z/L) is actually found using the iterative method. ! - ! b. Stable functions are computed in a more generic way. BH91 claim that the ! - ! oft-used approximation (-beta*zeta) can cause poor ventilation of the ! - ! stable layer, leading to decoupling between the atmosphere and the canopy ! - ! air space and excessive cooling. ! - ! 5. Similar as 3, but we compute the stable functions the same way as OD95. ! - !---------------------------------------------------------------------------------! - !----- We now compute the stability correction functions. ------------------------! - zeta = zoobukhov8(rib,zref-dheight,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) - zeta0m = rough * zeta / (zref - dheight) - zeta0h = z0hoz0m8 * zeta0m - !----- Finding ustar, making sure it is not too small. ---------------------------! - ustar = max (ustmin8, vonk8 * uuse & - / (lnzoz0m - psim8(zeta,stable) + psim8(zeta0m,stable))) + !----- Find the coefficient to scale the other stars. ----------------------! + zeta0m = rough * zeta / (zref - dheight) + zeta0h = z0hoz0m8 * zeta0m + !---------------------------------------------------------------------------! - !----- Finding the coefficient to scale the other stars. -------------------------! - c3 = vonk8 & - / (tprandtl8 * (lnzoz0h - psih8(zeta,stable) + psih8(zeta0h,stable))) + !----- Find ustar, making sure it is not too small. ------------------------! + ustar = max (ustmin8, vonk8 * uuse & + / (lnzoz0m - psim8(zeta,stable) + psim8(zeta0m,stable))) + !---------------------------------------------------------------------------! + + + !----- Find the coefficient to scale the other stars. ----------------------! + c3 = vonk8 & + / (tprandtl8 * (lnzoz0h - psih8(zeta,stable) + psih8(zeta0h,stable))) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Use potential virtual temperature here because convection is related ! + ! to buoyancy. ! + !---------------------------------------------------------------------------! + tstar = c3 * (thetav_atm - thetav_can ) + !---------------------------------------------------------------------------! + + + !----- Estimate the convective velocity. -----------------------------------! + uconv = vertical_vel_flux8(zeta,tstar,ustar) / ustar + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! We are only after a rough estimate of this velocity, so if the ! + ! difference is less than the RK4 tolerance, then it's enough. ! + !---------------------------------------------------------------------------! + change = 2.d0 * abs(uconv-uconv_prev) / (abs(uconv) + abs(uconv_prev)) + if (change < rk4eps) exit unstable + !---------------------------------------------------------------------------! + end do unstable + end if !---------------------------------------------------------------------------------! end select + !------------------------------------------------------------------------------------! - !----- Computing the other scales. --------------------------------------------------! + + + !----- Compute the other scales. ----------------------------------------------------! qstar = c3 * (shv_atm - shv_can ) tstar = c3 * (theta_atm - theta_can ) estar = c3 * log(theiv_atm / theiv_can ) @@ -3348,6 +3221,11 @@ end function reduced_wind8 !=======================================================================================! !=======================================================================================! + ! Vertical flux, as in: ! + ! ! + ! Manton, M. J., Cotton, W. R., 1977: Parameterization of the atmospheric surface ! + ! layer. J. Atm. Sci., 34, 331-334. ! + !---------------------------------------------------------------------------------------! real function vertical_vel_flux(zeta,tstar,ustar) use consts_coms , only : vonk ! intent(in) @@ -3385,6 +3263,11 @@ end function vertical_vel_flux !=======================================================================================! !=======================================================================================! + ! Vertical flux, as in: ! + ! ! + ! Manton, M. J., Cotton, W. R., 1977: Parameterization of the atmospheric surface ! + ! layer. J. Atm. Sci., 34, 331-334. ! + !---------------------------------------------------------------------------------------! real(kind=8) function vertical_vel_flux8(zeta,tstar,ustar) use consts_coms , only : vonk8 ! intent(in) @@ -3521,13 +3404,7 @@ subroutine leaf_aerodynamic_conductances(ipft,veg_wind,leaf_temp,can_temp,can_sh , bflat_lami & ! intent(in) , mflat_lami & ! intent(in) , bflat_turb & ! intent(in) - , mflat_turb & ! intent(in) - , beta_r1 & ! intent(in) - , beta_r2 & ! intent(in) - , beta_re0 & ! intent(in) - , beta_g1 & ! intent(in) - , beta_g2 & ! intent(in) - , beta_gr0 ! ! intent(in) + , mflat_turb ! ! intent(in) use consts_coms , only : gr_coeff & ! intent(in) , th_diffi & ! intent(in) , th_diff & ! intent(in) @@ -3551,8 +3428,6 @@ subroutine leaf_aerodynamic_conductances(ipft,veg_wind,leaf_temp,can_temp,can_sh real(kind=4) :: nusselt_lami ! Nusselt number (laminar)[ ---] real(kind=4) :: nusselt_turb ! Nusselt number (turb.) [ ---] real(kind=4) :: nusselt ! Nusselt number [ ---] - real(kind=4) :: beta_forced ! Correct. term (forced) [ ---] - real(kind=4) :: beta_free ! Correct. term (free) [ ---] real(kind=4) :: forced_gbh_mos ! Forced convection cond. [ m/s] real(kind=4) :: free_gbh_mos ! Free convection cond. [ m/s] real(kind=4) :: gbh_mos ! Total convection cond. [ m/s] @@ -3572,11 +3447,9 @@ subroutine leaf_aerodynamic_conductances(ipft,veg_wind,leaf_temp,can_temp,can_sh !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = aflat_lami * reynolds ** nflat_lami nusselt_turb = aflat_turb * reynolds ** nflat_turb - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - beta_forced = beta_r1 + beta_r2 * tanh(log(reynolds/beta_re0)) - !----- 4. The right Nusselt number is the largest. ----------------------------------! - nusselt = beta_forced * max(nusselt_lami,nusselt_turb) - !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! + !----- 3. The right Nusselt number is the largest. ----------------------------------! + nusselt = max(nusselt_lami,nusselt_turb) + !----- 4. The conductance is given by MU08 - equation 10.4 --------------------------! forced_gbh_mos = th_diff * nusselt / lwidth !------------------------------------------------------------------------------------! @@ -3590,15 +3463,9 @@ subroutine leaf_aerodynamic_conductances(ipft,veg_wind,leaf_temp,can_temp,can_sh !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = bflat_lami * grashof ** mflat_lami nusselt_turb = bflat_turb * grashof ** mflat_turb - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - if (grashof == 0.0) then - beta_free = beta_g1 - beta_g2 - else - beta_free = beta_g1 + beta_g2 * tanh(log(grashof/beta_gr0)) - end if - !----- 4. The right Nusselt number is the largest. ----------------------------------! - nusselt = beta_free * max(nusselt_lami,nusselt_turb) - !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! + !----- 3. The right Nusselt number is the largest. ----------------------------------! + nusselt = max(nusselt_lami,nusselt_turb) + !----- 4. The conductance is given by MU08 - equation 10.4 --------------------------! free_gbh_mos = th_diff * nusselt / lwidth !------------------------------------------------------------------------------------! @@ -3653,15 +3520,7 @@ subroutine leaf_aerodynamic_conductances8(ipft,veg_wind,leaf_temp,can_temp,can_s , bflat_lami8 & ! intent(in) , mflat_lami8 & ! intent(in) , bflat_turb8 & ! intent(in) - , mflat_turb8 & ! intent(in) - , beta_lami8 & ! intent(in) - , beta_turb8 & ! intent(in) - , beta_r18 & ! intent(in) - , beta_r28 & ! intent(in) - , beta_re08 & ! intent(in) - , beta_g18 & ! intent(in) - , beta_g28 & ! intent(in) - , beta_gr08 ! ! intent(in) + , mflat_turb8 ! ! intent(in) use consts_coms , only : gr_coeff8 & ! intent(in) , th_diffi8 & ! intent(in) , th_diff8 & ! intent(in) @@ -3686,8 +3545,6 @@ subroutine leaf_aerodynamic_conductances8(ipft,veg_wind,leaf_temp,can_temp,can_s real(kind=8) :: lwidth ! Leaf width [ m] real(kind=8) :: nusselt_lami ! Nusselt number (laminar)[ ---] real(kind=8) :: nusselt_turb ! Nusselt number (turb.) [ ---] - real(kind=8) :: beta_forced ! Correct. term (forced) [ ---] - real(kind=8) :: beta_free ! Correct. term (free) [ ---] real(kind=8) :: forced_gbh_mos ! Forced convection cond. [ m/s] real(kind=8) :: free_gbh_mos ! Free convection cond. [ m/s] real(kind=8) :: gbh_mos ! Total convection cond. [ m/s] @@ -3707,11 +3564,9 @@ subroutine leaf_aerodynamic_conductances8(ipft,veg_wind,leaf_temp,can_temp,can_s !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = aflat_lami8 * reynolds ** nflat_lami8 nusselt_turb = aflat_turb8 * reynolds ** nflat_turb8 - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - beta_forced = beta_r18 + beta_r28 * tanh(log(reynolds/beta_re08)) - !----- 4. The right Nusselt number is the largest of the both. ----------------------! - nusselt_forced = beta_forced * max(nusselt_lami,nusselt_turb) - !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! + !----- 3. The right Nusselt number is the largest of the both. ----------------------! + nusselt_forced = max(nusselt_lami,nusselt_turb) + !----- 4. The conductance is given by MU08 - equation 10.4 --------------------------! forced_gbh_mos = th_diff8 * nusselt_forced / lwidth !------------------------------------------------------------------------------------! @@ -3725,15 +3580,9 @@ subroutine leaf_aerodynamic_conductances8(ipft,veg_wind,leaf_temp,can_temp,can_s !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = bflat_lami8 * grashof ** mflat_lami8 nusselt_turb = bflat_turb8 * grashof ** mflat_turb8 - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - if (grashof == 0.d0) then - beta_free = beta_g18 - beta_g28 - else - beta_free = beta_g18 + beta_g28 * tanh(log(grashof/beta_gr08)) - end if - !----- 4. The right Nusselt number is the largest of the both. ----------------------! - nusselt_free = beta_free * max(nusselt_lami,nusselt_turb) - !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! + !----- 3. The right Nusselt number is the largest of the both. ----------------------! + nusselt_free = max(nusselt_lami,nusselt_turb) + !----- 4. The conductance is given by MU08 - equation 10.4 --------------------------! free_gbh_mos = th_diff8 * nusselt_free / lwidth !------------------------------------------------------------------------------------! @@ -3788,13 +3637,7 @@ subroutine wood_aerodynamic_conductances(ipft,dbh,height,veg_wind,wood_temp,can_ , bcyli_lami & ! intent(in) , mcyli_lami & ! intent(in) , bcyli_turb & ! intent(in) - , mcyli_turb & ! intent(in) - , beta_r1 & ! intent(in) - , beta_r2 & ! intent(in) - , beta_re0 & ! intent(in) - , beta_g1 & ! intent(in) - , beta_g2 & ! intent(in) - , beta_gr0 ! ! intent(in) + , mcyli_turb ! ! intent(in) use consts_coms , only : gr_coeff & ! intent(in) , th_diffi & ! intent(in) , th_diff & ! intent(in) @@ -3820,8 +3663,6 @@ subroutine wood_aerodynamic_conductances(ipft,dbh,height,veg_wind,wood_temp,can_ real(kind=4) :: nusselt_lami ! Nusselt number (laminar)[ ---] real(kind=4) :: nusselt_turb ! Nusselt number (turb.) [ ---] real(kind=4) :: nusselt ! Nusselt number [ ---] - real(kind=4) :: beta_forced ! Correct. term (forced) [ ---] - real(kind=4) :: beta_free ! Correct. term (free) [ ---] real(kind=4) :: forced_gbh_mos ! Forced convection cond. [ m/s] real(kind=4) :: free_gbh_mos ! Free convection cond. [ m/s] real(kind=4) :: gbh_mos ! Total convection cond. [ m/s] @@ -3848,10 +3689,8 @@ subroutine wood_aerodynamic_conductances(ipft,dbh,height,veg_wind,wood_temp,can_ !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = ocyli_lami + acyli_lami * reynolds ** ncyli_lami nusselt_turb = ocyli_turb + acyli_turb * reynolds ** ncyli_turb - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - beta_forced = beta_r1 + beta_r2 * tanh(log(reynolds/beta_re0)) - !----- 4. The right Nusselt number is the largest. ----------------------------------! - nusselt = beta_forced * max(nusselt_lami,nusselt_turb) + !----- 3. The right Nusselt number is the largest. ----------------------------------! + nusselt = max(nusselt_lami,nusselt_turb) !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! forced_gbh_mos = th_diff * nusselt / w_diam !------------------------------------------------------------------------------------! @@ -3866,14 +3705,8 @@ subroutine wood_aerodynamic_conductances(ipft,dbh,height,veg_wind,wood_temp,can_ !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = bcyli_lami * grashof ** mcyli_lami nusselt_turb = bcyli_turb * grashof ** mcyli_turb - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - if (grashof == 0.0) then - beta_free = beta_g1 - beta_g2 - else - beta_free = beta_g1 + beta_g2 * tanh(log(grashof/beta_gr0)) - end if - !----- 4. The right Nusselt number is the largest. ----------------------------------! - nusselt = beta_free * max(nusselt_lami,nusselt_turb) + !----- 3. The right Nusselt number is the largest. ----------------------------------! + nusselt = max(nusselt_lami,nusselt_turb) !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! free_gbh_mos = th_diff * nusselt / w_diam !------------------------------------------------------------------------------------! @@ -3931,15 +3764,7 @@ subroutine wood_aerodynamic_conductances8(ipft,dbh,height,veg_wind,wood_temp,can , bcyli_lami8 & ! intent(in) , mcyli_lami8 & ! intent(in) , bcyli_turb8 & ! intent(in) - , mcyli_turb8 & ! intent(in) - , beta_lami8 & ! intent(in) - , beta_turb8 & ! intent(in) - , beta_r18 & ! intent(in) - , beta_r28 & ! intent(in) - , beta_re08 & ! intent(in) - , beta_g18 & ! intent(in) - , beta_g28 & ! intent(in) - , beta_gr08 ! ! intent(in) + , mcyli_turb8 ! ! intent(in) use consts_coms , only : gr_coeff8 & ! intent(in) , th_diffi8 & ! intent(in) , th_diff8 & ! intent(in) @@ -3966,8 +3791,6 @@ subroutine wood_aerodynamic_conductances8(ipft,dbh,height,veg_wind,wood_temp,can real(kind=8) :: w_diam ! Wood "diameter" [ m] real(kind=8) :: nusselt_lami ! Nusselt number (laminar)[ ---] real(kind=8) :: nusselt_turb ! Nusselt number (turb.) [ ---] - real(kind=8) :: beta_forced ! Correct. term (forced) [ ---] - real(kind=8) :: beta_free ! Correct. term (free) [ ---] real(kind=8) :: forced_gbh_mos ! Forced convection cond. [ m/s] real(kind=8) :: free_gbh_mos ! Free convection cond. [ m/s] real(kind=8) :: gbh_mos ! Total convection cond. [ m/s] @@ -3994,10 +3817,8 @@ subroutine wood_aerodynamic_conductances8(ipft,dbh,height,veg_wind,wood_temp,can !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = ocyli_lami8 + acyli_lami8 * reynolds ** ncyli_lami8 nusselt_turb = ocyli_turb8 + acyli_turb8 * reynolds ** ncyli_turb8 - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - beta_forced = beta_r18 + beta_r28 * tanh(log(reynolds/beta_re08)) - !----- 4. The right Nusselt number is the largest of the both. ----------------------! - nusselt_forced = beta_forced * max(nusselt_lami,nusselt_turb) + !----- 3. The right Nusselt number is the largest of the both. ----------------------! + nusselt_forced = max(nusselt_lami,nusselt_turb) !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! forced_gbh_mos = th_diff8 * nusselt_forced / w_diam !------------------------------------------------------------------------------------! @@ -4012,14 +3833,8 @@ subroutine wood_aerodynamic_conductances8(ipft,dbh,height,veg_wind,wood_temp,can !----- 2. Compute the Nusselt number for both the laminar and turbulent case. -------! nusselt_lami = bcyli_lami8 * grashof ** mcyli_lami8 nusselt_turb = bcyli_turb8 * grashof ** mcyli_turb8 - !----- 3. Compute the correction term for the theoretical Nusselt numbers. ----------! - if (grashof == 0.d0) then - beta_free = beta_g18 - beta_g28 - else - beta_free = beta_g18 + beta_g28 * tanh(log(grashof/beta_gr08)) - end if - !----- 4. The right Nusselt number is the largest of the both. ----------------------! - nusselt_free = beta_free * max(nusselt_lami,nusselt_turb) + !----- 3. The right Nusselt number is the largest of the both. ----------------------! + nusselt_free = max(nusselt_lami,nusselt_turb) !----- 5. The conductance is given by MU08 - equation 10.4 --------------------------! free_gbh_mos = th_diff8 * nusselt_free / w_diam !------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/disturbance.f90 b/ED/src/dynamics/disturbance.f90 index c9ab39685..113fab9e7 100644 --- a/ED/src/dynamics/disturbance.f90 +++ b/ED/src/dynamics/disturbance.f90 @@ -292,7 +292,6 @@ subroutine apply_disturbances(cgrid) call insert_survivors(csite,new_lu+onsp,ipa,new_lu,area_fac & ,poly_dest_type,mindbh_harvest) call accum_dist_litt(csite,new_lu+onsp,ipa,new_lu,area_fac & - ,cpoly%loss_fraction(new_lu,isi) & ,poly_dest_type,mindbh_harvest) !----- Update patch area. -----------------------------------------! @@ -436,7 +435,6 @@ subroutine site_disturbance_rates(month, year, cgrid) , include_fire & ! intent(in) , plantation_rotation & ! intent(in) , mature_harvest_age ! ! intent(in) - use pft_coms , only : agf_bs ! ! intent(in) use ed_max_dims , only : n_pft ! ! intent(in) implicit none @@ -630,15 +628,6 @@ subroutine site_disturbance_rates(month, year, cgrid) cpoly%disturbance_rates(3,3,isi)= cpoly%nat_disturbance_rate(isi) !------------------------------------------------------------------------------! - !------------------------------------------------------------------------------! - ! Fraction of above ground litter from disturbance that is removed from ! - ! patch. ! - !------------------------------------------------------------------------------! - cpoly%loss_fraction(1,isi) = agf_bs - cpoly%loss_fraction(2,isi) = agf_bs - cpoly%loss_fraction(3,isi) = 0.0 - !------------------------------------------------------------------------------! - end do siteloop end do polyloop @@ -1043,8 +1032,7 @@ end subroutine insert_survivors !=======================================================================================! ! This subroutine updates the litter pools after a disturbance takes place. ! !---------------------------------------------------------------------------------------! - subroutine accum_dist_litt(csite,np,cp,q,area_fac,loss_fraction,poly_dest_type & - ,mindbh_harvest) + subroutine accum_dist_litt(csite,np,cp,q,area_fac,poly_dest_type,mindbh_harvest) use ed_state_vars, only : sitetype & ! structure , patchtype & ! structure , polygontype ! ! structure @@ -1055,6 +1043,7 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,loss_fraction,poly_dest_type , c2n_recruit & ! intent(in) , c2n_stem & ! intent(in) , l2n_stem ! ! intent(in) + use pft_coms , only : agf_bs ! ! intent(in) use grid_coms , only : nzg ! ! intent(in) implicit none @@ -1063,7 +1052,6 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,loss_fraction,poly_dest_type integer , intent(in) :: np integer , intent(in) :: cp real , dimension(n_pft), intent(in) :: mindbh_harvest - real , intent(in) :: loss_fraction integer , intent(in) :: q real , intent(in) :: area_fac integer , intent(in) :: poly_dest_type @@ -1072,6 +1060,7 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,loss_fraction,poly_dest_type type(patchtype) , pointer :: npatch integer :: ico integer :: ipft + real :: loss_fraction real :: fast_litter real :: struct_litter real :: struct_lignin @@ -1095,6 +1084,20 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,loss_fraction,poly_dest_type do ico = 1,cpatch%ncohorts ipft = cpatch%pft(ico) + !---------------------------------------------------------------------------------! + ! Find the loss fraction, which normally corresponds to the above-ground bio- ! + ! mass in case the patch was harvest/logged, or nothing in case it was a natural ! + ! disturbance. ! + !---------------------------------------------------------------------------------! + select case(q) + case (1,2) + loss_fraction = agf_bs(ipft) + case (3) + loss_fraction = 0. + end select + !---------------------------------------------------------------------------------! + + fast_litter = fast_litter & + (1. - survivorship(q,poly_dest_type,mindbh_harvest,csite,cp,ico)) & * ( f_labile(ipft) * cpatch%balive(ico) + cpatch%bstorage(ico)) & @@ -1223,9 +1226,7 @@ subroutine plant_patch(csite,np,mzg,pft,density,ntext_soil,green_leaf_factor use pft_coms , only : q & ! intent(in) , qsw & ! intent(in) , sla & ! intent(in) - , hgt_min & ! intent(in) - , max_dbh & ! intent(in) - , is_grass ! ! intent(in) + , hgt_min ! ! intent(in) use ed_misc_coms , only : dtlsm ! ! intent(in) use fuse_fiss_utils, only : sort_cohorts ! ! sub-routine use ed_therm_lib , only : calc_veg_hcap ! ! function diff --git a/ED/src/dynamics/euler_driver.f90 b/ED/src/dynamics/euler_driver.f90 index 4b359865e..11e9e3e58 100644 --- a/ED/src/dynamics/euler_driver.f90 +++ b/ED/src/dynamics/euler_driver.f90 @@ -122,8 +122,9 @@ subroutine euler_timestep(cgrid) call copy_met_2_rk4site(nzg,cmet%vels,cmet%atm_theiv,cmet%atm_theta & ,cmet%atm_tmp,cmet%atm_shv,cmet%atm_co2,cmet%geoht & ,cmet%exner,cmet%pcpg,cmet%qpcpg,cmet%dpcpg,cmet%prss & - ,cmet%rshort,cmet%rlong,cmet%geoht,cpoly%lsl(isi) & - ,cpoly%ntext_soil(:,isi) & + ,cmet%rshort,cmet%rlong,cmet%par_beam,cmet%par_diffuse & + ,cmet%nir_beam,cmet%nir_diffuse,cmet%geoht & + ,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & ,cpoly%green_leaf_factor(:,isi) & ,cgrid%lon(ipy),cgrid%lat(ipy),cgrid%cosz(ipy)) diff --git a/ED/src/dynamics/events.f90 b/ED/src/dynamics/events.f90 index 5da3b6e3e..67c841402 100644 --- a/ED/src/dynamics/events.f90 +++ b/ED/src/dynamics/events.f90 @@ -349,9 +349,9 @@ subroutine event_harvest(agb_frac8,bgb_frac8,fol_frac8,stor_frac8) !! calc new pool sizes ialloc = 1.0 / (1.0 + q(pft) + qsw(pft) * cpatch%hite(ico)) bdead_new = cpatch%bdead(ico)*& - & (1.0-agb_frac*agf_bs - bgb_frac*(1.0-agf_bs)) + & (1.0-agb_frac*agf_bs(pft) - bgb_frac*(1.0-agf_bs(pft))) bsw_new = cpatch%balive(ico) * qsw(pft) * cpatch%hite(ico) *& - & ialloc * (1.0-agb_frac*agf_bs - bgb_frac*(1.0-agf_bs)) + & ialloc * (1.0-agb_frac*agf_bs(pft) - bgb_frac*(1.0-agf_bs(pft))) bstore_new = cpatch%bstorage(ico)*(1.0-stor_frac) bleaf_new = cpatch%balive(ico) * ialloc *(1.0-fol_frac) bfr_new = cpatch%balive(ico) * q(pft) * ialloc * (1.0-bgb_frac) diff --git a/ED/src/dynamics/farq_leuning.f90 b/ED/src/dynamics/farq_leuning.f90 index d842686ce..af2a2480c 100644 --- a/ED/src/dynamics/farq_leuning.f90 +++ b/ED/src/dynamics/farq_leuning.f90 @@ -110,12 +110,11 @@ subroutine lphysiol_full(can_prss,can_rhos,can_shv,can_co2,ipft,leaf_par,leaf_te , dark_respiration_factor & ! intent(in) , stomatal_slope & ! intent(in) , quantum_efficiency ! ! intent(in) - use phenology_coms , only : vm_tran & ! intent(in) - , vm_slop & ! intent(in) - , vm_amp & ! intent(in) - , vm_min ! ! intent(in) - use physiology_coms, only : istoma_scheme & ! intent(in) - , c34smin_lint_co28 & ! intent(in) + use phenology_coms , only : vm0_tran & ! intent(in) + , vm0_slope & ! intent(in) + , vm0_amp & ! intent(in) + , vm0_min ! ! intent(in) + use physiology_coms, only : c34smin_lint_co28 & ! intent(in) , c34smax_lint_co28 & ! intent(in) , gbh_2_gbw8 & ! intent(in) , gbw_2_gbc8 & ! intent(in) @@ -240,7 +239,7 @@ subroutine lphysiol_full(can_prss,can_rhos,can_shv,can_co2,ipft,leaf_par,leaf_te select case(phenology(ipft)) case (3) !------ Light-controlled phenology. ----------------------------------------------! - thispft%vm0 = dble(vm_amp / (1.0 + (llspan/vm_tran)**vm_slop) + vm_min) & + thispft%vm0 = dble(vm0_amp / (1.0 + (llspan/vm0_tran)**vm0_slope) + vm0_min) & * umol_2_mol8 thispft%rd0 = dble(vm_bar) * umol_2_mol8 * dble(dark_respiration_factor(ipft)) case default @@ -269,22 +268,9 @@ subroutine lphysiol_full(can_prss,can_rhos,can_shv,can_co2,ipft,leaf_par,leaf_te !------------------------------------------------------------------------------------! - ! At this point we call the main solver. If we choose the exact solver, we will ! - ! always solve all fluxes interactively, otherwise we will use a first order ! - ! approximation for some of the steps, and update the exact solution less often. ! + ! Call the main solver. ! !------------------------------------------------------------------------------------! - select case (istoma_scheme) - case (0) - call photosynthesis_exact_solver(ipft,limit_flag) - - case (1) - write (unit=*,fmt='(a)') '------------------------------------------------------' - write (unit=*,fmt='(a)') ' Sorry, the small perturbation scheme for ' - write (unit=*,fmt='(a)') ' photosynthesis is temporarily down. ' - write (unit=*,fmt='(a)') '------------------------------------------------------' - call fatal_error('ISTOMA_SCHEME = 1 is temporarily unavailable','lphysiol_full' & - ,'farq_leuning.f90') - end select + call photosynthesis_exact_solver(ipft,limit_flag) !------------------------------------------------------------------------------------! @@ -575,7 +561,7 @@ subroutine comp_photo_tempfun(ipft,leaf_aging_factor,green_leaf_factor) thigh_fun = 1.d0 + exp(lnexphigh) !---------------------------------------------------------------------------------! - !------ Correct rd. --------------------------------------------------------------! + !------ Correct Rd. --------------------------------------------------------------! aparms%leaf_resp = rd_nocorr / (tlow_fun * thigh_fun) !---------------------------------------------------------------------------------! @@ -759,6 +745,11 @@ subroutine photosynthesis_exact_solver(ipft,limit_flag) call copy_solution(stclosed,co2lim) co2lim%co2_demand = discard success = .true. + !---------------------------------------------------------------------------------! + ! C3, use the expression from C91, that Ao should not exceed 0.5 * Vm. ! + !---------------------------------------------------------------------------------! + ! call solve_aofixed_case(co2lim,success) + !---------------------------------------------------------------------------------! case (4) !---------------------------------------------------------------------------------! @@ -1374,9 +1365,9 @@ subroutine set_co2_demand_params(whichlim) !------------------------------------------------------------------------------! case ('CO2') - !----- CO2-limited for low CO2 concentration case (unused). ----------------! + !----- CO2-limited for low CO2 concentration case. -------------------------! aparms%rho = 0.d0 - aparms%sigma = huge(1.d0) + aparms%sigma = 5.d-1 * aparms%vm aparms%xi = 0.d0 aparms%tau = 1.d0 aparms%nu = -aparms%leaf_resp diff --git a/ED/src/dynamics/fire.f90 b/ED/src/dynamics/fire.f90 index 3becd89a3..065e0a368 100644 --- a/ED/src/dynamics/fire.f90 +++ b/ED/src/dynamics/fire.f90 @@ -3,56 +3,55 @@ ! This subroutine will evaluate whether fire conditions exist, and if that is the case, ! ! it will calculate the disturbance rate due to fire. ! !------------------------------------------------------------------------------------------! -subroutine fire_frequency(month, cgrid) +subroutine fire_frequency(cgrid) use ed_state_vars , only : edtype & ! structure , polygontype & ! structure , sitetype & ! structure , patchtype ! ! structure + use ed_misc_coms , only : simtime & ! intent(in) + , current_time & ! intent(in) + , dtlsm ! ! intent(in) use grid_coms , only : nzg ! ! intent(in) use soil_coms , only : slz & ! intent(in) , soil & ! intent(in) , dslz ! ! intent(in) use disturb_coms , only : include_fire & ! intent(in) , fire_dryness_threshold & ! intent(in) - , fire_smoist_threshold & ! intent(in) , fire_smoist_depth & ! intent(in) , k_fire_first & ! intent(in) , fire_parameter ! ! intent(in) use allometry , only : ed_biomass ! ! function - use consts_coms , only : wdnsi & ! intent(in) - , wdns ! ! intent(in) + use consts_coms , only : wdns & ! intent(in) + , day_sec ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid - integer , intent(in) :: month !----- Local variables -----------------------------------------------------------------! type(polygontype) , pointer :: cpoly type(sitetype) , pointer :: csite type(patchtype) , pointer :: cpatch + type(simtime) :: lastmonth integer :: ipy integer :: isi integer :: ipa integer :: ico integer :: k - integer :: ka integer :: nsoil - real :: babove + real :: ndaysi + real :: normfac real :: fire_wmass_threshold real :: fuel real :: ignition_rate - real :: patch_water_depth - real :: patch_water_mass - !----- Locally saved variables. --------------------------------------------------------! - logical , save :: first_time=.true. !---------------------------------------------------------------------------------------! - if (first_time) then - kfireloop: do k_fire_first=nzg-1,1,-1 - if (slz(k_fire_first) < fire_smoist_depth) exit kfireloop - end do kfireloop - k_fire_first = k_fire_first + 1 - first_time = .false. - end if + !---------------------------------------------------------------------------------------! + ! Find the number of days of last month so we can normalise the integrated ground ! + ! water. ! + !---------------------------------------------------------------------------------------! + call lastmonthdate(current_time,lastmonth,ndaysi) + normfac = dtlsm * ndaysi / (day_sec) + !---------------------------------------------------------------------------------------! + !----- Loop over polygons and sites. ---------------------------------------------------! @@ -64,103 +63,96 @@ subroutine fire_frequency(month, cgrid) !----- Initialize ignition rate (a site variable). -------------------------------! ignition_rate = 0.0 - + !---------------------------------------------------------------------------------! + patchloop: do ipa=1,csite%npatches cpatch => csite%patch(ipa) + !----- Normalise the monthly mean ground water. -------------------------------! + csite%avg_monthly_gndwater(ipa) = csite%avg_monthly_gndwater(ipa) * normfac + !------------------------------------------------------------------------------! + !----- Initialize patch fuel. -------------------------------------------------! fuel = 0.0 - + !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! ! Loop through all cohorts in this patch, and compute the fuel. Fuel will ! ! be defined as the above-ground biomass per unit area. ! !------------------------------------------------------------------------------! cohortloop: do ico = 1,cpatch%ncohorts - babove = ed_biomass(cpatch%bdead(ico),cpatch%balive(ico),cpatch%bleaf(ico) & - ,cpatch%pft(ico),cpatch%hite(ico),cpatch%bstorage(ico) & - ,cpatch%bsapwood(ico)) & - * cpatch%nplant(ico) - fuel = fuel + babove + fuel = fuel + cpatch%nplant(ico) * cpatch%agb(ico) end do cohortloop + !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! + ! Determine the correct threshold to ignite fires according to the fire ! + ! method. ! + !------------------------------------------------------------------------------! select case (include_fire) - case (1) - !---------------------------------------------------------------------------! - ! Calculate the patch-level equivalent depth of ground liquid water. ! - ! This is done by combining the total water mass from both the temporary ! - ! surface water/snow layers plus the soil moisture. ! - ! SFCWATER_DEPTH is the depth of the temporary surface water/snow ! - ! layer, and the depth calculated here will be the same as SFCWATER_DEPTH ! - ! is the layer is liquid, but this will not be true if the ground is ! - ! covered with snow. Therefore we compute the depth based on the liquid ! - ! water density [kg/m3] and surface water mass [kg/m2]. ! - ! Similarly, the underground water is converted to meters using the ! - ! soil moisture [m3/m3] and the depth of the soil layer [m]. ! + case (0) + !------ Set water mass threshold to infinity, so fires will never happen. --! + fire_wmass_threshold = huge(1.) !---------------------------------------------------------------------------! - patch_water_depth = 0.0 - do k = 1, csite%nlev_sfcwater(ipa) - patch_water_depth = patch_water_depth & - + csite%sfcwater_mass(k,ipa) * wdnsi - end do - do k = cpoly%lsl(isi), nzg - patch_water_depth = patch_water_depth & - + csite%soil_water(k,ipa) * dslz(k) - end do + case (1) !---------------------------------------------------------------------------! - ! If the soil is dry, then calculate patch contribution to the ignition ! - ! rate. ! + ! The fire threshold is equivalent to the dryness factor, converted to ! + ! kg/m2. This will be compared to the full column, so if the soil is too ! + ! deep fires will be nearly impossible. ! !---------------------------------------------------------------------------! - if (patch_water_depth < fire_dryness_threshold) then - ignition_rate = ignition_rate + fuel * csite%area(ipa) - end if - - case (2) + fire_wmass_threshold = fire_dryness_threshold * wdns !---------------------------------------------------------------------------! - ! Compute the total (ground + underground) water in kg/m2. ! - !---------------------------------------------------------------------------! - patch_water_mass = 0.0 - ka = max(cpoly%lsl(isi),k_fire_first) - - do k = 1, csite%nlev_sfcwater(ipa) - patch_water_mass = patch_water_mass + csite%sfcwater_mass(k,ipa) - end do - do k = ka, nzg - patch_water_mass = patch_water_mass & - + csite%soil_water(k,ipa) * dslz(k) * wdns - end do + case (2) !---------------------------------------------------------------------------! ! We now compute the minimum amount of water in kg/m2 that the soil ! ! must have to avoid fires, using the soil properties and the soil moisture ! ! fraction threshold. ! !---------------------------------------------------------------------------! fire_wmass_threshold = 0 - do k = ka, nzg + do k = k_fire_first, nzg nsoil = cpoly%ntext_soil(k,isi) fire_wmass_threshold = fire_wmass_threshold & - + ( fire_smoist_threshold & - * (soil(nsoil)%slmsts - soil(nsoil)%soilcp) & - + soil(nsoil)%soilcp ) * dslz(k) * wdns + + soil(nsoil)%soilfr * dslz(k) * wdns end do - !---------------------------------------------------------------------------! - ! If the soil is dry, then calculate patch contribution to the ignition ! - ! rate. ! - !---------------------------------------------------------------------------! - if (patch_water_mass < fire_wmass_threshold) then - ignition_rate = ignition_rate + fuel * csite%area(ipa) - end if - end select + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! If the soil is dry, then calculate patch contribution to the ignition ! + ! rate. ! + !------------------------------------------------------------------------------! + if (csite%avg_monthly_gndwater(ipa) < fire_wmass_threshold) then + ignition_rate = ignition_rate + fuel * csite%area(ipa) + end if + !------------------------------------------------------------------------------! + + + !----- Reset the ground water for next month. ---------------------------------! + csite%avg_monthly_gndwater(ipa) = 0. + !------------------------------------------------------------------------------! + end do patchloop - - !----- Calculate fire dist rate [1/month]. ---------------------------------------! - cpoly%lambda_fire(month,isi) = fire_parameter * ignition_rate - cpoly%ignition_rate(isi) = ignition_rate + !---------------------------------------------------------------------------------! + + + !----- Calculate fire disturbance rate [1/month]. --------------------------------! + cpoly%lambda_fire (current_time%month,isi) = fire_parameter * ignition_rate + cpoly%ignition_rate (isi) = ignition_rate + !---------------------------------------------------------------------------------! end do siteloop + !------------------------------------------------------------------------------------! end do polyloop + !---------------------------------------------------------------------------------------! return end subroutine fire_frequency diff --git a/ED/src/dynamics/forestry.f90 b/ED/src/dynamics/forestry.f90 index 79d62f89c..5768c7ed8 100644 --- a/ED/src/dynamics/forestry.f90 +++ b/ED/src/dynamics/forestry.f90 @@ -531,8 +531,7 @@ subroutine harv_mat_patches(cpoly,isi,newp,lambda_mature_primary ! insert survivors subroutine here just to generalise, with the target biomass ! ! the survivorship should be 0. ! !---------------------------------------------------------------------------------! - call accum_dist_litt(csite,newp,ipa,new_lu,dA,cpoly%loss_fraction(new_lu,isi) & - ,poly_dist_type,mindbh_harvest) + call accum_dist_litt(csite,newp,ipa,new_lu,dA,poly_dist_type,mindbh_harvest) end if end do @@ -622,8 +621,7 @@ subroutine harv_immat_patches(cpoly,isi, newp, harvest_deficit,total_harvest_are total_harvest_area = total_harvest_area + dA csite%area(ipa) = csite%area(ipa) - dA call increment_patch_vars(csite,newp,ipa, dA) - call accum_dist_litt(csite,newp,ipa,new_lu,dA,cpoly%loss_fraction(new_lu,isi) & - ,poly_dist_type,mindbh_harvest) + call accum_dist_litt(csite,newp,ipa,new_lu,dA,poly_dist_type,mindbh_harvest) end if end do patchloop1 @@ -669,8 +667,7 @@ subroutine harv_immat_patches(cpoly,isi, newp, harvest_deficit,total_harvest_are csite%area(ipa) = csite%area(ipa) - dA call increment_patch_vars(csite,newp,ipa,dA) - call accum_dist_litt(csite,newp,ipa,new_lu,dA,cpoly%loss_fraction(new_lu,isi) & - ,poly_dist_type,mindbh_harvest) + call accum_dist_litt(csite,newp,ipa,new_lu,dA,poly_dist_type,mindbh_harvest) end if end do patchloop2 diff --git a/ED/src/dynamics/growth_balive.f90 b/ED/src/dynamics/growth_balive.f90 index 6600a8163..7344ca7c7 100644 --- a/ED/src/dynamics/growth_balive.f90 +++ b/ED/src/dynamics/growth_balive.f90 @@ -35,7 +35,6 @@ subroutine dbalive_dt(cgrid, tfact) use allometry , only : area_indices & ! subroutine , ed_biomass ! ! function use mortality , only : mortality_rates ! ! subroutine - use phenology_coms , only : theta_crit ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -88,9 +87,8 @@ subroutine dbalive_dt(cgrid, tfact) !----- Update the elongation factor. ------------------------------------! select case (phenology(ipft)) - case (4) - cpatch%elongf(ico) = max(0.0, min(1.0, cpatch%paw_avg(ico) & - / theta_crit)) + case (3,4) + cpatch%elongf(ico) = max(0.0, min(1.0, cpatch%paw_avg(ico))) case default cpatch%elongf(ico) = 1.0 @@ -292,12 +290,12 @@ end subroutine dbalive_dt - !=======================================================================================! !=======================================================================================! - ! This subroutine will compute the respiration terms other than leaf ! - ! respiration, plus the carbon balance and maintenance costs but without ! - ! updating the pools. ! + ! This subroutine will compute the terms relative to growth of the living tissues, ! + ! without actually updating it. ! + ! IMPORTANT: The order of the operations here affect the C/N budgets, so don't change ! + ! the order of the operations unless you really know what you are doing. ! !---------------------------------------------------------------------------------------! subroutine dbalive_dt_eq_0(cgrid, tfact) use ed_state_vars , only : edtype & ! structure @@ -318,7 +316,6 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) use allometry , only : area_indices & ! subroutine , ed_biomass ! ! function use mortality , only : mortality_rates ! ! subroutine - use phenology_coms , only : theta_crit ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -347,6 +344,7 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) real :: old_wood_hcap real :: nitrogen_uptake real :: N_uptake_pot + real :: temp_dep !------------------------------------------------------------------------------------! @@ -368,33 +366,25 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) !----- Alias for current PFT. -------------------------------------------! ipft = cpatch%pft(ico) - !----- Update the elongation factor. ------------------------------------! - select case (phenology(ipft)) - case (4) - cpatch%elongf(ico) = max(0.0, min(1.0, cpatch%paw_avg(ico)/theta_crit)) - case default - cpatch%elongf(ico) = 1.0 - end select !----- Initialize cohort nitrogen uptake. -------------------------------! nitrogen_uptake = 0.0 N_uptake_pot = 0.0 - + !----- Set allocation factors. ------------------------------------------! salloc = 1.0 + qsw(ipft) * cpatch%hite(ico) + q(ipft) salloci = 1.0 / salloc - - !----- Leaf and root biomass. -------------------------------------------! - bl = cpatch%bleaf(ico) - br = cpatch%broot(ico) !------------------------------------------------------------------------! - ! Compute maintenance costs. ! + ! Compute maintenance costs using actual pools. ! !------------------------------------------------------------------------! - call plant_maintenance(cpatch,ico,br,bl,tfact,daily_C_gain & - ,csite%avg_daily_temp(ipa)) - - !----- Subtract maintenance costs from balive. --------------------------! + call plant_maintenance(cpatch,ico,cpatch%broot(ico),cpatch%bleaf(ico) & + ,tfact,daily_C_gain,csite%avg_daily_temp(ipa)) + + !----- Subtract maintenance costs from pools. ---------------------------! + cpatch%balive(ico) = cpatch%balive(ico) + cpatch%bleaf(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) = cpatch%broot(ico) cpatch%cb(13,ico) = cpatch%cb(13,ico) & - cpatch%leaf_maintenance(ico) & - cpatch%root_maintenance(ico) @@ -402,24 +392,73 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) - cpatch%leaf_maintenance(ico) & - cpatch%root_maintenance(ico) + !------------------------------------------------------------------------! + ! Storage respriation/turnover_rate. ! + ! Calculate in same way as leaf and root turnover in kgC/plant/year. ! + !------------------------------------------------------------------------! + + + !------------------------------------------------------------------------! + ! The commented line is an experimental and arbitrary test, borrowed ! + ! from maintainence temperature dependency. [[MCD]] ! + !------------------------------------------------------------------------! + ! temp_dep = 1.0 & + ! / ( 1.0 + exp( 0.4 * (278.15 - csite%avg_daily_temp(ipa)))) + temp_dep = 1.0 + !------------------------------------------------------------------------! + + cpatch%storage_respiration(ico) = cpatch%bstorage(ico) & + * storage_turnover_rate(ipft) & + * tfact * temp_dep + + cpatch%bstorage(ico) = cpatch%bstorage(ico) & + - cpatch%storage_respiration(ico) + + !------------------------------------------------------------------------! + ! When storage carbon is lost, allow the associated nitrogen to go ! + ! to litter in order to maintain prescribed C2N ratio. ! + !------------------------------------------------------------------------! + csite%fsn_in(ipa) = csite%fsn_in(ipa) + !------------------------------------------------------------------------! ! Calculate actual, potential and maximum carbon balances. ! !------------------------------------------------------------------------! call plant_carbon_balances(cpatch,ipa,ico,daily_C_gain,carbon_balance & ,carbon_balance_pot,carbon_balance_max) + !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! ! Compute respiration rates for coming day [kgC/plant/day]. ! !------------------------------------------------------------------------! - cpatch%growth_respiration(ico) = max(0.0, daily_C_gain & - * growth_resp_factor(ipft)) - cpatch%storage_respiration(ico) = cpatch%bstorage(ico) & - * storage_turnover_rate(ipft) * tfact - cpatch%vleaf_respiration(ico) = & - (1.0 - cpoly%green_leaf_factor(ipft,isi)) & - / (1.0 + q(ipft) + qsw(ipft) * cpatch%hite(ico)) & - * cpatch%balive(ico) * storage_turnover_rate(ipft) & - * tfact + cpatch%growth_respiration(ico) = max(0.0, daily_C_gain & + * growth_resp_factor(ipft)) + !------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------! + ! Find the "virtual" leaf respiration. ! + !------------------------------------------------------------------------! + cpatch%vleaf_respiration(ico) = (1.0-cpoly%green_leaf_factor(ipft,isi)) & + * salloci * cpatch%balive(ico) & + * storage_turnover_rate(ipft) & + * tfact * temp_dep + !------------------------------------------------------------------------! + + + !------------------------------------------------------------------------! + ! Find the potential allocation to the living tissues, but don't ! + ! update them. ! + !------------------------------------------------------------------------! + balive_in = cpatch%balive(ico) + call alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci & + ,carbon_balance,nitrogen_uptake & + ,cpoly%green_leaf_factor(ipft,isi)) + !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! ! Do a shadow calculation to see what would have happened if stomata ! @@ -431,21 +470,28 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) ,carbon_balance_pot,N_uptake_pot & ,cpoly%green_leaf_factor(ipft,isi)) end if + !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! ! Increment the [kgN/m2] taken up during previous day. ! !------------------------------------------------------------------------! csite%total_plant_nitrogen_uptake(ipa) = & - csite%total_plant_nitrogen_uptake(ipa) & - + nitrogen_uptake * cpatch%nplant(ico) + csite%total_plant_nitrogen_uptake(ipa) & + + nitrogen_uptake * cpatch%nplant(ico) + !------------------------------------------------------------------------! + + !----- Calculate plant N limitation factor. -----------------------------! if (n_plant_lim == 0 .or. N_uptake_pot <= 0.0) then cpatch%fsn(ico) = 1.0 else - nitrogen_supply = plant_N_supply_scale * br & + nitrogen_supply = plant_N_supply_scale * cpatch%broot(ico) & * csite%mineralized_soil_N(ipa) - cpatch%fsn(ico) = nitrogen_supply / (nitrogen_supply + N_uptake_pot) + cpatch%fsn(ico) = nitrogen_supply & + / (nitrogen_supply + N_uptake_pot) end if !------------------------------------------------------------------------! @@ -453,6 +499,10 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) !------------------------------------------------------------------------! call mortality_rates(cpatch,ipa,ico,csite%avg_daily_temp(ipa) & ,csite%age(ipa)) + + !----- Don't update monthly mortality rate [plants/m2/month]. -----------! + cpatch%monthly_dndt(ico) = cpatch%monthly_dndt(ico) + end do !----- It's a new day, reset average daily temperature. --------------------! @@ -565,26 +615,50 @@ subroutine plant_maintenance(cpatch,ico,br,bl,tfact,daily_C_gain,tempk) !------ Alias for plant functional type. --------------------------------------------! ipft = cpatch%pft(ico) - !------ Get the temperature dependence. ---------------------------------------------! - if (phenology(ipft) == 0) then + !------------------------------------------------------------------------------------! + ! Find the maintenance costs. This will depend on the type of phenology that ! + ! the PFT has. The tfact term applied converts the maintenance rates to ! + ! [kgC/plant/day]. ! + !------------------------------------------------------------------------------------! + select case (phenology(ipft)) + case (0) + !---------------------------------------------------------------------------------! + ! Evergreens, like pines. The turnover rates will be adjusted by a function ! + ! of temperature, which approaches 0 as the temperature goes down. ! + !---------------------------------------------------------------------------------! + !------ Find a temperature dependence adjustment. --------------------------------! maintenance_temp_dep = 1.0 / (1.0 + exp(0.4 * (278.15 - tempk))) - else - maintenance_temp_dep = 1.0 - end if + !----- Scale maintenance by biomass and apply the temperature correction. --------! + cpatch%leaf_maintenance(ico) = leaf_turnover_rate(ipft) * bl & + * maintenance_temp_dep * tfact + cpatch%root_maintenance(ico) = root_turnover_rate(ipft) * br & + * maintenance_temp_dep * tfact + !---------------------------------------------------------------------------------! - !----- Calculate maintenance demand (kgC/plant/year). -------------------------------! - cpatch%root_maintenance(ico) = root_turnover_rate(ipft) * br * maintenance_temp_dep - if (phenology(ipft) /= 3)then - cpatch%leaf_maintenance(ico) = leaf_turnover_rate(ipft) * bl * maintenance_temp_dep - else + case (3) + !---------------------------------------------------------------------------------! + ! Light phenology. Leaf turnover rate will be adjusted according to the ! + ! amplitude that comes from the dependence on the radiation (running average). ! + ! Roots are the same as the other plants that don't depend on temperature. ! + !---------------------------------------------------------------------------------! + cpatch%root_maintenance(ico) = root_turnover_rate(ipft) * br * tfact cpatch%leaf_maintenance(ico) = leaf_turnover_rate(ipft) * bl & - * cpatch%turnover_amp(ico) * maintenance_temp_dep - end if + * cpatch%turnover_amp(ico) * tfact + !---------------------------------------------------------------------------------! - !----- Convert units of maintenance to [kgC/plant/day]. -----------------------------! - cpatch%leaf_maintenance(ico) = cpatch%leaf_maintenance(ico) * tfact - cpatch%root_maintenance(ico) = cpatch%root_maintenance(ico) * tfact + case default + !---------------------------------------------------------------------------------! + ! Ohter phenologies, use the standard turnover rates, scaled by biomass ! + ! only. ! + !---------------------------------------------------------------------------------! + cpatch%root_maintenance(ico) = root_turnover_rate(ipft) * br * tfact + cpatch%leaf_maintenance(ico) = leaf_turnover_rate(ipft) * bl * tfact + !---------------------------------------------------------------------------------! + + end select + !------------------------------------------------------------------------------------! + !----- Compute daily C uptake [kgC/plant/day]. --------------------------------------! @@ -985,6 +1059,242 @@ end subroutine alloc_plant_c_balance + + + !=======================================================================================! + !=======================================================================================! + ! Find the allocation terms, but don't really allocate them. ! + !---------------------------------------------------------------------------------------! + subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balance & + ,nitrogen_uptake,green_leaf_factor) + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use pft_coms , only : c2n_storage & ! intent(in) + , c2n_leaf & ! intent(in) + , sla & ! intent(in) + , q & ! intent(in) + , qsw & ! intent(in) + , c2n_stem ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use allometry , only : dbh2bl ! ! function + implicit none + !----- Arguments. -------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + integer , intent(in) :: ico + real , intent(in) :: salloc + real , intent(in) :: salloci + real , intent(in) :: carbon_balance + real , intent(inout) :: nitrogen_uptake + real , intent(in) :: green_leaf_factor + !----- Local variables. -------------------------------------------------------------! + type(patchtype), pointer :: cpatch + integer :: ipft + real :: bl_max + real :: balive_max + real :: bl_pot + real :: increment + real :: old_status + real :: delta_bleaf + real :: delta_broot + real :: delta_bsapwood + real :: available_carbon + real :: f_total + real :: f_bleaf + real :: f_broot + real :: f_bsapwood + real :: f_resp + real :: tr_bleaf + real :: tr_broot + real :: tr_bsapwood + real :: bl + logical :: on_allometry + logical :: time_to_flush + !------------------------------------------------------------------------------------! + + cpatch => csite%patch(ipa) + + ipft = cpatch%pft(ico) + + !------------------------------------------------------------------------------------! + ! When plants transit from dormancy to leaf flushing, it is possible that ! + ! carbon_balance is negative, but the sum of carbon_balance and bstorage is ! + ! positive. Under this circumstance, we have to allow plants to grow leaves. ! + !------------------------------------------------------------------------------------! + increment = cpatch%bstorage(ico) + carbon_balance + time_to_flush = (carbon_balance <= 0.0) .and. (increment > 0.0) .and. & + (cpatch%phenology_status(ico) == 1) + + if (carbon_balance > 0.0 .or. time_to_flush) then + if (cpatch%phenology_status(ico) == 1) then + !------------------------------------------------------------------------------! + ! There are leaves, we are not actively dropping leaves and we're off ! + ! allometry. Here we will compute the maximum amount that can go to balive ! + ! pools, and put any excess in storage. ! + !------------------------------------------------------------------------------! + available_carbon = cpatch%bstorage(ico) + carbon_balance + + !------------------------------------------------------------------------------! + ! Maximum bleaf that the allometric relationship would allow. If the ! + ! plant is drought stress (elongf < 1), we do not allow the plant to get back ! + ! to full allometry. ! + !------------------------------------------------------------------------------! + bl_max = dbh2bl(cpatch%dbh(ico),ipft) * green_leaf_factor & + * cpatch%elongf(ico) + balive_max = dbh2bl(cpatch%dbh(ico),ipft) * salloc * cpatch%elongf(ico) + + !--- Amount that bleaf, broot, and bsapwood are off allometry -----------------! + delta_bleaf = max (0.0, bl_max- cpatch%bleaf(ico)) + delta_broot = max (0.0, balive_max * q(ipft) * salloci - cpatch%broot(ico)) + delta_bsapwood = max (0.0, balive_max * qsw(ipft) * cpatch%hite(ico) * salloci & + - cpatch%bsapwood(ico)) + + !------------------------------------------------------------------------------! + ! If the available carbon is less than what we need to get back to allometry. ! + ! Grow pools in proportion to demand. If we have enough carbon, we'll put the ! + ! extra into bstorage. ! + !------------------------------------------------------------------------------! + + f_bleaf = delta_bleaf / bl_max + f_broot = delta_broot / (balive_max * q(ipft) * salloci ) + f_bsapwood = delta_bsapwood / (balive_max * qsw(ipft) * cpatch%hite(ico) & + * salloci) + f_total = f_bleaf + f_broot + f_bsapwood + + !------------------------------------------------------------------------------! + ! We only allow transfer from storage to living tissues if there is need ! + ! to transfer. ! + !------------------------------------------------------------------------------! + if (f_total > 0.0) then + tr_bleaf = min( delta_bleaf , (f_bleaf/f_total) * available_carbon) + tr_broot = min( delta_broot , (f_broot/f_total) * available_carbon) + tr_bsapwood = min( delta_bsapwood, (f_bsapwood/f_total) * available_carbon) + else + tr_bleaf = 0. + tr_broot = 0. + tr_bsapwood = 0. + end if + !------------------------------------------------------------------------------! + + cpatch%bleaf(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) = cpatch%broot(ico) + cpatch%bsapwood(ico) = cpatch%bsapwood(ico) + + cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwood(ico) + + !----- NPP allocation in diff pools in KgC/m2/day. ----------------------------! + cpatch%today_nppleaf(ico) = tr_bleaf * cpatch%nplant(ico) + cpatch%today_nppfroot(ico) = tr_broot * cpatch%nplant(ico) + cpatch%today_nppsapwood(ico)= tr_bsapwood * cpatch%nplant(ico) + cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) + + !------------------------------------------------------------------------------! + ! Find the amount of carbon used to recover the tissues that were off- ! + ! -allometry, take that from the carbon balance first, then use some of the ! + ! storage if needed be. ! + !------------------------------------------------------------------------------! + increment = carbon_balance - tr_bleaf - tr_broot - tr_bsapwood + cpatch%bstorage(ico) = max(0.0, cpatch%bstorage(ico) + increment) + !------------------------------------------------------------------------------! + + if (increment <= 0.0) then + !---------------------------------------------------------------------------! + ! We are using up all of daily C gain and some of bstorage. First ! + ! calculate N demand from using daily C gain. ! + !---------------------------------------------------------------------------! + if (carbon_balance < 0.0) then + nitrogen_uptake = nitrogen_uptake + carbon_balance / c2n_storage + nitrogen_uptake = nitrogen_uptake & + + (carbon_balance - increment) & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft) & + - 1.0 / c2n_storage) + + else + nitrogen_uptake = nitrogen_uptake + carbon_balance & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft) ) + + !------------------------------------------------------------------------! + ! Now calculate additional N uptake required from transfer of C from ! + ! storage to balive. ! + !------------------------------------------------------------------------! + nitrogen_uptake = nitrogen_uptake + ( - 1.0 * increment ) & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft) & + - 1.0 / c2n_storage) + end if + + else + !---------------------------------------------------------------------------! + ! N uptake for fraction of daily C gain going to balive. ! + !---------------------------------------------------------------------------! + nitrogen_uptake = nitrogen_uptake + (carbon_balance - increment) & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft)) + !----- N uptake for fraction of daily C gain going to bstorage. ------------! + nitrogen_uptake = nitrogen_uptake + increment / c2n_storage + end if + + on_allometry = 2.0 * abs(balive_max - cpatch%balive(ico)) & + / (balive_max + cpatch%balive(ico)) < 1.e-6 + if (cpatch%elongf(ico) == 1.0 .and. on_allometry) then + !---------------------------------------------------------------------------! + ! We're back to allometry, change phenology_status. ! + !---------------------------------------------------------------------------! + cpatch%phenology_status(ico) = 0 + end if + else + !------------------------------------------------------------------------------! + ! Put carbon gain into storage. If we're not actively dropping leaves or ! + ! off-allometry, this will be used for structural growth at the end of the ! + ! month. ! + !------------------------------------------------------------------------------! + cpatch%bstorage(ico) = cpatch%bstorage(ico) + carbon_balance + nitrogen_uptake = nitrogen_uptake + carbon_balance / c2n_storage + + !----- NPP allocation in diff pools in Kg C/m2/day. ---------------------------! + cpatch%today_nppleaf(ico) = 0.0 + cpatch%today_nppfroot(ico) = 0.0 + cpatch%today_nppsapwood(ico) = 0.0 + cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) + end if + + + else + !---------------------------------------------------------------------------------! + ! Carbon balance is negative, take it out of storage. ! + !---------------------------------------------------------------------------------! + increment = cpatch%bstorage(ico) + carbon_balance + + if (increment <= 0.0) then + !----- Use Storage pool first then take out of balive. ------------------------! + increment = - increment + cpatch%bstorage(ico) = 0.0 + csite%fsn_in(ipa) = csite%fsn_in(ipa) + else + !------ Burn the storage pool. Dont' forget the nitrogen. --------------------! + cpatch%bstorage(ico) = cpatch%bstorage(ico) + carbon_balance + csite%fsn_in(ipa) = csite%fsn_in(ipa) + end if + + !---- NPP allocation in diff pools in KgC/m2/day. --------------------------------! + cpatch%today_nppleaf(ico) = 0.0 + cpatch%today_nppfroot(ico) = 0.0 + cpatch%today_nppsapwood(ico) = 0.0 + cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) + end if + + return + end subroutine alloc_plant_c_balance_eq_0 + !=======================================================================================! + !=======================================================================================! + + + + + !=======================================================================================! !=======================================================================================! subroutine potential_N_uptake(cpatch,ico,salloc,salloci,balive_in,carbon_balance_pot & diff --git a/ED/src/dynamics/heun_driver.f90 b/ED/src/dynamics/heun_driver.f90 index da1f593cf..3fb5faeb2 100644 --- a/ED/src/dynamics/heun_driver.f90 +++ b/ED/src/dynamics/heun_driver.f90 @@ -121,8 +121,9 @@ subroutine heun_timestep(cgrid) call copy_met_2_rk4site(nzg,cmet%vels,cmet%atm_theiv,cmet%atm_theta & ,cmet%atm_tmp,cmet%atm_shv,cmet%atm_co2,cmet%geoht & ,cmet%exner,cmet%pcpg,cmet%qpcpg,cmet%dpcpg,cmet%prss & - ,cmet%rshort,cmet%rlong,cmet%geoht,cpoly%lsl(isi) & - ,cpoly%ntext_soil(:,isi) & + ,cmet%rshort,cmet%rlong,cmet%par_beam,cmet%par_diffuse & + ,cmet%nir_beam,cmet%nir_diffuse,cmet%geoht & + ,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & ,cpoly%green_leaf_factor(:,isi) & ,cgrid%lon(ipy),cgrid%lat(ipy),cgrid%cosz(ipy)) diff --git a/ED/src/dynamics/multiple_scatter.f90 b/ED/src/dynamics/multiple_scatter.f90 new file mode 100644 index 000000000..484826cf7 --- /dev/null +++ b/ED/src/dynamics/multiple_scatter.f90 @@ -0,0 +1,975 @@ +!==========================================================================================! +!==========================================================================================! +! This sub-routine solves the long-wave radiation method using the multiple-scatter- ! +! ing model. We consider the finite crown area when computing the layer transmittance. ! +! Contrary to short-wave radiation, and contrary to the two-stream model, we don't ! +! normalise long-wave radiation, nor do we split into incident and surface. Splitting ! +! into PAR and NIR is fine, because we are dealing with two different parts of the ! +! spectrum, but celestial and surface radiation interact in the canopy and we cannot ! +! really tear them apart. Therefore we dump all the LW radiation into one array (which ! +! will be the rlong_v_incid), whilst the other is always set to 0. ! +! ! +! References: ! +! ! +! Zhao, W., R. J. Qualls, 2006: Modeling of long-wave and net radiation energy ! +! distribution within a homogeneous plant canopy via multiple scattering processes. ! +! Water Resources Res., 42, W08435, doi: 10.1029/2005WR004581. (ZQ06) ! ! +! ! +! Oleson, K. W., and co-authors, 2004: Technical description of the community land model ! +! (CLM). NCAR Technical note NCAR/TN-461+STR. 186pp. (CLM04) ! +! ! +! Sellers, P. J., 1985: Canopy reflectance, photosynthesis and transpiration. Intl. J. ! +! of remote sensing, 6, 1335-1372. (S85) ! +! ! +! ! +!------------------------------------------------------------------------------------------! +subroutine lw_multiple_scatter(grnd_emis4,grnd_temp4,rlong_top4,ncoh,pft,lai,wai,cai & + ,leaf_temp,wood_temp,tir_flip,dw_tirlo,uw_tirlo,uw_tirhi) + use ed_max_dims , only : n_pft ! ! intent(in) + use rk4_coms , only : tiny_offset ! ! intent(in) + use canopy_radiation_coms, only : clumping_factor & ! intent(in) + , orient_factor & ! intent(in) + , leaf_emis & ! intent(in) + , wood_emis & ! intent(in) + , phi1 & ! intent(in) + , phi2 & ! intent(in) + , mu_bar & ! intent(in) + , leaf_backscatter_tir & ! intent(in) + , wood_backscatter_tir ! ! intent(in) + use consts_coms , only : stefan8 ! ! intent(in) + + implicit none + + !----- Arguments. ----------------------------------------------------------------------! + real(kind=4) , intent(in) :: grnd_emis4 + real(kind=4) , intent(in) :: grnd_temp4 + real(kind=4) , intent(in) :: rlong_top4 + integer , intent(in) :: ncoh + integer , dimension(ncoh) , intent(in) :: pft + real(kind=8), dimension(ncoh) , intent(in) :: lai + real(kind=8), dimension(ncoh) , intent(in) :: wai + real(kind=8), dimension(ncoh) , intent(in) :: cai + real(kind=8), dimension(ncoh) , intent(in) :: leaf_temp + real(kind=8), dimension(ncoh) , intent(in) :: wood_temp + real(kind=4), dimension(ncoh) , intent(out) :: tir_flip + real(kind=4) , intent(out) :: dw_tirlo + real(kind=4) , intent(out) :: uw_tirlo + real(kind=4) , intent(out) :: uw_tirhi + !----- Local variables. ----------------------------------------------------------------! + integer :: ipft + integer :: nsiz + integer :: i + integer :: ip1 + integer :: im1 + integer :: i2 + integer :: i2p1 + integer :: i2m1 + integer :: i2p2 + logical :: sing + real(kind=8), dimension(ncoh) :: locetai + real(kind=8), dimension(ncoh) :: elai + real(kind=8), dimension(ncoh) :: etai + real(kind=8), dimension(ncoh) :: tai + real(kind=8), dimension(ncoh) :: leaf_weight + real(kind=8), dimension(ncoh) :: wood_weight + real(kind=8), dimension(ncoh) :: source_lw + real(kind=8), dimension(0:ncoh+1) :: tau ! tau_i + real(kind=8), dimension(0:ncoh+1) :: omt ! 1-tau_i + real(kind=8), dimension(0:ncoh+1) :: omr ! 1-r_i + real(kind=8), dimension(0:ncoh+1) :: r ! r_i + real(kind=8), dimension(0:ncoh+1) :: epsil ! epsilon_i + real(kind=8), dimension(0:ncoh+1) :: ome ! 1-epsilon_i + real(kind=8), dimension( ncoh+1) :: lwd0 + real(kind=8), dimension(0:ncoh ) :: lwu0 + real(kind=8), dimension( ncoh+1) :: lwd + real(kind=8), dimension(0:ncoh ) :: lwu + real(kind=8), dimension(2*ncoh+2) :: lwvec + real(kind=8), dimension(2*ncoh+2) :: cvec + real(kind=8), dimension(2*ncoh+2,2*ncoh+2) :: amat + real(kind=8) :: grnd_emis + real(kind=8) :: grnd_temp + real(kind=8) :: rlong_top + real(kind=8) :: ext_diff1 + real(kind=8) :: ext_diff2 + !----- External functions. -------------------------------------------------------------! + real(kind=8) , external :: eifun8 + real(kind=4) , external :: sngloff + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Find the size of the solution matrix and array. ! + !---------------------------------------------------------------------------------------! + nsiz = 2*ncoh + 2 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Convert some properties to double precision. ! + !---------------------------------------------------------------------------------------! + grnd_emis = dble(grnd_emis4) + grnd_temp = dble(grnd_temp4) + rlong_top = dble(rlong_top4) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Convert some leaf variables to double precision, then find some general ! + ! properties of leaves/branches (i.e., properties that do not depend on which band we ! + ! are solving): the extinction coefficient lambda, the layer transmittance ! + ! coefficients tau_beam and tau_diff, and the weight of LAI and WAI relative to the ! + ! total area. ! + !---------------------------------------------------------------------------------------! + do i=1,ncoh + ipft = pft(i) + !----- Area indices, correct LAI by clumping factor. --------------------------------! + elai(i) = clumping_factor(ipft) * lai(i) + tai(i) = lai(i) + wai(i) + etai(i) = elai(i) + wai(i) + !------------------------------------------------------------------------------------! + + + + !----- LOCETAI is the local exposed LAI. --------------------------------------------! + locetai(i) = etai(i) / cai(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! The weighting factors are defined by the relative LAI and WAI areas. ! + !------------------------------------------------------------------------------------! + leaf_weight(i) = lai(i) / tai(i) + wood_weight(i) = 1.d0 - leaf_weight(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! The layer transmittance coefficient for diffuse radiation is defined in a ! + ! similar way from equation (2) of ZQ06. We must integrate the contribution coming ! + ! from each hemispheric direction. Again, we must consider the finite crown area, ! + ! and use the same extinction function we use for shortwave radiation, which comes ! + ! from CLM04 equation 3.3. ! + ! The integral can be solved analytically for our case, with the help of the ! + ! handy http://www.integrals.com website, of course ;-). ! + !------------------------------------------------------------------------------------! + ext_diff1 = phi1(ipft) * locetai(i) + ext_diff2 = phi2(ipft) * locetai(i) + tau(i) = (1.d0 - cai(i)) & + - cai(i) * exp(- ext_diff1 - ext_diff2) & + * ( ext_diff1 * ext_diff1 * exp(ext_diff1) * eifun8(-ext_diff1) & + + (ext_diff1 - 1.d0) ) + !------------------------------------------------------------------------------------! + + + + !----- Backward scattering of diffuse radiation. ------------------------------------! + r(i) = leaf_weight(i) * leaf_backscatter_tir(ipft) & + + wood_weight(i) * wood_backscatter_tir(ipft) + !------------------------------------------------------------------------------------! + + + + !----- Layer emissivity. ------------------------------------------------------------! + epsil(i) = leaf_weight(i) * leaf_emis(ipft) + wood_weight(i) * wood_emis(ipft) + !------------------------------------------------------------------------------------! + + + + !----- Thermal emission. ------------------------------------------------------------! + source_lw(i) = epsil(i) * stefan8 & + * (leaf_weight(i) * leaf_temp(i) + wood_weight(i) * wood_temp(i)) ** 4 + !------------------------------------------------------------------------------------! + + + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Define some boundary conditions for transmission, emission, and backscattering, ! + ! and the complement of the three properties. The boundary conditions come from ZQ06, ! + ! equations 16-22. ! + !---------------------------------------------------------------------------------------! + tau (0) = 0.d0 + tau (ncoh+1) = 1.d0 + r (0) = 1.d0 + r (ncoh+1) = 0.d0 + epsil (0) = grnd_emis + omr(:) = 1.d0 - r (:) + omt(:) = 1.d0 - tau (:) + ome(:) = 1.d0 - epsil(:) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Find the top diffuse radiation, using equations (19) and (22) from ZQ06. ! + !---------------------------------------------------------------------------------------! + lwd0 (ncoh+1) = rlong_top + lwu0 ( 0) = epsil(0) * stefan8 * grnd_temp ** 4 + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! Fill in the right hand side vector (C) and the matrix (A) described by ! + ! equations (25) and ("25 1/2") of ZQ06. ! + !---------------------------------------------------------------------------------------! + !------ Initialise the vector and the matrix. The matrix is a sparse one... -----------! + amat(:,:) = 0.d0 + cvec(:) = 0.d0 + !------ Add the edge values first. -----------------------------------------------------! + amat(1,1) = 1.d0 + amat(nsiz,nsiz) = 1.d0 + cvec(1) = lwu0(0) + cvec(nsiz) = lwd0(ncoh+1) + do i=1,ncoh + !----- Find auxiliary indices. ------------------------------------------------------! + ip1 = i + 1 + im1 = i - 1 + i2 = 2 * i + i2p1 = i2 + 1 + i2m1 = i2 - 1 + i2p2 = i2 + 2 + !------------------------------------------------------------------------------------! + + !----- Make elements of C vector. ---------------------------------------------------! + cvec(i2) = ( 1.d0 - r(im1) * ome(im1) * omt(im1) * r(i) * ome(i) * omt(i)) & + * omt(i) * source_lw(i) + cvec(i2p1) = ( 1.d0 - r(i) * ome(i) * omt(i) * r(ip1) * ome(ip1) * omt(ip1)) & + * omt(i) * source_lw(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Make elements of the tri-diagonal A array. ! + !------------------------------------------------------------------------------------! + amat(i2 ,i2m1) = - (tau(i) + omr(i) * ome(i) * omt(i)) + amat(i2 ,i2 ) = - r(im1) * ome(im1) * omt(im1) * (tau(i) + omt(i) * ome(i) * omr(i)) + amat(i2 ,i2p1) = 1.d0 - r(im1) * ome(im1) * omt(im1) * r(i) * ome(i) * omt(i) + amat(i2p1,i2 ) = 1.d0 - r(i) * ome(i) * omt(i) * r(ip1) * ome(ip1) * omt(ip1) + amat(i2p1,i2p1) = - r(ip1) * ome(ip1) * omt(ip1) * (tau(i) + omt(i) * ome(i) * omr(i)) + amat(i2p1,i2p2) = - (tau(i) + omt(i) * ome(i) * omr(i)) + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Solve the linear system. In the future we could use a tridiagonal solver, ! + ! which is a lot cheaper than the regular Gauss elimination, but for the time being, we ! + ! go with a tested method. ! + !---------------------------------------------------------------------------------------! + call lisys_solver8(nsiz,amat,cvec,lwvec,sing) + if (sing) then + call fatal_error('LW radiation failed... The matrix is singular!' & + ,'lw_multiple_scatter','multiple_scatter.f90') + end if + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Copy the solution without considering the multiple scattering to the vectors. ! + !---------------------------------------------------------------------------------------! + lwu0(0) = lwvec(1) + lwd0(ncoh+1) = lwvec(nsiz) + do i=1,ncoh + + !----- Auxiliary indices. -----------------------------------------------------------! + i2 = i * 2 + i2p1 = i * 2 + 1 + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Retrieve the downward and upward diffuse (hemispheric) radiation, using ! + ! equation (24) from ZQ06. ! + !------------------------------------------------------------------------------------! + lwd0(i) = lwvec(i2) + lwu0(i) = lwvec(i2p1) + !------------------------------------------------------------------------------------! + + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Find the diffuse radiation when multiple scattering is considered. This is based ! + ! on equations (8) and (9) of ZQ06, with the difference that we find LWd_i instead of ! + ! LWd_i+1. ! + !---------------------------------------------------------------------------------------! + !----- Downward diffuse (hemispheric) radiation. ---------------------------------------! + do i=1,ncoh+1 + im1 = i - 1 + ip1 = i + 1 + lwd(i) = ( lwd0(i) + r(i) * ome(i) * omt(i) * lwu0(im1) ) & + / ( 1.d0 - r(im1) * ome(im1) * omt(im1) * r(i) * ome(i) * omt(i) ) + end do + !----- Upward diffuse (hemispheric) radiation. -----------------------------------------! + do i=0,ncoh + im1 = i - 1 + ip1 = i + 1 + lwu(i) = ( lwu0(i) + r(i) * ome(i) * omt(i) * lwd0(ip1) ) & + / ( 1.d0 - r(i) * ome(i) * omt(i) * r(ip1) * ome(ip1) * omt(ip1) ) + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Save the fluxes that we will use outside this sub-routine. ! + !---------------------------------------------------------------------------------------! + + + + !------ Save the fluxes reaching the surface and leaving the top. ----------------------! + dw_tirlo = sngloff(lwd (1), tiny_offset) + uw_tirlo = sngloff(lwu (0), tiny_offset) + uw_tirhi = sngloff(lwu (ncoh), tiny_offset) + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Save the radiation fluxes to the output variable. ! + !---------------------------------------------------------------------------------------! + do i=1,ncoh + im1 = i - 1 + ip1 = i + 1 + tir_flip(i) = sngloff(lwd(ip1) - lwd(i) + lwu(im1) - lwu(i), tiny_offset) + end do + !---------------------------------------------------------------------------------------! + + return +end subroutine lw_multiple_scatter +!==========================================================================================! +!==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This sub-routine solves the short-wave radiation method using the multiple-scatter- ! +! ing model. We consider the finite crown area when computing the transmittance of both ! +! direct and diffuse radiation. References: ! +! ! +! Zhao, W., R. J. Qualls, 2005: A multiple-layer canopy scattering model to simulate ! +! shortwave radiation distribution within a homogeneous plant canopy. Water Resources ! +! Res., 41, W08409, doi: 10.1029/2005WR004016. (ZQ05) ! +! ! +! Oleson, K. W., and co-authors, 2004: Technical description of the community land model ! +! (CLM). NCAR Technical note NCAR/TN-461+STR. 186pp. (CLM04) ! +! ! +! Sellers, P. J., 1985: Canopy reflectance, photosynthesis and transpiration. Intl. J. ! +! of remote sensing, 6, 1335-1372. (S85) ! +! ! +! ! +!------------------------------------------------------------------------------------------! +subroutine sw_multiple_scatter(grnd_alb_par4,grnd_alb_nir4,cosaoi4,ncoh,pft,lai,wai,cai & + ,par_beam_flip,par_diff_flip,sw_abs_beam_flip & + ,sw_abs_diff_flip,dw_parlo_beam,dw_parlo_diff & + ,uw_parhi_beam,uw_parhi_diff,dw_nirlo_beam & + ,dw_nirlo_diff,uw_nirhi_beam,uw_nirhi_diff & + ,par_beam_level,par_diff_level,light_level,light_beam_level & + ,light_diff_level,lambda_out,lambda_tot) + use ed_max_dims , only : n_pft ! ! intent(in) + use rk4_coms , only : tiny_offset ! ! intent(in) + use canopy_radiation_coms, only : clumping_factor & ! intent(in) + , orient_factor & ! intent(in) + , phi1 & ! intent(in) + , phi2 & ! intent(in) + , mu_bar & ! intent(in) + , leaf_scatter_vis & ! intent(in) + , leaf_scatter_nir & ! intent(in) + , leaf_backscatter_nir & ! intent(in) + , leaf_backscatter_vis & ! intent(in) + , wood_scatter_nir & ! intent(in) + , wood_scatter_vis & ! intent(in) + , wood_backscatter_nir & ! intent(in) + , wood_backscatter_vis & ! intent(in) + , par_beam_norm & ! intent(in) + , par_diff_norm & ! intent(in) + , nir_beam_norm & ! intent(in) + , nir_diff_norm & ! intent(in) + , cosz_min8 ! ! intent(in) + + implicit none + + !----- Arguments. ----------------------------------------------------------------------! + real(kind=4) , intent(in) :: grnd_alb_par4 + real(kind=4) , intent(in) :: grnd_alb_nir4 + real(kind=4) , intent(in) :: cosaoi4 + integer , intent(in) :: ncoh + integer , dimension(ncoh) , intent(in) :: pft + real(kind=8), dimension(ncoh) , intent(in) :: lai + real(kind=8), dimension(ncoh) , intent(in) :: wai + real(kind=8), dimension(ncoh) , intent(in) :: cai + real(kind=4), dimension(ncoh) , intent(out) :: par_beam_flip + real(kind=4), dimension(ncoh) , intent(out) :: par_diff_flip + real(kind=4), dimension(ncoh) , intent(out) :: sw_abs_beam_flip + real(kind=4), dimension(ncoh) , intent(out) :: sw_abs_diff_flip + real(kind=4) , intent(out) :: uw_parhi_beam + real(kind=4) , intent(out) :: uw_parhi_diff + real(kind=4) , intent(out) :: uw_nirhi_beam + real(kind=4) , intent(out) :: uw_nirhi_diff + real(kind=4) , intent(out) :: dw_parlo_beam + real(kind=4) , intent(out) :: dw_parlo_diff + real(kind=4) , intent(out) :: dw_nirlo_beam + real(kind=4) , intent(out) :: dw_nirlo_diff + real(kind=8), dimension(ncoh) , intent(out) :: par_beam_level + real(kind=8), dimension(ncoh) , intent(out) :: par_diff_level + real(kind=8), dimension(ncoh) , intent(out) :: light_level + real(kind=8), dimension(ncoh) , intent(out) :: light_beam_level + real(kind=8), dimension(ncoh) , intent(out) :: light_diff_level + real(kind=8), dimension(ncoh) , intent(out) :: lambda_out + real(kind=8) , intent(out) :: lambda_tot + !----- Local variables. ----------------------------------------------------------------! + integer :: ipft + integer :: iband + integer :: nsiz + integer :: i + integer :: ip1 + integer :: im1 + integer :: i2 + integer :: i2p1 + integer :: i2m1 + integer :: i2p2 + logical :: sing + real(kind=8) :: alb_par + real(kind=8) :: alb_nir + real(kind=8) :: mu + real(kind=4), dimension(ncoh) :: nir_beam_flip + real(kind=4), dimension(ncoh) :: nir_diff_flip + real(kind=8), dimension(ncoh) :: locetai + real(kind=8), dimension(ncoh) :: etai + real(kind=8), dimension(ncoh) :: elai + real(kind=8), dimension(ncoh) :: leaf_weight + real(kind=8), dimension(ncoh) :: wood_weight + real(kind=8), dimension(ncoh) :: beam_backscatter + real(kind=8), dimension(ncoh) :: lambda + real(kind=8), dimension(0:ncoh+1) :: tau_beam ! tau_i(psi) + real(kind=8), dimension(0:ncoh+1) :: tau_diff ! tau_i + real(kind=8), dimension(0:ncoh+1) :: omt_beam ! 1-tau_i(psi) + real(kind=8), dimension(0:ncoh+1) :: omt_diff ! 1-tau_i + real(kind=8), dimension(0:ncoh+1) :: omr_beam ! 1-r_i(psi) + real(kind=8), dimension(0:ncoh+1) :: omr_diff ! 1-r_i + real(kind=8), dimension(0:ncoh+1) :: r_beam ! r_i(psi) + real(kind=8), dimension(0:ncoh+1) :: r_diff ! r_i + real(kind=8), dimension(0:ncoh+1) :: alpha ! alpha_i + real(kind=8), dimension(0:ncoh+1) :: oma ! 1-alpha_i + real(kind=8), dimension( ncoh+1) :: beam_down + real(kind=8), dimension( ncoh+1) :: swd0 + real(kind=8), dimension(0:ncoh ) :: swu0 + real(kind=8), dimension( ncoh+1) :: swd + real(kind=8), dimension(0:ncoh ) :: swu + real(kind=8), dimension(2*ncoh+2) :: swvec + real(kind=8), dimension(2*ncoh+2) :: cvec + real(kind=8), dimension(2*ncoh+2,2*ncoh+2) :: amat + real(kind=8) :: proj_area + real(kind=8) :: ext_diff1 + real(kind=8) :: ext_diff2 + real(kind=8) :: snglscat_alb + !----- External functions. -------------------------------------------------------------! + real(kind=8) , external :: eifun8 + real(kind=4) , external :: sngloff + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Find the size of the solution matrix and array. ! + !---------------------------------------------------------------------------------------! + nsiz = 2*ncoh + 2 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Convert cosine of angle of incidence to double precision. ! + !---------------------------------------------------------------------------------------! + mu = max(cosz_min8,dble(cosaoi4)) + alb_par = dble(grnd_alb_par4) + alb_nir = dble(grnd_alb_nir4) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Convert some leaf variables to double precision, then find some general ! + ! properties of leaves/branches (i.e., properties that do not depend on which band we ! + ! are solving): the extinction coefficient lambda, the layer transmittance ! + ! coefficients tau_beam and tau_diff, and the weight of LAI and WAI relative to the ! + ! total area. ! + !---------------------------------------------------------------------------------------! + do i=1,ncoh + ipft = pft(i) + !----- Area indices, correct LAI by clumping factor. --------------------------------! + elai(i) = clumping_factor(ipft) * lai(i) + etai(i) = elai(i) + wai(i) + !------------------------------------------------------------------------------------! + + + + !----- LOCETAI is the local exposed LAI. --------------------------------------------! + locetai(i) = etai(i) / cai(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! The weighting factors are defined by the relative LAI and WAI areas. ! + !------------------------------------------------------------------------------------! + leaf_weight(i) = elai(i) / etai(i) + wood_weight(i) = 1.d0 - leaf_weight(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! We find the optical depth of the direct beam (lambda), following CLM04 ! + ! (equation 3.3 and text after equation 3.2). ! + !------------------------------------------------------------------------------------! + proj_area = phi1(ipft) + phi2(ipft) * mu + lambda (i) = proj_area / mu + lambda_out(i) = lambda(i) * locetai(i) / (lai(i) + wai(i)) + lambda_tot = lambda_tot + lambda(i) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! The layer transmittance coefficient for direct radiation is defined from ! + ! equation (1) of ZQ05, with the difference that the crown area is taken into ! + ! account. ! + !------------------------------------------------------------------------------------! + tau_beam(i) = (1.d0 - cai(i)) + cai(i) * exp (- lambda(i) * locetai(i)) + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! The layer transmittance coefficient for diffuse radiation is defined in a ! + ! similar way from equation (2) of ZQ05. We must integrate the contribution coming ! + ! from each hemispheric direction. Again, we must consider the finite crown area. ! + ! The integral can be solved analytically for our case, with the help of the ! + ! handy http://www.integrals.com website, of course ;-). ! + !------------------------------------------------------------------------------------! + ext_diff1 = phi1(ipft) * locetai(i) + ext_diff2 = phi2(ipft) * locetai(i) + tau_diff(i) = (1.d0 - cai(i)) & + - cai(i) * exp(- ext_diff1 - ext_diff2) & + * ( ext_diff1 * ext_diff1 * exp(ext_diff1) * eifun8(-ext_diff1) & + + (ext_diff1 - 1.d0) ) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the backscatter for direct beam radiation, following CLM04, equations ! + ! (3.14) and (3.15). The forward scattering was omitted on both equations because ! + ! they are different for PAR and NIR, but in both cases they would cancel out. ! + !------------------------------------------------------------------------------------! + snglscat_alb = 5.d-1 * proj_area / (phi2(ipft) * mu + proj_area) & + * ( 1.d0 - phi1(ipft) * mu / (phi2(ipft) * mu + proj_area) & + * log (1.d0 + (phi2(ipft) * mu + proj_area) & + / (phi1(ipft) * mu))) + beam_backscatter(i) = ( 1.d0 + mu_bar(ipft) * lambda(i) ) * snglscat_alb & + / ( mu_bar(ipft) * lambda(i) ) + !------------------------------------------------------------------------------------! + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Define some boundary conditions for transmission, and the complement of ! + ! transmission. The boundary conditions come from ZQ05, equations 32-37. ! + !---------------------------------------------------------------------------------------! + tau_beam(0) = 0.d0 + tau_beam(ncoh+1) = 1.d0 + tau_diff(0) = 0.d0 + tau_diff(ncoh+1) = 1.d0 + omt_beam(:) = 1.d0 - tau_beam(:) + omt_diff(:) = 1.d0 - tau_diff(:) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Find the average lambda. ! + !---------------------------------------------------------------------------------------! + lambda_tot = lambda_tot / sum(lai(:) + wai(:)) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Initialise the light level variables. ! + !---------------------------------------------------------------------------------------! + light_level (:) = 0.d0 + light_beam_level(:) = 0.d0 + light_diff_level(:) = 0.d0 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Here we loop over the two bands (band 1 is PAR and band 2 is NIR), following the ! + ! algorithm proposed by ZQ05. ! + !---------------------------------------------------------------------------------------! + bandloop: do iband = 1,2 + select case (iband) + case (1) + !---------------------------------------------------------------------------------! + ! Visible (PAR). ! + !---------------------------------------------------------------------------------! + do i=1,ncoh + !----- Alias for PFT of this layer. -------------------------------------------! + ipft = pft(i) + + !----- Absorptance: the fraction that is not scattered. -----------------------! + alpha(i) = 1.d0 - leaf_weight(i) * leaf_scatter_vis(ipft) & + - wood_weight(i) * wood_scatter_vis(ipft) + + !----- Backward scattering of diffuse radiation. ------------------------------! + r_diff(i) = leaf_weight(i) * leaf_backscatter_vis(ipft) & + + wood_weight(i) * wood_backscatter_vis(ipft) + + !----- Backward scattering of direct radiation. -------------------------------! + r_beam(i) = beam_backscatter(i) + + end do + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Find the boundary conditions following ZQ05, equations (32-37). ! + !---------------------------------------------------------------------------------! + alpha (0) = 1.d0 - alb_par + alpha (ncoh+1) = 0.d0 + r_beam(0) = 1.d0 + r_diff(0) = 1.d0 + r_beam(ncoh+1) = 0.d0 + r_diff(ncoh+1) = 0.d0 + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Find the top beam and diffuse radiation. For the direct radiation, we ! + ! follow a notation that is slightly different from ZQ05 notation, in which ! + ! the beam radiation at level i is the amount that reaches the bottom of the ! + ! layer. ! + !---------------------------------------------------------------------------------! + beam_down(ncoh+1) = par_beam_norm + swd0 (ncoh+1) = par_diff_norm + !---------------------------------------------------------------------------------! + + + case (2) + !---------------------------------------------------------------------------------! + ! Near-Infrared (NIR). ! + !---------------------------------------------------------------------------------! + do i=1,ncoh + !----- Alias for PFT of this layer. -------------------------------------------! + ipft = pft(i) + + !----- Absorptance: the fraction that is not scattered. -----------------------! + alpha(i) = 1.d0 - leaf_weight(i) * leaf_scatter_nir(ipft) & + - wood_weight(i) * wood_scatter_nir(ipft) + + !----- Backward scattering of diffuse radiation. ------------------------------! + r_diff(i) = leaf_weight(i) * leaf_backscatter_nir(ipft) & + + wood_weight(i) * wood_backscatter_nir(ipft) + + !----- Backward scattering of direct radiation. -------------------------------! + r_beam(i) = beam_backscatter(i) + + end do + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Find the boundary conditions following ZQ05, equations (32-37). ! + !---------------------------------------------------------------------------------! + alpha (0) = 1.d0 - alb_nir + alpha (ncoh+1) = 0.d0 + r_beam(0) = 1.d0 + r_diff(0) = 1.d0 + r_beam(ncoh+1) = 0.d0 + r_diff(ncoh+1) = 0.d0 + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Find the top beam and diffuse radiation. For the direct radiation, we ! + ! follow a notation that is slightly different from ZQ05 notation, in which ! + ! the beam radiation at level i is the amount that reaches the bottom of the ! + ! layer. ! + !---------------------------------------------------------------------------------! + beam_down(ncoh+1) = nir_beam_norm + swd0 (ncoh+1) = nir_diff_norm + !---------------------------------------------------------------------------------! + end select + + + + !----- Find the complement of the absorptance and scattering. -----------------------! + oma (:) = 1.d0 - alpha (:) + omr_diff(:) = 1.d0 - r_diff(:) + omr_beam(:) = 1.d0 - r_beam(:) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the profile of downward direct radiation using the typical atenuation ! + ! function. We define the beam_down vector in a slightly different way from ZQ05, ! + ! because here we will define S_i as the radiation that reaches the bottom of the ! + ! layer, whereas they defined it as the radiation that reaches the top. ! + !------------------------------------------------------------------------------------! + do i=ncoh,1,-1 + beam_down(i) = beam_down(i+1) * tau_beam(i) + end do + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Fill in the right hand side vector (C) and the matrix (A) described by ! + ! equations (41) and (42) of ZQ05. ! + !------------------------------------------------------------------------------------! + !------ Initialise the vector and the matrix. The matrix is a sparse one... --------! + amat(:,:) = 0.d0 + cvec(:) = 0.d0 + !------ Add the edge values first. --------------------------------------------------! + amat(1,1) = 1.d0 + amat(nsiz,nsiz) = 1.d0 + cvec(1) = oma(0) * beam_down(1) + cvec(nsiz) = swd0(ncoh+1) + do i=1,ncoh + !----- Find auxiliary indices. ---------------------------------------------------! + ip1 = i + 1 + im1 = i - 1 + i2 = 2 * i + i2p1 = i2 + 1 + i2m1 = i2 - 1 + i2p2 = i2 + 2 + !---------------------------------------------------------------------------------! + + !----- Make elements of C vector. ------------------------------------------------! + cvec(i2) = ( 1.d0 & + - r_diff(im1) * oma(im1) * omt_diff(im1) & + * r_diff(i) * oma(i) * omt_diff(i) ) & + * oma(i) * omt_beam(i) * r_beam(i) * beam_down(ip1) + cvec(i2p1) = ( 1.d0 & + - r_diff(i) * oma(i) * omt_diff(i) & + * r_diff(ip1) * oma(ip1) * omt_diff(ip1) ) & + * oma(i) * omt_beam(i) * omr_beam(i) * beam_down(ip1) + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Make elements of the tri-diagonal A array. ! + !---------------------------------------------------------------------------------! + amat(i2 ,i2m1) = - (tau_diff(i) + omt_diff(i) * oma(i) * omr_diff(i)) + amat(i2 ,i2 ) = - r_diff(im1) * oma(im1) * omt_diff(im1) & + * (tau_diff(i) + omt_diff(i) * oma(i) * omr_diff(i) ) + amat(i2 ,i2p1) = 1.d0 - r_diff(im1) * oma(im1) * omt_diff(im1) & + * r_diff(i) * oma(i) * omt_diff(i) + amat(i2p1,i2 ) = 1.d0 - r_diff(i) * oma(i) * omt_diff(i) & + * r_diff(ip1) * oma(ip1) * omt_diff(ip1) + amat(i2p1,i2p1) = - r_diff(ip1) * oma(ip1) * omt_diff(ip1) & + * (tau_diff(i) + omt_diff(i) * oma(i) * omr_diff(i)) + amat(i2p1,i2p2) = - (tau_diff(i) + omt_diff(i) * oma(i) * omr_diff(i)) + end do + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Solve the linear system. In the future we could use a tridiagonal solver, ! + ! which is a lot cheaper than the regular Gauss elimination, but for the time being, ! + ! we go with a tested method. ! + !------------------------------------------------------------------------------------! + call lisys_solver8(nsiz,amat,cvec,swvec,sing) + if (sing) then + call fatal_error('SW radiation failed... The matrix is singular!' & + ,'sw_multiple_scatter','multiple_scatter.f90') + end if + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Copy the solution without considering the multiple scattering to the vectors. ! + !------------------------------------------------------------------------------------! + swu0(0) = swvec(1) + swd0(ncoh+1) = swvec(nsiz) + do i=1,ncoh + + !----- Auxiliary indices. --------------------------------------------------------! + i2 = i * 2 + i2p1 = i * 2 + 1 + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Retrieve the downward and upward diffuse (hemispheric) radiation, using ! + ! equation (40) from ZQ05. ! + !---------------------------------------------------------------------------------! + swd0(i) = swvec(i2) + swu0(i) = swvec(i2p1) + !---------------------------------------------------------------------------------! + + end do + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the diffuse radiation when multiple scattering is considered. This is ! + ! based on equations (24) and (25) of ZQ05, with the difference that we find SWd_i ! + ! instead of SWd_i+1. ! + !------------------------------------------------------------------------------------! + !----- Downward diffuse (hemispheric) radiation. ------------------------------------! + do i=1,ncoh+1 + im1 = i - 1 + ip1 = i + 1 + swd(i) = ( swd0(i) + r_diff(i) * oma(i) * omt_diff(i) * swu0(im1) ) & + / ( 1.d0 - r_diff(im1) * oma(im1) * omt_diff(im1) & + * r_diff(i) * oma(i) * omt_diff(i) ) + end do + !----- Upward diffuse (hemispheric) radiation. --------------------------------------! + do i=0,ncoh + im1 = i - 1 + ip1 = i + 1 + swu(i) = ( swu0(i) + r_diff(i) * oma(i) * omt_diff(i) * swd0(ip1) ) & + / ( 1.d0 - r_diff(i) * oma(i) * omt_diff(i) & + * r_diff(ip1) * oma(ip1) * omt_diff(ip1) ) + end do + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Integrate the light levels. ! + !------------------------------------------------------------------------------------! + do i=1,ncoh + ip1 = i + 1 + light_level (i) = light_level (i) & + + 5.d-1 * (swd(i) + swd(ip1) + beam_down(i) + beam_down(ip1)) + light_beam_level(i) = light_beam_level(i) + 5.d-1 * (beam_down(i) + beam_down(ip1)) + light_diff_level(i) = light_diff_level(i) + 5.d-1 * (swd(i) + swd(ip1)) + end do + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Save the fluxes that we will use outside this sub-routine. ! + !------------------------------------------------------------------------------------! + select case (iband) + case (1) + !---------------------------------------------------------------------------------! + ! Visible (PAR). ! + !---------------------------------------------------------------------------------! + + !------ Integrate the visible light levels. --------------------------------------! + do i=1,ncoh + ip1 = i + 1 + par_diff_level (i) = 5.d-1 * (swd(i) + swd(ip1)) / par_diff_norm + par_beam_level (i) = 5.d-1 * (beam_down(i) + beam_down(ip1)) & + / par_beam_norm + end do + !---------------------------------------------------------------------------------! + + + + !------ Save the fluxes reaching the surface and leaving the top. ----------------! + dw_parlo_beam = sngloff(beam_down (1), tiny_offset) + dw_parlo_diff = sngloff(swd (1), tiny_offset) + uw_parhi_beam = 0.d0 + uw_parhi_diff = sngloff(swu (ncoh), tiny_offset) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Save the radiation fluxes to the output variable. ! + !---------------------------------------------------------------------------------! + do i=1,ncoh + im1 = i - 1 + ip1 = i + 1 + par_beam_flip(i) = sngloff(beam_down(ip1) - beam_down(i) , tiny_offset) + par_diff_flip(i) = sngloff(swd(ip1) - swd(i) + swu(im1) - swu(i), tiny_offset) + end do + !---------------------------------------------------------------------------------! + + case (2) + !---------------------------------------------------------------------------------! + ! Near-Infrared (NIR). ! + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Save the radiation fluxes to the output variable. ! + !---------------------------------------------------------------------------------! + do i=1,ncoh + im1 = i - 1 + ip1 = i + 1 + nir_beam_flip(i) = sngloff(beam_down(ip1) - beam_down(i) , tiny_offset) + nir_diff_flip(i) = sngloff(swd(ip1) - swd(i) + swu(im1) - swu(i), tiny_offset) + end do + !---------------------------------------------------------------------------------! + + + + !------ Save the fluxes reaching the surface and leaving the top. ----------------! + dw_nirlo_beam = sngloff(beam_down (1), tiny_offset) + dw_nirlo_diff = sngloff(swd (1), tiny_offset) + uw_nirhi_beam = 0.d0 + uw_nirhi_diff = sngloff(swu (ncoh), tiny_offset) + !---------------------------------------------------------------------------------! + end select + end do bandloop + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Normalise the light levels. ! + !---------------------------------------------------------------------------------------! + do i=1,ncoh + light_beam_level(i) = light_beam_level(i) / ( par_beam_norm + nir_beam_norm ) + light_diff_level(i) = light_diff_level(i) / ( par_diff_norm + nir_diff_norm ) + end do + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Total normalised radiation. ! + !---------------------------------------------------------------------------------------! + do i=1,ncoh + sw_abs_beam_flip(i) = par_beam_flip(i) + nir_beam_flip(i) + sw_abs_diff_flip(i) = par_diff_flip(i) + nir_diff_flip(i) + end do + !---------------------------------------------------------------------------------------! + + return +end subroutine sw_multiple_scatter +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/dynamics/phenology_aux.f90 b/ED/src/dynamics/phenology_aux.f90 index d693b2e07..8ff37112a 100644 --- a/ED/src/dynamics/phenology_aux.f90 +++ b/ED/src/dynamics/phenology_aux.f90 @@ -182,14 +182,31 @@ subroutine update_turnover(cpoly, isi) , sitetype & ! structure , patchtype ! ! structure use pft_coms , only : is_tropical & ! intent(in) - , sla & ! intent(in) + , phenology & ! intent(in) + , SLA & ! intent(in) + , sla_scale & ! intent(in) + , sla_inter & ! intent(in) + , sla_slope & ! intent(in) , leaf_turnover_rate ! ! intent(in) - use phenology_coms , only : rad_turnover_int & ! intent(in) - , rad_turnover_slope & ! intent(in) - , vm_tran & ! intent(in) - , vm_slop & ! intent(in) - , vm_amp & ! intent(in) - , vm_min ! ! intent(in) + use phenology_coms , only : radint & ! intent(in) + , radslp & ! intent(in) + , turnamp_window & ! intent(out) + , turnamp_wgt & ! intent(out) + , turnamp_min & ! intent(out) + , turnamp_max & ! intent(out) + , radto_min & ! intent(out) + , radto_max & ! intent(out) + , llspan_window & ! intent(out) + , llspan_wgt & ! intent(out) + , llspan_min & ! intent(out) + , llspan_max & ! intent(out) + , llspan_inf & ! intent(out) + , vm0_window & ! intent(out) + , vm0_wgt & ! intent(out) + , vm0_tran & ! intent(out) + , vm0_slope & ! intent(out) + , vm0_amp & ! intent(out) + , vm0_min ! ! intent(out) use consts_coms , only : day_sec ! ! intent(in) implicit none @@ -202,20 +219,13 @@ subroutine update_turnover(cpoly, isi) integer :: ipa integer :: ico integer :: ipft - real :: turnover0 - real :: llspan0 - real :: vm0 - !----- Local constants -----------------------------------------------------------------! - real , parameter :: tfact10 = 0.1 - real , parameter :: tfact60 = 1./60 - real , save :: radcrit - logical , save :: first_time=.true. + real :: turnover_now + real :: turnamp_now + real :: llspan_now + real :: vm0_now !---------------------------------------------------------------------------------------! - if (first_time) then - first_time = .false. - radcrit = - rad_turnover_int / rad_turnover_slope - end if + !----- Loop over patches. --------------------------------------------------------------! csite => cpoly%site(isi) @@ -225,52 +235,81 @@ subroutine update_turnover(cpoly, isi) cohortloop: do ico = 1,cpatch%ncohorts ipft = cpatch%pft(ico) - - !write(unit=*,fmt='(a,1x,es12.5)') 'Rad_avg is =', cpoly%rad_avg - - !----- Update turnover mulitplier. -----------------------------------------------! - if (cpoly%rad_avg(isi) < radcrit) then - turnover0 = 0.01 - else - turnover0 = min(100. & - , max(0.01 & - ,rad_turnover_int+rad_turnover_slope*cpoly%rad_avg(isi))) - end if - - ! write(unit=*,fmt='(a,1x,es12.5)') 'New Turnover is =', turnover0 - - cpatch%turnover_amp(ico) = (1.0 - tfact10) * cpatch%turnover_amp(ico) & - + tfact10 * turnover0 - - !----- Update leaf lifespan. -----------------------------------------------------! - if (leaf_turnover_rate(ipft) > 0.) then - llspan0 = 12.0 / (cpatch%turnover_amp(ico) * leaf_turnover_rate(ipft)) - if (llspan0 < 2.) then - llspan0=2. - elseif (llspan0 > 60.) then - llspan0 = 60. + + + !---------------------------------------------------------------------------------! + ! We must check whether the light phenology is to be applied for this PFT. ! + !---------------------------------------------------------------------------------! + select case (phenology(ipft)) + case (3) + !------------------------------------------------------------------------------! + ! Find the target turnover rate amplitude (turnamp_now). ! + !------------------------------------------------------------------------------! + if (cpoly%rad_avg(isi) <= radto_min) then + turnamp_now = turnamp_min + elseif (cpoly%rad_avg(isi) >= radto_max) then + turnamp_now = turnamp_max + else + turnamp_now = radint + radslp * cpoly%rad_avg(isi) end if - else - llspan0 = 9999. - end if - - ! write(unit=*,fmt='(a,1x,es12.5)') 'llspan0 is =', llspan0 - cpatch%llspan(ico) = (1.0 - tfact60) * cpatch%llspan(ico) + tfact60 * llspan0 - ! write(unit=*,fmt='(a,1x,es12.5)') 'llspan(ico) is =', cpatch%llspan(ico) - - !----- Update vm_bar. ------------------------------------------------------------! - vm0 = vm_amp / (1.0 + (cpatch%llspan(ico)/vm_tran)**vm_slop) + vm_min - cpatch%vm_bar(ico)= (1.0 - tfact60) * cpatch%vm_bar(ico) + tfact60 * vm0 - - !----- Update the specific leaf area (SLA). --------------------------------------! - if (is_tropical(ipft) .and. ipft /= 17) then - cpatch%sla(ico) = 10.0 & - ** ( 1.6923 & - - 0.3305 *log10(12.0 / ( cpatch%turnover_amp(ico) & - * leaf_turnover_rate(ipft)) ) ) - else - cpatch%sla(ico) = sla(ipft) - end if + !------------------------------------------------------------------------------! + + + !------ The actual turnover amplitude is based on a running average. ----------! + cpatch%turnover_amp(ico) = (1.0 - turnamp_wgt) * cpatch%turnover_amp(ico) & + + turnamp_wgt * turnamp_now + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! Update target leaf lifespan. ! + !------------------------------------------------------------------------------! + if (leaf_turnover_rate(ipft) > 0.) then + llspan_now = 12.0 / (cpatch%turnover_amp(ico) * leaf_turnover_rate(ipft)) + !----- Make sure the life span is bounded. ---------------------------------! + if ( llspan_now < llspan_min) then + llspan_now = llspan_min + elseif (llspan_now > llspan_max) then + llspan_now = llspan_max + end if + !---------------------------------------------------------------------------! + else + !---- Nothing lasts forever, so impose a maximum life span. ----------------! + llspan_now = llspan_inf + !---------------------------------------------------------------------------! + end if + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! The actual leaf lifespan is the weighted average. ! + !------------------------------------------------------------------------------! + cpatch%llspan(ico) = (1.0 - llspan_wgt) * cpatch%llspan(ico) & + + llspan_wgt * llspan_now + !------------------------------------------------------------------------------! + + + + !----- Update the running average of the photosythetic capacity (Vm0). --------! + vm0_now = vm0_amp / (1.0 + (cpatch%llspan(ico) / vm0_tran)**vm0_slope) & + + vm0_min + cpatch%vm_bar(ico) = (1.0 - vm0_wgt) * cpatch%vm_bar(ico) + vm0_wgt * vm0_now + !------------------------------------------------------------------------------! + + + + !----- Update the specific leaf area (SLA). -----------------------------------! + turnover_now = cpatch%turnover_amp(ico) * leaf_turnover_rate(ipft) + cpatch%sla(ico) = 10.0 ** ( sla_inter & + + sla_slope * log10( 12.0 / turnover_now ) ) & + * sla_scale + case default + !----- The default is to keep these variables the same. -----------------------! + continue + !------------------------------------------------------------------------------! + end select end do cohortloop end do patchloop @@ -383,11 +422,13 @@ end subroutine first_phenology ! fully flushed leaves. ! !------------------------------------------------------------------------------------------! subroutine pheninit_balive_bstorage(mzg,csite,ipa,ico,ntext_soil,green_leaf_factor) + use ed_misc_coms , only : ivegt_dynamics ! ! intent(in) use ed_state_vars , only : sitetype & ! structure , patchtype ! ! structure use soil_coms , only : soil & ! intent(in), look-up table - , slz ! ! intent(in) - use phenology_coms, only : theta_crit & ! intent(in) + , slz & ! intent(in) + , dslz ! ! intent(in) + use phenology_coms, only : spot_phen & ! intent(in) , elongf_min ! ! intent(in) use pft_coms , only : phenology & ! intent(in) , q & ! intent(in) @@ -411,6 +452,9 @@ subroutine pheninit_balive_bstorage(mzg,csite,ipa,ico,ntext_soil,green_leaf_fact real :: salloci ! bleaf:balive ratio real :: bleaf_max ! maximum bleaf real :: balive_max ! balive if on-allometry + real :: psi_layer ! Water potential of this layer + real :: psi_wilt ! Wilting point potential + real :: psi_crit ! Critical point potential !---------------------------------------------------------------------------------------! @@ -418,34 +462,63 @@ subroutine pheninit_balive_bstorage(mzg,csite,ipa,ico,ntext_soil,green_leaf_fact ipft = cpatch%pft(ico) + !---------------------------------------------------------------------------------------! + ! Here we decide how to compute the mean available water fraction. ! + !---------------------------------------------------------------------------------------! + if (spot_phen) then + !----- Use soil potential to determine phenology. -----------------------------------! + cpatch%paw_avg(ico) = 0.0 + do k=cpatch%krdepth(ico),mzg + nsoil = ntext_soil(k) + + psi_layer = soil(nsoil)%slpots & + / (csite%soil_water(k,ipa) / soil(nsoil)%slmsts) ** soil(nsoil)%slbs + psi_wilt = soil(nsoil)%slpots & + / (soil(nsoil)%soilwp / soil(nsoil)%slmsts) ** soil(nsoil)%slbs + psi_crit = soil(nsoil)%slpots & + / (soil(nsoil)%soilld / soil(nsoil)%slmsts) ** soil(nsoil)%slbs + + cpatch%paw_avg(ico) = cpatch%paw_avg(ico) & + + max(0.0, (psi_layer - psi_wilt)) & + * dslz(k) / (psi_crit - psi_wilt) + end do + cpatch%paw_avg(ico) = - cpatch%paw_avg(ico) / slz(cpatch%krdepth(ico)) + else + !----- Use soil moisture (mass) to determine phenology. -----------------------------! + cpatch%paw_avg(ico) = 0.0 + do k = cpatch%krdepth(ico), mzg + nsoil = ntext_soil(k) + cpatch%paw_avg(ico) = cpatch%paw_avg(ico) & + + max(0.0, (csite%soil_water(k,ipa) - soil(nsoil)%soilwp)) & + * dslz(k) / (soil(nsoil)%soilld - soil(nsoil)%soilwp) + end do + cpatch%paw_avg(ico) = - cpatch%paw_avg(ico) / slz(cpatch%krdepth(ico)) + end if - cpatch%paw_avg(ico) = 0.0 + !---------------------------------------------------------------------------------------! + ! We make the elongation factor 1.0 when we are not solving the vegetation dynamics, ! + ! otherwise we assign the normal values. ! + !---------------------------------------------------------------------------------------! + select case (ivegt_dynamics) + case (0) + cpatch%elongf(ico) = 1.0 - do k = cpatch%krdepth(ico), mzg - 1 - nsoil = ntext_soil(k) - cpatch%paw_avg(ico) = cpatch%paw_avg(ico) & - + max(0.0,(csite%soil_water(k,ipa) - soil(nsoil)%soilwp)) & - * (slz(k+1)-slz(k)) & - / (soil(nsoil)%slmsts - soil(nsoil)%soilwp) - end do - nsoil = ntext_soil(mzg) - cpatch%paw_avg(ico) = cpatch%paw_avg(ico) & - + max(0.0,(csite%soil_water(mzg,ipa) - soil(nsoil)%soilwp)) & - * (-1.0*slz(mzg)) / (soil(nsoil)%slmsts - soil(nsoil)%soilwp) - cpatch%paw_avg(ico) = cpatch%paw_avg(ico)/(-1.0*slz(cpatch%krdepth(ico))) - select case (phenology(ipft)) - case (1) - if (cpatch%paw_avg(ico) < theta_crit) then - cpatch%elongf(ico) = 0.0 - else - cpatch%elongf(ico) = green_leaf_factor(ipft) - end if - case (4) - cpatch%elongf(ico) = max(0.0,min(1.0,cpatch%paw_avg(ico)/theta_crit)) & - * green_leaf_factor(ipft) case default - cpatch%elongf(ico) = green_leaf_factor(ipft) + select case (phenology(ipft)) + case (1) + if (cpatch%paw_avg(ico) < 1.0) then + cpatch%elongf(ico) = 0.0 + else + cpatch%elongf(ico) = 1.0 + end if + case (3,4) + cpatch%elongf(ico) = max(0.0,min(1.0,cpatch%paw_avg(ico))) + case default + cpatch%elongf(ico) = 1.0 + end select + end select + !---------------------------------------------------------------------------------------! !----- Set phenology status according to the elongation factor. ------------------------! if (cpatch%elongf(ico) >= 1.0) then diff --git a/ED/src/dynamics/phenology_driv.f90 b/ED/src/dynamics/phenology_driv.f90 index a43a4ebcb..bd74a7dc0 100644 --- a/ED/src/dynamics/phenology_driv.f90 +++ b/ED/src/dynamics/phenology_driv.f90 @@ -119,11 +119,21 @@ subroutine phenology_driver_eq_0(cgrid, doy, month, tfact) ! deciduous phenology for broadleaf PFTs. ! !------------------------------------------------------------------------------! call update_thermal_sums(month, cpoly, isi, cgrid%lat(ipy)) + call update_phenology_eq_0(doy,cpoly,isi,cgrid%lat(ipy)) + + case (1) + !----- Use prescribed phenology. ----------------------------------------------! + call prescribed_leaf_state(cgrid%lat(ipy), current_time%month & + ,current_time%year, doy & + ,cpoly%green_leaf_factor(:,isi) & + ,cpoly%leaf_aging_factor(:,isi),cpoly%phen_pars(isi)) + call update_phenology_eq_0(doy,cpoly,isi,cgrid%lat(ipy)) case (3) !----- KIM light-controlled predictive phenology scheme. ----------------------! call update_thermal_sums(month, cpoly, isi, cgrid%lat(ipy)) call update_turnover(cpoly,isi) + call update_phenology_eq_0(doy,cpoly,isi,cgrid%lat(ipy)) end select end do end do @@ -155,7 +165,6 @@ subroutine update_phenology(doy, cpoly, isi, lat) , c2n_storage ! ! intent(in) use decomp_coms , only : f_labile ! ! intent(in) use phenology_coms , only : retained_carbon_fraction & ! intent(in) - , theta_crit & ! intent(in) , iphen_scheme & ! intent(in) , elongf_min ! ! intent(in) use consts_coms , only : t3ple & ! intent(in) @@ -261,7 +270,8 @@ subroutine update_phenology(doy, cpoly, isi, lat) ! 2. Cold deciduous - these plants will drop their leaves when cold conditions ! ! happen. ! ! 3. Light phenology - these plants will control their leaf structure with ! - ! the light history (last 10 days); ! + ! the light history (last 10 days). On top of that, they ! + ! are also drought-deciduous, similar to phenology 4; ! ! 4. Drought deciduous - similar to one, but the threshold is compared against ! ! a 10-day running average rather than the instantaneous ! ! value. ! @@ -279,7 +289,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) ! enough water or it is too dry, or if there is some drought relief so leaves ! ! can start to grow again. ! !------------------------------------------------------------------------------! - if (theta(kroot) < theta_crit) then + if (theta(kroot) < 1.0) then !----- It is time to drop leaves. ------------------------------------------! if (cpatch%phenology_status(ico) < 2) then @@ -324,7 +334,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) - cpatch%leaf_drop(ico) end if - elseif(theta(kroot) > theta_crit .and. cpatch%phenology_status(ico) == 2) then + elseif(theta(kroot) > 1.0 .and. cpatch%phenology_status(ico) == 2) then !----- It is time to flush. Change phenology_status will update -----------! !----- carbon pools in growth_balive ---------------------------------! @@ -405,7 +415,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) end if - case (4) + case (3,4) !------------------------------------------------------------------------------! ! Drought deciduous. Here we must check two possibilities: ! ! ! @@ -415,7 +425,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) ! 2. The plant has no leaves, but the soil has started to come back to more ! ! moist conditions. Given this situation, leaves can start growing again. ! !------------------------------------------------------------------------------! - cpatch%elongf(ico) = max(0.0, min (1.0, cpatch%paw_avg(ico)/theta_crit)) + cpatch%elongf(ico) = max(0.0, min (1.0, cpatch%paw_avg(ico))) bl_max = cpatch%elongf(ico) * dbh2bl(cpatch%dbh(ico),ipft) @@ -506,14 +516,14 @@ subroutine update_phenology(doy, cpoly, isi, lat) ipft=cpatch%pft(ico) if (first_time(ipft)) then first_time(ipft) = .false. - write (unit=40+ipft,fmt='(a10,6(1x,a12))') & + write (unit=40+ipft,fmt='(a10,5(1x,a12))') & &' TIME',' PATCH',' COHORT',' NPLANT' & - & ,' LEAF_DROP',' THETA',' THETA_CRIT' + & ,' LEAF_DROP',' THETA' end if write (unit=40+ipft,fmt='(2(i2.2,a1),i4.4,2(1x,i12),4(1x,es12.5))') & current_time%month,'/',current_time%date,'/',current_time%year,ipa,ico & - ,cpatch%nplant(ico),cpatch%leaf_drop(ico),theta(kroot),theta_crit + ,cpatch%nplant(ico),cpatch%leaf_drop(ico),theta(kroot) end if end do cohortloop end do patchloop @@ -527,6 +537,332 @@ end subroutine update_phenology +!==========================================================================================! +!==========================================================================================! +! This subroutine will make a simpler version of the leaf phenology: it will change ! +! bleaf according to cold or drought, but it won't check whether there is enough carbon ! +! to change it, it will simply change it to the target bleaf. ! +!------------------------------------------------------------------------------------------! +subroutine update_phenology_eq_0(doy, cpoly, isi, lat) + + use ed_state_vars , only : polygontype & ! structure + , sitetype & ! structure + , patchtype ! ! structure + use grid_coms , only : nzg ! ! intent(in) + use pft_coms , only : phenology & ! intent(in) + , q & ! intent(in) + , qsw ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use phenology_coms , only : retained_carbon_fraction & ! intent(in) + , iphen_scheme & ! intent(in) + , elongf_min ! ! intent(in) + use ed_therm_lib , only : calc_veg_hcap & ! function + , update_veg_energy_cweh ! ! subroutine + use ed_max_dims , only : n_pft ! ! intent(in) + use ed_misc_coms , only : current_time ! ! intent(in) + use allometry , only : area_indices & ! subroutine + , ed_biomass & ! function + , dbh2bl ! ! function + + implicit none + !----- Arguments -----------------------------------------------------------------------! + type(polygontype) , target :: cpoly + real , intent(in) :: lat + integer , intent(in) :: doy ! Day of year (1=Jan 1, 365/366=Dec 31) + integer , intent(in) :: isi + !----- Local variables -----------------------------------------------------------------! + type(sitetype) , pointer :: csite + type(patchtype) , pointer :: cpatch + integer :: ipa + integer :: ico + integer :: isoil_lev + integer :: kroot + integer :: ipft + logical :: leaf_out_cold + logical :: drop_cold + real, dimension(nzg) :: theta + real :: daylight + real :: delta_bleaf + real :: bleaf_new + real :: old_leaf_hcap + real :: old_wood_hcap + real :: salloci + !----- External functions. -------------------------------------------------------------! + real , external :: daylength + !---------------------------------------------------------------------------------------! + + + !----- Level to evaluate the soil temperature. -----------------------------------------! + isoil_lev = nzg + + !----- Calculate daylength for this gridcell. ------------------------------------------! + daylight = daylength(lat, doy) + + !----- Loop over patches. --------------------------------------------------------------! + csite => cpoly%site(isi) + + patchloop: do ipa = 1,csite%npatches + cpatch => csite%patch(ipa) + + !----- Determine what phenology thresholds have been crossed. -----------------------! + call phenology_thresholds(daylight,csite%soil_tempk(isoil_lev,ipa) & + ,csite%soil_water(:,ipa),cpoly%ntext_soil(:,isi) & + ,csite%sum_chd(ipa),csite%sum_dgd(ipa),drop_cold & + ,leaf_out_cold,theta,cpoly%lsl(isi)) + + cohortloop: do ico = 1,cpatch%ncohorts + ipft = cpatch%pft(ico) + kroot = cpatch%krdepth(ico) + salloci = 1. / (1.0 + qsw(ipft) * cpatch%hite(ico) + q(ipft)) + + !----- Initially, we assume all leaves stay. -------------------------------------! + cpatch%leaf_drop(ico) = 0.0 + + !----- Initially, we assume elongation factor to be 1. ---------------------------! + cpatch%elongf(ico) = 1.0 + + !----- Find cohort-specific thresholds. ------------------------------------------! + select case (iphen_scheme) + case (1) + !----- Get cohort-specific thresholds for prescribed phenology. ---------------! + call assign_prescribed_phen(cpoly%green_leaf_factor(ipft,isi) & + ,cpoly%leaf_aging_factor(ipft,isi),cpatch%dbh(ico) & + ,cpatch%hite(ico),ipft,drop_cold,leaf_out_cold & + ,bleaf_new) + case default + !----- Drop_cold is computed in phenology_thresholds for Botta scheme. --------! + if (drop_cold) bleaf_new = 0.0 + end select + + !---------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------! + ! Here we decide what to do depending on the phenology habit. There are five ! + ! different types: ! + ! 0. Evergreen - neither cold nor drought makes these plants to drop ! + ! their leaves; ! + ! 1. Drought deciduous - these plants will drop all leaves when drought ! + ! conditions happen. By drought conditions we mean a time ! + ! when the available water drops below a threshold; ! + ! 2. Cold deciduous - these plants will drop their leaves when cold conditions ! + ! happen. ! + ! 3. Light phenology - these plants will control their leaf structure with ! + ! the light history (last 10 days). On top of that, they ! + ! are also drought-deciduous, similar to phenology 4; ! + ! 4. Drought deciduous - similar to one, but the threshold is compared against ! + ! a 10-day running average rather than the instantaneous ! + ! value. ! + !---------------------------------------------------------------------------------! + select case (phenology(ipft)) + case (0) + !------------------------------------------------------------------------------! + ! Evergreen, there is nothing to be done here, move on. ! + !------------------------------------------------------------------------------! + continue + + case (1) + !------------------------------------------------------------------------------! + ! Drought deciduous. Now we must check whether the plants still have ! + ! enough water or it is too dry, or if there is some drought relief so leaves ! + ! can start to grow again. ! + !------------------------------------------------------------------------------! + if (theta(kroot) < 1.0) then + + !----- It is time to drop leaves. ------------------------------------------! + if (cpatch%phenology_status(ico) < 2) then + !----- Find the leaf drop. ----------------------------------------------! + cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) & + * cpatch%lai(ico) / cpatch%sla(ico) & + / cpatch%nplant(ico) + + !----- Update plant carbon pools. ---------------------------------------! + cpatch%balive(ico) = cpatch%balive(ico) - cpatch%bleaf(ico) + cpatch%bleaf(ico) = 0.0 + cpatch%phenology_status(ico) = 2 + cpatch%elongf(ico) = 0. + cpatch%cb(13,ico) = cpatch%cb(13,ico) & + - cpatch%leaf_drop(ico) + cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) & + - cpatch%leaf_drop(ico) + end if + + elseif(theta(kroot) > 1.0 .and. cpatch%phenology_status(ico) == 2) then + + !---------------------------------------------------------------------------! + ! It is time to flush. Change phenology_status here, and make all ! + ! leaves appear all of a sudden. ! + !---------------------------------------------------------------------------! + cpatch%phenology_status(ico) = 1 + cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),ipft) + cpatch%balive(ico) = cpatch%balive(ico) + cpatch%bleaf(ico) + cpatch%elongf(ico) = 1.0 + end if ! critical moisture + + case (2) + !------------------------------------------------------------------------------! + ! Cold deciduous. Here we must check two possibilities: ! + ! ! + ! 1. It is cold, and the plants have leaves, so we flag them with ! + ! phenology_status=0 (leaves not growing) and the plants will start losing ! + ! their leaves; ! + ! 2. The plant has no leaves, but the temperature and light conditions are ! + ! okay again, and leaves can start growing. ! + !------------------------------------------------------------------------------! + if (cpatch%phenology_status(ico) < 2 .and. drop_cold) then + + if (cpoly%green_leaf_factor(ipft,isi) < elongf_min) then + bleaf_new = 0.0 + else + bleaf_new = cpoly%green_leaf_factor(ipft,isi) & + * dbh2bl(cpatch%dbh(ico),ipft) + end if + + delta_bleaf = cpatch%bleaf(ico) - bleaf_new + + if (delta_bleaf > 0.0) then + !------------------------------------------------------------------------! + ! Phenology_status = 0 means that the plant has leaves, but they are ! + ! not growing (not necessarily because the leaves are fully flushed). ! + !------------------------------------------------------------------------! + cpatch%phenology_status(ico) = -1 + cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) * delta_bleaf + !------------------------------------------------------------------------! + + + + !----- Adjust plant carbon pools. ---------------------------------------! + cpatch%balive(ico) = cpatch%balive(ico) - delta_bleaf + !------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------! + ! Contribution due to the fact that c2n_leaf and c2n_storage may be ! + ! different. ! + !------------------------------------------------------------------------! + cpatch%bleaf(ico) = bleaf_new + cpatch%cb(13,ico) = cpatch%cb(13,ico) - cpatch%leaf_drop(ico) + cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) - cpatch%leaf_drop(ico) + !------------------------------------------------------------------------! + end if + + !----- Set status flag. ----------------------------------------------------! + if (bleaf_new == 0.0) then + cpatch%phenology_status(ico) = 2 + end if + !---------------------------------------------------------------------------! + + + elseif (cpatch%phenology_status(ico) == 2 .and. leaf_out_cold) then + !---------------------------------------------------------------------------! + ! Update the phenology status (1 means that leaves are growing), ! + !---------------------------------------------------------------------------! + cpatch%phenology_status(ico) = 1 + cpatch%bleaf(ico) = cpoly%green_leaf_factor(ipft,isi) & + * dbh2bl(cpatch%dbh(ico),ipft) + cpatch%balive(ico) = cpatch%balive(ico) + cpatch%bleaf(ico) + !---------------------------------------------------------------------------! + end if + + + case (3,4) + !------------------------------------------------------------------------------! + ! Drought deciduous. Here we must check two possibilities: ! + ! ! + ! 1. The soil has been dry recently, and the plants have leaves, so we flag ! + ! them with phenology_status=0 (leaves not growing) and the plants will ! + ! start losing their leaves; ! + ! 2. The plant has no leaves, but the soil has started to come back to more ! + ! moist conditions. Given this situation, leaves can start growing again. ! + !------------------------------------------------------------------------------! + cpatch%elongf(ico) = max(0.0, min (1.0, cpatch%paw_avg(ico))) + + !------------------------------------------------------------------------------! + ! In case it is too dry, drop all the leaves, otherwise scale the leaf ! + ! biomass with elongation factor. ! + !------------------------------------------------------------------------------! + if (cpatch%elongf(ico) < elongf_min) then + bleaf_new = 0.0 + else + bleaf_new = cpatch%elongf(ico) * dbh2bl(cpatch%dbh(ico),ipft) + end if + + delta_bleaf = cpatch%bleaf(ico) - bleaf_new + + if (delta_bleaf > 0.0 .and. cpatch%phenology_status(ico) < 2) then + cpatch%phenology_status(ico) = -1 + cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) * delta_bleaf + + !----- Adjust plant carbon pools. ------------------------------------------! + cpatch%balive(ico) = cpatch%balive(ico) - delta_bleaf + + !---------------------------------------------------------------------------! + ! Contribution due to the fact that c2n_leaf and c2n_storage may be ! + ! different. ! + !---------------------------------------------------------------------------! + cpatch%bleaf(ico) = bleaf_new + + if (cpatch%bleaf(ico) == 0.0) then + !----- No leaves. -------------------------------------------------------! + cpatch%phenology_status(ico) = 2 + cpatch%elongf(ico) = 0. + end if + + cpatch%cb(13,ico) = cpatch%cb(13,ico) - cpatch%leaf_drop(ico) + cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) - cpatch%leaf_drop(ico) + !------ Becoming slightly moister again, start flushing the leaves. -----------! + + elseif (cpatch%elongf(ico) > elongf_min .and. & + cpatch%phenology_status(ico) /= 0 ) then + !----- Not in allometry but growing, allocate carbon in growth_balive. -----! + if (cpatch%elongf(ico) == 1.0) then + cpatch%phenology_status(ico) = 0 + else + cpatch%phenology_status(ico) = 1 + end if + cpatch%bleaf(ico) = bleaf_new + cpatch%balive(ico) = cpatch%balive(ico) - delta_bleaf + end if + + + end select + !---------------------------------------------------------------------------------! + + !----- Update LAI, WPA, and WAI accordingly. -------------------------------------! + call area_indices(cpatch%nplant(ico),cpatch%bleaf(ico),cpatch%bdead(ico) & + ,cpatch%balive(ico),cpatch%dbh(ico),cpatch%hite(ico) & + ,cpatch%pft(ico),cpatch%sla(ico),cpatch%lai(ico) & + ,cpatch%wpa(ico),cpatch%wai(ico),cpatch%crown_area(ico) & + ,cpatch%bsapwood(ico)) + + !----- Update above-ground biomass. ----------------------------------------------! + cpatch%agb(ico) = ed_biomass(cpatch%bdead(ico),cpatch%balive(ico) & + ,cpatch%bleaf(ico),cpatch%pft(ico) & + ,cpatch%hite(ico) ,cpatch%bstorage(ico) & + ,cpatch%bsapwood(ico)) + + !---------------------------------------------------------------------------------! + ! The leaf biomass of the cohort has changed, update the vegetation energy - ! + ! using a constant temperature assumption. ! + !---------------------------------------------------------------------------------! + old_leaf_hcap = cpatch%leaf_hcap(ico) + old_wood_hcap = cpatch%wood_hcap(ico) + call calc_veg_hcap(cpatch%bleaf(ico),cpatch%bdead(ico),cpatch%bsapwood(ico) & + ,cpatch%nplant(ico),cpatch%pft(ico) & + ,cpatch%leaf_hcap(ico),cpatch%wood_hcap(ico) ) + call update_veg_energy_cweh(csite,ipa,ico,old_leaf_hcap,old_wood_hcap) + call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + end do cohortloop + end do patchloop + return +end subroutine update_phenology_eq_0 +!==========================================================================================! +!==========================================================================================! + + + + + + !==========================================================================================! !==========================================================================================! ! This subroutine establishes whether itīs time to drop leaves or start flushing them ! @@ -538,6 +874,7 @@ subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd ,drop_cold,leaf_out_cold,theta,lsl) use grid_coms , only : nzg ! ! intent(in) use soil_coms , only : soil & ! intent(in) + , dslz & ! intent(in) , slz ! ! intent(in) use phenology_coms, only : dl_tr & ! intent(in) , st_tr1 & ! intent(in) @@ -600,14 +937,12 @@ subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd theta(1:nzg) = 0.0 topsoil = soil_class(nzg) do k1 = lsl, nzg - do k2 = k1,nzg-1 + do k2 = k1,nzg nsoil = soil_class(k2) theta(k1) = theta(k1) & - + (soil_water(k2) - soil(nsoil)%soilwp) * (slz(k2+1)-slz(k2)) & - / (soil(nsoil)%slmsts - soil(nsoil)%soilwp) + + (soil_water(k2) - soil(nsoil)%soilwp) * dslz(k2) & + / (soil(nsoil)%soilld - soil(nsoil)%soilwp) end do - theta(k1) = theta(k1) - (soil_water(nzg) - soil(topsoil)%soilwp) * slz(nzg) & - / (soil(topsoil)%slmsts - soil(topsoil)%soilwp) theta(k1) = - theta(k1) / slz(k1) end do diff --git a/ED/src/dynamics/photosyn_driv.f90 b/ED/src/dynamics/photosyn_driv.f90 index 15e94f6b3..bb99692a7 100644 --- a/ED/src/dynamics/photosyn_driv.f90 +++ b/ED/src/dynamics/photosyn_driv.f90 @@ -5,27 +5,32 @@ !------------------------------------------------------------------------------------------! subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil & ,leaf_aging_factor,green_leaf_factor) - use ed_state_vars , only : sitetype & ! structure - , patchtype ! ! structure - use ed_max_dims , only : n_pft ! ! intent(in) - use pft_coms , only : leaf_width & ! intent(in) - , water_conductance & ! intent(in) - , include_pft ! ! intent(in) - use soil_coms , only : soil & ! intent(in) - , slz & ! intent(in) - , dslz & ! intent(in) - , freezecoef ! ! intent(in) - use consts_coms , only : t00 & ! intent(in) - , epi & ! intent(in) - , wdnsi & ! intent(in) - , wdns & ! intent(in) - , kgCday_2_umols & ! intent(in) - , lnexp_min ! ! intent(in) - use ed_misc_coms , only : current_time ! ! intent(in) - use met_driver_coms, only : met_driv_state ! ! structure - use physiology_coms, only : print_photo_debug & ! intent(in) - , h2o_plant_lim ! ! intent(in) - use farq_leuning , only : lphysiol_full ! ! sub-routine + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use ed_max_dims , only : n_pft ! ! intent(in) + use pft_coms , only : leaf_width & ! intent(in) + , water_conductance & ! intent(in) + , include_pft & ! intent(in) + , vm0 & ! intent(in) + , leaf_turnover_rate ! ! intent(in) + use soil_coms , only : soil & ! intent(in) + , slz & ! intent(in) + , slzt & ! intent(in) + , dslz ! ! intent(in) + use consts_coms , only : t00 & ! intent(in) + , epi & ! intent(in) + , wdnsi & ! intent(in) + , wdns & ! intent(in) + , kgCday_2_umols & ! intent(in) + , lnexp_min & ! intent(in) + , tiny_num ! ! intent(in) + use ed_misc_coms , only : current_time ! ! intent(in) + use met_driver_coms, only : met_driv_state ! ! structure + use physiology_coms, only : print_photo_debug & ! intent(in) + , h2o_plant_lim ! ! intent(in) + use phenology_coms , only : llspan_inf ! ! intent(in) + use farq_leuning , only : lphysiol_full ! ! sub-routine + use allometry , only : h2crownbh ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(sitetype) , target :: csite ! Current site @@ -41,17 +46,14 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil integer :: ico ! Current cohort # integer :: tuco ! Tallest used cohort integer :: ipft - integer :: k1 - integer :: k2 + integer :: tpft + integer :: k integer :: kroot integer :: nsoil integer :: limit_flag logical, dimension(mzg+1) :: root_depth_indices ! logical :: las - real , dimension(mzg+1) :: avg_frozen_water - real , dimension(mzg+1) :: avg_liquid_water - real , dimension(mzg+1) :: available_liquid_water - real , dimension(mzg+1) :: wilting_factor + real , dimension(:) , allocatable :: avail_h2o_coh real :: leaf_par real :: leaf_resp real :: d_gsw_open @@ -62,23 +64,36 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil real :: d_lsfc_co2_closed real :: d_lint_co2_open real :: d_lint_co2_closed - real :: slpotv real :: swp real :: vm + real :: mcheight real :: compp real :: broot_tot real :: broot_loc real :: wgpfrac - real :: avg_fracliq - real :: psi_wilting - real :: psi_layer - real :: freezecor + real :: water_demand + real :: psiplusz + real :: avail_h2o_lyr + real :: wilting_factor real :: pss_available_water + real :: vm0_tuco + real :: llspan_tuco + integer, dimension(n_pft) :: tuco_pft !---------------------------------------------------------------------------------------! !----- Point to the cohort structures --------------------------------------------------! cpatch => csite%patch(ipa) + !---------------------------------------------------------------------------------------! + + + + !----- Allocate the available water function for plants. -------------------------------! + if (cpatch%ncohorts > 0) then + allocate (avail_h2o_coh(cpatch%ncohorts)) + end if + !---------------------------------------------------------------------------------------! + !----- Find the patch-level Total Leaf and Wood Area Index. ----------------------------! csite%lai(ipa) = 0.0 @@ -89,65 +104,110 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil csite%wpa(ipa) = csite%wpa(ipa) + cpatch%wpa(ico) csite%wai(ipa) = csite%wai(ipa) + cpatch%wai(ico) end do - - - !----- Calculate liquid water available for transpiration. -----------------------------! - available_liquid_water(mzg+1) = 0. - do k1 = mzg, lsl, -1 - nsoil = ntext_soil(k1) - available_liquid_water(k1) = available_liquid_water(k1+1) & - + wdns * dslz(k1) * csite%soil_fracliq(k1,ipa) & - * max(0.0, csite%soil_water(k1,ipa) - soil(nsoil)%soilwp ) - end do !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! If we are solving H2O_PLANT_LIM = 2, then we must account for the water potential ! - ! as in CLM. ! + ! Calculate liquid water available for transpiration. The way this is done ! + ! depends on how the water limitation is to be solved. ! !---------------------------------------------------------------------------------------! select case (h2o_plant_lim) - case (2) - - !----- Find the average liquid and frozen water. ------------------------------------! - avg_liquid_water(:) = 0.0 - avg_frozen_water(:) = 0.0 - do k1=mzg,lsl,-1 - avg_frozen_water(k1) = avg_frozen_water(k1+1) & - + dslz(k1) * (1. - csite%soil_fracliq(k1,ipa)) & - * csite%soil_water(k1,ipa) - avg_liquid_water(k1) = avg_liquid_water(k1+1) & - + dslz(k1) * csite%soil_fracliq(k1,ipa) & - * csite%soil_water(k1,ipa) - end do - avg_frozen_water(lsl:mzg) = avg_frozen_water(lsl:mzg) / (- slz(lsl:mzg)) - avg_liquid_water(lsl:mzg) = avg_liquid_water(lsl:mzg) / (- slz(lsl:mzg)) + case (0,1) + !------------------------------------------------------------------------------------! + ! Available water is defined as the soil moisture (mass) above wilting point, ! + ! scaled by liquid water fraction. ! !------------------------------------------------------------------------------------! + do ico = 1, cpatch%ncohorts + !---- Aliases for rooting depth and PFT. -----------------------------------------! + kroot = cpatch%krdepth(ico) + ipft = cpatch%pft(ico) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Find the available water for each layer. ! + !---------------------------------------------------------------------------------! + avail_h2o_coh(ico) = 0. + do k=mzg,kroot,-1 + !----- Alias for soil type. ---------------------------------------------------! + nsoil = ntext_soil(k) + !------------------------------------------------------------------------------! + + + + !----- Find the available water factor for this layer. ------------------------! + avail_h2o_lyr = max(0.0, (csite%soil_water(k,ipa) - soil(nsoil)%soilwp)) & + * csite%soil_fracliq(k,ipa) * wdns * dslz(k) + !------------------------------------------------------------------------------! + + !----- Add the factor from this layer to the integral. ------------------------! + avail_h2o_coh(ico) = avail_h2o_coh(ico) + avail_h2o_lyr + !------------------------------------------------------------------------------! + end do + end do + !------------------------------------------------------------------------------------! + case (2) !------------------------------------------------------------------------------------! - ! Compute the soil potential for transpiration for each layer as in CLM. ! + ! The available water factor is the soil moisture at field capacity minus wilt- ! + ! ing point, scaled by the wilting factor, defined as a function of soil potential ! + ! and height between roots and mid-crown. ! !------------------------------------------------------------------------------------! - wilting_factor(:) = 0.0 - do k1=lsl,mzg - nsoil = ntext_soil(k1) - if (avg_liquid_water(k1) > soil(nsoil)%soilwp) then + do ico = 1,cpatch%ncohorts + !---- Aliases for rooting depth and PFT. -----------------------------------------! + kroot = cpatch%krdepth(ico) + ipft = cpatch%pft(ico) + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Find the mean height of the crown (to represent the distance between ! + ! the ground and the leaves. ! + !---------------------------------------------------------------------------------! + mcheight = 0.5 * (cpatch%hite(ico) + h2crownbh(cpatch%hite(ico),ipft)) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Find the available water for each layer. ! + !---------------------------------------------------------------------------------! + avail_h2o_coh(ico) = 0. + do k = mzg, kroot, -1 + !----- Alias for soil type. ---------------------------------------------------! + nsoil = ntext_soil(k) + !------------------------------------------------------------------------------! + + !----- Find the average soil wetness. -----------------------------------------! - wgpfrac = avg_liquid_water(k1) / soil(nsoil)%slmsts - avg_fracliq = avg_liquid_water(k1) & - / (avg_liquid_water(k1) + avg_frozen_water(k1)) - - !----- Apply correction in case the soil is partially frozen. -----------------! - freezecor = 10. ** max(lnexp_min,- freezecoef * (1.0 - avg_fracliq)) - psi_wilting = soil(nsoil)%slpots & - / (soil(nsoil)%soilwp / soil(nsoil)%slmsts) ** soil(nsoil)%slbs - psi_layer = soil(nsoil)%slpots / wgpfrac ** soil(nsoil)%slbs - - !----- Find the wilting factor which will control the dry soil correction. ----! - wilting_factor(k1) = max( 0., min(1., (psi_wilting - psi_layer ) & - / (psi_wilting - soil(nsoil)%slpots) ) ) - end if + wgpfrac = csite%soil_water(k,ipa) / soil(nsoil)%slmsts + !------------------------------------------------------------------------------! + + + !----- Find the potential for this layer. -------------------------------------! + psiplusz = slzt(k) - mcheight & + + soil(nsoil)%slpots / wgpfrac ** soil(nsoil)%slbs + !------------------------------------------------------------------------------! + + + !----- Find the available water factor for this layer. ------------------------! + wilting_factor = (psiplusz - soil(nsoil)%slpotwp) & + / (soil(nsoil)%slpotfc - soil(nsoil)%slpotwp) + avail_h2o_lyr = min( 1.0, max( 0.0, wilting_factor ) ) & + * csite%soil_fracliq(k,ipa) & + * ( soil(nsoil)%sfldcap - soil(nsoil)%soilwp ) & + * wdns * dslz(k) + !------------------------------------------------------------------------------! + + + + !----- Add the factor from this layer to the integral. ------------------------! + avail_h2o_coh(ico) = avail_h2o_coh(ico) + avail_h2o_lyr + !------------------------------------------------------------------------------! + end do + !---------------------------------------------------------------------------------! end do !------------------------------------------------------------------------------------! end select @@ -155,29 +215,45 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil - !---------------------------------------------------------------------------------------! ! Initialize the array of maximum photosynthesis rates used in the mortality ! ! function. ! !---------------------------------------------------------------------------------------! csite%A_o_max(1:n_pft,ipa) = 0.0 csite%A_c_max(1:n_pft,ipa) = 0.0 + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! - ! Find the tallest cohort with TAI above minimum, sufficient heat capacity, and not ! - ! buried in snow. The first two conditions are redundant, but we will keep them for ! - ! the time being, so it is going to be safer. ! + ! Find the tallest cohort amongst all cohorts in this patch that is resolved ! + ! (tuco). In addition, we must find the tallest cohort for each PFT, so in case the ! + ! we are using the light phenology, we use that value for Vm0 and leaf life span. ! !---------------------------------------------------------------------------------------! - las = .false. + las = .false. + tuco_pft(:) = 0 do ico = 1,cpatch%ncohorts + ipft = cpatch%pft(ico) + !----- If this is the tallest cohort to be used, we save its index. -----------------! if (.not. las .and. cpatch%leaf_resolvable(ico)) then las = .true. tuco = ico end if - end do + !------------------------------------------------------------------------------------! + + + !----- If this is the tallest cohort for this specific PFT, we save the index too. --! + if (tuco_pft(ipft) == 0 .and. cpatch%leaf_resolvable(ico)) then + tuco_pft(ipft) = ico + end if + !------------------------------------------------------------------------------------! + end do !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! There is at least one cohort that meet requirements. And this is tallest one, so ! ! we can use it to compute the maximum photosynthetic rates, i.e., the rate the cohort ! @@ -187,12 +263,44 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil if (las) then !----- We now loop over PFTs, not cohorts, skipping those we are not using. ---------! do ipft = 1, n_pft + if (include_pft(ipft)) then + !------------------------------------------------------------------------------! + ! Find the tallest cohort for this PFT. In case the patch no longer has ! + ! the PFT, then we just the default Vm0 and leaf life span. This only matters ! + ! for light-controlled phenology, not the standard cases. ! + !------------------------------------------------------------------------------! + tpft = tuco_pft(ipft) + if (tpft == 0) then + !---------------------------------------------------------------------------! + ! This patch doesn't have any cohort of this PFT left, use default ! + ! values. ! + !---------------------------------------------------------------------------! + vm0_tuco = Vm0(ipft) + if (leaf_turnover_rate(ipft) == 0.) then + llspan_tuco = llspan_inf + else + llspan_tuco = 12. / leaf_turnover_rate(ipft) + end if + else + !---------------------------------------------------------------------------! + ! Use Vm0 and leaf life span of the tallest cohort of this PFT, so we ! + ! avoid punishing or helping the plants too much in case the PFTs don't ! + ! match. ! + !---------------------------------------------------------------------------! + vm0_tuco = cpatch%vm_bar(tpft) + llspan_tuco = cpatch%llspan(tpft) + end if + !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! ! Scale photosynthetically active radiation per unit of leaf. ! !------------------------------------------------------------------------------! leaf_par = csite%par_l_max(ipa) / cpatch%lai(tuco) + !------------------------------------------------------------------------------! !------------------------------------------------------------------------------! ! Call the photosynthesis for maximum photosynthetic rates. The units ! @@ -212,8 +320,8 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil , cpatch%lint_shv(tuco) & ! Leaf intercellular spec. hum. [ kg/kg] , green_leaf_factor(ipft) & ! Greenness rel. to on-allometry [ ---] , leaf_aging_factor(ipft) & ! Ageing parameter to scale VM [ ---] - , cpatch%llspan(tuco) & ! Leaf life span [ yr] - , cpatch%vm_bar(tuco) & ! Average Vm function [ĩmol/mē/s] + , llspan_tuco & ! Leaf life span [ yr] + , vm0_tuco & ! Average Vm function [ĩmol/mē/s] , cpatch%leaf_gbw(tuco) & ! Aerodyn. condct. of water vapour [ kg/mē/s] , csite%A_o_max(ipft,ipa) & ! Photosynthesis rate (open) [ĩmol/mē/s] , csite%A_c_max(ipft,ipa) & ! Photosynthesis rate (closed) [ĩmol/mē/s] @@ -264,13 +372,15 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil !------------------------------------------------------------------------------------! if (cpatch%leaf_resolvable(ico)) then - !----- Alias for PFT ----------------------------------------------------------! - ipft = cpatch%pft(ico) + !----- Alias for PFT and root layer. ------------------------------------------! + ipft = cpatch%pft(ico) + kroot = cpatch%krdepth(ico) !------------------------------------------------------------------------------! ! Scale photosynthetically active radiation per unit of leaf. ! !------------------------------------------------------------------------------! leaf_par = cpatch%par_l(ico) / cpatch%lai(ico) + !------------------------------------------------------------------------------! !------------------------------------------------------------------------------! @@ -322,14 +432,13 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil broot_loc = cpatch%broot(ico) * cpatch%nplant(ico) !----- Supply of water. -------------------------------------------------------! - cpatch%water_supply(ico) = water_conductance(ipft) & - * available_liquid_water(cpatch%krdepth(ico)) & - * broot_loc + cpatch%water_supply(ico) = water_conductance(ipft) * broot_loc & + * avail_h2o_coh(ico) - root_depth_indices(cpatch%krdepth(ico)) = .true. - broot_tot = broot_tot + broot_loc - pss_available_water = pss_available_water & - + available_liquid_water(cpatch%krdepth(ico)) * broot_loc + root_depth_indices(kroot) = .true. + broot_tot = broot_tot + broot_loc + pss_available_water = pss_available_water & + + avail_h2o_coh(ico) * broot_loc !------------------------------------------------------------------------------! ! Determine the fraction of open stomata due to water limitation. ! @@ -342,20 +451,13 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil !---- No water limitation, fsw is always 1.0. ------------------------------! cpatch%fsw(ico) = 1.0 - case (1) - !---- Original ED-1.0 scheme. ----------------------------------------------! - cpatch%fsw(ico) = cpatch%water_supply(ico) & - / max( 1.0e-20 & - , cpatch%water_supply(ico) + cpatch%psi_open(ico)) - case (2) - !---------------------------------------------------------------------------! - ! Somewhat based on CLM, but we reduce the total amount of available ! - ! water by the fraction of root biomass belonging to this cohort. We don't ! - ! have the root profile up to now, assume they are evenly distributed ! - ! through all layers that have roots. ! - !---------------------------------------------------------------------------! - cpatch%fsw(ico) = wilting_factor(cpatch%krdepth(ico)) - + case (1,2) + water_demand = cpatch%psi_open(ico) + if (cpatch%water_supply (ico) < tiny_num) then + cpatch%fsw(ico) = 0.0 + else + cpatch%fsw(ico) = 1.0 / (1.0 + water_demand / cpatch%water_supply(ico)) + end if end select !------------------------------------------------------------------------------! @@ -440,16 +542,29 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil call print_photo_details(cmet,csite,ipa,ico,limit_flag,vm,compp) end if end do cohortloop + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! - ! Add the contribution of this time step to the average available water. ! + ! Add the contribution of this time step to the average available water. This is ! + ! done only if there is some cohort transpiring. ! !---------------------------------------------------------------------------------------! if (broot_tot > 1.e-20) then csite%avg_available_water(ipa) = csite%avg_available_water(ipa) & + pss_available_water / broot_tot - !else - ! Add nothing, the contribution of this time is zero since no cohort can transpire... end if + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! De-allocate the temporary vector. ! + !---------------------------------------------------------------------------------------! + if (cpatch%ncohorts > 0) then + deallocate(avail_h2o_coh) + end if + !---------------------------------------------------------------------------------------! return end subroutine canopy_photosynthesis @@ -500,12 +615,14 @@ subroutine print_photo_details(cmet,csite,ipa,ico,limit_flag,vm,compp) real :: leaf_resp real :: stom_condct real :: par_area + real :: nir_area real :: parv + real :: nirv real :: util_parv real :: alpha !----- Local constants. ----------------------------------------------------------------! - character(len=10), parameter :: hfmt='(58(a,1x))' - character(len=48), parameter :: bfmt='(3(i13,1x),1(es13.6,1x),2(i13,1x),52(es13.6,1x))' + character(len=10), parameter :: hfmt='(60(a,1x))' + character(len=48), parameter :: bfmt='(3(i13,1x),1(es13.6,1x),2(i13,1x),54(es13.6,1x))' !----- Locally saved variables. --------------------------------------------------------! logical , save :: first_time=.true. !---------------------------------------------------------------------------------------! @@ -521,7 +638,8 @@ subroutine print_photo_details(cmet,csite,ipa,ico,limit_flag,vm,compp) if (cpatch%leaf_resolvable(ico)) then par_area = cpatch%par_l(ico) * Watts_2_Ein * mol_2_umol parv = par_area / cpatch%lai(ico) - + nir_area = (cpatch%rshort_l(ico) - cpatch%par_l(ico)) * Watts_2_Ein * mol_2_umol + nirv = nir_area / cpatch%lai(ico) !------------------------------------------------------------------------------------! ! Is alpha (quantum efficiency) temperature dependent? If so, calculate after ! @@ -596,14 +714,15 @@ subroutine print_photo_details(cmet,csite,ipa,ico,limit_flag,vm,compp) , ' ATM_CO2', ' CAN_CO2', 'LSFC_CO2_OPEN' & , 'LSFC_CO2_CLOS', 'LINT_CO2_OPEN', 'LINT_CO2_CLOS' & , ' COMPP', ' PAR_AREA', ' PARV' & - , ' UTIL_PARV', ' GPP', ' LEAF_RESP' & - , ' LEAF_GBH', ' LEAF_GBW', ' WOOD_GBH' & - , ' WOOD_GBW', ' STOM_CONDCT', ' A_OPEN' & - , ' A_CLOS', ' GSW_OPEN', ' GSW_CLOS' & - , ' PSI_OPEN', ' PSI_CLOS', ' H2O_SUPPLY' & - , ' FSW', ' FSN', ' FS_OPEN' & - , ' ATM_WIND', ' VEG_WIND', ' USTAR' & - , ' VM' + , ' UTIL_PARV', ' NIR_AREA', ' NIRV' & + , ' GPP', ' LEAF_RESP', ' LEAF_GBH' & + , ' LEAF_GBW', ' WOOD_GBH', ' WOOD_GBW' & + , ' STOM_CONDCT', ' A_OPEN', ' A_CLOS' & + , ' GSW_OPEN', ' GSW_CLOS', ' PSI_OPEN' & + , ' PSI_CLOS', ' H2O_SUPPLY', ' FSW' & + , ' FSN', ' FS_OPEN', ' ATM_WIND' & + , ' VEG_WIND', ' USTAR', ' VM' + close (unit=57,status='keep') end if @@ -628,15 +747,14 @@ subroutine print_photo_details(cmet,csite,ipa,ico,limit_flag,vm,compp) , cmet%atm_co2 , csite%can_co2(ipa) , cpatch%lsfc_co2_open(ico) & , cpatch%lsfc_co2_closed(ico), cpatch%lint_co2_open(ico) , cpatch%lint_co2_closed(ico) & , compp , par_area , parv & - , util_parv , cpatch%gpp(ico) , leaf_resp & - , cpatch%leaf_gbh(ico) , cpatch%leaf_gbw(ico) , cpatch%wood_gbh(ico) & - , cpatch%wood_gbw(ico) , stom_condct , cpatch%A_open(ico) & - , cpatch%A_closed(ico) , cpatch%gsw_open(ico) , cpatch%gsw_closed(ico) & - , cpatch%psi_open(ico) , cpatch%psi_closed(ico) , cpatch%water_supply(ico) & - , cpatch%fsw(ico) , cpatch%fsn(ico) , cpatch%fs_open(ico) & - , cmet%vels , cpatch%veg_wind(ico) , csite%ustar(ipa) & - , vm - + , util_parv , nir_area , nirv & + , cpatch%gpp(ico) , leaf_resp , cpatch%leaf_gbh(ico) & + , cpatch%leaf_gbw(ico) , cpatch%wood_gbh(ico) , cpatch%wood_gbw(ico) & + , stom_condct , cpatch%A_open(ico) , cpatch%A_closed(ico) & + , cpatch%gsw_open(ico) , cpatch%gsw_closed(ico) , cpatch%psi_open(ico) & + , cpatch%psi_closed(ico) , cpatch%water_supply(ico) , cpatch%fsw(ico) & + , cpatch%fsn(ico) , cpatch%fs_open(ico) , cmet%vels & + , cpatch%veg_wind(ico) , csite%ustar(ipa) , vm close(unit=57,status='keep') !---------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/radiate_driver.f90 b/ED/src/dynamics/radiate_driver.f90 index 6b4f9fd65..d0e1b8c28 100644 --- a/ED/src/dynamics/radiate_driver.f90 +++ b/ED/src/dynamics/radiate_driver.f90 @@ -152,8 +152,9 @@ subroutine radiate_driver(cgrid) !----- Get unnormalized radiative transfer information. -----------------------! call sfcrad_ed(cgrid%cosz(ipy),cpoly%cosaoi(isi),csite,nzg,nzs & - ,cpoly%ntext_soil(:,isi),maxcohort,tuco & - ,rshort_tot,cpoly%met(isi)%rshort_diffuse,daytime,twilight) + ,cpoly%ntext_soil(:,isi),cpoly%ncol_soil(isi),maxcohort,tuco & + ,rshort_tot,cpoly%met(isi)%rshort_diffuse,cpoly%met(isi)%rlong & + ,daytime,twilight) !------------------------------------------------------------------------------! @@ -194,19 +195,27 @@ end subroutine radiate_driver ! This subroutine will drive the distribution of radiation among crowns, snow layers, ! ! and soil. ! !------------------------------------------------------------------------------------------! -subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco & - ,rshort_tot,rshort_diffuse,daytime,twilight) +subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tuco & + ,rshort_tot,rshort_diffuse,rlong,daytime,twilight) use ed_state_vars , only : sitetype & ! structure , patchtype ! ! structure use canopy_layer_coms , only : crown_mod ! ! intent(in) - use canopy_radiation_coms, only : ican_swrad & ! intent(in) + use canopy_radiation_coms, only : icanrad & ! intent(in) , cosz_min & ! intent(in) + , clumping_factor & ! intent(in) , par_beam_norm & ! intent(in) , par_diff_norm & ! intent(in) , nir_beam_norm & ! intent(in) - , nir_diff_norm ! ! intent(in) + , nir_diff_norm & ! intent(in) + , leaf_scatter_vis & ! intent(in) + , wood_scatter_vis & ! intent(in) + , leaf_scatter_nir & ! intent(in) + , wood_scatter_nir & ! intent(in) + , leaf_emis & ! intent(in) + , wood_emis ! ! intent(in) use soil_coms , only : soil & ! intent(in) + , soilcol & ! intent(in) , emisg ! ! intent(in) use consts_coms , only : stefan ! ! intent(in) use ed_max_dims , only : n_pft ! ! intent(in) @@ -218,8 +227,10 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco integer , intent(in) :: mzg integer , intent(in) :: mzs integer , dimension(mzg), intent(in) :: ntext_soil + integer , intent(in) :: ncol_soil real , intent(in) :: rshort_tot real , intent(in) :: rshort_diffuse + real , intent(in) :: rlong real , intent(in) :: cosaoi real , intent(in) :: cosz integer , intent(in) :: maxcohort @@ -232,8 +243,10 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco integer :: il integer :: ipa integer :: ico + integer :: ipft integer :: cohort_count integer :: nsoil + integer :: colour integer :: k integer :: ksn real :: fcpct @@ -291,8 +304,14 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco real :: downward_rshort_below_diffuse real :: surface_absorbed_longwave_surf real :: surface_absorbed_longwave_incid - real :: weight_leaf - real :: weight_wood + real :: nir_v_beam + real :: nir_v_diffuse + real :: wleaf_vis + real :: wleaf_nir + real :: wleaf_tir + real :: wwood_vis + real :: wwood_nir + real :: wwood_tir !----- External function. --------------------------------------------------------------! real , external :: sngloff !----- Local constants. ----------------------------------------------------------------! @@ -420,7 +439,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco select case (crown_mod) case (0) CA_array (cohort_count) = 1.d0 - case (1,2) + case (1) CA_array (cohort_count) = dble(cpatch%crown_area(ico)) end select !------------------------------------------------------------------------------! @@ -453,7 +472,8 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco ! / (soil(nsoil)%slmsts - soil(nsoil)%soilcp) ) ) ! alg = soil(nsoil)%albdry + fcpct * (soil(nsoil)%albwet - soil(nsoil)%albdry) ! end select - nsoil = ntext_soil(mzg) + nsoil = ntext_soil(mzg) + colour = ncol_soil select case (nsoil) case (13) !----- Bedrock, use constants soil value for granite. ----------------------------! @@ -465,15 +485,28 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco albedo_soil_par = max (0.07, 0.14 * (1.0 - fcpct)) albedo_soil_nir = albedo_soil_par case default - !---------------------------------------------------------------------------------! - ! Other soils, we use the soil numbers from CLM. We don't have soil colour ! - ! but here we assume soils to be of class 1 (the lightest one). The reason is ! - ! because we don't have a litter layer, which usually has a high reflectance, ! - ! especially in the near infra-red at least in the tropics. ! - !---------------------------------------------------------------------------------! - fcpct = max(0., 0.11 - 0.40 * csite%soil_water(mzg,ipa)) - albedo_soil_par = min(0.24, 0.12 + fcpct) - albedo_soil_nir = min(0.48, 0.24 + fcpct) + select case (colour) + case (21) + !------------------------------------------------------------------------------! + ! ED-2.1 soil colour. Also, we use the ED-2.1 default method to determine ! + ! the albedo. ! + !------------------------------------------------------------------------------! + fcpct = csite%soil_water(mzg,ipa) / soil(nsoil)%slmsts + albedo_soil_par = max(0.14,0.31-0.34*fcpct) + albedo_soil_nir = albedo_soil_par + case default + !------------------------------------------------------------------------------! + ! Other soils, we use the soil numbers from CLM-4. The colour class must ! + ! be given at RAMSIN. At this point the value is the same for all points, but ! + ! in the future we may read their files if the results are promising. ! + !------------------------------------------------------------------------------! + fcpct = max(0., 0.11 - 0.40 * csite%soil_water(mzg,ipa)) + albedo_soil_par = min(soilcol(colour)%alb_vis_dry & + ,soilcol(colour)%alb_vis_wet + fcpct) + albedo_soil_nir = min(soilcol(colour)%alb_nir_dry & + ,soilcol(colour)%alb_nir_wet + fcpct) + !------------------------------------------------------------------------------! + end select !---------------------------------------------------------------------------------! end select !------------------------------------------------------------------------------------! @@ -573,11 +606,14 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco if (cohort_count > 0) then !---------------------------------------------------------------------------------! - ! Solve long wave first. Check whether to solve cohort by cohort, or layer ! - ! by layer. ! + ! First, let's solve the long-wave. Here we must check which model to use, ! + ! two-stream or multiple scattering. ! !---------------------------------------------------------------------------------! - select case (crown_mod) - case (0,1) + select case (icanrad) + case (0) + !------------------------------------------------------------------------------! + ! Two-stream model. ! + !------------------------------------------------------------------------------! call lw_twostream(cohort_count,emissivity,T_surface,pft_array(1:cohort_count) & ,LAI_array(1:cohort_count),WAI_array(1:cohort_count) & ,CA_array(1:cohort_count) & @@ -588,174 +624,166 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco ,downward_lw_below_incid, upward_lw_below_surf & ,upward_lw_below_incid, upward_lw_above_surf & ,upward_lw_above_incid) - case (2) - call lw_twostream_layer(cohort_count,emissivity,T_surface & - ,pft_array(1:cohort_count) & - ,LAI_array(1:cohort_count),WAI_array(1:cohort_count) & - ,CA_array(1:cohort_count),htop_array(1:cohort_count) & - ,hbot_array(1:cohort_count) & - ,leaf_temp_array(1:cohort_count) & - ,wood_temp_array(1:cohort_count) & - ,lw_v_surf_array(1:cohort_count) & - ,lw_v_incid_array(1:cohort_count) & - ,downward_lw_below_surf & - ,downward_lw_below_incid, upward_lw_below_surf & - ,upward_lw_below_incid, upward_lw_above_surf & - ,upward_lw_above_incid) - end select - !---------------------------------------------------------------------------------! + !------------------------------------------------------------------------------! - !----- Upwelling long wave radiation at the top of the canopy. -------------------! - csite%rlongup(ipa) = upward_lw_above_surf - csite%rlong_albedo(ipa) = upward_lw_above_incid - !---------------------------------------------------------------------------------! - + !----- Upwelling long wave radiation at the top of the canopy. ----------------! + csite%rlongup(ipa) = upward_lw_above_surf + csite%rlong_albedo(ipa) = upward_lw_above_incid + !------------------------------------------------------------------------------! - !----- Long wave absorbed by either soil or sfcwater. ----------------------------! - surface_absorbed_longwave_surf = downward_lw_below_surf - upward_lw_below_surf - surface_absorbed_longwave_incid = downward_lw_below_incid - upward_lw_below_incid - !---------------------------------------------------------------------------------! + !----- Long wave absorbed by either soil or sfcwater. -------------------------! + surface_absorbed_longwave_surf = downward_lw_below_surf & + - upward_lw_below_surf + surface_absorbed_longwave_incid = downward_lw_below_incid & + - upward_lw_below_incid + !------------------------------------------------------------------------------! + case (1) + !------------------------------------------------------------------------------! + ! Multiple-scatter model. Here there is one important difference: we do ! + ! NOT scale longwave radiation, and we do NOT split longwave radiation coming ! + ! from the sky and coming from the surface, as they interact in the middle ! + ! layers. We save all radiation in the "incid" arrays, and scale them after ! + ! the solution, so the code called after this step can be used the same way ! + ! for both radiations. ! + !------------------------------------------------------------------------------! + lw_v_surf_array(1:cohort_count) = 0.d0 + downward_lw_below_surf = 0.d0 + upward_lw_below_surf = 0.d0 + upward_lw_above_surf = 0.d0 + call lw_multiple_scatter(emissivity,T_surface,rlong,cohort_count & + ,pft_array(1:cohort_count),LAI_array(1:cohort_count) & + ,WAI_array(1:cohort_count),CA_array(1:cohort_count) & + ,leaf_temp_array(1:cohort_count) & + ,wood_temp_array(1:cohort_count) & + ,lw_v_incid_array(1:cohort_count) & + ,downward_lw_below_incid,upward_lw_below_incid & + ,upward_lw_above_incid) + !------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! - ! Compute short wave only if it is daytime or at least twilight. ! - !---------------------------------------------------------------------------------! - if (twilight) then !------------------------------------------------------------------------------! - ! We must check which crown model we are using. ! + ! Here we scale the "incident" longwave by dividing by the incoming long- ! + ! wave radiation, because the two-stream is normalised and it will scale back ! + ! in the scale_ed_radiation sub-routine. ! + !------------------------------------------------------------------------------! + lw_v_incid_array(1:cohort_count) = lw_v_incid_array(1:cohort_count) / rlong !------------------------------------------------------------------------------! - select case (crown_mod) - case (0,1) - !---------------------------------------------------------------------------! - ! No vertical distribution / horizontal competition of canopy. There is ! - ! a chance that the user wants to use Beers' law, so we must check here. ! - !---------------------------------------------------------------------------! - select case (ican_swrad) - case (0) - call sw_beers_clump (albedo_ground_par,albedo_ground_nir & - ,cosz,cosaoi,cohort_count & - ,pft_array(1:cohort_count) & - ,LAI_array(1:cohort_count) & - ,WAI_array(1:cohort_count) & - ,CA_array(1:cohort_count) & - ,par_v_beam_array(1:cohort_count) & - ,par_v_diffuse_array(1:cohort_count) & - ,rshort_v_beam_array(1:cohort_count) & - ,rshort_v_diffuse_array(1:cohort_count) & - ,downward_par_below_beam & - ,downward_par_below_diffuse & - ,upward_par_above_beam,upward_par_above_diffuse & - ,downward_nir_below_beam & - ,downward_nir_below_diffuse & - ,upward_nir_above_beam,upward_nir_above_diffuse & - ,beam_level_array,diff_level_array & - ,light_level_array,light_beam_level_array & - ,light_diff_level_array,lambda_array,lambda_tot) - case (1) - call sw_twostream_clump(albedo_ground_par,albedo_ground_nir & - ,cosz,cosaoi,cohort_count & - ,pft_array(1:cohort_count) & - ,LAI_array(1:cohort_count) & - ,WAI_array(1:cohort_count) & - ,CA_array(1:cohort_count) & - ,par_v_beam_array(1:cohort_count) & - ,par_v_diffuse_array(1:cohort_count) & - ,rshort_v_beam_array(1:cohort_count) & - ,rshort_v_diffuse_array(1:cohort_count) & - ,downward_par_below_beam & - ,downward_par_below_diffuse & - ,upward_par_above_beam,upward_par_above_diffuse & - ,downward_nir_below_beam & - ,downward_nir_below_diffuse & - ,upward_nir_above_beam,upward_nir_above_diffuse & - ,beam_level_array,diff_level_array & - ,light_level_array,light_beam_level_array & - ,light_diff_level_array,lambda_array,lambda_tot) - end select - !---------------------------------------------------------------------------! - !---------------------------------------------------------------------------! - ! Since there is no horizontal competition, assuming that the maximum ! - ! possible PAR is just the PAR from the tallest resolvable cohort is good ! - ! enough. ! - !---------------------------------------------------------------------------! - weight_leaf = sngloff( LAI_array(cohort_count) & - / (LAI_array(cohort_count) + WAI_array(cohort_count)) & - , tiny_offset) - csite%par_l_beam_max(ipa) = par_v_beam_array(cohort_count) & - * weight_leaf - csite%par_l_diffuse_max(ipa) = par_v_diffuse_array(cohort_count) & - * weight_leaf - case (2) + !----- Upwelling long wave radiation at the top of the canopy. ----------------! + csite%rlongup(ipa) = upward_lw_above_incid + csite%rlong_albedo(ipa) = upward_lw_above_incid / rlong + !------------------------------------------------------------------------------! - !---------------------------------------------------------------------------! - ! Solve the top cohort by itself using the normal subroutine. This is ! - ! to find the maximum possible PAR (so even the tallest cohort won't be ! - ! with cbr_bar = 1 if it is facing light competition). ! - !---------------------------------------------------------------------------! - call sw_twostream_clump(albedo_ground_par,albedo_ground_nir & - ,cosz,cosaoi,1,pft_array(cohort_count) & - ,LAI_array(cohort_count),WAI_array(cohort_count) & - ,CA_array(cohort_count) & - ,par_v_beam_array(1),par_v_diffuse_array(1) & - ,rshort_v_beam_array(1),rshort_v_diffuse_array(1) & - ,downward_par_below_beam,downward_par_below_diffuse & - ,upward_par_above_beam,upward_par_above_diffuse & - ,downward_nir_below_beam,downward_nir_below_diffuse & - ,upward_nir_above_beam,upward_nir_above_diffuse & - ,beam_level_array(1),diff_level_array(1) & - ,light_level_array(1),light_beam_level_array(1) & - ,light_diff_level_array(1),lambda_array,lambda_tot) - !---------------------------------------------------------------------------! - ! Since there is no horizontal competition, assuming that the maximum ! - ! possible PAR is just the PAR from the tallest resolvable cohort is good ! - ! enough. ! - !---------------------------------------------------------------------------! - weight_leaf = sngloff( LAI_array(1) / (LAI_array(1) + WAI_array(1)) & - , tiny_offset) - csite%par_l_beam_max (ipa) = par_v_beam_array (1) * weight_leaf - csite%par_l_diffuse_max(ipa) = par_v_diffuse_array(1) * weight_leaf - !---------------------------------------------------------------------------! + + !----- Long wave absorbed by either soil or sfcwater. -------------------------! + surface_absorbed_longwave_surf = 0.d0 + surface_absorbed_longwave_incid = ( downward_lw_below_incid & + - upward_lw_below_incid ) / rlong + !------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! + ! Compute short wave only if it is daytime or at least twilight. ! + !---------------------------------------------------------------------------------! + if (twilight) then + !------------------------------------------------------------------------------! + ! Solve the short-wave. Decide which canopy radiation method we are going ! + ! to use. Unlike the long-wave, here we scale radiation the same way in both ! + ! cases, because PAR and NIR are truly independent bands. ! + !------------------------------------------------------------------------------! + select case (icanrad) + case (0) !---------------------------------------------------------------------------! - ! Now we solve the radiation for all resolvable cohorts, using the ! - ! layer-by-layer approach. ! + ! Two-stream model. ! !---------------------------------------------------------------------------! - call sw_twostream_layer(albedo_ground_par,albedo_ground_nir & + call sw_twostream_clump(albedo_ground_par,albedo_ground_nir & ,cosz,cosaoi,cohort_count & - ,pft_array(1:cohort_count),LAI_array(1:cohort_count) & - ,WAI_array(1:cohort_count),CA_array(1:cohort_count) & - ,htop_array(1:cohort_count) & - ,hbot_array(1:cohort_count) & + ,pft_array(1:cohort_count) & + ,LAI_array(1:cohort_count) & + ,WAI_array(1:cohort_count) & + ,CA_array(1:cohort_count) & ,par_v_beam_array(1:cohort_count) & ,par_v_diffuse_array(1:cohort_count) & ,rshort_v_beam_array(1:cohort_count) & ,rshort_v_diffuse_array(1:cohort_count) & - ,downward_par_below_beam,downward_par_below_diffuse & + ,downward_par_below_beam & + ,downward_par_below_diffuse & ,upward_par_above_beam,upward_par_above_diffuse & - ,downward_nir_below_beam,downward_nir_below_diffuse & + ,downward_nir_below_beam & + ,downward_nir_below_diffuse & ,upward_nir_above_beam,upward_nir_above_diffuse & ,beam_level_array,diff_level_array & ,light_level_array,light_beam_level_array & ,light_diff_level_array,lambda_array,lambda_tot) !---------------------------------------------------------------------------! + case (1) + !---------------------------------------------------------------------------! + ! Multiple-scatter model. ! + !---------------------------------------------------------------------------! + call sw_multiple_scatter(albedo_ground_par,albedo_ground_nir,cosaoi & + ,cohort_count & + ,pft_array(1:cohort_count) & + ,LAI_array(1:cohort_count) & + ,WAI_array(1:cohort_count) & + ,CA_array(1:cohort_count) & + ,par_v_beam_array(1:cohort_count) & + ,par_v_diffuse_array(1:cohort_count) & + ,rshort_v_beam_array(1:cohort_count) & + ,rshort_v_diffuse_array(1:cohort_count) & + ,downward_par_below_beam & + ,downward_par_below_diffuse & + ,upward_par_above_beam,upward_par_above_diffuse & + ,downward_nir_below_beam & + ,downward_nir_below_diffuse & + ,upward_nir_above_beam,upward_nir_above_diffuse & + ,beam_level_array,diff_level_array & + ,light_level_array,light_beam_level_array & + ,light_diff_level_array,lambda_array,lambda_tot) + !---------------------------------------------------------------------------! end select + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! Since there is no horizontal competition, assuming that the maximum ! + ! possible PAR is just the PAR from the tallest resolvable cohort is good ! + ! enough. ! + !------------------------------------------------------------------------------! + ipft = pft_array(cohort_count) + wleaf_vis = sngloff( clumping_factor(ipft) * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(cohort_count) & + / ( clumping_factor(ipft) * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(cohort_count) & + + (1.d0 - wood_scatter_vis(ipft)) & + * WAI_array(cohort_count) ) & + , tiny_offset) + csite%par_l_beam_max(ipa) = par_v_beam_array(cohort_count) * wleaf_vis + csite%par_l_diffuse_max(ipa) = par_v_diffuse_array(cohort_count) * wleaf_vis + !------------------------------------------------------------------------------! + + !----- Below-canopy downwelling radiation. ------------------------------------! downward_rshort_below_beam = downward_par_below_beam & + downward_nir_below_beam downward_rshort_below_diffuse = downward_par_below_diffuse & + downward_nir_below_diffuse + !------------------------------------------------------------------------------! + + !----- Soil+sfcwater+veg albedo (different for diffuse and beam radiation). ---! csite%albedo_beam(ipa) = ( upward_par_above_beam & @@ -769,6 +797,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco csite%albedo(ipa) = ( upward_par_above_beam + upward_nir_above_beam & + upward_par_above_diffuse + upward_nir_above_diffuse ) csite%lambda_light(ipa) = sngloff(lambda_tot,tiny_offset) + !------------------------------------------------------------------------------! else !----- The code expects values for these, even when it is not daytime. --------! @@ -796,35 +825,74 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco do ico = cpatch%ncohorts,1,-1 if (cpatch%leaf_resolvable(ico) .or. cpatch%wood_resolvable(ico)) then - il = il + 1 - + il = il + 1 + ipft = pft_array(il) + + !---------------------------------------------------------------------------! + ! Find the weight for leaves and branchwood. This is a weighted aver- ! + ! age between the area and absorptance. We must treat the visible and near ! + ! infrared separately. ! !---------------------------------------------------------------------------! - weight_leaf = sngloff( LAI_array(il) / (LAI_array(il) + WAI_array(il)) & - , tiny_offset) - weight_wood = 1. - weight_leaf - - cpatch%par_l_beam (ico) = par_v_beam_array (il) & - * weight_leaf - cpatch%par_l_diffuse (ico) = par_v_diffuse_array (il) & - * weight_leaf - cpatch%rshort_l_beam (ico) = rshort_v_beam_array (il) & - * weight_leaf - cpatch%rshort_l_diffuse (ico) = rshort_v_diffuse_array (il) & - * weight_leaf - cpatch%rlong_l_surf (ico) = lw_v_surf_array (il) & - * weight_leaf - cpatch%rlong_l_incid (ico) = lw_v_incid_array (il) & - * weight_leaf - cpatch%rshort_w_beam (ico) = rshort_v_beam_array (il) & - * weight_wood - cpatch%rshort_w_diffuse (ico) = rshort_v_diffuse_array (il) & - * weight_wood - cpatch%rlong_w_surf (ico) = lw_v_surf_array (il) & - * weight_wood - cpatch%rlong_w_incid (ico) = lw_v_incid_array (il) & - * weight_wood + wleaf_vis = sngloff ( ( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(il) ) & + / ( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(il) & + + (1.d0 - wood_scatter_vis(ipft)) & + * WAI_array(il) ), tiny_offset ) + wleaf_nir = sngloff ( ( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_nir(ipft)) & + * LAI_array(il) ) & + / ( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_nir(ipft)) & + * LAI_array(il) & + + (1.d0 - wood_scatter_nir(ipft)) & + * WAI_array(il) ), tiny_offset ) + wleaf_tir = sngloff( ( leaf_emis(ipft) * LAI_array(il) ) & + / ( leaf_emis(ipft) * LAI_array(il) & + + wood_emis(ipft) * WAI_array(il) ), tiny_offset ) + wwood_vis = 1. - wleaf_vis + wwood_nir = 1. - wleaf_nir + wwood_tir = 1. - wleaf_tir + !---------------------------------------------------------------------------! + + + + !----- Find the near infrared absorption, so we average things properly. ---! + nir_v_beam = rshort_v_beam_array (il) - par_v_beam_array (il) + nir_v_diffuse = rshort_v_diffuse_array (il) - par_v_diffuse_array (il) + !---------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------! + ! Split the layer radiation between leaf and branchwood. ! + !---------------------------------------------------------------------------! + !------ Visible (PAR), only leaves need this (photsynthesis model). --------! + cpatch%par_l_beam (ico) = par_v_beam_array (il) * wleaf_vis + cpatch%par_l_diffuse (ico) = par_v_diffuse_array (il) * wleaf_vis + !------ Total short wave radiation (PAR+NIR). ------------------------------! + cpatch%rshort_l_beam (ico) = par_v_beam_array (il) * wleaf_vis & + + nir_v_beam * wleaf_nir + cpatch%rshort_l_diffuse (ico) = par_v_diffuse_array (il) * wleaf_vis & + + nir_v_diffuse * wleaf_nir + cpatch%rshort_w_beam (ico) = par_v_beam_array (il) * wwood_vis & + + nir_v_beam * wwood_nir + cpatch%rshort_w_diffuse (ico) = par_v_diffuse_array (il) * wwood_vis & + + nir_v_diffuse * wwood_nir + !----- Thermal infra-red (long wave). --------------------------------------! + cpatch%rlong_l_surf (ico) = lw_v_surf_array (il) * wleaf_tir + cpatch%rlong_l_incid (ico) = lw_v_incid_array (il) * wleaf_tir + cpatch%rlong_w_surf (ico) = lw_v_surf_array (il) * wwood_tir + cpatch%rlong_w_incid (ico) = lw_v_incid_array (il) * wwood_tir + !---------------------------------------------------------------------------! + + + !----- Save the light levels. ----------------------------------------------! cpatch%lambda_light (ico) = sngloff(lambda_array (il) & ,tiny_offset ) cpatch%beamext_level (ico) = sngloff(beam_level_array (il) & @@ -837,6 +905,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco ,tiny_offset ) cpatch%light_level_diff (ico) = sngloff(light_diff_level_array(il) & ,tiny_offset ) + !---------------------------------------------------------------------------! end if end do @@ -871,6 +940,12 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,maxcohort,tuco + downward_nir_below_beam * abs_ground_nir csite%rshort_g_diffuse(ipa) = downward_par_below_diffuse * abs_ground_par & + downward_nir_below_diffuse * abs_ground_nir + + !----- Incident radiation at the ground. --------------------------------------------! + csite%par_b_beam (ipa) = downward_par_below_beam + csite%nir_b_beam (ipa) = downward_nir_below_beam + csite%par_b_diffuse (ipa) = downward_par_below_diffuse + csite%nir_b_diffuse (ipa) = downward_nir_below_diffuse !----- Absorption rate of short wave by the surface water. --------------------------! @@ -1010,12 +1085,14 @@ real function mean_daysecz(plon,plat,whena,dt,tmax) real(kind=4) , intent(in) :: dt real(kind=4) , intent(in) :: tmax !------ Local variables. ---------------------------------------------------------------! - type(simtime) :: now ! Current time - integer :: is ! Step counter - integer :: nsteps ! Number of steps to perform the average - real :: dtfit ! Delta-t that nicely fits within tmax - real :: dtnow ! Delta-t for this time - real :: cosz ! Declination + type(simtime) :: now ! Current time + integer :: is ! Step counter + integer :: nsteps ! Number of steps to perform the average + real :: dtfit ! Delta-t that nicely fits within tmax + real :: dtnow ! Delta-t for this time + real :: cosz ! Declination + real :: daytot ! Total time that was daytime + real :: mean_daycosz ! Average cosine of zenith angle !----- External functions. -------------------------------------------------------------! real(kind=4), external :: ed_zen ! Function to find day of year ("Julian" day) !---------------------------------------------------------------------------------------! @@ -1044,7 +1121,8 @@ real function mean_daysecz(plon,plat,whena,dt,tmax) dtfit = tmax / real(nsteps) !------------------------------------------------------------------------------------! - mean_daysecz = 0.0 + mean_daycosz = 0.0 + daytot = 0.0 do is=1,nsteps !----- Get the current time. -----------------------------------------------------! now = whena @@ -1056,7 +1134,8 @@ real function mean_daysecz(plon,plat,whena,dt,tmax) !----- Add to the integral only if it this value is valid. -----------------------! if (cosz > cosz_min) then - mean_daysecz = mean_daysecz + dtfit / cosz + mean_daycosz = mean_daycosz + dtfit * cosz + daytot = daytot + dtfit end if !---------------------------------------------------------------------------------! end do @@ -1067,7 +1146,12 @@ real function mean_daysecz(plon,plat,whena,dt,tmax) !------------------------------------------------------------------------------------! ! Find the normalisation factor. ! !------------------------------------------------------------------------------------! - mean_daysecz = mean_daysecz / tmax + if (daytot > 0.0 .and. mean_daycosz > 0.0) then + mean_daycosz = mean_daycosz / daytot + mean_daysecz = 1.0 / mean_daycosz + else + mean_daysecz = 0.0 + end if !------------------------------------------------------------------------------------! end if @@ -1130,9 +1214,15 @@ subroutine scale_ed_radiation(tuco,rshort,rshort_diffuse,rlong,csite) end if end do - csite%rshort_g_beam(ipa) = 0. + csite%rshort_g_beam (ipa) = 0. csite%rshort_g_diffuse(ipa) = 0. - csite%rshort_g(ipa) = 0. + csite%rshort_g (ipa) = 0. + csite%par_b_beam (ipa) = 0. + csite%par_b_diffuse (ipa) = 0. + csite%par_b (ipa) = 0. + csite%nir_b_beam (ipa) = 0. + csite%nir_b_diffuse (ipa) = 0. + csite%nir_b (ipa) = 0. !----- Absorption rate of short wave by the surface water. -----------------------! do k=1,csite%nlev_sfcwater(ipa) csite%rshort_s_beam(k,ipa) = 0. @@ -1190,7 +1280,15 @@ subroutine scale_ed_radiation(tuco,rshort,rshort_diffuse,rlong,csite) csite%rshort_g_beam(ipa) = csite%rshort_g_beam(ipa) * rshort csite%rshort_g_diffuse(ipa) = csite%rshort_g_diffuse(ipa) * rshort csite%rshort_g(ipa) = csite%rshort_g_beam(ipa) + csite%rshort_g_diffuse(ipa) - + + csite%par_b_beam(ipa) = csite%par_b_beam(ipa) * rshort + csite%par_b_diffuse(ipa) = csite%par_b_diffuse(ipa) * rshort + csite%par_b(ipa) = csite%par_b_beam(ipa) + csite%par_b_diffuse(ipa) + + csite%nir_b_beam(ipa) = csite%nir_b_beam(ipa) * rshort + csite%nir_b_diffuse(ipa) = csite%nir_b_diffuse(ipa) * rshort + csite%nir_b(ipa) = csite%nir_b_beam(ipa) + csite%nir_b_diffuse(ipa) + !----- Absorption rate of short wave by the surface water. --------------------------! do k=1,csite%nlev_sfcwater(ipa) csite%rshort_s_beam(k,ipa) = csite%rshort_s_beam (k,ipa) * rshort @@ -1263,179 +1361,3 @@ end subroutine angle_of_incid !==========================================================================================! - - - - -!==========================================================================================! -!==========================================================================================! -! This sub-routine solves the within canopy radiation for short wave radiation, using ! -! the simplified Beers law. It will take into account the crown area and/or branches in ! -! case the user wants so. ! -! This sub-routine is added for very simple tests only, and it shouldn't be used for ! -! long-term simulations. ! -!------------------------------------------------------------------------------------------! -subroutine sw_beers_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft & - ,lai,wai,canopy_area & - ,par_beam_flip,par_diffuse_flip,sw_abs_beam_flip & - ,sw_abs_diffuse_flip,dw_vislo_beam,dw_vislo_diffuse & - ,uw_vishi_beam,uw_vishi_diffuse,dw_nirlo_beam & - ,dw_nirlo_diffuse,uw_nirhi_beam,uw_nirhi_diffuse & - ,beam_level,diff_level,light_level,light_beam_level & - ,light_diff_level,lambda_coh,lambda_tot) - - use ed_max_dims , only : n_pft ! ! intent(in) - use pft_coms , only : clumping_factor & ! intent(in) - , phenology ! ! intent(in) - use canopy_radiation_coms, only : par_beam_norm & ! intent(in) - , par_diff_norm & ! intent(in) - , nir_beam_norm & ! intent(in) - , nir_diff_norm & ! intent(in) - , cosz_min8 ! ! intent(in) - use consts_coms , only : tiny_num8 ! ! intent(in) - implicit none - !----- Arguments -----------------------------------------------------------------------! - integer, dimension(ncoh) , intent(in) :: pft - integer , intent(in) :: ncoh - real(kind=8), dimension(ncoh), intent(in) :: LAI - real(kind=8), dimension(ncoh), intent(in) :: WAI - real(kind=8), dimension(ncoh), intent(in) :: canopy_area - real(kind=4) , intent(in) :: salbedo_par - real(kind=4) , intent(in) :: salbedo_nir - real(kind=4) , intent(in) :: scosz - real(kind=4) , intent(in) :: scosaoi - real(kind=4), dimension(ncoh), intent(out) :: PAR_beam_flip - real(kind=4), dimension(ncoh), intent(out) :: PAR_diffuse_flip - real(kind=4), dimension(ncoh), intent(out) :: SW_abs_beam_flip - real(kind=4), dimension(ncoh), intent(out) :: SW_abs_diffuse_flip - real(kind=4) , intent(out) :: UW_vishi_beam - real(kind=4) , intent(out) :: UW_vishi_diffuse - real(kind=4) , intent(out) :: UW_nirhi_beam - real(kind=4) , intent(out) :: UW_nirhi_diffuse - real(kind=4) , intent(out) :: DW_vislo_beam - real(kind=4) , intent(out) :: DW_vislo_diffuse - real(kind=4) , intent(out) :: DW_nirlo_beam - real(kind=4) , intent(out) :: DW_nirlo_diffuse - real(kind=8), dimension(ncoh), intent(out) :: beam_level - real(kind=8), dimension(ncoh), intent(out) :: diff_level - real(kind=8), dimension(ncoh), intent(out) :: light_level - real(kind=8), dimension(ncoh), intent(out) :: light_beam_level - real(kind=8), dimension(ncoh), intent(out) :: light_diff_level - real(kind=8), dimension(ncoh), intent(out) :: lambda_coh - real(kind=8) , intent(out) :: lambda_tot - !----- Local variables -----------------------------------------------------------------! - integer :: il - integer :: ipft - real(kind=8) :: lambda - real(kind=8) :: cosz - real(kind=8) :: cosaoi - real(kind=8) :: albedo - real(kind=8) :: abscoh - real(kind=8), dimension(ncoh) :: beam_bot - real(kind=8), dimension(ncoh) :: beam_bot_crown - real(kind=8), dimension(ncoh) :: eff_tai - real(kind=8), dimension(ncoh) :: tai - real(kind=8) :: beam_top - real(kind=8) :: diff_top - !----- External functions. -------------------------------------------------------------! - real(kind=4) , external :: sngloff - !---------------------------------------------------------------------------------------! - - - !----- Convert input variables to double precision. ------------------------------------! - albedo = 5.d-1 * (dble(salbedo_par) + dble(salbedo_nir)) - cosz = max(cosz_min8,dble(scosz)) - cosaoi = max(cosz_min8,dble(scosaoi)) - !---------------------------------------------------------------------------------------! - - - - !----- Lambda is the extinction coefficient. -------------------------------------------! - lambda = 5.d-1/cosaoi - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Find the light extinction coefficients. ! - !---------------------------------------------------------------------------------------! - lambda_tot = 0.0d0 - do il=1,ncoh - ipft = pft(il) - lambda_tot = lambda_tot + clumping_factor(ipft) - tai (il) = lai(il) + wai(il) - eff_tai (il) = clumping_factor(ipft) * lai(il) + wai(il) - lambda_coh(il) = lambda * eff_tai(il) / ( canopy_area(il) * tai(il)) - end do - lambda_tot = lambda_tot * lambda / dble(ncoh) - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! Find the light extinction curve. ! - !---------------------------------------------------------------------------------------! - beam_bot_crown(ncoh) = exp(-lambda * eff_tai(ncoh) / canopy_area(ncoh)) - beam_level(ncoh) = exp(-5.d-1 * lambda * eff_tai(ncoh) / canopy_area(ncoh)) - beam_bot (ncoh) = (1.d0 - canopy_area(ncoh)) & - + canopy_area(ncoh) * beam_bot_crown(ncoh) - do il=ncoh-1,1,-1 - beam_bot_crown(il) = beam_bot(il+1) * exp(-lambda*eff_tai(il)/canopy_area(il)) - beam_bot (il) = beam_bot(il+1)*(1.d0-canopy_area(il)) & - + canopy_area(il)*beam_bot_crown(il) - beam_level (il) = beam_bot(il+1) & - * exp(-5.d-1*lambda*eff_tai(il)/canopy_area(il)) & - * canopy_area(il) & - + (1.d0-canopy_area(il)) * beam_bot(il+1) - end do - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! Currently we simply use the light extinction curve to determine PAR and total ! - ! shortwave radiation. ! - !---------------------------------------------------------------------------------------! - do il=1,ncoh-1 - diff_level (il) = 5.d-1 * (beam_bot(il+1) + beam_bot(il)) - abscoh = beam_bot(il+1) - beam_bot(il) - PAR_beam_flip (il) = sngloff(par_beam_norm * abscoh, tiny_num8) - PAR_diffuse_flip (il) = sngloff(par_diff_norm * abscoh, tiny_num8) - SW_abs_beam_flip (il) = sngloff( abscoh, tiny_num8) - SW_abs_diffuse_flip(il) = sngloff( abscoh, tiny_num8) - end do - abscoh = 1.d0 - beam_bot(ncoh) - PAR_beam_flip (ncoh) = sngloff(par_beam_norm * abscoh,tiny_num8) - PAR_diffuse_flip (ncoh) = sngloff(par_diff_norm * abscoh,tiny_num8) - SW_abs_beam_flip (ncoh) = sngloff( abscoh,tiny_num8) - SW_abs_diffuse_flip (ncoh) = sngloff( abscoh,tiny_num8) - - light_level (1:ncoh) = diff_level(1:ncoh) - light_beam_level (1:ncoh) = diff_level(1:ncoh) - light_diff_level (1:ncoh) = diff_level(1:ncoh) - beam_level (1:ncoh) = diff_level(1:ncoh) - !---------------------------------------------------------------------------------------! - - - - - - !----- Copy to the output variables. ---------------------------------------------------! - DW_vislo_beam = sngloff(par_beam_norm * beam_bot(1), tiny_num8) - DW_vislo_diffuse = sngloff(par_diff_norm * beam_bot(1), tiny_num8) - UW_vishi_beam = sngloff(par_beam_norm * albedo * beam_bot(1), tiny_num8) - UW_vishi_diffuse = sngloff(par_diff_norm * albedo * beam_bot(1), tiny_num8) - DW_nirlo_beam = sngloff(nir_beam_norm * beam_bot(1), tiny_num8) - DW_nirlo_diffuse = sngloff(nir_diff_norm * beam_bot(1), tiny_num8) - UW_nirhi_beam = sngloff(nir_beam_norm * albedo * beam_bot(1), tiny_num8) - UW_nirhi_diffuse = sngloff(nir_diff_norm * albedo * beam_bot(1), tiny_num8) - !---------------------------------------------------------------------------------------! - - return -end subroutine sw_beers_clump -!==========================================================================================! -!==========================================================================================! - - diff --git a/ED/src/dynamics/reproduction.f90 b/ED/src/dynamics/reproduction.f90 index a91002e72..86531e146 100644 --- a/ED/src/dynamics/reproduction.f90 +++ b/ED/src/dynamics/reproduction.f90 @@ -346,6 +346,108 @@ end subroutine reproduction +!==========================================================================================! +!==========================================================================================! +! This subroutine will bypass all reproduction. ! +!------------------------------------------------------------------------------------------! +subroutine reproduction_eq_0(cgrid, month) + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype & ! structure + , patchtype & ! structure + , allocate_patchtype & ! subroutine + , copy_patchtype & ! subroutine + , deallocate_patchtype ! ! subroutine + use pft_coms , only : recruittype & ! structure + , zero_recruit & ! subroutine + , copy_recruit & ! subroutine + , seedling_mortality & ! intent(in) + , c2n_stem & ! intent(in) + , l2n_stem & ! intent(in) + , min_recruit_size & ! intent(in) + , c2n_recruit & ! intent(in) + , seed_rain & ! intent(in) + , include_pft & ! intent(in) + , include_pft_ag & ! intent(in) + , qsw & ! intent(in) + , q & ! intent(in) + , sla & ! intent(in) + , hgt_min & ! intent(in) + , plant_min_temp ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use ed_max_dims , only : n_pft ! ! intent(in) + use fuse_fiss_utils , only : sort_cohorts & ! subroutine + , terminate_cohorts & ! subroutine + , fuse_cohorts & ! subroutine + , split_cohorts ! ! subroutine + use phenology_coms , only : repro_scheme ! ! intent(in) + use mem_polygons , only : maxcohort ! ! intent(in) + use consts_coms , only : pio4 ! ! intent(in) + use ed_therm_lib , only : calc_veg_hcap ! ! function + use allometry , only : dbh2bd & ! function + , dbh2bl & ! function + , h2dbh & ! function + , ed_biomass & ! function + , area_indices ! ! subroutine + use grid_coms , only : nzg ! ! intent(in) + implicit none + !----- Arguments -----------------------------------------------------------------------! + type(edtype) , target :: cgrid + integer , intent(in) :: month + !----- Local variables -----------------------------------------------------------------! + type(polygontype), pointer :: cpoly + type(sitetype) , pointer :: csite + type(patchtype) , pointer :: cpatch + type(patchtype) , pointer :: temppatch + type(recruittype), dimension(n_pft) :: recruit + type(recruittype) :: rectest + integer :: ipy + integer :: isi + integer :: ipa + integer :: ico + !----- Saved variables -----------------------------------------------------------------! + logical , save :: first_time = .true. + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! If this is the first time, check whether the user wants reproduction. If not, ! + ! kill all potential recruits and send their biomass to the litter pool. ! + !---------------------------------------------------------------------------------------! + seedling_mortality(1:n_pft) = 1.0 + !---------------------------------------------------------------------------------------! + + + !----- The big loops start here. -------------------------------------------------------! + polyloop: do ipy = 1,cgrid%npolygons + cpoly => cgrid%polygon(ipy) + + siteloop: do isi = 1,cpoly%nsites + csite => cpoly%site(isi) + + !---------------------------------------------------------------------------------! + ! Zero all reproduction stuff... ! + !---------------------------------------------------------------------------------! + patchloop: do ipa = 1,csite%npatches + call zero_recruit(n_pft,recruit) + csite%repro(:,ipa) = 0.0 + end do patchloop + + !----- Reset minimum monthly temperature. ----------------------------------------! + cpoly%min_monthly_temp(isi) = huge(1.) + end do siteloop + end do polyloop + return +end subroutine reproduction_eq_0 +!==========================================================================================! +!==========================================================================================! + + + + + !==========================================================================================! !==========================================================================================! diff --git a/ED/src/dynamics/rk4_derivs.F90 b/ED/src/dynamics/rk4_derivs.F90 index 10011eb10..bae5fb018 100644 --- a/ED/src/dynamics/rk4_derivs.F90 +++ b/ED/src/dynamics/rk4_derivs.F90 @@ -104,8 +104,9 @@ subroutine leaftw_derivs(mzg,mzs,initp,dinitp,csite,ipa) , zero_rk4_aux ! ! intent(in) use ed_state_vars , only : sitetype & ! structure , patchtype & ! structure - , polygontype + , polygontype ! ! structure use therm_lib8 , only : qtk8 ! ! subroutine + use physiology_coms , only : h2o_plant_lim ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(rk4patchtype) , target :: initp ! RK4 structure, intermediate step @@ -137,7 +138,10 @@ subroutine leaftw_derivs(mzg,mzs,initp,dinitp,csite,ipa) real(kind=8) :: throughfall_tot ! Water shedding flux real(kind=8) :: qthroughfall_tot ! Energy flux due to water shedding real(kind=8) :: dthroughfall_tot ! Depth flux due to water shedding + real(kind=8) :: wilting_factor ! Wilting factor + real(kind=8) :: ext_weight ! Layer weight for transpiration real(kind=8) :: wgpmid ! Soil in between layers + real(kind=8) :: tloss ! Transpired water loss real(kind=8) :: wloss ! Water loss due to transpiration real(kind=8) :: qwloss ! Energy loss due to transpiration real(kind=8) :: dqwt ! Energy adjustment aux. variable @@ -217,50 +221,91 @@ end subroutine canopy_derivs_two !---------------------------------------------------------------------------------------! - ! Calculate water available to vegetation (in meters). SLZ is specified in RAMSIN. ! - ! Each element of the array sets the value of the bottom of a corresponding soil layer. ! - ! Eg, SLZ = -2, -1, -0.5, -0.25. There are four soil layers in this example; soil ! - ! layer 1 goes from 2 meters below the surface to 1 meter below the surface. ! - !---------------------------------------------------------------------------------------! - nsoil = rk4site%ntext_soil(mzg) - rk4aux%available_liquid_water(mzg) = dslz8(mzg) & - * max( 0.0d0 & - , initp%soil_fracliq(mzg) & - * (initp%soil_water(mzg)-soil8(nsoil)%soilwp) ) - do k = mzg - 1, klsl, -1 - nsoil = rk4site%ntext_soil(k) - rk4aux%available_liquid_water(k) = rk4aux%available_liquid_water(k+1) + dslz8(k) & - * max( 0.0d0 & - , initp%soil_fracliq(k) & - * (initp%soil_water(k) - soil8(nsoil)%soilwp) ) - end do + ! Compute the following variables: ! + ! ! + ! HYDCOND -- hydraulic conductivity [ m/s] ! + ! PSIPLUSZ -- the total potential (water + gravitational) [ m] ! + ! DRYSOIL -- flag that tells whether this layer is totally dry [ T|F] ! + ! SATSOIL -- flag that tells whether this layer is saturated [ T|F] ! + ! AVAIL_H2O_LYR -- the available water factor for this layer [ kg/mē] ! + ! AVAIL_H2O_INT -- the integral of AVAIL_H2O down to the layer [ kg/mē] ! + ! ! + ! Both AVAIL_H2O_LYR and AVAIL_H2O_INT depend on which water limitation we are using. ! !---------------------------------------------------------------------------------------! + select case (h2o_plant_lim) + case (0,1) + !------------------------------------------------------------------------------------! + ! The available water factor is the fraction of water mass above wilting point, ! + ! scaled by the liquid fraction. ! + !------------------------------------------------------------------------------------! + do k = mzg, klsl, -1 + nsoil = rk4site%ntext_soil(k) + wgpfrac = min(initp%soil_water(k)/soil8(nsoil)%slmsts, 1.d0) + rk4aux%hydcond (k) = slcons18(k,nsoil) & + * wgpfrac ** (2.d0 * soil8(nsoil)%slbs + 3.d0) + rk4aux%psiplusz (k) = slzt8(k) + soil8(nsoil)%slpots & + / wgpfrac ** soil8(nsoil)%slbs + rk4aux%drysoil (k) = (initp%soil_water(k) - soil8(nsoil)%soilcp) & + * initp%soil_fracliq(k) <= 0.d0 + rk4aux%satsoil (k) = initp%soil_water(k) >= soil8(nsoil)%slmsts + !----- Find the available water factor for this layer. ---------------------------! + rk4aux%avail_h2o_lyr(k) = max(0.d0, (initp%soil_water(k) - soil8(nsoil)%soilwp)) & + * initp%soil_fracliq(k) * wdns8 * dslz8(k) + !---------------------------------------------------------------------------------! + + + !----- Add the factor from this layer to the integral. ---------------------------! + rk4aux%avail_h2o_int(k) = rk4aux%avail_h2o_int(k+1) + rk4aux%avail_h2o_lyr(k) + !---------------------------------------------------------------------------------! + end do + !------------------------------------------------------------------------------------! + + case (2) + !------------------------------------------------------------------------------------! + ! The available water factor is the soil moisture at field capacity minus wilt- ! + ! ing, scaled by the wilting factor, defined as a function of soil potential. ! + !------------------------------------------------------------------------------------! + do k = mzg, klsl, -1 + nsoil = rk4site%ntext_soil(k) + + wgpfrac = min(initp%soil_water(k)/soil8(nsoil)%slmsts, 1.d0) + + rk4aux%hydcond (k) = slcons18(k,nsoil) & + * wgpfrac ** (2.d0 * soil8(nsoil)%slbs + 3.d0) + + rk4aux%psiplusz (k) = slzt8(k) + soil8(nsoil)%slpots & + / wgpfrac ** soil8(nsoil)%slbs + + + rk4aux%drysoil (k) = (initp%soil_water(k) - soil8(nsoil)%soilcp) & + * initp%soil_fracliq(k) <= 0.d0 + rk4aux%satsoil (k) = initp%soil_water(k) >= soil8(nsoil)%slmsts + + !----- Find the available water factor for this layer. ---------------------------! + wilting_factor = (rk4aux%psiplusz(k) - soil8(nsoil)%slpotwp) & + / (soil8(nsoil)%slpotfc - soil8(nsoil)%slpotwp) + rk4aux%avail_h2o_lyr(k) = min( 1.d0, max( 0.d0, wilting_factor ) ) & + * initp%soil_fracliq(k) & + * ( soil8(nsoil)%sfldcap - soil8(nsoil)%soilwp ) & + * wdns8 * dslz8(k) + !---------------------------------------------------------------------------------! + + + !----- Add the factor from this layer to the integral. ---------------------------! + rk4aux%avail_h2o_int(k) = rk4aux%avail_h2o_int(k+1) + rk4aux%avail_h2o_lyr(k) + !---------------------------------------------------------------------------------! + end do + !------------------------------------------------------------------------------------! + end select !---------------------------------------------------------------------------------------! - ! Compute the following variables: ! - ! - psiplusz - the total potential (water + gravitational) [ m] ! - ! - hydcond - hydraulic conductivity [ m/s] ! - ! - soil_liq_wilt - the liquid water content above wilting point [ mģ/mģ] ! - ! - soil_liq_dry - the liquid water content above dry air soil [ mģ/mģ] ! - !---------------------------------------------------------------------------------------! - do k = klsl, mzg - nsoil = rk4site%ntext_soil(k) - wgpfrac = min(initp%soil_water(k)/soil8(nsoil)%slmsts, 1.d0) - rk4aux%hydcond (k) = slcons18(k,nsoil) & - * wgpfrac ** (2.d0 * soil8(nsoil)%slbs + 3.d0) - rk4aux%psiplusz (k) = slzt8(k) + soil8(nsoil)%slpots & - / wgpfrac ** soil8(nsoil)%slbs - rk4aux%soil_liq_wilt(k) = max(0.d0, (initp%soil_water(k) - soil8(nsoil)%soilwp) & - * initp%soil_fracliq(k) ) - rk4aux%drysoil (k) = (initp%soil_water(k) - soil8(nsoil)%soilcp) & - * initp%soil_fracliq(k) <= 0.d0 - rk4aux%satsoil (k) = initp%soil_water(k) >= soil8(nsoil)%slmsts - end do - !---------------------------------------------------------------------------------------! + + + @@ -350,9 +395,6 @@ end subroutine canopy_derivs_two !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! ! Get derivatives of vegetation and canopy air space variables, plus some fluxes ! ! that will be used for soil top boundary conditions and for transpiration. ! @@ -656,20 +698,45 @@ end subroutine canopy_derivs_two do k1 = klsl, mzg ! loop over extracted water do k2=k1,mzg if (rk4site%ntext_soil(k2) /= 13) then - if (rk4aux%available_liquid_water(k1) > 0.d0) then - wloss = wdnsi8 * rk4aux%extracted_water(k1) & - * rk4aux%soil_liq_wilt(k2) / rk4aux%available_liquid_water(k1) - dinitp%soil_water(k2) = dinitp%soil_water(k2) - dble(wloss) - - !----- Energy: only liquid water is lost through transpiration. ---------! + !---------------------------------------------------------------------------! + ! Transpiration happens only when there is some water left down to this ! + ! layer. ! + !---------------------------------------------------------------------------! + if (rk4aux%avail_h2o_int(k1) > 0.d0) then + !------------------------------------------------------------------------! + ! Find the contribution of layer k2 for the transpiration from ! + ! cohorts that reach layer k1. ! + !------------------------------------------------------------------------! + ext_weight = rk4aux%avail_h2o_lyr(k2) / rk4aux%avail_h2o_int(k1) + + !------------------------------------------------------------------------! + ! Find the loss of water from layer k2 due to cohorts that reach at ! + ! least layer k1. Here we convert extracted water which is in kg/m2/s ! + ! (tloss) to m3/m3/s (wloss). Also, find the internal energy loss ! + ! (qwloss) associated with the water loss. Since plants can extract ! + ! liquid water only, the internal energy is assumed to be entirely in ! + ! liquid phase. ! + !------------------------------------------------------------------------! + tloss = rk4aux%extracted_water(k1) * ext_weight + wloss = rk4aux%extracted_water(k1) * ext_weight * wdnsi8 * dslzi8(k2) qwloss = wloss * cliqvlme8 * (initp%soil_tempk(k2) - tsupercool8) - dinitp%soil_energy(k2) = dinitp%soil_energy(k2) - qwloss - dinitp%avg_transloss(k2) = dinitp%avg_transloss(k2) - wdns8*dble(wloss) & - * dslz8(k2) + !------------------------------------------------------------------------! + + + + !----- Update derivatives of water, energy, and transpiration. ----------! + dinitp%soil_water (k2) = dinitp%soil_water(k2) - wloss + dinitp%soil_energy (k2) = dinitp%soil_energy(k2) - qwloss + dinitp%avg_transloss(k2) = dinitp%avg_transloss(k2) - tloss + !------------------------------------------------------------------------! end if + !---------------------------------------------------------------------------! end if + !------------------------------------------------------------------------------! end do + !---------------------------------------------------------------------------------! end do + !------------------------------------------------------------------------------------! end if !---------------------------------------------------------------------------------------! @@ -1033,7 +1100,7 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de ! itself and the soil moisture. ! !------------------------------------------------------------------------------------! wflxgc = initp%ggnet * initp%can_rhos * (initp%ground_shv - initp%can_shv) & - * ( initp%ggsoil / (initp%ggnet + initp%ggsoil) ) + * ( 1.d0 / (1.d0 + initp%ggnet / initp%ggsoil) ) !----- Adjusting the flux accordingly to the surface fraction (no phase bias). ------! qwflxgc = wflxgc * ( alvi8 - initp%ground_fliq * alli8) !----- Set condensation fluxes to zero. ---------------------------------------------! @@ -1169,7 +1236,7 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de ! Compute the water demand from both open closed and open stomata, but ! ! first make sure that there is some water available for transpiration... ! !---------------------------------------------------------------------------! - if (rk4aux%available_liquid_water(kroot) > 0.d0 ) then + if (rk4aux%avail_h2o_int(kroot) > 0.d0 ) then c3lai = effarea_transp(ipft) * initp%lai(ico) & * (initp%lint_shv(ico) - initp%can_shv) * initp%leaf_gbw(ico) @@ -1534,6 +1601,12 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de dthroughfall_tot = dthroughfall_tot + dintercepted_max * initp%wai(ico) * taii end if !------------------------------------------------------------------------------------! + + + !------ Find the combined leaf + wood derivative. -----------------------------------! + dinitp%veg_energy(ico) = dinitp%leaf_energy(ico) + dinitp%wood_energy(ico) + dinitp%veg_water (ico) = dinitp%leaf_water (ico) + dinitp%wood_water (ico) + !------------------------------------------------------------------------------------! end do cohortloop !---------------------------------------------------------------------------------------! @@ -1564,20 +1637,20 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de if (fast_diagnostics .or. print_detailed) then - dinitp%avg_carbon_ac = cflxac ! Carbon flx, Atmo->Canopy - dinitp%avg_sensible_ac = hflxac ! Sens. heat, Atmo->Canopy - dinitp%avg_vapor_ac = wflxac ! Lat. heat, Atmo->Canopy + dinitp%avg_carbon_ac = cflxac ! Carbon flx, Atmo->Canopy + dinitp%avg_carbon_st = cflxgc + cflxlc_tot + cflxac ! Carbon storage flux + dinitp%avg_sensible_ac = hflxac ! Sens. heat, Atmo->Canopy + dinitp%avg_vapor_ac = wflxac ! Lat. heat, Atmo->Canopy - dinitp%avg_sensible_lc = hflxlc_tot ! Sens. heat, Leaf->Canopy - dinitp%avg_vapor_lc = wflxlc_tot ! Lat. heat, Leaf->Canopy + dinitp%avg_sensible_lc = hflxlc_tot ! Sens. heat, Leaf->Canopy + dinitp%avg_vapor_lc = wflxlc_tot ! Lat. heat, Leaf->Canopy - dinitp%avg_sensible_wc = hflxwc_tot ! Sens. heat, Wood->Canopy - dinitp%avg_vapor_wc = wflxwc_tot ! Lat. heat, Wood->Canopy + dinitp%avg_sensible_wc = hflxwc_tot ! Sens. heat, Wood->Canopy + dinitp%avg_vapor_wc = wflxwc_tot ! Lat. heat, Wood->Canopy - dinitp%avg_sensible_gc = hflxgc ! Sens. heat, Grnd->Canopy - dinitp%avg_transp = transp_tot ! Transpiration - dinitp%avg_vapor_gc = wflxgc ! Lat. heat, Grnd->Canopy - dinitp%avg_dew_cg = dewgndflx ! Lat. heat, Canopy->Grnd + dinitp%avg_sensible_gc = hflxgc ! Sens. heat, Grnd->Canopy + dinitp%avg_transp = transp_tot ! Transpiration + dinitp%avg_vapor_gc = wflxgc - dewgndflx ! Lat. heat, Canopy->Grnd !----- Total evaporation to the canopy air space. -----------------------------------! dinitp%avg_evap = wflxgc - dewgndflx + wflxlc_tot + wflxwc_tot @@ -1589,6 +1662,14 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de dinitp%avg_qintercepted = qintercepted_tot ! Intercepted, Atmo->Lead dinitp%avg_throughfall = throughfall_tot ! Throughfall, Atmo->Grnd dinitp%avg_qthroughfall = qthroughfall_tot ! Throughfall, Atmo->Grnd + !------------------------------------------------------------------------------------! + + !------ These are used to compute the averages of the star terms. -------------------! + dinitp%avg_ustar = initp%ustar + dinitp%avg_tstar = initp%tstar + dinitp%avg_qstar = initp%qstar + dinitp%avg_cstar = initp%cstar + !------------------------------------------------------------------------------------! end if !---------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/rk4_driver.F90 b/ED/src/dynamics/rk4_driver.F90 index 5dd0d9fd5..688129911 100644 --- a/ED/src/dynamics/rk4_driver.F90 +++ b/ED/src/dynamics/rk4_driver.F90 @@ -132,8 +132,9 @@ subroutine rk4_timestep(cgrid,ifm) call copy_met_2_rk4site(nzg,cmet%vels,cmet%atm_theiv,cmet%atm_theta & ,cmet%atm_tmp,cmet%atm_shv,cmet%atm_co2,cmet%geoht & ,cmet%exner,cmet%pcpg,cmet%qpcpg,cmet%dpcpg & - ,cmet%prss,cmet%rshort,cmet%rlong,cmet%geoht & - ,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & + ,cmet%prss,cmet%rshort,cmet%rlong,cmet%par_beam & + ,cmet%par_diffuse,cmet%nir_beam,cmet%nir_diffuse & + ,cmet%geoht,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & ,cpoly%green_leaf_factor(:,isi) & ,cgrid%lon(ipy),cgrid%lat(ipy),cgrid%cosz(ipy)) @@ -324,16 +325,21 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm , patchtype & ! structure , edgrid_g ! ! structure use consts_coms , only : day_sec & ! intent(in) - , t3ple8 ! ! intent(in) - use ed_misc_coms , only : fast_diagnostics & ! intent(in) - , dtlsm ! ! intent(in) + , t3ple8 & ! intent(in) + , wdns8 ! ! intent(in) + use ed_misc_coms , only : fast_diagnostics ! ! intent(in) use soil_coms , only : soil8 & ! intent(in) - , slz8 ! ! intent(in) + , dslz8 & ! intent(in) + , slz8 & ! intent(in) + , slzt8 ! ! intent(in) use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) use therm_lib , only : qwtk & ! subroutine , rslif ! ! function - use canopy_air_coms , only : i_blyr_condct ! ! intent(in) + use phenology_coms , only : spot_phen ! ! intent(in) + use allometry , only : h2crownbh ! ! function + use disturb_coms , only : include_fire & ! intent(in) + , k_fire_first ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! type(rk4patchtype), target :: initp @@ -351,13 +357,19 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm type(patchtype) , pointer :: cpatch integer :: mould integer :: ico + integer :: ipft integer :: k + integer :: ka + integer :: kroot integer :: kclosest integer :: ksn integer :: nsoil integer :: nlsw1 real(kind=8) :: tmp_energy real(kind=8) :: available_water + real(kind=8) :: gnd_water + real(kind=8) :: psiplusz + real(kind=8) :: mcheight !----- Local contants ---------------------------------------------------------------! real , parameter :: tendays_sec=10.*day_sec !----- External function ------------------------------------------------------------! @@ -408,7 +420,6 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm if (fast_diagnostics) then csite%avg_vapor_lc (ipa) = sngloff(initp%avg_vapor_lc ,tiny_offset) csite%avg_vapor_wc (ipa) = sngloff(initp%avg_vapor_wc ,tiny_offset) - csite%avg_dew_cg (ipa) = sngloff(initp%avg_dew_cg ,tiny_offset) csite%avg_vapor_gc (ipa) = sngloff(initp%avg_vapor_gc ,tiny_offset) csite%avg_wshed_vg (ipa) = sngloff(initp%avg_wshed_vg ,tiny_offset) csite%avg_intercepted (ipa) = sngloff(initp%avg_intercepted ,tiny_offset) @@ -428,6 +439,11 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm csite%avg_sensible_gc (ipa) = sngloff(initp%avg_sensible_gc ,tiny_offset) csite%avg_sensible_ac (ipa) = sngloff(initp%avg_sensible_ac ,tiny_offset) csite%avg_carbon_ac (ipa) = sngloff(initp%avg_carbon_ac ,tiny_offset) + csite%avg_carbon_st (ipa) = sngloff(initp%avg_carbon_st ,tiny_offset) + csite%avg_ustar (ipa) = sngloff(initp%avg_ustar ,tiny_offset) + csite%avg_tstar (ipa) = sngloff(initp%avg_tstar ,tiny_offset) + csite%avg_qstar (ipa) = sngloff(initp%avg_qstar ,tiny_offset) + csite%avg_cstar (ipa) = sngloff(initp%avg_cstar ,tiny_offset) do k = rk4site%lsl, nzg csite%avg_sensible_gg(k,ipa) = sngloff(initp%avg_sensible_gg(k) ,tiny_offset) csite%avg_smoist_gg (k,ipa) = sngloff(initp%avg_smoist_gg (k) ,tiny_offset) @@ -438,15 +454,15 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm ! These variables are integrated here, since they don't change with time. ! !---------------------------------------------------------------------------------! csite%avg_rlongup (ipa) = csite%avg_rlongup (ipa) & - + csite%rlongup (ipa) * dtlsm + + csite%rlongup (ipa) * sngl(hdid) csite%avg_albedo (ipa) = csite%avg_albedo (ipa) & - + csite%albedo (ipa) * dtlsm + + csite%albedo (ipa) * sngl(hdid) csite%avg_albedo_beam (ipa) = csite%avg_albedo_beam (ipa) & - + csite%albedo_beam (ipa) * dtlsm + + csite%albedo_beam (ipa) * sngl(hdid) csite%avg_albedo_diffuse (ipa) = csite%avg_albedo_diffuse (ipa) & - + csite%albedo_diffuse (ipa) * dtlsm + + csite%albedo_diffuse (ipa) * sngl(hdid) csite%avg_rlong_albedo (ipa) = csite%avg_rlong_albedo (ipa) & - + csite%rlong_albedo (ipa) * dtlsm + + csite%rlong_albedo (ipa) * sngl(hdid) !---------------------------------------------------------------------------------! end if !------------------------------------------------------------------------------------! @@ -482,30 +498,75 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm !------------------------------------------------------------------------------------! - ! paw_avg - 10-day average of plant available water. ! + ! This variable is the monthly mean ground water that will be used to control ! + ! fire disturbance. ! + !------------------------------------------------------------------------------------! + gnd_water = 0.d0 + !----- Add temporary surface water. -------------------------------------------------! + do k=1,initp%nlev_sfcwater + gnd_water = gnd_water + initp%sfcwater_mass(k) + end do + !----- Find the bottommost layer to consider. ---------------------------------------! + select case(include_fire) + case (0,2) + ka = k_fire_first + case (1) + ka = rk4site%lsl + end select + !----- Add soil moisture. -----------------------------------------------------------! + do k=ka,nzg + gnd_water = gnd_water + initp%soil_water(k) * dslz8(k) * wdns8 + end do + !----- Add to the monthly mean. -----------------------------------------------------! + csite%avg_monthly_gndwater(ipa) = csite%avg_monthly_gndwater(ipa) & + + sngloff(gnd_water,tiny_offset) !------------------------------------------------------------------------------------! - cpatch => csite%patch(ipa) - do ico = 1,cpatch%ncohorts - available_water = 0.d0 - do k = cpatch%krdepth(ico), nzg - 1 - nsoil = rk4site%ntext_soil(k) - available_water = available_water & - + max(0.d0,(initp%soil_water(k) - soil8(nsoil)%soilwp)) & - * (slz8(k+1)-slz8(k)) & - / (soil8(nsoil)%slmsts - soil8(nsoil)%soilwp) - end do - nsoil = rk4site%ntext_soil(nzg) - available_water = available_water & - + max(0.d0,(initp%soil_water(nzg) - soil8(nsoil)%soilwp)) & - * (-1.d0*slz8(nzg)) & - / (soil8(nsoil)%slmsts -soil8(nsoil)%soilwp) - available_water = available_water / (-1.d0*slz8(cpatch%krdepth(ico))) - cpatch%paw_avg(ico) = cpatch%paw_avg(ico)*(1.0-sngl(hdid)/tendays_sec) & - + sngl(available_water)*sngl(hdid)/tendays_sec - end do + !------------------------------------------------------------------------------------! + ! paw_avg - 10-day average of relative plant available water. The relative value ! + ! depends on whether the user wants to define phenology based on soil ! + ! moisture or soil potential. ! + !------------------------------------------------------------------------------------! + if (spot_phen) then + cpatch => csite%patch(ipa) + do ico = 1,cpatch%ncohorts + ipft = cpatch%pft(ico) + kroot = cpatch%krdepth(ico) + + available_water = 0.d0 + do k = kroot, nzg + nsoil = rk4site%ntext_soil(k) + mcheight = 5.d-1 * ( dble(cpatch%hite(ico)) & + + dble(h2crownbh(cpatch%hite(ico),ipft)) ) + psiplusz = slzt8(k) - mcheight & + + soil8(nsoil)%slpots & + / (initp%soil_water(k) / soil8(nsoil)%slmsts) & + ** soil8(nsoil)%slbs + available_water = available_water & + + max(0.d0,(psiplusz - soil8(nsoil)%slpotwp)) * dslz8(k) & + / (soil8(nsoil)%slpotld - soil8(nsoil)%slpotwp) + end do + available_water = available_water / abs(slz8(kroot)) + cpatch%paw_avg(ico) = cpatch%paw_avg(ico)*(1.0-sngl(hdid)/tendays_sec) & + + sngl(available_water)*sngl(hdid)/tendays_sec + end do + else + cpatch => csite%patch(ipa) + do ico = 1,cpatch%ncohorts + available_water = 0.d0 + do k = kroot, nzg + nsoil = rk4site%ntext_soil(k) + available_water = available_water & + + max(0.d0,(initp%soil_water(k) - soil8(nsoil)%soilwp)) & + * dslz8(k) / (soil8(nsoil)%soilld - soil8(nsoil)%soilwp) + end do + available_water = available_water / abs(slz8(kroot)) + cpatch%paw_avg(ico) = cpatch%paw_avg(ico)*(1.0-sngl(hdid)/tendays_sec) & + + sngl(available_water)*sngl(hdid)/tendays_sec + end do + end if do k = rk4site%lsl, nzg csite%soil_water(k,ipa) = sngloff(initp%soil_water(k) ,tiny_offset) @@ -595,10 +656,10 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm !------------------------------------------------------------------------------! ! Divide the values of water demand by the time step to obtain the average ! - ! value over the past DTLSM period. ! + ! value over the past hdid period. ! !------------------------------------------------------------------------------! - cpatch%psi_open (ico) = sngloff(initp%psi_open (ico),tiny_offset) / hdid - cpatch%psi_closed(ico) = sngloff(initp%psi_closed(ico),tiny_offset) / hdid + cpatch%psi_open (ico) = sngloff(initp%psi_open (ico),tiny_offset) / sngl(hdid) + cpatch%psi_closed(ico) = sngloff(initp%psi_closed(ico),tiny_offset) / sngl(hdid) elseif (cpatch%hite(ico) <= csite%total_sfcw_depth(ipa)) then !------------------------------------------------------------------------------! @@ -728,7 +789,7 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm write (unit=*,fmt='(a,1x,f9.4)') ' + LATITUDE: ',rk4site%lat write (unit=*,fmt='(a,1x,i6)') ' + PATCH: ',ipa write (unit=*,fmt='(a,1x,i6)') ' + COHORT: ',ico - write (unit=*,fmt='(a)') ' + PATCH AGE: ',csite%age(ipa) + write (unit=*,fmt='(a)') ' + PATCH AGE: ' write (unit=*,fmt='(a,1x,es12.4)') ' - AGE: ',csite%age(ipa) write (unit=*,fmt='(a,1x,i6)') ' - DIST_TYPE: ',csite%dist_type(ipa) write (unit=*,fmt='(a)') ' + BUFFER_COHORT (initp):' @@ -757,7 +818,7 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_loss2atm write (unit=*,fmt='(a,1x,f9.4)') ' + LATITUDE: ',rk4site%lat write (unit=*,fmt='(a,1x,i6)') ' + PATCH: ',ipa write (unit=*,fmt='(a,1x,i6)') ' + COHORT: ',ico - write (unit=*,fmt='(a)') ' + PATCH AGE: ',csite%age(ipa) + write (unit=*,fmt='(a)') ' + PATCH AGE: ' write (unit=*,fmt='(a,1x,es12.4)') ' - AGE: ',csite%age(ipa) write (unit=*,fmt='(a,1x,i6)') ' - DIST_TYPE: ',csite%dist_type(ipa) write (unit=*,fmt='(a)') ' + BUFFER_COHORT (initp):' diff --git a/ED/src/dynamics/rk4_integ_utils.f90 b/ED/src/dynamics/rk4_integ_utils.f90 index 41eaeb7b7..de48e4e08 100644 --- a/ED/src/dynamics/rk4_integ_utils.f90 +++ b/ED/src/dynamics/rk4_integ_utils.f90 @@ -219,8 +219,9 @@ end subroutine odeint ! ables. ! !------------------------------------------------------------------------------------------! subroutine copy_met_2_rk4site(mzg,vels,atm_theiv,atm_theta,atm_tmp,atm_shv,atm_co2,zoff & - ,exner,pcpg,qpcpg,dpcpg,prss,rshort,rlong,geoht,lsl & - ,ntext_soil,green_leaf_factor,lon,lat,cosz) + ,exner,pcpg,qpcpg,dpcpg,prss,rshort,rlong,par_beam & + ,par_diffuse,nir_beam,nir_diffuse,geoht,lsl,ntext_soil & + ,green_leaf_factor,lon,lat,cosz) use ed_max_dims , only : n_pft ! ! intent(in) use rk4_coms , only : rk4site ! ! structure use canopy_air_coms, only : ubmin8 ! ! intent(in) @@ -244,6 +245,10 @@ subroutine copy_met_2_rk4site(mzg,vels,atm_theiv,atm_theta,atm_tmp,atm_shv,atm_c real , intent(in) :: prss real , intent(in) :: rshort real , intent(in) :: rlong + real , intent(in) :: par_beam + real , intent(in) :: par_diffuse + real , intent(in) :: nir_beam + real , intent(in) :: nir_diffuse real , intent(in) :: geoht integer, dimension(mzg) , intent(in) :: ntext_soil real , dimension(n_pft), intent(in) :: green_leaf_factor @@ -274,6 +279,10 @@ subroutine copy_met_2_rk4site(mzg,vels,atm_theiv,atm_theta,atm_tmp,atm_shv,atm_c rk4site%atm_prss = dble(prss ) rk4site%rshort = dble(rshort ) rk4site%rlong = dble(rlong ) + rk4site%par_beam = dble(par_beam ) + rk4site%par_diffuse = dble(par_diffuse ) + rk4site%nir_beam = dble(nir_beam ) + rk4site%nir_diffuse = dble(nir_diffuse ) rk4site%geoht = dble(geoht ) rk4site%lon = dble(lon ) rk4site%lat = dble(lat ) @@ -318,7 +327,6 @@ subroutine inc_rk4_patch(rkp, inc, fac, cpatch) use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) use ed_misc_coms , only : fast_diagnostics ! ! intent(in) - implicit none !----- Arguments -----------------------------------------------------------------------! @@ -357,12 +365,13 @@ subroutine inc_rk4_patch(rkp, inc, fac, cpatch) rkp%qpwp = rkp%qpwp + fac * inc%qpwp rkp%cpwp = rkp%cpwp + fac * inc%cpwp - do ico = 1,cpatch%ncohorts rkp%leaf_water (ico) = rkp%leaf_water (ico) + fac * inc%leaf_water (ico) rkp%leaf_energy(ico) = rkp%leaf_energy(ico) + fac * inc%leaf_energy(ico) rkp%wood_water (ico) = rkp%wood_water (ico) + fac * inc%wood_water (ico) rkp%wood_energy(ico) = rkp%wood_energy(ico) + fac * inc%wood_energy(ico) + rkp%veg_water (ico) = rkp%veg_water (ico) + fac * inc%veg_water (ico) + rkp%veg_energy(ico) = rkp%veg_energy (ico) + fac * inc%veg_energy (ico) rkp%psi_open (ico) = rkp%psi_open (ico) + fac * inc%psi_open (ico) rkp%psi_closed(ico) = rkp%psi_closed(ico) + fac * inc%psi_closed(ico) @@ -384,11 +393,17 @@ subroutine inc_rk4_patch(rkp, inc, fac, cpatch) + fac * inc%ebudget_loss2drainage end if if (fast_diagnostics) then + rkp%avg_ustar = rkp%avg_ustar + fac * inc%avg_ustar + rkp%avg_tstar = rkp%avg_tstar + fac * inc%avg_tstar + rkp%avg_qstar = rkp%avg_qstar + fac * inc%avg_qstar + rkp%avg_cstar = rkp%avg_cstar + fac * inc%avg_cstar + + rkp%avg_carbon_ac = rkp%avg_carbon_ac + fac * inc%avg_carbon_ac - + rkp%avg_carbon_st = rkp%avg_carbon_st + fac * inc%avg_carbon_st + rkp%avg_vapor_lc = rkp%avg_vapor_lc + fac * inc%avg_vapor_lc rkp%avg_vapor_wc = rkp%avg_vapor_wc + fac * inc%avg_vapor_wc - rkp%avg_dew_cg = rkp%avg_dew_cg + fac * inc%avg_dew_cg rkp%avg_vapor_gc = rkp%avg_vapor_gc + fac * inc%avg_vapor_gc rkp%avg_wshed_vg = rkp%avg_wshed_vg + fac * inc%avg_wshed_vg rkp%avg_intercepted = rkp%avg_intercepted + fac * inc%avg_intercepted @@ -423,10 +438,10 @@ subroutine inc_rk4_patch(rkp, inc, fac, cpatch) !---------------------------------------------------------------------------------------! if (print_detailed) then rkp%flx_carbon_ac = rkp%flx_carbon_ac + fac * inc%avg_carbon_ac - + rkp%flx_carbon_st = rkp%flx_carbon_st + fac * inc%avg_carbon_st + rkp%flx_vapor_lc = rkp%flx_vapor_lc + fac * inc%avg_vapor_lc rkp%flx_vapor_wc = rkp%flx_vapor_wc + fac * inc%avg_vapor_wc - rkp%flx_dew_cg = rkp%flx_dew_cg + fac * inc%avg_dew_cg rkp%flx_vapor_gc = rkp%flx_vapor_gc + fac * inc%avg_vapor_gc rkp%flx_wshed_vg = rkp%flx_wshed_vg + fac * inc%avg_wshed_vg rkp%flx_intercepted = rkp%flx_intercepted + fac * inc%avg_intercepted @@ -491,6 +506,7 @@ subroutine get_yscal(y,dy,htry,yscal,cpatch) use ed_state_vars , only : patchtype ! ! structure use rk4_coms , only : rk4patchtype & ! structure , rk4site & ! intent(in) + , ibranch_thermo & ! intent(in) , tiny_offset & ! intent(in) , huge_offset & ! intent(in) , rk4water_stab_thresh & ! intent(in) @@ -651,26 +667,101 @@ subroutine get_yscal(y,dy,htry,yscal,cpatch) !---------------------------------------------------------------------------------------! - ! Scale for leaf water and energy. In case the plants have few or no leaves, or the ! - ! plant is buried in snow, we assign huge values for typical scale, thus preventing ! - ! unecessary small steps. ! + ! Scale for leaf, wood, and vegetation water and energy. In case the plants have ! + ! few or no leaves, or the plant is buried in snow, we assign huge values for typical ! + ! scale, thus preventing unecessary small steps. ! ! Also, if the cohort has almost no water, make the scale less strict. ! !---------------------------------------------------------------------------------------! - do ico = 1,cpatch%ncohorts - yscal%leaf_resolvable(ico) = y%leaf_resolvable(ico) - if (y%leaf_resolvable(ico)) then - yscal%leaf_energy(ico) = abs( y%leaf_energy(ico)) & - + abs(dy%leaf_energy(ico) * htry) - yscal%leaf_temp(ico) = abs( y%leaf_temp(ico)) - yscal%leaf_water(ico) = max( abs(y%leaf_water(ico)) & - + abs(dy%leaf_water(ico) * htry) & - , rk4leaf_drywhc * y%lai(ico)) - else + select case (ibranch_thermo) + case (1) + !----- Combined leaf+wood solution. -------------------------------------------------! + do ico=1,cpatch%ncohorts + !----- Copy the logical tests. ---------------------------------------------------! + yscal%leaf_resolvable(ico) = y%leaf_resolvable(ico) + yscal%wood_resolvable(ico) = y%wood_resolvable(ico) + yscal%veg_resolvable(ico) = y%veg_resolvable(ico) + !---------------------------------------------------------------------------------! + + + + !----- Find the scale only if we must solve veg. ---------------------------------! + if (y%veg_resolvable(ico)) then + yscal%veg_energy(ico) = abs( y%veg_energy(ico)) & + + abs(dy%veg_energy(ico) * htry) + yscal%veg_water(ico) = max( abs(y%veg_water(ico)) & + + abs(dy%veg_water(ico) * htry) & + , rk4leaf_drywhc * y%tai(ico)) + else + yscal%veg_water(ico) = huge_offset + yscal%veg_energy(ico) = huge_offset + end if + !---------------------------------------------------------------------------------! + + + + !----- No need to scale wood and leaf correctly, let's make it always acceptable. ! yscal%leaf_water(ico) = huge_offset yscal%leaf_energy(ico) = huge_offset yscal%leaf_temp(ico) = huge_offset - end if - end do + yscal%wood_water(ico) = huge_offset + yscal%wood_energy(ico) = huge_offset + yscal%wood_temp(ico) = huge_offset + !---------------------------------------------------------------------------------! + end do + !------------------------------------------------------------------------------------! + + case (0,2) + !------------------------------------------------------------------------------------! + ! Either we are solving leaves only, or leaves and branches are treated as ! + ! independent pools. ! + !------------------------------------------------------------------------------------! + do ico = 1,cpatch%ncohorts + !----- Copy the logical tests. ---------------------------------------------------! + yscal%leaf_resolvable(ico) = y%leaf_resolvable(ico) + yscal%wood_resolvable(ico) = y%wood_resolvable(ico) + yscal%veg_resolvable(ico) = y%veg_resolvable(ico) + !---------------------------------------------------------------------------------! + + + !----- Find the scale only if we must solve leaves. ------------------------------! + if (y%leaf_resolvable(ico)) then + yscal%leaf_energy(ico) = abs( y%leaf_energy(ico)) & + + abs(dy%leaf_energy(ico) * htry) + yscal%leaf_temp(ico) = abs( y%leaf_temp(ico)) + yscal%leaf_water(ico) = max( abs(y%leaf_water(ico)) & + + abs(dy%leaf_water(ico) * htry) & + , rk4leaf_drywhc * y%lai(ico)) + else + yscal%leaf_water(ico) = huge_offset + yscal%leaf_energy(ico) = huge_offset + yscal%leaf_temp(ico) = huge_offset + end if + !---------------------------------------------------------------------------------! + + + !----- Find the scale only if we must solve wood. --------------------------------! + if (y%wood_resolvable(ico)) then + yscal%wood_energy(ico) = abs( y%wood_energy(ico)) & + + abs(dy%wood_energy(ico) * htry) + yscal%wood_temp(ico) = abs( y%wood_temp(ico)) + yscal%wood_water(ico) = max( abs(y%wood_water(ico)) & + + abs(dy%wood_water(ico) * htry) & + , rk4leaf_drywhc * y%wai(ico)) + else + yscal%wood_water(ico) = huge_offset + yscal%wood_energy(ico) = huge_offset + yscal%wood_temp(ico) = huge_offset + end if + !---------------------------------------------------------------------------------! + + + + !----- No need to scale veg correctly, let's make it always acceptable. ----------! + yscal%veg_water(ico) = huge_offset + yscal%veg_energy(ico) = huge_offset + !---------------------------------------------------------------------------------! + end do + end select !---------------------------------------------------------------------------------------! @@ -682,19 +773,6 @@ subroutine get_yscal(y,dy,htry,yscal,cpatch) ! Also, if the cohort has almost no water, make the scale less strict. ! !---------------------------------------------------------------------------------------! do ico = 1,cpatch%ncohorts - yscal%wood_resolvable(ico) = y%wood_resolvable(ico) - if (y%wood_resolvable(ico)) then - yscal%wood_energy(ico) = abs( y%wood_energy(ico)) & - + abs(dy%wood_energy(ico) * htry) - yscal%wood_temp(ico) = abs( y%wood_temp(ico)) - yscal%wood_water(ico) = max( abs(y%wood_water(ico)) & - + abs(dy%wood_water(ico) * htry) & - , rk4leaf_drywhc * y%wai(ico)) - else - yscal%wood_water(ico) = huge_offset - yscal%wood_energy(ico) = huge_offset - yscal%wood_temp(ico) = huge_offset - end if end do !---------------------------------------------------------------------------------------! @@ -810,6 +888,7 @@ end subroutine get_yscal subroutine get_errmax(errmax,yerr,yscal,cpatch,y,ytemp) use rk4_coms , only : rk4patchtype & ! structure + , ibranch_thermo & ! intent(in) , rk4eps & ! intent(in) , rk4site & ! intent(in) , checkbudget & ! intent(in) @@ -880,47 +959,77 @@ subroutine get_errmax(errmax,yerr,yscal,cpatch,y,ytemp) !---------------------------------------------------------------------------------------! - ! Get the worst error only amongst the cohorts in which leaf properties were ! - ! computed. ! + ! Get the worst error only amongst the cohorts in which leaf or wood properties ! + ! were computed. ! !---------------------------------------------------------------------------------------! - errh2oMAX = 0.d0 - erreneMAX = 0.d0 - do ico = 1,cpatch%ncohorts - if (yscal%leaf_resolvable(ico)) then - errh2o = abs(yerr%leaf_water (ico) / yscal%leaf_water (ico)) - errene = abs(yerr%leaf_energy(ico) / yscal%leaf_energy(ico)) - errmax = max(errmax,errh2o,errene) - errh2oMAX = max(errh2oMAX ,errh2o ) - erreneMAX = max(erreneMAX ,errene ) + select case (ibranch_thermo) + case (1) + !------------------------------------------------------------------------------------! + ! The combined leaf+branch pool is being solved. Check the veg variables only, ! + ! but add the error to both leaf and wood. ! + !------------------------------------------------------------------------------------! + errh2oMAX = 0.d0 + erreneMAX = 0.d0 + do ico = 1,cpatch%ncohorts + if (yscal%veg_resolvable(ico)) then + errh2o = abs(yerr%veg_water (ico) / yscal%veg_water (ico)) + errene = abs(yerr%veg_energy(ico) / yscal%veg_energy(ico)) + errmax = max(errmax,errh2o,errene) + errh2oMAX = max(errh2oMAX ,errh2o ) + erreneMAX = max(erreneMAX ,errene ) + end if + end do + if(cpatch%ncohorts > 0 .and. record_err) then + if (errh2oMAX > rk4eps) then + integ_err( 7,1) = integ_err( 7,1) + 1_8 + integ_err( 9,1) = integ_err( 9,1) + 1_8 + end if + if (erreneMAX > rk4eps) then + integ_err( 8,1) = integ_err( 8,1) + 1_8 + integ_err(10,1) = integ_err(10,1) + 1_8 + end if end if - end do - if(cpatch%ncohorts > 0 .and. record_err) then - if (errh2oMAX > rk4eps) integ_err(7,1) = integ_err(7,1) + 1_8 - if (erreneMAX > rk4eps) integ_err(8,1) = integ_err(8,1) + 1_8 - end if - !---------------------------------------------------------------------------------------! - - + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Get the worst error only amongst the cohorts in which wood properties were ! - ! computed. ! - !---------------------------------------------------------------------------------------! - errh2oMAX = 0.d0 - erreneMAX = 0.d0 - do ico = 1,cpatch%ncohorts - if (yscal%wood_resolvable(ico)) then - errh2o = abs(yerr%wood_water (ico) / yscal%wood_water (ico)) - errene = abs(yerr%wood_energy(ico) / yscal%wood_energy(ico)) - errmax = max(errmax,errh2o,errene) - errh2oMAX = max(errh2oMAX ,errh2o ) - erreneMAX = max(erreneMAX ,errene ) + case default + !------------------------------------------------------------------------------------! + ! Either we are solving leaves only, or both leaf and branch pools are being ! + ! solved independently. Check both leaf and wood variables. ! + !------------------------------------------------------------------------------------! + !----- Leaves. ----------------------------------------------------------------------! + errh2oMAX = 0.d0 + erreneMAX = 0.d0 + do ico = 1,cpatch%ncohorts + if (yscal%leaf_resolvable(ico)) then + errh2o = abs(yerr%leaf_water (ico) / yscal%leaf_water (ico)) + errene = abs(yerr%leaf_energy(ico) / yscal%leaf_energy(ico)) + errmax = max(errmax,errh2o,errene) + errh2oMAX = max(errh2oMAX ,errh2o ) + erreneMAX = max(erreneMAX ,errene ) + end if + end do + if(cpatch%ncohorts > 0 .and. record_err) then + if (errh2oMAX > rk4eps) integ_err(7,1) = integ_err(7,1) + 1_8 + if (erreneMAX > rk4eps) integ_err(8,1) = integ_err(8,1) + 1_8 end if - end do - if(cpatch%ncohorts > 0 .and. record_err) then - if (errh2oMAX > rk4eps) integ_err( 9,1) = integ_err( 9,1) + 1_8 - if (erreneMAX > rk4eps) integ_err(10,1) = integ_err(10,1) + 1_8 - end if + !----- Wood. ------------------------------------------------------------------------! + errh2oMAX = 0.d0 + erreneMAX = 0.d0 + do ico = 1,cpatch%ncohorts + if (yscal%wood_resolvable(ico)) then + errh2o = abs(yerr%wood_water (ico) / yscal%wood_water (ico)) + errene = abs(yerr%wood_energy(ico) / yscal%wood_energy(ico)) + errmax = max(errmax,errh2o,errene) + errh2oMAX = max(errh2oMAX ,errh2o ) + erreneMAX = max(erreneMAX ,errene ) + end if + end do + if(cpatch%ncohorts > 0 .and. record_err) then + if (errh2oMAX > rk4eps) integ_err( 9,1) = integ_err( 9,1) + 1_8 + if (erreneMAX > rk4eps) integ_err(10,1) = integ_err(10,1) + 1_8 + end if + !------------------------------------------------------------------------------------! + end select !---------------------------------------------------------------------------------------! @@ -1073,6 +1182,7 @@ subroutine copy_rk4_patch(sourcep, targetp, cpatch) targetp%ggbare = sourcep%ggbare targetp%ggveg = sourcep%ggveg targetp%ggnet = sourcep%ggnet + targetp%ggsoil = sourcep%ggsoil targetp%flag_wflxgc = sourcep%flag_wflxgc @@ -1156,6 +1266,11 @@ subroutine copy_rk4_patch(sourcep, targetp, cpatch) targetp%rshort_w (k) = sourcep%rshort_w (k) targetp%rlong_w (k) = sourcep%rlong_w (k) + targetp%veg_resolvable (k) = sourcep%veg_resolvable (k) + targetp%veg_energy (k) = sourcep%veg_energy (k) + targetp%veg_water (k) = sourcep%veg_water (k) + targetp%veg_hcap (k) = sourcep%veg_hcap (k) + targetp%veg_wind (k) = sourcep%veg_wind (k) targetp%lint_shv (k) = sourcep%lint_shv (k) targetp%nplant (k) = sourcep%nplant (k) @@ -1191,10 +1306,14 @@ subroutine copy_rk4_patch(sourcep, targetp, cpatch) targetp%wbudget_storage = sourcep%wbudget_storage end if if (fast_diagnostics) then + targetp%avg_ustar = sourcep%avg_ustar + targetp%avg_tstar = sourcep%avg_tstar + targetp%avg_qstar = sourcep%avg_qstar + targetp%avg_cstar = sourcep%avg_cstar targetp%avg_carbon_ac = sourcep%avg_carbon_ac + targetp%avg_carbon_st = sourcep%avg_carbon_st targetp%avg_vapor_lc = sourcep%avg_vapor_lc targetp%avg_vapor_wc = sourcep%avg_vapor_wc - targetp%avg_dew_cg = sourcep%avg_dew_cg targetp%avg_vapor_gc = sourcep%avg_vapor_gc targetp%avg_wshed_vg = sourcep%avg_wshed_vg targetp%avg_intercepted = sourcep%avg_intercepted @@ -1223,9 +1342,9 @@ subroutine copy_rk4_patch(sourcep, targetp, cpatch) if (print_detailed) then targetp%flx_carbon_ac = sourcep%flx_carbon_ac + targetp%flx_carbon_st = sourcep%flx_carbon_st targetp%flx_vapor_lc = sourcep%flx_vapor_lc targetp%flx_vapor_wc = sourcep%flx_vapor_wc - targetp%flx_dew_cg = sourcep%flx_dew_cg targetp%flx_vapor_gc = sourcep%flx_vapor_gc targetp%flx_wshed_vg = sourcep%flx_wshed_vg targetp%flx_intercepted = sourcep%flx_intercepted diff --git a/ED/src/dynamics/rk4_misc.f90 b/ED/src/dynamics/rk4_misc.f90 index 5cd46059d..cec023440 100644 --- a/ED/src/dynamics/rk4_misc.f90 +++ b/ED/src/dynamics/rk4_misc.f90 @@ -43,7 +43,6 @@ subroutine copy_patch_init(sourcesite,ipa,targetp) , reducedpress8 ! ! function use soil_coms , only : soil8 ! ! intent(in) use ed_therm_lib , only : ed_grndvap8 ! ! subroutine - use canopy_air_coms , only : i_blyr_condct ! ! intent(in) use canopy_struct_dynamics, only : canopy_turbulence8 ! ! subroutine implicit none @@ -301,6 +300,17 @@ subroutine copy_patch_init(sourcesite,ipa,targetp) !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Make the combined leaf and branchwood pool. It will be really used only if ! + ! ibranch_thermo is set to 1. ! + !------------------------------------------------------------------------------------! + targetp%veg_resolvable(ico) = targetp%leaf_resolvable(ico) .or. & + targetp%wood_resolvable(ico) + targetp%veg_energy(ico) = targetp%leaf_energy(ico) + targetp%wood_energy(ico) + targetp%veg_water(ico) = targetp%leaf_water(ico) + targetp%wood_water(ico) + targetp%veg_hcap(ico) = targetp%leaf_hcap(ico) + targetp%wood_hcap(ico) + !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! @@ -353,28 +363,32 @@ subroutine copy_patch_init(sourcesite,ipa,targetp) ! RK4. Inside RK4 we only want the contribution of those variables during the span ! ! of one time step. ! !------------------------------------------------------------------------------------! - targetp%avg_carbon_ac = dble(sourcesite%avg_carbon_ac(ipa) ) - targetp%avg_vapor_lc = dble(sourcesite%avg_vapor_lc(ipa) ) - targetp%avg_vapor_wc = dble(sourcesite%avg_vapor_wc(ipa) ) - targetp%avg_dew_cg = dble(sourcesite%avg_dew_cg(ipa) ) - targetp%avg_vapor_gc = dble(sourcesite%avg_vapor_gc(ipa) ) - targetp%avg_wshed_vg = dble(sourcesite%avg_wshed_vg(ipa) ) - targetp%avg_intercepted = dble(sourcesite%avg_intercepted(ipa) ) - targetp%avg_throughfall = dble(sourcesite%avg_throughfall(ipa) ) - targetp%avg_vapor_ac = dble(sourcesite%avg_vapor_ac(ipa) ) - targetp%avg_transp = dble(sourcesite%avg_transp(ipa) ) - targetp%avg_evap = dble(sourcesite%avg_evap(ipa) ) - targetp%avg_drainage = dble(sourcesite%avg_drainage(ipa) ) - targetp%avg_drainage_heat = dble(sourcesite%avg_drainage_heat(ipa) ) - targetp%avg_rshort_gnd = dble(sourcesite%avg_rshort_gnd(ipa) ) - targetp%avg_rlong_gnd = dble(sourcesite%avg_rlong_gnd(ipa) ) - targetp%avg_sensible_lc = dble(sourcesite%avg_sensible_lc(ipa) ) - targetp%avg_sensible_wc = dble(sourcesite%avg_sensible_wc(ipa) ) - targetp%avg_qwshed_vg = dble(sourcesite%avg_qwshed_vg(ipa) ) - targetp%avg_qintercepted = dble(sourcesite%avg_qintercepted(ipa) ) - targetp%avg_qthroughfall = dble(sourcesite%avg_qthroughfall(ipa) ) - targetp%avg_sensible_gc = dble(sourcesite%avg_sensible_gc(ipa) ) - targetp%avg_sensible_ac = dble(sourcesite%avg_sensible_ac(ipa) ) + targetp%avg_ustar = dble(sourcesite%avg_ustar (ipa)) + targetp%avg_tstar = dble(sourcesite%avg_tstar (ipa)) + targetp%avg_qstar = dble(sourcesite%avg_qstar (ipa)) + targetp%avg_cstar = dble(sourcesite%avg_cstar (ipa)) + targetp%avg_carbon_ac = dble(sourcesite%avg_carbon_ac (ipa)) + targetp%avg_carbon_st = dble(sourcesite%avg_carbon_st (ipa)) + targetp%avg_vapor_lc = dble(sourcesite%avg_vapor_lc (ipa)) + targetp%avg_vapor_wc = dble(sourcesite%avg_vapor_wc (ipa)) + targetp%avg_vapor_gc = dble(sourcesite%avg_vapor_gc (ipa)) + targetp%avg_wshed_vg = dble(sourcesite%avg_wshed_vg (ipa)) + targetp%avg_intercepted = dble(sourcesite%avg_intercepted (ipa)) + targetp%avg_throughfall = dble(sourcesite%avg_throughfall (ipa)) + targetp%avg_vapor_ac = dble(sourcesite%avg_vapor_ac (ipa)) + targetp%avg_transp = dble(sourcesite%avg_transp (ipa)) + targetp%avg_evap = dble(sourcesite%avg_evap (ipa)) + targetp%avg_drainage = dble(sourcesite%avg_drainage (ipa)) + targetp%avg_drainage_heat = dble(sourcesite%avg_drainage_heat (ipa)) + targetp%avg_rshort_gnd = dble(sourcesite%avg_rshort_gnd (ipa)) + targetp%avg_rlong_gnd = dble(sourcesite%avg_rlong_gnd (ipa)) + targetp%avg_sensible_lc = dble(sourcesite%avg_sensible_lc (ipa)) + targetp%avg_sensible_wc = dble(sourcesite%avg_sensible_wc (ipa)) + targetp%avg_qwshed_vg = dble(sourcesite%avg_qwshed_vg (ipa)) + targetp%avg_qintercepted = dble(sourcesite%avg_qintercepted (ipa)) + targetp%avg_qthroughfall = dble(sourcesite%avg_qthroughfall (ipa)) + targetp%avg_sensible_gc = dble(sourcesite%avg_sensible_gc (ipa)) + targetp%avg_sensible_ac = dble(sourcesite%avg_sensible_ac (ipa)) do k = rk4site%lsl, nzg targetp%avg_sensible_gg(k) = dble(sourcesite%avg_sensible_gg(k,ipa)) @@ -500,6 +514,7 @@ end function large_error !------------------------------------------------------------------------------------------! subroutine update_diagnostic_vars(initp, csite,ipa) use rk4_coms , only : rk4site & ! intent(in) + , ibranch_thermo & ! intent(in) , rk4tiny_sfcw_mass & ! intent(in) , rk4min_sfcw_mass & ! intent(in) , rk4min_virt_water & ! intent(in) @@ -574,9 +589,14 @@ subroutine update_diagnostic_vars(initp, csite,ipa) real(kind=8) :: int_virt_energy real(kind=8) :: energy_tot real(kind=8) :: wmass_tot + real(kind=8) :: veg_temp + real(kind=8) :: veg_fliq real(kind=8) :: hcapdry_tot + real(kind=8) :: rk4min_veg_water real(kind=8) :: rk4min_leaf_water real(kind=8) :: rk4min_wood_water + real(kind=8) :: wgt_leaf + real(kind=8) :: wgt_wood !---------------------------------------------------------------------------------------! !----- Then we define some logicals to make the code cleaner. --------------------------! @@ -798,128 +818,334 @@ subroutine update_diagnostic_vars(initp, csite,ipa) !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Loop over cohorts to update the leaf temperature and liquid fraction. ! + ! Initialise the leaf and wood checks here. ! !---------------------------------------------------------------------------------------! ok_leaf = .true. + ok_wood = .true. cpatch => csite%patch(ipa) - leafloop: do ico=1,cpatch%ncohorts - !----- Check whether the leaves of this cohort are safe... --------------------------! - if (initp%leaf_resolvable(ico)) then + !---------------------------------------------------------------------------------------! - !----- Find the minimum leaf water for this cohort. ------------------------------! - rk4min_leaf_water = rk4min_veg_lwater * initp%lai(ico) - !---------------------------------------------------------------------------------! - ! Update leaf temperature and liquid fraction only if leaf water makes sense. ! - !---------------------------------------------------------------------------------! - if (initp%leaf_water(ico) < rk4min_leaf_water) then - ok_leaf = .false. - cycle leafloop - else - call qwtk8(initp%leaf_energy(ico),initp%leaf_water(ico),initp%leaf_hcap(ico) & - ,initp%leaf_temp(ico),initp%leaf_fliq(ico)) - if (initp%leaf_temp(ico) < rk4min_veg_temp .or. & - initp%leaf_temp(ico) > rk4max_veg_temp) then - ok_leaf = .false. - cycle leafloop + + + + !---------------------------------------------------------------------------------------! + ! Now we update leaf and branch properties, based on which kind of branch thermo- ! + ! dynamics we're using. ! + !---------------------------------------------------------------------------------------! + select case(ibranch_thermo) + case (1) + + !------------------------------------------------------------------------------------! + ! The combined case. Here we assume the leaves and wood are eternally in ! + ! thermal equilibrium, and that the total water is evenly spread over branches and ! + ! leaves. We then proceed to reconstruct the leaf and wood internal energy. This, ! + ! of course, if the step produced decent values, otherwise we bypass and reject the ! + !step. ! + !------------------------------------------------------------------------------------! + vegloop: do ico=1,cpatch%ncohorts + !----- Check whether the cohort is safe... ---------------------------------------! + if (initp%veg_resolvable(ico)) then + + !------------------------------------------------------------------------------! + ! Find the weighting factors for leaves and branches, so we put the right ! + ! amount of each on top of each surface. ! + !------------------------------------------------------------------------------! + if (initp%leaf_resolvable(ico) .and. initp%wood_resolvable(ico)) then + !----- Both leaves and branchwood are solved, split according to LAI/WAI. --! + wgt_leaf = initp%lai(ico) / initp%tai(ico) + wgt_wood = 1.d0 - wgt_leaf + elseif (initp%leaf_resolvable(ico)) then + wgt_leaf = 1.d0 + wgt_wood = 0.d0 else + wgt_leaf = 0.d0 + wgt_wood = 1.d0 + end if + !------------------------------------------------------------------------------! + + + + !----- Find the minimum vegetation water for this cohort. ---------------------! + rk4min_veg_water = rk4min_veg_lwater * initp%tai(ico) + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! Update leaf temperature and liquid fraction only if leaf water makes ! + ! sense. ! + !------------------------------------------------------------------------------! + if (initp%veg_water(ico) < rk4min_veg_water) then !---------------------------------------------------------------------------! - ! Compute the leaf intercellular specific humidity, assumed to be at ! - ! saturation. ! + ! Water is too negative, we must reject the step. To be safe, we cheat ! + ! and put the total water to both pools. ! !---------------------------------------------------------------------------! - initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) - initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) + initp%leaf_water(ico) = initp%veg_water(ico) + initp%wood_water(ico) = initp%veg_water(ico) !---------------------------------------------------------------------------! + + + + !----- Flag the step as bad so it doesn't find turbulence parameters. ------! + ok_leaf = .false. + ok_wood = .false. + !---------------------------------------------------------------------------! + + + + !----- Move on to the next cohort. -----------------------------------------! + cycle vegloop + !---------------------------------------------------------------------------! + else + !----- Find the temperature and liquid fraction. ---------------------------! + call qwtk8(initp%veg_energy(ico),initp%veg_water(ico),initp%veg_hcap(ico) & + ,veg_temp,veg_fliq) + !---------------------------------------------------------------------------! + + + + if (veg_temp < rk4min_veg_temp .or. veg_temp > rk4max_veg_temp) then + !------------------------------------------------------------------------! + ! Temperature is off, we must reject the step. To be safe, we ! + ! cheat and put the bad temperature in both pools. ! + !------------------------------------------------------------------------! + initp%leaf_temp(ico) = veg_temp + initp%wood_temp(ico) = veg_temp + initp%leaf_fliq(ico) = veg_fliq + initp%wood_fliq(ico) = veg_fliq + !------------------------------------------------------------------------! + + !----- Flag the step as bad so it doesn't find turbulence parameters. ---! + ok_leaf = .false. + ok_wood = .false. + !------------------------------------------------------------------------! + + + + !----- Move on to the next cohort. --------------------------------------! + cycle vegloop + !------------------------------------------------------------------------! + else + !----- Copy veg temperature and liquid fraction to leaves and wood. -----! + initp%leaf_temp(ico) = veg_temp + initp%wood_temp(ico) = veg_temp + initp%leaf_fliq(ico) = veg_fliq + initp%wood_fliq(ico) = veg_fliq + !------------------------------------------------------------------------! + + + !----- Split vegetation water according to LAI and WAI. -----------------! + initp%leaf_water(ico) = initp%veg_water(ico) * wgt_leaf + initp%wood_water(ico) = initp%veg_water(ico) * wgt_wood + !------------------------------------------------------------------------! + + + !----- Find lead and wood internal energy. ------------------------------! + initp%leaf_energy(ico) = initp%leaf_hcap(ico) * initp%leaf_temp(ico) & + + initp%leaf_water(ico) & + * ( ( 1.d0 - initp%leaf_fliq(ico)) * cice8 & + * initp%leaf_temp(ico) & + + initp%leaf_fliq(ico) * cliq8 & + * (initp%leaf_temp(ico) - tsupercool8) ) + initp%wood_energy(ico) = initp%wood_hcap(ico) * initp%wood_temp(ico) & + + initp%wood_water(ico) & + * ( ( 1.d0 - initp%wood_fliq(ico)) * cice8 & + * initp%wood_temp(ico) & + + initp%wood_fliq(ico) * cliq8 & + * (initp%wood_temp(ico) - tsupercool8) ) + !------------------------------------------------------------------------! + + + !------------------------------------------------------------------------! + ! Compute the leaf intercellular specific humidity, assumed to be at ! + ! saturation. ! + !------------------------------------------------------------------------! + initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) + initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) + !------------------------------------------------------------------------! + end if end if - end if - !---------------------------------------------------------------------------------! - else - !---------------------------------------------------------------------------------! - ! For plants with minimal foliage or very sparse patches, fix the leaf ! - ! temperature to the canopy air space and force leaf_water to be zero. ! - !---------------------------------------------------------------------------------! - initp%leaf_temp(ico) = initp%can_temp - initp%leaf_water(ico) = 0.d0 - initp%leaf_energy(ico) = initp%leaf_hcap(ico) * initp%leaf_temp(ico) - if (initp%leaf_temp(ico) == t3ple8) then - initp%leaf_fliq(ico) = 5.d-1 - elseif (initp%leaf_temp(ico) > t3ple8) then - initp%leaf_fliq(ico) = 1.d0 + !------------------------------------------------------------------------------! else - initp%leaf_fliq(ico) = 0.d0 + !------------------------------------------------------------------------------! + ! For plants with minimal foliage or very sparse patches, fix the leaf ! + ! and wood temperatures to the canopy air space and force leaf_water and ! + ! wood_water to be zero. ! + !------------------------------------------------------------------------------! + initp%leaf_temp(ico) = initp%can_temp + initp%wood_temp(ico) = initp%can_temp + initp%leaf_water(ico) = 0.d0 + initp%wood_water(ico) = 0.d0 + initp%veg_water(ico) = 0.d0 + initp%leaf_energy(ico) = initp%leaf_hcap(ico) * initp%leaf_temp(ico) + initp%wood_energy(ico) = initp%wood_hcap(ico) * initp%wood_temp(ico) + initp%veg_energy(ico) = initp%leaf_energy(ico) + initp%wood_energy(ico) + if (initp%can_temp == t3ple8) then + initp%leaf_fliq(ico) = 5.d-1 + initp%wood_fliq(ico) = 5.d-1 + elseif (initp%can_temp > t3ple8) then + initp%leaf_fliq(ico) = 1.d0 + initp%wood_fliq(ico) = 1.d0 + else + initp%leaf_fliq(ico) = 0.d0 + initp%wood_fliq(ico) = 0.d0 + end if + !------------------------------------------------------------------------------! + + + + + + !------------------------------------------------------------------------------! + ! Compute the leaf intercellular specific humidity, assumed to be at ! + ! saturation. ! + !------------------------------------------------------------------------------! + initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) + initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) + !------------------------------------------------------------------------------! end if - !---------------------------------------------------------------------------------! + end do vegloop + case default + !------------------------------------------------------------------------------------! + ! Loop over cohorts to update the leaf temperature and liquid fraction. This is ! + ! done here only if leaves aren't being solved together with branches as a combined ! + ! pool (either being the only vegetation pool or treated as a separate pool). ! + !------------------------------------------------------------------------------------! + leafloop: do ico=1,cpatch%ncohorts + !----- Check whether the leaves of this cohort are safe... -----------------------! + if (initp%leaf_resolvable(ico)) then + !----- Find the minimum leaf water for this cohort. ---------------------------! + rk4min_leaf_water = rk4min_veg_lwater * initp%lai(ico) + !------------------------------------------------------------------------------! + ! Update leaf temperature and liquid fraction only if leaf water makes ! + ! sense. ! + !------------------------------------------------------------------------------! + if (initp%leaf_water(ico) < rk4min_leaf_water) then + ok_leaf = .false. + cycle leafloop + else + call qwtk8(initp%leaf_energy(ico),initp%leaf_water(ico) & + ,initp%leaf_hcap(ico),initp%leaf_temp(ico),initp%leaf_fliq(ico)) + if (initp%leaf_temp(ico) < rk4min_veg_temp .or. & + initp%leaf_temp(ico) > rk4max_veg_temp) then + ok_leaf = .false. + cycle leafloop + else + !------------------------------------------------------------------------! + ! Compute the leaf intercellular specific humidity, assumed to be at ! + ! saturation. ! + !------------------------------------------------------------------------! + initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) + initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) + !------------------------------------------------------------------------! + end if + end if + !------------------------------------------------------------------------------! + else + !------------------------------------------------------------------------------! + ! For plants with minimal foliage or very sparse patches, fix the leaf ! + ! temperature to the canopy air space and force leaf_water to be zero. ! + !------------------------------------------------------------------------------! + initp%leaf_temp(ico) = initp%can_temp + initp%leaf_water(ico) = 0.d0 + initp%leaf_energy(ico) = initp%leaf_hcap(ico) * initp%leaf_temp(ico) + if (initp%leaf_temp(ico) == t3ple8) then + initp%leaf_fliq(ico) = 5.d-1 + elseif (initp%leaf_temp(ico) > t3ple8) then + initp%leaf_fliq(ico) = 1.d0 + else + initp%leaf_fliq(ico) = 0.d0 + end if + !------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! - ! Compute the leaf intercellular specific humidity, assumed to be at ! - ! saturation. ! - !---------------------------------------------------------------------------------! - initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) - initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) - !---------------------------------------------------------------------------------! - end if - end do leafloop - !---------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------! + ! Compute the leaf intercellular specific humidity, assumed to be at ! + ! saturation. ! + !------------------------------------------------------------------------------! + initp%lint_shv(ico) = rslif8(initp%can_prss,initp%leaf_temp(ico)) + initp%lint_shv(ico) = initp%lint_shv(ico) / (1.d0 + initp%lint_shv(ico)) + !------------------------------------------------------------------------------! + end if + end do leafloop + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Loop over cohorts to update the wood temperature and liquid fraction. ! - !---------------------------------------------------------------------------------------! - ok_wood = .true. - cpatch => csite%patch(ipa) - woodloop: do ico=1,cpatch%ncohorts - !----- Check whether the leaves of this cohort are safe... --------------------------! - if (initp%wood_resolvable(ico)) then - !----- Find the minimum leaf water for this cohort. ------------------------------! - rk4min_wood_water = rk4min_veg_lwater * initp%wai(ico) - !---------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Loop over cohorts to update the wood temperature and liquid fraction. This is ! + ! done only when branches are being solved by themselves. ! + !------------------------------------------------------------------------------------! + woodloop: do ico=1,cpatch%ncohorts + !----- Check whether the leaves of this cohort are safe... -----------------------! + if (initp%wood_resolvable(ico)) then + + !----- Find the minimum leaf water for this cohort. ---------------------------! + rk4min_wood_water = rk4min_veg_lwater * initp%wai(ico) + !------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------! - ! Update wood temperature and liquid fraction only if wood water makes sense. ! - !---------------------------------------------------------------------------------! - if (initp%wood_water(ico) < rk4min_wood_water) then - ok_wood = .false. - cycle woodloop - else - call qwtk8(initp%wood_energy(ico),initp%wood_water(ico),initp%wood_hcap(ico) & - ,initp%wood_temp(ico),initp%wood_fliq(ico)) - if (initp%wood_temp(ico) < rk4min_veg_temp .or. & - initp%wood_temp(ico) > rk4max_veg_temp) then - ok_leaf = .false. + + !------------------------------------------------------------------------------! + ! Update wood temperature and liquid fraction only if wood water makes ! + ! sense. ! + !------------------------------------------------------------------------------! + if (initp%wood_water(ico) < rk4min_wood_water) then + ok_wood = .false. cycle woodloop + else + call qwtk8(initp%wood_energy(ico),initp%wood_water(ico) & + ,initp%wood_hcap(ico),initp%wood_temp(ico),initp%wood_fliq(ico)) + if (initp%wood_temp(ico) < rk4min_veg_temp .or. & + initp%wood_temp(ico) > rk4max_veg_temp) then + ok_leaf = .false. + cycle woodloop + end if end if - end if - !---------------------------------------------------------------------------------! - else - !---------------------------------------------------------------------------------! - ! In case we are not solving branches, or for cohorts that are very sparse, ! - ! fix the wood temperature to the canopy air space and force wood_water to be ! - ! zero. ! - !---------------------------------------------------------------------------------! - initp%wood_temp(ico) = initp%can_temp - initp%wood_water(ico) = 0.d0 - initp%wood_energy(ico) = initp%wood_hcap(ico) * initp%wood_temp(ico) - if (initp%wood_temp(ico) == t3ple8) then - initp%wood_fliq(ico) = 5.d-1 - elseif (initp%wood_temp(ico) > t3ple8) then - initp%wood_fliq(ico) = 1.d0 + !------------------------------------------------------------------------------! else - initp%wood_fliq(ico) = 0.d0 + !------------------------------------------------------------------------------! + ! In case we are not solving branches, or for cohorts that are very ! + ! sparse, fix the wood temperature to the canopy air space and force ! + ! wood_water to be zero. ! + !------------------------------------------------------------------------------! + initp%wood_temp(ico) = initp%can_temp + initp%wood_water(ico) = 0.d0 + initp%wood_energy(ico) = initp%wood_hcap(ico) * initp%wood_temp(ico) + if (initp%wood_temp(ico) == t3ple8) then + initp%wood_fliq(ico) = 5.d-1 + elseif (initp%wood_temp(ico) > t3ple8) then + initp%wood_fliq(ico) = 1.d0 + else + initp%wood_fliq(ico) = 0.d0 + end if + !------------------------------------------------------------------------------! end if - !---------------------------------------------------------------------------------! - end if - end do woodloop + end do woodloop + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Update vegetation properties, so everything is neat and consistent. This can ! + ! be done for non-resolvable and unrealistic cohorts, it's just a sum and the time ! + ! step is about to be rejected anyway. ! + !------------------------------------------------------------------------------------! + do ico=1,cpatch%ncohorts + initp%veg_energy(ico) = initp%leaf_energy(ico) + initp%wood_energy(ico) + initp%veg_water(ico) = initp%leaf_water(ico) + initp%wood_water(ico) + end do + !------------------------------------------------------------------------------------! + end select !---------------------------------------------------------------------------------------! + !----- Compute canopy turbulence properties. -------------------------------------------! @@ -2399,8 +2625,10 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa) leaf_dwshed_tot = leaf_dwshed_tot + leaf_dwshed !----- Update water mass and energy. ------------------------------------------! - initp%leaf_water(ico) = initp%leaf_water(ico) - leaf_wshed + initp%leaf_water (ico) = initp%leaf_water (ico) - leaf_wshed + initp%veg_water (ico) = initp%veg_water (ico) - leaf_wshed initp%leaf_energy(ico) = initp%leaf_energy(ico) - leaf_qwshed + initp%veg_energy (ico) = initp%veg_energy (ico) - leaf_qwshed !----- Update fluxes if needed be. --------------------------------------------! if (print_detailed) then @@ -2428,8 +2656,10 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa) leaf_qdew_tot = leaf_qdew_tot + leaf_qdew !----- Update cohort state variables. -----------------------------------------! - initp%leaf_water(ico) = 0.d0 - initp%leaf_energy(ico) = initp%leaf_energy(ico) + leaf_qdew - leaf_qboil + initp%leaf_water (ico) = 0.d0 + initp%veg_water (ico) = initp%veg_water(ico) + leaf_dew - leaf_boil + initp%leaf_energy(ico) = initp%leaf_energy(ico) + leaf_qdew - leaf_qboil + initp%veg_energy (ico) = initp%veg_energy(ico) + leaf_qdew - leaf_qboil !----- Update fluxes if needed be. --------------------------------------------! if (print_detailed) then @@ -2493,8 +2723,10 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa) wood_dwshed_tot = wood_dwshed_tot + wood_dwshed !----- Update water mass and energy. ------------------------------------------! - initp%wood_water(ico) = initp%wood_water(ico) - wood_wshed + initp%wood_water (ico) = initp%wood_water (ico) - wood_wshed + initp%veg_water (ico) = initp%veg_water (ico) - wood_wshed initp%wood_energy(ico) = initp%wood_energy(ico) - wood_qwshed + initp%veg_energy (ico) = initp%veg_energy (ico) - wood_qwshed !----- Update fluxes if needed be. --------------------------------------------! if (print_detailed) then @@ -2522,8 +2754,10 @@ subroutine adjust_veg_properties(initp,hdid,csite,ipa) wood_qdew_tot = wood_qdew_tot + wood_qdew !----- Update cohort state variables. -----------------------------------------! - initp%wood_water(ico) = 0.d0 + initp%wood_water (ico) = 0.d0 + initp%veg_water (ico) = initp%veg_water (ico) + wood_dew - wood_boil initp%wood_energy(ico) = initp%wood_energy(ico) + wood_qdew - wood_qboil + initp%veg_energy (ico) = initp%veg_energy (ico) + wood_qdew - wood_qboil !----- Update fluxes if needed be. --------------------------------------------! if (print_detailed) then @@ -2612,6 +2846,7 @@ end subroutine adjust_veg_properties !==========================================================================================! subroutine print_errmax(errmax,yerr,yscal,cpatch,y,ytemp) use rk4_coms , only : rk4patchtype & ! Structure + , ibranch_thermo & ! intent(in) , rk4eps & ! intent(in) , rk4site & ! intent(in) , checkbudget ! ! intent(in) @@ -2711,64 +2946,115 @@ subroutine print_errmax(errmax,yerr,yscal,cpatch,y,ytemp) ,yscal%sfcwater_mass(k),troublemaker end do end if + !---------------------------------------------------------------------------------------! - write(unit=*,fmt='(80a)') ('-',k=1,80) - write(unit=*,fmt='(a)' ) - write(unit=*,fmt='(80a)') ('-',k=1,80) - write(unit=*,fmt='(a)' ) ' Leaf-level variables (only the resolvable ones):' - write(unit=*,fmt='(10(a,1x))') 'Name ',' PFT',' LAI' & - ,' WAI',' WPA',' TAI' & - ,' Max.Error',' Abs.Error',' Scale' & - ,'Problem(T|F)' - do ico = 1,cpatch%ncohorts - if (y%leaf_resolvable(ico)) then - errmax = max(errmax,abs(yerr%leaf_water(ico)/yscal%leaf_water(ico))) - troublemaker = large_error(yerr%leaf_water(ico),yscal%leaf_water(ico)) - write(unit=*,fmt=cohfmt) 'LEAF_WATER:',cpatch%pft(ico),y%lai(ico),y%wai(ico) & - ,y%wpa(ico),y%tai(ico),errmax & - ,yerr%leaf_water(ico),yscal%leaf_water(ico) & - ,troublemaker - - - errmax = max(errmax,abs(yerr%leaf_energy(ico)/yscal%leaf_energy(ico))) - troublemaker = large_error(yerr%leaf_energy(ico),yscal%leaf_energy(ico)) - write(unit=*,fmt=cohfmt) 'LEAF_ENERGY:',cpatch%pft(ico),cpatch%lai(ico) & - ,y%wai(ico),y%wpa(ico),y%tai(ico),errmax & - ,yerr%leaf_energy(ico) & - ,yscal%leaf_energy(ico) & - ,troublemaker - end if - end do - write(unit=*,fmt='(80a)') ('-',k=1,80) - write(unit=*,fmt='(a)' ) - write(unit=*,fmt='(80a)') ('-',k=1,80) - write(unit=*,fmt='(a)' ) ' Wood-level variables (only the resolvable ones):' - write(unit=*,fmt='(10(a,1x))') 'Name ',' PFT',' LAI' & - ,' WAI',' WPA',' TAI' & - ,' Max.Error',' Abs.Error',' Scale' & - ,'Problem(T|F)' - do ico = 1,cpatch%ncohorts - if (y%wood_resolvable(ico)) then - errmax = max(errmax,abs(yerr%wood_water(ico)/yscal%wood_water(ico))) - troublemaker = large_error(yerr%wood_water(ico),yscal%wood_water(ico)) - write(unit=*,fmt=cohfmt) 'WOOD_WATER:',cpatch%pft(ico),y%lai(ico),y%wai(ico) & - ,y%wpa(ico),y%tai(ico),errmax & - ,yerr%wood_water(ico),yscal%wood_water(ico) & - ,troublemaker - - - errmax = max(errmax,abs(yerr%wood_energy(ico)/yscal%wood_energy(ico))) - troublemaker = large_error(yerr%wood_energy(ico),yscal%wood_energy(ico)) - write(unit=*,fmt=cohfmt) 'WOOD_ENERGY:',cpatch%pft(ico),cpatch%lai(ico) & - ,y%wai(ico),y%wpa(ico),y%tai(ico),errmax & - ,yerr%wood_energy(ico) & - ,yscal%wood_energy(ico) & - ,troublemaker + !---------------------------------------------------------------------------------------! + ! Choose what to print based on wood thermodynamics. ! + !---------------------------------------------------------------------------------------! + select case (ibranch_thermo) + case (1) + !----- Combined case, print vegetation only. ----------------------------------------! + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) ' Veg-level variables (only the resolvable ones):' + write(unit=*,fmt='(10(a,1x))') 'Name ',' PFT',' LAI' & + ,' WAI',' WPA',' TAI' & + ,' Max.Error',' Abs.Error',' Scale' & + ,'Problem(T|F)' + do ico = 1,cpatch%ncohorts + if (y%veg_resolvable(ico)) then + errmax = max(errmax,abs(yerr%veg_water(ico)/yscal%veg_water(ico))) + troublemaker = large_error(yerr%veg_water(ico),yscal%veg_water(ico)) + write(unit=*,fmt=cohfmt) 'VEG_WATER:',cpatch%pft(ico),y%lai(ico),y%wai(ico) & + ,y%wpa(ico),y%tai(ico),errmax & + ,yerr%veg_water(ico) & + ,yscal%veg_water(ico),troublemaker + + + errmax = max(errmax,abs(yerr%veg_energy(ico)/yscal%veg_energy(ico))) + troublemaker = large_error(yerr%veg_energy(ico),yscal%veg_energy(ico)) + write(unit=*,fmt=cohfmt) 'VEG_ENERGY:',cpatch%pft(ico),cpatch%lai(ico) & + ,y%wai(ico),y%wpa(ico),y%tai(ico) & + ,errmax,yerr%veg_energy(ico) & + ,yscal%veg_energy(ico) & + ,troublemaker + + end if + end do + !------------------------------------------------------------------------------------! + + case default + !------------------------------------------------------------------------------------! + ! Leaf-only or two separate pools, print leaves if they are resolved. ! + !------------------------------------------------------------------------------------! + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) ' Leaf-level variables (only the resolvable ones):' + write(unit=*,fmt='(10(a,1x))') 'Name ',' PFT',' LAI' & + ,' WAI',' WPA',' TAI' & + ,' Max.Error',' Abs.Error',' Scale' & + ,'Problem(T|F)' + do ico = 1,cpatch%ncohorts + if (y%leaf_resolvable(ico)) then + errmax = max(errmax,abs(yerr%leaf_water(ico)/yscal%leaf_water(ico))) + troublemaker = large_error(yerr%leaf_water(ico),yscal%leaf_water(ico)) + write(unit=*,fmt=cohfmt) 'LEAF_WATER:',cpatch%pft(ico),y%lai(ico),y%wai(ico) & + ,y%wpa(ico),y%tai(ico),errmax & + ,yerr%leaf_water(ico) & + ,yscal%leaf_water(ico),troublemaker + + errmax = max(errmax,abs(yerr%leaf_energy(ico)/yscal%leaf_energy(ico))) + troublemaker = large_error(yerr%leaf_energy(ico),yscal%leaf_energy(ico)) + write(unit=*,fmt=cohfmt) 'LEAF_ENERGY:',cpatch%pft(ico),cpatch%lai(ico) & + ,y%wai(ico),y%wpa(ico),y%tai(ico) & + ,errmax,yerr%leaf_energy(ico) & + ,yscal%leaf_energy(ico) & + ,troublemaker + + end if + end do + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Branchwood, this is solved only if ibranch_thermo is 2. ! + !------------------------------------------------------------------------------------! + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) + write(unit=*,fmt='(80a)') ('-',k=1,80) + write(unit=*,fmt='(a)' ) ' Wood-level variables (only the resolvable ones):' + write(unit=*,fmt='(10(a,1x))') 'Name ',' PFT',' LAI' & + ,' WAI',' WPA',' TAI' & + ,' Max.Error',' Abs.Error',' Scale' & + ,'Problem(T|F)' + do ico = 1,cpatch%ncohorts + if (y%wood_resolvable(ico)) then + errmax = max(errmax,abs(yerr%wood_water(ico)/yscal%wood_water(ico))) + troublemaker = large_error(yerr%wood_water(ico),yscal%wood_water(ico)) + write(unit=*,fmt=cohfmt) 'WOOD_WATER:',cpatch%pft(ico),y%lai(ico),y%wai(ico) & + ,y%wpa(ico),y%tai(ico),errmax & + ,yerr%wood_water(ico) & + ,yscal%wood_water(ico),troublemaker + + errmax = max(errmax,abs(yerr%wood_energy(ico)/yscal%wood_energy(ico))) + troublemaker = large_error(yerr%wood_energy(ico),yscal%wood_energy(ico)) + write(unit=*,fmt=cohfmt) 'WOOD_ENERGY:',cpatch%pft(ico),cpatch%lai(ico) & + ,y%wai(ico),y%wpa(ico),y%tai(ico) & + ,errmax,yerr%wood_energy(ico) & + ,yscal%wood_energy(ico),troublemaker + end if + end do + !------------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------------! + + - end if - end do !---------------------------------------------------------------------------------------! ! Here we just need to make sure the user is checking mass, otherwise these ! @@ -3369,10 +3655,14 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) real(kind=8) :: avg_wood_temp real(kind=8) :: avg_wood_fliq real(kind=8) :: sfc_temp + real(kind=8) :: par_b_beam + real(kind=8) :: par_b_diff + real(kind=8) :: nir_b_beam + real(kind=8) :: nir_b_diff real(kind=8) :: elapsec !----- Local constants. ----------------------------------------------------------------! - character(len=10), parameter :: phfmt='(74(a,1x))' - character(len=48), parameter :: pbfmt='(3(i13,1x),4(es13.6,1x),3(i13,1x),64(es13.6,1x))' + character(len=10), parameter :: phfmt='(82(a,1x))' + character(len=48), parameter :: pbfmt='(3(i13,1x),4(es13.6,1x),3(i13,1x),72(es13.6,1x))' character(len=10), parameter :: chfmt='(57(a,1x))' character(len=48), parameter :: cbfmt='(3(i13,1x),2(es13.6,1x),3(i13,1x),49(es13.6,1x))' !----- Locally saved variables. --------------------------------------------------------! @@ -3461,6 +3751,10 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) end do !---------------------------------------------------------------------------------------! + par_b_beam = dble(csite%par_b_beam (ipa)) + par_b_diff = dble(csite%par_b_diffuse(ipa)) + nir_b_beam = dble(csite%nir_b_beam (ipa)) + nir_b_diff = dble(csite%nir_b_diffuse(ipa)) !---------------------------------------------------------------------------------------! @@ -3526,31 +3820,35 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) inquire(file=trim(detail_fout),exist=isthere) if (.not. isthere) then open (unit=83,file=trim(detail_fout),status='replace',action='write') - write (unit=83,fmt=phfmt) ' YEAR', ' MONTH', ' DAY' & - , ' TIME', ' HDID', ' LAI' & - , ' WAI', ' KSN', 'FLAG.SFCWATER' & - , ' FLAG.WFLXGC', ' ATM.PRSS', ' ATM.TEMP' & - , ' ATM.SHV', ' ATM.CO2', ' ATM.VELS' & - , ' ATM.PRATE', ' ATM.HEIGHT', ' ATM.RHOS' & - , ' ATM.RELHUM', ' ATM.THETA', ' ATM.THEIV' & - , ' MET.RSHORT', ' MET.RLONG', ' CAN.PRSS' & - , ' CAN.TEMP', ' CAN.SHV', ' CAN.CO2' & - , ' CAN.DEPTH', ' CAN.RHOS', ' CAN.RELHUM' & - , ' CAN.THETA', ' CAN.THEIV', ' SFC.TEMP' & - , ' SFC.SHV', ' LEAF.TEMP', ' LEAF.WATER' & - , ' WOOD.TEMP', ' WOOD.WATER', ' GGBARE' & - , ' GGVEG', ' GGNET', ' OPENCAN' & - , ' SOIL.TEMP', ' SOIL.WATER', ' SOILCP' & - , ' SOILWP', ' SOILFC', ' SLMSTS' & - , ' USTAR', ' TSTAR', ' QSTAR' & - , ' CSTAR', ' ZETA', ' RI_BULK' & - , ' GND.RSHORT', ' GND.RLONG', ' WFLXLC' & - , ' WFLXWC', ' DEWGND', ' WFLXGC' & - , ' WFLXAC', ' TRANSP', ' WSHED' & - , ' INTERCEPT', ' THROUGHFALL', ' HFLXGC' & - , ' HFLXLC', ' HFLXWC', ' HFLXAC' & - , ' CFLXAC', ' CWDRH', ' SOILRH' & - , ' GPP', ' PLRESP' + write (unit=83,fmt=phfmt) ' YEAR' , ' MONTH', ' DAY' & + , ' TIME' , ' HDID', ' LAI' & + , ' WAI' , ' KSN', 'FLAG.SFCWATER' & + , ' FLAG.WFLXGC' , ' ATM.PRSS', ' ATM.TEMP' & + , ' ATM.SHV' , ' ATM.CO2', ' ATM.VELS' & + , ' ATM.PRATE' , ' ATM.HEIGHT', ' ATM.RHOS' & + , ' ATM.RELHUM' , ' ATM.THETA', ' ATM.THEIV' & + , ' MET.RSHORT' , ' MET.RLONG', ' CAN.PRSS' & + , ' CAN.TEMP' , ' CAN.SHV', ' CAN.CO2' & + , ' CAN.DEPTH' , ' CAN.RHOS', ' CAN.RELHUM' & + , ' CAN.THETA' , ' CAN.THEIV', ' SFC.TEMP' & + , ' SFC.SHV' , ' LEAF.TEMP', ' LEAF.WATER' & + , ' WOOD.TEMP' , ' WOOD.WATER', ' GGBARE' & + , ' GGVEG' , ' GGNET', ' OPENCAN' & + , ' SOIL.TEMP' , ' SOIL.WATER', ' SOILCP' & + , ' SOILWP' , ' SOILFC', ' SLMSTS' & + , ' USTAR' , ' TSTAR', ' QSTAR' & + , ' CSTAR' , ' ZETA', ' RI.BULK' & + , ' GND.RSHORT' , ' GND.RLONG', ' WFLXLC' & + , ' WFLXWC' , ' WFLXGC', ' WFLXAC' & + , ' TRANSP' , ' WSHED', ' INTERCEPT' & + , ' THROUGHFALL' , ' HFLXGC', ' HFLXLC' & + , ' HFLXWC' , ' HFLXAC', ' CFLXAC' & + , ' CFLXST' , ' CWDRH', ' SOILRH' & + , ' GPP' , ' PLRESP', ' PAR.BEAM.TOP' & + , ' PAR.DIFF.TOP' , ' NIR.BEAM.TOP', ' NIR.DIFF.TOP' & + , ' PAR.BEAM.BOT' , ' PAR.DIFF.BOT', ' NIR.BEAM.BOT' & + , ' NIR.DIFF.BOT' + @@ -3585,14 +3883,16 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) , initp%ustar , initp%tstar , initp%qstar & , initp%cstar , initp%zeta , initp%ribulk & , fluxp%flx_rshort_gnd , fluxp%flx_rlong_gnd , fluxp%flx_vapor_lc & - , fluxp%flx_vapor_wc , fluxp%flx_dew_cg , fluxp%flx_vapor_gc & - , fluxp%flx_vapor_ac , fluxp%flx_transp , fluxp%flx_wshed_vg & - , fluxp%flx_intercepted , fluxp%flx_throughfall , fluxp%flx_sensible_gc & - , fluxp%flx_sensible_lc , fluxp%flx_sensible_wc , fluxp%flx_sensible_ac & - , fluxp%flx_carbon_ac , initp%cwd_rh , soil_rh & - , sum_gpp , sum_plresp - - + , fluxp%flx_vapor_wc , fluxp%flx_vapor_gc , fluxp%flx_vapor_ac & + , fluxp%flx_transp , fluxp%flx_wshed_vg , fluxp%flx_intercepted & + , fluxp%flx_throughfall , fluxp%flx_sensible_gc , fluxp%flx_sensible_lc & + , fluxp%flx_sensible_wc , fluxp%flx_sensible_ac , fluxp%flx_carbon_ac & + , fluxp%flx_carbon_st , initp%cwd_rh , soil_rh & + , sum_gpp , sum_plresp , rk4site%par_beam & + , rk4site%par_diffuse , rk4site%nir_beam , rk4site%nir_diffuse & + , par_b_beam , par_b_diff , nir_b_beam & + , nir_b_diff + close(unit=83,status='keep') !---------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/soil_respiration.f90 b/ED/src/dynamics/soil_respiration.f90 index 04ce57db5..076dd1138 100644 --- a/ED/src/dynamics/soil_respiration.f90 +++ b/ED/src/dynamics/soil_respiration.f90 @@ -6,9 +6,10 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) use ed_state_vars, only : sitetype & ! structure , patchtype ! ! structure - use soil_coms , only : soil ! ! intent(in) - use pft_coms , only : root_respiration_factor ! ! intent(in) - + use soil_coms , only : soil & ! intent(in) + , dslz & ! intent(in) + , slz & ! intent(in) + , nzg ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! type(sitetype) , target :: csite @@ -19,36 +20,62 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) type(patchtype) , pointer :: cpatch integer :: ico integer :: ipft - real :: r_resp_temp_fac + integer :: k + integer :: kroot real :: Lc - real :: r_resp !----- External functions. -------------------------------------------------------------! - real , external :: resp_weight + real , external :: het_resp_weight + real , external :: root_resp_norm !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! This is the temperature dependence of root respiration. Same for all cohorts. ! + ! Find the current root respiration. This is done cohort by cohort because the ! + ! parameters may be different depending on the PFT, and also because each layer has a ! + ! different temperature. ! !---------------------------------------------------------------------------------------! - r_resp_temp_fac = 1.0 & - / (1.0 + exp(0.4 * ( 278.15 - csite%soil_tempk(mzg,ipa) ) ) ) & - / (1.0 + exp(0.4 * ( csite%soil_tempk(mzg,ipa) - 318.15 ) ) ) & - * exp( 10.41 - 3000.0/csite%soil_tempk(mzg,ipa) ) - cpatch => csite%patch(ipa) do ico = 1,cpatch%ncohorts - ipft = cpatch%pft(ico) - r_resp = root_respiration_factor(ipft) * r_resp_temp_fac * cpatch%broot(ico) & - * cpatch%nplant(ico) - cpatch%root_respiration(ico) = r_resp - cpatch%mean_root_resp(ico) = cpatch%mean_root_resp(ico) + r_resp - cpatch%today_root_resp(ico) = cpatch%today_root_resp(ico) + r_resp + ipft = cpatch%pft(ico) + kroot = cpatch%krdepth(ico) + + !------------------------------------------------------------------------------------! + ! Add "intensive" contribution of each layer, assuming that the roots are equally ! + ! spread throughout the entire depth. ! + !------------------------------------------------------------------------------------! + cpatch%root_respiration(ico) = 0.0 + do k = kroot,nzg + cpatch%root_respiration(ico) = cpatch%root_respiration(ico) & + + root_resp_norm(ipft,csite%soil_tempk(k,ipa)) & + * dslz(k) + end do + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Now we make the value in umol/m2/s, by dividing by the total depth and ! + ! multiplying by the total root biomass. The minus sign is because slz is negative. ! + !------------------------------------------------------------------------------------! + cpatch%root_respiration(ico) = - cpatch%root_respiration(ico) * cpatch%broot(ico) & + * cpatch%nplant(ico) / slz(kroot) + !------------------------------------------------------------------------------------! + + + !----- Add this time step to the mean and daily mean root respiration. --------------! + cpatch%mean_root_resp(ico) = cpatch%mean_root_resp(ico) & + + cpatch%root_respiration(ico) + cpatch%today_root_resp(ico) = cpatch%today_root_resp(ico) & + + cpatch%root_respiration(ico) + !------------------------------------------------------------------------------------! end do + !---------------------------------------------------------------------------------------! !----- Compute soil/temperature modulation of heterotrophic respiration. ---------------! - csite%A_decomp(ipa) = resp_weight(csite%soil_tempk(mzg,ipa),csite%soil_water(mzg,ipa) & - ,ntext_soil(mzg)) + csite%A_decomp(ipa) = het_resp_weight(csite%soil_tempk(mzg,ipa) & + ,csite%soil_water(mzg,ipa) & + ,ntext_soil(mzg)) + !---------------------------------------------------------------------------------------! !----- Compute nitrogen immobilization factor. -----------------------------------------! call resp_f_decomp(csite,ipa, Lc) @@ -74,10 +101,111 @@ end subroutine soil_respiration !==========================================================================================! !==========================================================================================! -! This function computes the respiration limitation factor, which includes limitations ! -! due to temperature and moisture. ! +! This function determines the normalised root respiration (umol/kg_fine_root/s) at a ! +! given soil layer. ! +!------------------------------------------------------------------------------------------! +real function root_resp_norm(ipft,soil_temp) + use pft_coms , only : root_respiration_factor & ! intent(in) + , rrf_low_temp & ! intent(in) + , rrf_high_temp & ! intent(in) + , rrf_decay_e & ! intent(in) + , rrf_hor & ! intent(in) + , rrf_q10 ! ! intent(in) + use farq_leuning , only : arrhenius & ! function + , collatz ! ! function + use soil_coms , only : soil8 ! ! intent(in) + use rk4_coms , only : tiny_offset ! ! intent(in) + use physiology_coms, only : iphysiol ! ! intent(in) + use consts_coms , only : lnexp_min8 & ! intent(in) + , lnexp_max8 & ! intent(in) + , t008 ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: ipft + real(kind=4), intent(in) :: soil_temp + !----- Local variables. ----------------------------------------------------------------! + real(kind=8) :: soil_temp8 + real(kind=8) :: rrf08 + real(kind=8) :: rrf_low_temp8 + real(kind=8) :: rrf_high_temp8 + real(kind=8) :: rrf_decay_e8 + real(kind=8) :: rrf_hor8 + real(kind=8) :: rrf_q108 + real(kind=8) :: lnexplow + real(kind=8) :: lnexphigh + real(kind=8) :: tlow_fun + real(kind=8) :: thigh_fun + real(kind=8) :: rrf8 + !----- External functions. -------------------------------------------------------------! + real(kind=4) :: sngloff + !---------------------------------------------------------------------------------------! + + !----- Copy some variables to double precision temporaries. ----------------------------! + soil_temp8 = dble(soil_temp ) + rrf08 = dble(root_respiration_factor(ipft)) + rrf_low_temp8 = dble(rrf_low_temp (ipft)) + t008 + rrf_high_temp8 = dble(rrf_high_temp (ipft)) + t008 + rrf_decay_e8 = dble(rrf_decay_e (ipft)) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Compute the functions that will control the Rrf function for low and high temper- ! + ! ature. In order to avoid floating point exceptions, we check whether the temperature ! + ! will make the exponential too large or too small. ! + !---------------------------------------------------------------------------------------! + !----- Low temperature. ----------------------------------------------------------------! + lnexplow = rrf_decay_e8 * (rrf_low_temp8 - soil_temp8) + lnexplow = max(lnexp_min8,min(lnexp_max8,lnexplow)) + tlow_fun = 1.d0 + exp(lnexplow) + !----- High temperature. ---------------------------------------------------------------! + lnexphigh = rrf_decay_e8 * (soil_temp8 - rrf_high_temp8) + lnexphigh = max(lnexp_min8,min(lnexp_max8,lnexphigh)) + thigh_fun = 1.d0 + exp(lnexphigh) + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Decide which functional form to use based on the physiology. This is just to make ! + ! it look similar to the leaf respiration respiration. ! + !---------------------------------------------------------------------------------------! + select case (iphysiol) + case (0,1) + rrf_hor8 = dble(rrf_hor(ipft)) + rrf8 = arrhenius(soil_temp8,rrf08,rrf_hor8) / (tlow_fun * thigh_fun) + case (2,3) + rrf_q108 = dble(rrf_q10(ipft)) + rrf8 = collatz(soil_temp8,rrf08,rrf_q108) / (tlow_fun * thigh_fun) + end select + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Convert result to single precision. ! + !---------------------------------------------------------------------------------------! + root_resp_norm = sngloff(rrf8,tiny_offset) + !---------------------------------------------------------------------------------------! + + + return +end function root_resp_norm +!==========================================================================================! +!==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This function computes the heterotrophic respiration limitation factor, which ! +! includes limitations due to temperature and soil moisture. ! !------------------------------------------------------------------------------------------! -real function resp_weight(soil_tempk,soil_water,nsoil) +real function het_resp_weight(soil_tempk,soil_water,nsoil) use decomp_coms, only : resp_temperature_increase & ! intent(in) , resp_opt_water & ! intent(in) @@ -125,10 +253,10 @@ real function resp_weight(soil_tempk,soil_water,nsoil) end if !----- Compute the weight, which is just the combination of both. ----------------------! - resp_weight = temperature_limitation * water_limitation + het_resp_weight = temperature_limitation * water_limitation return -end function resp_weight +end function het_resp_weight !==========================================================================================! !==========================================================================================! diff --git a/ED/src/dynamics/structural_growth.f90 b/ED/src/dynamics/structural_growth.f90 index f1ca4a647..216072ad7 100644 --- a/ED/src/dynamics/structural_growth.f90 +++ b/ED/src/dynamics/structural_growth.f90 @@ -118,18 +118,19 @@ subroutine structural_growth(cgrid, month) !----- Determine how to distribute what is in bstorage. --------------------! call plant_structural_allocation(cpatch%pft(ico),cpatch%hite(ico) & - ,cgrid%lat(ipy),month & - ,cpatch%phenology_status(ico),f_bseeds,f_bdead) + ,cpatch%dbh(ico),cgrid%lat(ipy) & + ,cpatch%phenology_status(ico) & + ,f_bseeds,f_bdead) !----- Grow plants; bdead gets fraction f_bdead of bstorage. ---------------! cpatch%bdead(ico) = cpatch%bdead(ico) + f_bdead * cpatch%bstorage(ico) !------ NPP allocation to wood and course roots in KgC /m2 -----------------! - cpatch%today_NPPwood(ico) = agf_bs * f_bdead * cpatch%bstorage(ico) & - * cpatch%nplant(ico) - cpatch%today_NPPcroot(ico) = (1. - agf_bs) * f_bdead * cpatch%bstorage(ico) & + cpatch%today_NPPwood(ico) = agf_bs(ipft) * f_bdead * cpatch%bstorage(ico) & * cpatch%nplant(ico) + cpatch%today_NPPcroot(ico) = (1. - agf_bs(ipft)) * f_bdead & + * cpatch%bstorage(ico) * cpatch%nplant(ico) !---------------------------------------------------------------------------! ! Rebalance the plant nitrogen uptake considering the actual alloc- ! @@ -261,8 +262,10 @@ end subroutine structural_growth !==========================================================================================! !==========================================================================================! -! This subroutine will compute some structural growth variables without really ! -! updating the plant structure. This should be used for test purposes only. ! +! This subroutine will compute the seed allocation and carbon balance stuff, but it ! +! won't apply to cohorts. ! +! IMPORTANT: Do not change the order of operations below unless you know what you are ! +! doing. Changing the order can affect the C/N budgets. ! !------------------------------------------------------------------------------------------! subroutine structural_growth_eq_0(cgrid, month) use ed_state_vars , only : edtype & ! structure @@ -276,7 +279,9 @@ subroutine structural_growth_eq_0(cgrid, month) , c2n_storage & ! intent(in) , c2n_recruit & ! intent(in) , c2n_stem & ! intent(in) - , l2n_stem ! ! intent(in) + , l2n_stem & ! intent(in) + , negligible_nplant & ! intent(in) + , agf_bs ! ! intent(in) use decomp_coms , only : f_labile ! ! intent(in) use ed_max_dims , only : n_pft & ! intent(in) , n_dbh ! ! intent(in) @@ -354,9 +359,37 @@ subroutine structural_growth_eq_0(cgrid, month) agb_in = cpatch%agb(ico) ba_in = cpatch%basarea(ico) - !----- Reset monthly_dndt. -------------------------------------------------! + !---------------------------------------------------------------------------! + ! Apply mortality, and do not allow nplant < negligible_nplant (such a ! + ! sparse cohort is about to be terminated, anyway). ! + ! NB: monthly_dndt may be negative. ! + !---------------------------------------------------------------------------! cpatch%monthly_dndt(ico) = 0.0 + cpatch%nplant(ico) = cpatch%nplant(ico) + + !----- Calculate litter owing to mortality. --------------------------------! + balive_mort_litter = - cpatch%balive(ico) * cpatch%monthly_dndt(ico) + bstorage_mort_litter = - cpatch%bstorage(ico) * cpatch%monthly_dndt(ico) + struct_litter = - cpatch%bdead(ico) * cpatch%monthly_dndt(ico) + mort_litter = balive_mort_litter + bstorage_mort_litter & + + struct_litter + !----- Determine how to distribute what is in bstorage. --------------------! + call plant_structural_allocation(cpatch%pft(ico),cpatch%hite(ico) & + ,cpatch%dbh(ico),cgrid%lat(ipy) & + ,cpatch%phenology_status(ico) & + ,f_bseeds,f_bdead) + + !----- Grow plants; bdead gets fraction f_bdead of bstorage. ---------------! + cpatch%bdead(ico) = cpatch%bdead(ico) + + + !------ NPP allocation to wood and course roots in KgC /m2 -----------------! + cpatch%today_NPPwood(ico) = agf_bs(ipft) * f_bdead * cpatch%bstorage(ico) & + * cpatch%nplant(ico) + cpatch%today_NPPcroot(ico) = (1. - agf_bs(ipft)) * f_bdead & + * cpatch%bstorage(ico) * cpatch%nplant(ico) + !---------------------------------------------------------------------------! ! Rebalance the plant nitrogen uptake considering the actual alloc- ! ! ation to structural growth. This is necessary because c2n_stem does not ! @@ -369,8 +402,13 @@ subroutine structural_growth_eq_0(cgrid, month) ! Calculate total seed production and seed litter. The seed pool gets ! ! a fraction f_bseeds of bstorage. ! !---------------------------------------------------------------------------! - cpatch%bseeds(ico) = 0. - seed_litter = 0. + cpatch%bseeds(ico) = f_bseeds * cpatch%bstorage(ico) + + cpatch%today_NPPseeds(ico) = f_bseeds * cpatch%bstorage(ico) & + * cpatch%nplant(ico) + + seed_litter = cpatch%bseeds(ico) * cpatch%nplant(ico) & + * seedling_mortality(ipft) !---------------------------------------------------------------------------! ! Rebalance the plant nitrogen uptake considering the actual alloc- ! @@ -380,29 +418,34 @@ subroutine structural_growth_eq_0(cgrid, month) net_seed_N_uptake = cpatch%bseeds(ico) * cpatch%nplant(ico) & * (1.0 / c2n_recruit(ipft) - 1.0 / c2n_storage) + !----- Decrement the storage pool. -----------------------------------------! + cpatch%bstorage(ico) = cpatch%bstorage(ico) * (1.0 - f_bdead - f_bseeds) + !----- Finalize litter inputs. ---------------------------------------------! - csite%fsc_in(ipa) = csite%fsc_in(ipa) + f_labile(ipft) * balive_mort_litter & - + bstorage_mort_litter + seed_litter - csite%fsn_in(ipa) = csite%fsn_in(ipa) & - + f_labile(ipft) * balive_mort_litter / c2n_leaf(ipft) & - + bstorage_mort_litter/ c2n_storage & - + seed_litter / c2n_recruit(ipft) - csite%ssc_in(ipa) = csite%ssc_in(ipa) + struct_litter & - + (1.0 - f_labile(ipft)) * balive_mort_litter - csite%ssl_in(ipa) = csite%ssl_in(ipa) + & - ((1.0 - f_labile(ipft)) * balive_mort_litter & - + struct_litter ) * l2n_stem / c2n_stem(ipft) + csite%fsc_in(ipa) = csite%fsc_in(ipa) + csite%fsn_in(ipa) = csite%fsn_in(ipa) + csite%ssc_in(ipa) = csite%ssc_in(ipa) + csite%ssl_in(ipa) = csite%ssl_in(ipa) csite%total_plant_nitrogen_uptake(ipa) = & - csite%total_plant_nitrogen_uptake(ipa) + net_seed_N_uptake & - + net_stem_N_uptake + csite%total_plant_nitrogen_uptake(ipa) + !----- Update annual average carbon balances for mortality. ----------------! update_month = month - 1 if(update_month == 0) update_month = 12 cpatch%cb(update_month,ico) = cpatch%cb(13,ico) cpatch%cb_max(update_month,ico) = cpatch%cb_max(13,ico) + + !----- If monthly files are written, save the current carbon balance. ------! + if (associated(cpatch%mmean_cb)) then + cpatch%mmean_cb(ico) = cpatch%cb(13,ico) + end if + + !----- Reset the current month integrator. ---------------------------------! cpatch%cb(13,ico) = 0.0 cpatch%cb_max(13,ico) = 0.0 + + !----- Compute the relative carbon balance. --------------------------------! cb_act = 0.0 cb_max = 0.0 do imonth = 1,12 @@ -414,6 +457,8 @@ subroutine structural_growth_eq_0(cgrid, month) else cpatch%cbr_bar(ico) = 0.0 end if + !---------------------------------------------------------------------------! + !----- Update interesting output quantities. -------------------------------! call update_vital_rates(cpatch,ico,ilu,dbh_in,bdead_in,balive_in,hite_in & @@ -426,6 +471,9 @@ subroutine structural_growth_eq_0(cgrid, month) end do cohortloop + !----- Age the patch if this is not agriculture. ------------------------------! + if (csite%dist_type(ipa) /= 1) csite%age(ipa) = csite%age(ipa) + 1.0/12.0 + end do patchloop end do siteloop end do polyloop @@ -446,30 +494,57 @@ end subroutine structural_growth_eq_0 ! This subroutine will decide the partition of storage biomass into seeds and dead ! ! (structural) biomass. ! !------------------------------------------------------------------------------------------! -subroutine plant_structural_allocation(ipft,hite,lat,month,phen_status,f_bseeds,f_bdead) +subroutine plant_structural_allocation(ipft,hite,dbh,lat,phen_status,f_bseeds,f_bdead) use pft_coms , only : phenology & ! intent(in) , repro_min_h & ! intent(in) , r_fract & ! intent(in) , st_fract & ! intent(in) - , hgt_max & ! intent(in) + , dbh_crit & ! intent(in) , is_grass ! ! intent(in) - + use ed_misc_coms , only : current_time ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! - integer , intent(in) :: ipft - integer , intent(in) :: month - real , intent(in) :: hite - real , intent(in) :: lat - integer , intent(in) :: phen_status - real , intent(out) :: f_bseeds - real , intent(out) :: f_bdead + integer , intent(in) :: ipft + real , intent(in) :: hite + real , intent(in) :: dbh + real , intent(in) :: lat + integer , intent(in) :: phen_status + real , intent(out) :: f_bseeds + real , intent(out) :: f_bdead !----- Local variables -----------------------------------------------------------------! - logical :: late_spring + logical :: late_spring + logical , parameter :: printout = .false. + character(len=13), parameter :: fracfile = 'storalloc.txt' + !----- Locally saved variables. --------------------------------------------------------! + logical , save :: first_time = .true. + !---------------------------------------------------------------------------------------! + + + !----- First time, and the user wants to print the output. Make a header. -------------! + if (first_time) then + + !----- Make the header. -------------------------------------------------------------! + if (printout) then + open (unit=66,file=fracfile,status='replace',action='write') + write (unit=66,fmt='(15(a,1x))') & + ,' YEAR',' MONTH',' DAY',' PFT',' PHENOLOGY' & + ,' PHEN_STATUS',' LATE_SPRING',' GRASS',' HEIGHT',' REPRO_HGT' & + ,' DBH',' DBH_CRIT',' F_STORAGE',' F_SEEDS',' F_BDEAD' + close (unit=66,status='keep') + end if + !------------------------------------------------------------------------------------! + + first_time = .false. + end if !---------------------------------------------------------------------------------------! !----- Check whether this is late spring... --------------------------------------------! - late_spring = (lat >= 0.0 .and. month == 6) .or. (lat < 0.0 .and. month == 12) + late_spring = (lat >= 0.0 .and. current_time%month == 6) .or. & + (lat < 0.0 .and. current_time%month == 12) + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! Calculate fraction of bstorage going to bdead and reproduction. First we must ! @@ -478,7 +553,7 @@ subroutine plant_structural_allocation(ipft,hite,lat,month,phen_status,f_bseeds, ! deciduous plants), or if the plants are actively dropping leaves or off allometry. ! !---------------------------------------------------------------------------------------! if ((phenology(ipft) /= 2 .or. late_spring) .and. phen_status == 0) then - if (is_grass(ipft) .and. hite >= hgt_max(ipft)) then + if (is_grass(ipft) .and. dbh >= dbh_crit(ipft)) then !---------------------------------------------------------------------------------! ! Grasses have reached the maximum height, stop growing in size and send ! ! everything to reproduction. ! @@ -495,7 +570,16 @@ subroutine plant_structural_allocation(ipft,hite,lat,month,phen_status,f_bseeds, else f_bdead = 0.0 f_bseeds = 0.0 - end if + end if + + if (printout) then + open (unit=66,file=fracfile,status='old',position='append',action='write') + write (unit=66,fmt='(6(i12,1x),2(11x,l1,1x),7(f12.4,1x))') & + current_time%year,current_time%month,current_time%date,ipft,phenology(ipft) & + ,phen_status,late_spring,is_grass(ipft),hite,repro_min_h(ipft),dbh & + ,dbh_crit(ipft),st_fract(ipft),f_bseeds,f_bdead + close (unit=66,status='keep') + end if !---------------------------------------------------------------------------------------! return @@ -526,7 +610,6 @@ subroutine update_derived_cohort_props(cpatch,ico,green_leaf_factor,lsl) , ed_biomass & ! function , area_indices ! ! subroutine use consts_coms , only : pio4 ! ! intent(in) - use phenology_coms, only: theta_crit ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! @@ -548,8 +631,8 @@ subroutine update_derived_cohort_props(cpatch,ico,green_leaf_factor,lsl) case (0,1) select case (phenology(cpatch%pft(ico))) - case (4) - cpatch%elongf(ico) = max(0.0,min (1.0, cpatch%paw_avg(ico)/theta_crit)) + case (3,4) + cpatch%elongf(ico) = max(0.0,min (1.0, cpatch%paw_avg(ico))) case default cpatch%elongf(ico) = 1.0 end select diff --git a/ED/src/dynamics/twostream_rad.f90 b/ED/src/dynamics/twostream_rad.f90 index ecb85f62f..2fa5620af 100644 --- a/ED/src/dynamics/twostream_rad.f90 +++ b/ED/src/dynamics/twostream_rad.f90 @@ -12,11 +12,9 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft ,uw_vishi_beam,uw_vishi_diffuse,dw_nirlo_beam & ,dw_nirlo_diffuse,uw_nirhi_beam,uw_nirhi_diffuse & ,beam_level,diff_level,light_level,light_beam_level & - ,light_diff_level,lambda_coh,lambda_tot) + ,light_diff_level,lambda_out,lambda_tot) use ed_max_dims , only : n_pft ! ! intent(in) - use pft_coms , only : clumping_factor & ! intent(in) - , phenology ! ! intent(in) use canopy_radiation_coms, only : leaf_backscatter_nir & ! intent(in) , leaf_backscatter_vis & ! intent(in) , leaf_scatter_nir & ! intent(in) @@ -25,6 +23,11 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft , wood_backscatter_vis & ! intent(in) , wood_scatter_nir & ! intent(in) , wood_scatter_vis & ! intent(in) + , clumping_factor & ! intent(in) + , orient_factor & ! intent(in) + , phi1 & ! intent(in) + , phi2 & ! intent(in) + , mu_bar & ! intent(in) , par_beam_norm & ! intent(in) , par_diff_norm & ! intent(in) , nir_beam_norm & ! intent(in) @@ -58,7 +61,7 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft real(kind=8), dimension(ncoh) , intent(out) :: light_level real(kind=8), dimension(ncoh) , intent(out) :: light_beam_level real(kind=8), dimension(ncoh) , intent(out) :: light_diff_level - real(kind=8), dimension(ncoh) , intent(out) :: lambda_coh + real(kind=8), dimension(ncoh) , intent(out) :: lambda_out real(kind=8) , intent(out) :: lambda_tot !----- Local variables -----------------------------------------------------------------! integer , dimension(2*ncoh) :: indx @@ -91,6 +94,8 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft real(kind=8), dimension(ncoh) :: beam_bot_crown real(kind=8), dimension(ncoh) :: tai real(kind=8), dimension(ncoh) :: eff_tai + real(kind=8), dimension(ncoh) :: lambda + real(kind=8), dimension(ncoh) :: beam_backscatter real(kind=8), dimension(ncoh) :: cohort_scatter_vis real(kind=8), dimension(ncoh) :: cohort_backscatter_vis real(kind=8), dimension(ncoh) :: cohort_scatter_nir @@ -116,8 +121,6 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft real(kind=8) :: albedo real(kind=8) :: cosz real(kind=8) :: cosaoi - real(kind=8) :: lambda - real(kind=8) :: beam_backscatter real(kind=8) :: eta real(kind=8) :: zeta real(kind=8) :: iota @@ -126,6 +129,7 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft real(kind=8) :: zetai real(kind=8) :: d real(kind=8) :: rhoo + real(kind=8) :: psi real(kind=8) :: sigma real(kind=8) :: source_bot real(kind=8) :: source_top @@ -133,6 +137,8 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft real(kind=8) :: diff_top real(kind=8) :: weight_leaf real(kind=8) :: weight_wood + real(kind=8) :: proj_area + real(kind=8) :: snglscat_alb !---------------------------------------------------------------------------------------! @@ -145,12 +151,54 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft lambda = 5.d-1/cosaoi lambda_tot = 0.0d0 do il=1,ncoh - ipft = pft(il) - lambda_tot = lambda_tot + clumping_factor(ipft) + ipft = pft(il) + + !------------------------------------------------------------------------------------! + ! We find the optical depth of the direct beam (lambda), following CLM technical ! + ! note (equation 3.3 and text after equation 3.2). ! + !------------------------------------------------------------------------------------! + proj_area = phi1(ipft) + phi2(ipft) * cosaoi + lambda(il) = proj_area / cosaoi + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Find the backscatter for direct beam radiation, following equations (3.14) ! + ! and (3.15) of the CLM technical note. The forward scattering was omitted on both ! + ! equations because they are different for PAR and NIR, but in both cases they ! + ! cancel out. ! + !------------------------------------------------------------------------------------! + snglscat_alb = 5.d-1 * proj_area / (phi2(ipft) * cosaoi + proj_area) & + * ( 1.d0 - phi1(ipft) * cosaoi & + / (phi2(ipft) * cosaoi + proj_area) & + * log (1.d0 + (phi2(ipft) * cosaoi + proj_area) & + / (phi1(ipft) * cosaoi))) + beam_backscatter(il) = ( 1.d0 + mu_bar(ipft) * lambda(il) ) * snglscat_alb & + / ( mu_bar(ipft) * lambda(il) ) + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the effective TAI for this layer, and the net clumping factor. ! + !------------------------------------------------------------------------------------! tai (il) = lai(il) + wai(il) eff_tai (il) = clumping_factor(ipft) * lai(il) + wai(il) cohort_clumping (il) = eff_tai(il) / tai(il) - lambda_coh (il) = lambda * cohort_clumping(il) / canopy_area(il) + !------------------------------------------------------------------------------------! + + + + + !------------------------------------------------------------------------------------! + ! Find the output variables. ! + !------------------------------------------------------------------------------------! + lambda_out(il) = lambda(il) * cohort_clumping(il) / canopy_area(il) + lambda_tot = lambda_tot + cohort_clumping(il) * lambda(il) + !------------------------------------------------------------------------------------! + + + !----- Find the scattering coefficients. --------------------------------------------! weight_leaf = clumping_factor(ipft) * lai(il) / eff_tai(il) @@ -163,10 +211,9 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft + wood_backscatter_vis(ipft) * weight_wood cohort_backscatter_nir(il) = leaf_backscatter_nir(ipft) * weight_leaf & + wood_backscatter_nir(ipft) * weight_wood - + end do - lambda_tot = lambda_tot * lambda / dble(ncoh) - beam_backscatter = (5.d-1 + cosz) * (1.0d0 - cosz*log(1.0d0+1.0d0/cosz)) + lambda_tot = lambda_tot / dble(ncoh) !----- Loop over bands (currently Visible and near infrared). --------------------------! bandloop: do iband = 1,2 @@ -204,16 +251,19 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft ! canopy_area is one.). ! !------------------------------------------------------------------------------------! !----- Start with the tallest cohort, moving downwards. -----------------------------! - beam_bot_crown(ncoh) = beam_top * exp(-lambda*eff_tai(ncoh)/canopy_area(ncoh)) - beam_level(ncoh) = beam_top * exp(-5.d-1*lambda*eff_tai(ncoh)/canopy_area(ncoh)) - beam_bot(ncoh) = beam_top * (1.d0-canopy_area(ncoh)) & + beam_bot_crown(ncoh) = beam_top * exp( - lambda(ncoh) * eff_tai(ncoh) & + / canopy_area(ncoh) ) + beam_level(ncoh) = beam_top * exp( - 5.d-1 * lambda(ncoh) * eff_tai(ncoh) & + / canopy_area(ncoh) ) + beam_bot(ncoh) = beam_top * (1.d0 - canopy_area(ncoh)) & + canopy_area(ncoh) * beam_bot_crown(ncoh) do il=ncoh-1,1,-1 - beam_bot_crown(il) = beam_bot(il+1) * exp(-lambda*eff_tai(il)/canopy_area(il)) - beam_bot(il) = beam_bot(il+1)*(1.d0-canopy_area(il)) & - + canopy_area(il)*beam_bot_crown(il) + beam_bot_crown(il) = beam_bot(il+1) * exp( - lambda(il) * eff_tai(il) & + / canopy_area(il) ) + beam_bot(il) = beam_bot(il+1) * (1.d0 - canopy_area(il)) & + + canopy_area(il) * beam_bot_crown(il) beam_level(il) = beam_bot(il+1) & - * exp(-5.d-1*lambda*eff_tai(il)/canopy_area(il)) & + * exp(- 5.d-1 * lambda(il) * eff_tai(il) / canopy_area(il)) & * canopy_area(il) & + (1.d0-canopy_area(il)) * beam_bot(il+1) end do @@ -221,10 +271,12 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft do il=1,ncoh ipft = pft(il) eta = cohort_clumping(il) & - * (1.0d0 - (1.0d0-cohort_backscatter(il)) * cohort_scatter(il)) - zeta = cohort_scatter(il) * cohort_backscatter(il) * cohort_clumping(il) - sigma = cohort_clumping(il) * lambda - iota = sigma * cohort_scatter(il) * beam_backscatter + * (1.0d0 - ( 1.0d0 - cohort_backscatter(il)) * cohort_scatter(il)) & + / mu_bar(ipft) + zeta = cohort_scatter(il) * cohort_backscatter(il) * cohort_clumping(il) & + / mu_bar(ipft) + psi = cohort_clumping(il) * lambda(il) + iota = psi * cohort_scatter(il) * beam_backscatter(il) !----- Find derived properties. --------------------------------------------------! @@ -232,35 +284,36 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft exki = 1.0d0/exk zetai = 1.0d0/zeta + sigma = psi * psi + zeta * zeta - eta * eta !----- Sources. ------------------------------------------------------------------! source_bot = iota * beam_bot_crown(il) - source_top = source_bot * exp(lambda * eff_tai(il)) + source_top = source_bot * exp(lambda(il) * eff_tai(il)) !----- Forcing coefficients. -----------------------------------------------------! - rhoo = - (zeta + eta + sigma) * source_bot + rhoo = - (zeta + eta + psi) * source_bot !----- Calculate exponentials only once. -----------------------------------------! expkl_bot (il) = 1.0d0 expkl_top (il) = exp(exk * tai(il)) expamk_bot(il) = 1.0d0 - expamk_top(il) = exp((sigma-exk) * tai(il)) + expamk_top(il) = exp((psi-exk) * tai(il)) expapk_bot(il) = 1.0d0 - expapk_top(il) = exp((sigma+exk) * tai(il)) + expapk_top(il) = exp((psi+exk) * tai(il)) a_bot(il) = -source_bot*zetai a_top(il) = -source_top*zetai & - + 5.d-1*zetai*(eta*exki-1.0d0)*expkl_top(il)*rhoo/(sigma-exk) & + + 5.d-1*zetai*(eta*exki-1.0d0)*expkl_top(il)*rhoo/(psi-exk) & * (expamk_top(il)-expamk_bot(il)) & - - 5.d-1*zetai*(eta*exki+1.0d0) / expkl_top(il)*rhoo/(sigma+exk) & + - 5.d-1*zetai*(eta*exki+1.0d0) / expkl_top(il)*rhoo/(psi+exk) & * (expapk_top(il)-expapk_bot(il)) b_bot(il) = 5.d-1*zetai*(eta*exki-1.0d0) b_top(il) = 5.d-1*zetai*(eta*exki-1.0d0)*expkl_top(il) c_bot(il) = -5.d-1*zetai*(eta*exki+1.0d0) c_top(il) = -5.d-1*zetai*(eta*exki+1.0d0)/expkl_top(il) f_bot(il) = 0.0d0 - f_top(il) = 5.d-1*exki*expkl_top(il)*rhoo/(sigma-exk) & + f_top(il) = 5.d-1*exki*expkl_top(il)*rhoo/(psi-exk) & * (expamk_top(il)-expamk_bot(il)) & - - 5.d-1*exki/expkl_top(il)*rhoo/(sigma+exk) & + - 5.d-1*exki/expkl_top(il)*rhoo/(psi+exk) & * (expapk_top(il)-expapk_bot(il)) g_bot(il) = 5.d-1*exki g_top(il) = 5.d-1*exki*expkl_top(il) @@ -456,930 +509,36 @@ subroutine sw_twostream_clump(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft / ( par_beam_norm + nir_beam_norm ) light_diff_level(il) = 5.d-1 * ( downward_vis_diffuse(il ) & - + downward_nir_diffuse(il ) & - + downward_vis_diffuse(il+1) & - + downward_nir_diffuse(il+1) ) & - / ( par_diff_norm + nir_beam_norm ) - !------------------------------------------------------------------------------------! - - par_beam_flip(il) = sngl( downward_vis_beam (il+1) & - - downward_vis_beam (il ) & - + upward_vis_beam (il ) & - - upward_vis_beam (il+1) ) - par_diffuse_flip(il) = sngl( downward_vis_diffuse (il+1) & - - downward_vis_diffuse (il ) & - + upward_vis_diffuse (il ) & - - upward_vis_diffuse (il+1) ) - - sw_abs_beam_flip(il) = par_beam_flip(il) + sngl( downward_nir_beam (il+1) & - - downward_nir_beam (il ) & - + upward_nir_beam (il ) & - - upward_nir_beam(il+1)) - - sw_abs_diffuse_flip(il) = par_diffuse_flip(il) + sngl( downward_nir_diffuse(il+1) & - - downward_nir_diffuse(il ) & - + upward_nir_diffuse (il ) & - - upward_nir_diffuse (il+1) ) - - !----- Ensure that we don't get any negative radiation... ---------------------------! - par_beam_flip(il) = max(0.0,par_beam_flip(il) ) - par_diffuse_flip(il) = max(0.0,par_diffuse_flip(il) ) - sw_abs_beam_flip(il) = max(0.0,sw_abs_beam_flip(il) ) - sw_abs_diffuse_flip(il) = max(0.0,sw_abs_diffuse_flip(il) ) - end do - !---------------------------------------------------------------------------------------! - - - - - - !----- Copy to the output variables. ---------------------------------------------------! - dw_vislo_beam = max(0.0,sngl(downward_vis_beam (1) ) ) - dw_vislo_diffuse = max(0.0,sngl(downward_vis_diffuse (1) ) ) - uw_vishi_beam = max(0.0,sngl(upward_vis_beam (ncoh+1) ) ) - uw_vishi_diffuse = max(0.0,sngl(upward_vis_diffuse (ncoh+1) ) ) - dw_nirlo_beam = max(0.0,sngl(downward_nir_beam (1) ) ) - dw_nirlo_diffuse = max(0.0,sngl(downward_nir_diffuse (1) ) ) - uw_nirhi_beam = max(0.0,sngl(upward_nir_beam (ncoh+1) ) ) - uw_nirhi_diffuse = max(0.0,sngl(upward_nir_diffuse (ncoh+1) ) ) - !---------------------------------------------------------------------------------------! - - return -end subroutine sw_twostream_clump -!==========================================================================================! -!==========================================================================================! - - - - - - -!==========================================================================================! -!==========================================================================================! -! This subroutine will solve the within canopy two-stream radiation for shortwave, ! -! considering the light absorption by leaves, and branches if the user wants so. In both ! -! cases we consider the clumpiness effect (i.e., the fact that leaves and branches aren't ! -! randomly distributed). In this case, we solve the canopy layer-by-layer rather than ! -! cohort-by-cohort. ! -!------------------------------------------------------------------------------------------! -subroutine sw_twostream_layer(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft & - ,lai,wai,canopy_area,hgttop,hgtbot & - ,par_beam_flip,par_diffuse_flip,sw_abs_beam_flip & - ,sw_abs_diffuse_flip,dw_vislo_beam,dw_vislo_diffuse & - ,uw_vishi_beam,uw_vishi_diffuse,dw_nirlo_beam & - ,dw_nirlo_diffuse,uw_nirhi_beam,uw_nirhi_diffuse & - ,beam_level,diff_level,light_level,light_beam_level & - ,light_diff_level,lambda_coh,lambda_tot) - - use ed_max_dims , only : n_pft ! ! intent(in) - use pft_coms , only : clumping_factor & ! intent(in) - , phenology ! ! intent(in) - use canopy_radiation_coms, only : leaf_backscatter_nir & ! intent(in) - , leaf_backscatter_vis & ! intent(in) - , leaf_scatter_nir & ! intent(in) - , leaf_scatter_vis & ! intent(in) - , wood_backscatter_nir & ! intent(in) - , wood_backscatter_vis & ! intent(in) - , wood_scatter_nir & ! intent(in) - , wood_scatter_vis & ! intent(in) - , par_beam_norm & ! intent(in) - , par_diff_norm & ! intent(in) - , nir_beam_norm & ! intent(in) - , nir_diff_norm & ! intent(in) - , cosz_min8 ! ! intent(in) - use canopy_layer_coms , only : dzcan8 & ! intent(in) - , zztop8 & ! intent(in) - , zzmid8 & ! intent(in) - , zzbot8 & ! intent(in) - , zztop0i8 & ! intent(in) - , ehgti8 & ! intent(in) - , ncanlyr & ! intent(in) - , ncanlyrp1 & ! intent(in) - , ncanlyrt2 & ! intent(in) - , indx & ! intent(inout) - , populated & ! intent(inout) - , dzcanpop & ! intent(inout) - , matal & ! intent(inout) - , mastermat & ! intent(inout) - , masmatcp & ! intent(inout) - , opencan8 & ! intent(inout) - , layer_scatter & ! intent(inout) - , layer_backscatter & ! intent(inout) - , layer_clumping & ! intent(inout) - , expkl_top & ! intent(inout) - , expkl_bot & ! intent(inout) - , expamk_top & ! intent(inout) - , expamk_bot & ! intent(inout) - , expapk_top & ! intent(inout) - , expapk_bot & ! intent(inout) - , a_top & ! intent(inout) - , a_bot & ! intent(inout) - , b_top & ! intent(inout) - , b_bot & ! intent(inout) - , c_top & ! intent(inout) - , c_bot & ! intent(inout) - , f_top & ! intent(inout) - , f_bot & ! intent(inout) - , g_top & ! intent(inout) - , g_bot & ! intent(inout) - , h_top & ! intent(inout) - , h_bot & ! intent(inout) - , beam_bot & ! intent(inout) - , beam_mid & ! intent(inout) - , beam_bot_crown & ! intent(inout) - , upward_vis_beam & ! intent(inout) - , upward_vis_diffuse & ! intent(inout) - , upward_nir_beam & ! intent(inout) - , upward_nir_diffuse & ! intent(inout) - , downward_nir_beam & ! intent(inout) - , downward_nir_diffuse & ! intent(inout) - , downward_vis_beam & ! intent(inout) - , downward_vis_diffuse & ! intent(inout) - , mastervec_beam & ! intent(inout) - , masveccp_beam & ! intent(inout) - , mastervec_diffuse & ! intent(inout) - , masveccp_diffuse & ! intent(inout) - , par_beam_layer & ! intent(inout) - , par_diffuse_layer & ! intent(inout) - , sw_abs_beam_layer & ! intent(inout) - , sw_abs_diffuse_layer & ! intent(inout) - , zero_canopy_layer ! ! subroutine - use consts_coms , only : tiny_num8 ! ! intent(in) - implicit none - !----- Arguments -----------------------------------------------------------------------! - integer , dimension(ncoh) , intent(in) :: pft - integer , intent(in) :: ncoh - real(kind=8), dimension(ncoh) , intent(in) :: lai - real(kind=8), dimension(ncoh) , intent(in) :: wai - real(kind=8), dimension(ncoh) , intent(in) :: canopy_area - real(kind=8), dimension(ncoh) , intent(in) :: hgttop - real(kind=8), dimension(ncoh) , intent(in) :: hgtbot - real(kind=4) , intent(in) :: salbedo_par - real(kind=4) , intent(in) :: salbedo_nir - real(kind=4) , intent(in) :: scosz - real(kind=4) , intent(in) :: scosaoi - real(kind=4), dimension(ncoh) , intent(out) :: par_beam_flip - real(kind=4), dimension(ncoh) , intent(out) :: par_diffuse_flip - real(kind=4), dimension(ncoh) , intent(out) :: sw_abs_beam_flip - real(kind=4), dimension(ncoh) , intent(out) :: sw_abs_diffuse_flip - real(kind=4) , intent(out) :: uw_vishi_beam - real(kind=4) , intent(out) :: uw_vishi_diffuse - real(kind=4) , intent(out) :: uw_nirhi_beam - real(kind=4) , intent(out) :: uw_nirhi_diffuse - real(kind=4) , intent(out) :: dw_vislo_beam - real(kind=4) , intent(out) :: dw_vislo_diffuse - real(kind=4) , intent(out) :: dw_nirlo_beam - real(kind=4) , intent(out) :: dw_nirlo_diffuse - real(kind=8), dimension(ncoh) , intent(out) :: beam_level - real(kind=8), dimension(ncoh) , intent(out) :: diff_level - real(kind=8), dimension(ncoh) , intent(out) :: light_level - real(kind=8), dimension(ncoh) , intent(out) :: light_beam_level - real(kind=8), dimension(ncoh) , intent(out) :: light_diff_level - real(kind=8), dimension(ncoh) , intent(out) :: lambda_coh - real(kind=8) , intent(out) :: lambda_tot - !----- Local variables -----------------------------------------------------------------! - integer :: il - integer :: ico - integer :: jco - integer :: ipft - integer :: iband - integer :: i - integer :: j - integer :: ind - integer :: nactlyr - integer :: nactlyrp1 - integer :: nactlyrt2 - integer , dimension(ncoh) :: kapartial - integer , dimension(ncoh) :: kafull - integer , dimension(ncoh) :: kzpartial - integer , dimension(ncoh) :: kzfull - integer , dimension(ncoh) :: nlyr_coh - real(kind=8) :: albedo - real(kind=8) :: cosz - real(kind=8) :: cosaoi - real(kind=8) :: lambda - real(kind=8) :: lad - real(kind=8) :: wad - real(kind=8) :: this_cai - real(kind=8) :: this_tai - real(kind=8) :: this_eff_tai - real(kind=8) :: this_ext - real(kind=8) :: layer_ext - real(kind=8) :: beam_backscatter - real(kind=8) :: eta - real(kind=8) :: zeta - real(kind=8) :: exk - real(kind=8) :: exki - real(kind=8) :: zetai - real(kind=8) :: d - real(kind=8) :: rhoo - real(kind=8) :: sigma - real(kind=8) :: iota - real(kind=8) :: source_bot - real(kind=8) :: source_top - real(kind=8) :: beam_top - real(kind=8) :: diff_top - real(kind=8) :: weight_leaf - real(kind=8) :: weight_wood - !----- Variables that must be allocated every time. ------------------------------------! - real(kind=8), dimension(:,:) , allocatable :: extinct_full - real(kind=8), dimension(:,:) , allocatable :: extinct_half - real(kind=8), dimension(:,:) , allocatable :: canfrac_lyr - real(kind=8), dimension(:,:) , allocatable :: tai_lyr - real(kind=8), dimension(:,:) , allocatable :: eff_tai_lyr - real(kind=8), dimension(:,:) , allocatable :: scatter_vis_lyr - real(kind=8), dimension(:,:) , allocatable :: backscatter_vis_lyr - real(kind=8), dimension(:,:) , allocatable :: scatter_nir_lyr - real(kind=8), dimension(:,:) , allocatable :: backscatter_nir_lyr - !------ External functions. ------------------------------------------------------------! - real(kind=4) , external :: sngloff - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! These must be allocated and de-allocated every time as the number of cohorts is ! - ! unbounded and may change. ! - !---------------------------------------------------------------------------------------! - allocate(extinct_full (ncoh,ncanlyr)) - allocate(extinct_half (ncoh,ncanlyr)) - allocate(canfrac_lyr (ncoh,ncanlyr)) - allocate(tai_lyr (ncoh,ncanlyr)) - allocate(eff_tai_lyr (ncoh,ncanlyr)) - allocate(scatter_vis_lyr (ncoh,ncanlyr)) - allocate(backscatter_vis_lyr(ncoh,ncanlyr)) - allocate(scatter_nir_lyr (ncoh,ncanlyr)) - allocate(backscatter_nir_lyr(ncoh,ncanlyr)) - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Reset the temporary variables. ! - !---------------------------------------------------------------------------------------! - call zero_canopy_layer('sw_twostream_layer') - extinct_full (:,:) = 0.d0 - extinct_half (:,:) = 0.d0 - canfrac_lyr (:,:) = 0.d0 - tai_lyr (:,:) = 0.d0 - eff_tai_lyr (:,:) = 0.d0 - scatter_vis_lyr (:,:) = 0.d0 - backscatter_vis_lyr (:,:) = 0.d0 - scatter_nir_lyr (:,:) = 0.d0 - backscatter_nir_lyr (:,:) = 0.d0 - !---------------------------------------------------------------------------------------! - - - - !----- Convert input variable to double precision. -------------------------------------! - cosz = max(cosz_min8,dble(scosz)) - cosaoi = max(cosz_min8,dble(scosaoi)) - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Find the crown area for each layer, and determine the layer bounds for each ! - ! cohort. ! - !---------------------------------------------------------------------------------------! - do ico = 1,ncoh - !------ Find the layer bounds. ------------------------------------------------------! - kapartial (ico) = min(ncanlyr,floor ((hgtbot(ico) * zztop0i8)**ehgti8) + 1) - kafull (ico) = min(ncanlyr,ceiling((hgtbot(ico) * zztop0i8)**ehgti8) + 1) - kzpartial (ico) = min(ncanlyr,ceiling((hgttop(ico) * zztop0i8)**ehgti8)) - kzfull (ico) = min(ncanlyr,floor ((hgttop(ico) * zztop0i8)**ehgti8)) - - - !------------------------------------------------------------------------------------! - ! Find the actual crown area that each cohort has in each layer. The allometry ! - ! value should be regarded as the potential value if no other cohort is present. ! - ! In case the total crown area for a given layer exceeds one, then we squeeze the ! - ! plants in that layer so the cohorts don't sit on top of each other. ! - !------------------------------------------------------------------------------------! - do il = kapartial(ico),kzpartial(ico) - populated(il) = .true. - canfrac_lyr (ico,il) = canopy_area(ico) - end do - !------------------------------------------------------------------------------------! - end do - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Find the open canopy fraction. This is done in three steps: ! - ! 1. Find the closed canopy fraction. ! - ! 2. Check the size. If it exceeds one, scale down the canopy area for each layer and ! - ! force it to be one. ! - ! 3. Set the open canopy area to be 1- closed canopy area. ! - !---------------------------------------------------------------------------------------! - do il=1,ncanlyr - opencan8(il) = sum(canfrac_lyr(:,il)) - if (opencan8(il) > 1.d0) then - canfrac_lyr(:,il) = canfrac_lyr(:,il) / opencan8(il) - opencan8(il) = 1.d0 - end if - opencan8(il) = 1.d0 - opencan8(il) - end do - !---------------------------------------------------------------------------------------! - - - lambda = 5.d-1/cosaoi - lambda_coh(:) = 0.d0 - do ico=1,ncoh - !------ Alias for current PFT. ------------------------------------------------------! - ipft = pft(ico) - - !------ Find the "tree" area density. -----------------------------------------------! - lad = lai(ico) / (hgttop(ico) - hgtbot(ico)) - wad = wai(ico) / (hgttop(ico) - hgtbot(ico)) - - !------------------------------------------------------------------------------------! - ! Integrate the extinction coefficients for partial layers. Here we scale the ! - ! leaf area density to the layer (partial or full), so the total leaf area index is ! - ! preserved. The only special case is when the top and bottom of the crown are in ! - ! the same layer, in which case we simply use the leaf area index. If the user is ! - ! running with branch thermodynamics, then it should be total (leaf + branch) area ! - ! index instead of leaf area index. ! - !------------------------------------------------------------------------------------! - if (kapartial(ico) == kzpartial(ico)) then - il = kapartial(ico) - this_tai = lai (ico) + wai(ico) - this_eff_tai = clumping_factor(ipft) * lai (ico) + wai(ico) - weight_leaf = (clumping_factor(ipft) * lai (ico)) / this_eff_tai - weight_wood = 1.d0 - weight_leaf - - tai_lyr (ico,il) = this_tai - eff_tai_lyr (ico,il) = this_eff_tai - this_ext = lambda * eff_tai_lyr(ico,il) / canfrac_lyr(ico,il) - extinct_full (ico,il) = exp( - this_ext) - extinct_half (ico,il) = exp( - 5.d-1 * this_ext ) - lambda_coh (ico) = lambda_coh(ico) + this_ext - scatter_vis_lyr (ico,il) = leaf_scatter_vis(ipft) * weight_leaf & - + wood_scatter_vis(ipft) * weight_wood - backscatter_vis_lyr(ico,il) = leaf_backscatter_vis(ipft) * weight_leaf & - + wood_backscatter_vis(ipft) * weight_wood - scatter_nir_lyr (ico,il) = leaf_scatter_nir(ipft) * weight_leaf & - + wood_scatter_nir(ipft) * weight_wood - backscatter_nir_lyr(ico,il) = leaf_backscatter_nir(ipft) * weight_leaf & - + wood_backscatter_nir(ipft) * weight_wood - else - !------ Fully vegetated layers. --------------------------------------------------! - do il=kafull(ico),kzfull(ico) - this_tai = (lad + wad) * dzcan8(il) - this_eff_tai = (clumping_factor(ipft) * lad + wad) * dzcan8(il) - weight_leaf = (clumping_factor(ipft) * lad * dzcan8(il)) & - / this_eff_tai - weight_wood = 1.d0 - weight_leaf - - tai_lyr (ico,il) = this_tai - eff_tai_lyr (ico,il) = this_eff_tai - this_ext = lambda * eff_tai_lyr(ico,il) / canfrac_lyr(ico,il) - extinct_full (ico,il) = exp( - this_ext) - extinct_half (ico,il) = exp( - 5.d-1 * this_ext) - lambda_coh (ico) = lambda_coh(ico) + this_ext - scatter_vis_lyr (ico,il) = leaf_scatter_vis(ipft) * weight_leaf & - + wood_scatter_vis(ipft) * weight_wood - backscatter_vis_lyr(ico,il) = leaf_backscatter_vis(ipft) * weight_leaf & - + wood_backscatter_vis(ipft) * weight_wood - scatter_nir_lyr (ico,il) = leaf_scatter_nir(ipft) * weight_leaf & - + wood_scatter_nir(ipft) * weight_wood - backscatter_nir_lyr(ico,il) = leaf_backscatter_nir(ipft) * weight_leaf & - + wood_backscatter_nir(ipft) * weight_wood - end do - !---------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------! - ! Partial layer at the bottom of the crown. This shouldn't be done if the ! - ! partial and full indices are the same, otherwise we double account the layer. ! - !---------------------------------------------------------------------------------! - if (kapartial(ico) /= kafull(ico)) then - il = kapartial(ico) - this_tai = (lad + wad) * (zztop8(il)-hgtbot(ico)) - this_eff_tai = (clumping_factor(ipft) * lad + wad) & - * (zztop8(il)-hgtbot(ico)) - weight_leaf = ( clumping_factor(ipft) * lad & - * (zztop8(il)-hgtbot(ico)) ) & - / this_eff_tai - weight_wood = 1.d0 - weight_leaf - - tai_lyr (ico,il) = this_tai - eff_tai_lyr (ico,il) = this_eff_tai - this_ext = lambda * eff_tai_lyr(ico,il) / canfrac_lyr(ico,il) - extinct_full (ico,il) = exp( - this_ext) - extinct_half (ico,il) = exp( - 5.d-1 * this_ext) - lambda_coh (ico) = lambda_coh(ico) + this_ext - scatter_vis_lyr (ico,il) = leaf_scatter_vis(ipft) * weight_leaf & - + wood_scatter_vis(ipft) * weight_wood - backscatter_vis_lyr(ico,il) = leaf_backscatter_vis(ipft) * weight_leaf & - + wood_backscatter_vis(ipft) * weight_wood - scatter_nir_lyr (ico,il) = leaf_scatter_nir(ipft) * weight_leaf & - + wood_scatter_nir(ipft) * weight_wood - backscatter_nir_lyr(ico,il) = leaf_backscatter_nir(ipft) * weight_leaf & - + wood_backscatter_nir(ipft) * weight_wood - end if - if (kzpartial(ico) /= kzfull(ico)) then - il = kzpartial(ico) - this_tai = (lad + wad) * (hgttop(ico) - zzbot8(il)) - this_eff_tai = (clumping_factor(ipft) * lad + wad) & - * (hgttop(ico) - zzbot8(il)) - weight_leaf = ( clumping_factor(ipft) * lad & - * (hgttop(ico) - zzbot8(il)) ) & - / this_eff_tai - weight_wood = 1.d0 - weight_leaf - - tai_lyr (ico,il) = this_tai - eff_tai_lyr (ico,il) = this_eff_tai - this_ext = lambda * eff_tai_lyr(ico,il) / canfrac_lyr(ico,il) - extinct_full (ico,il) = exp( - this_ext) - extinct_half (ico,il) = exp( - 5.d-1 * this_ext) - lambda_coh (ico) = lambda_coh(ico) + this_ext - scatter_vis_lyr (ico,il) = leaf_scatter_vis(ipft) * weight_leaf & - + wood_scatter_vis(ipft) * weight_wood - backscatter_vis_lyr(ico,il) = leaf_backscatter_vis(ipft) * weight_leaf & - + wood_backscatter_vis(ipft) * weight_wood - scatter_nir_lyr (ico,il) = leaf_scatter_nir(ipft) * weight_leaf & - + wood_scatter_nir(ipft) * weight_wood - backscatter_nir_lyr(ico,il) = leaf_backscatter_nir(ipft) * weight_leaf & - + wood_backscatter_nir(ipft) * weight_wood - end if - end if - !------------------------------------------------------------------------------------! - end do - !---------------------------------------------------------------------------------------! - - - - - !------ Find the average extinction coefficients. --------------------------------------! - lambda_tot = sum(lambda_coh(:)) / sum(lai(:) + wai(:)) - lambda_coh = lambda_coh(:) / (lai(:) + wai(:)) - !---------------------------------------------------------------------------------------! - - - - - !------ Find the beam backscattering coefficient. --------------------------------------! - beam_backscatter = (5.d-1 + cosz) * (1.0d0 - cosz*log(1.0d0+1.0d0/cosz)) - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! Pack the information so we skip empty layers in the middle, thus avoinding ! - ! singularities. From this point on we must refer to nactlyr, not ncanlyr. ! - !---------------------------------------------------------------------------------------! - !----- Find out how many active layers we have. ----------------------------------------! - nactlyr = count(populated) - nactlyrp1 = nactlyr+1 - nactlyrt2 = 2 * nactlyr - !----- Squeeze the arrays. -------------------------------------------------------------! - opencan8(1:nactlyr) = pack(opencan8, populated) - dzcanpop(1:nactlyr) = pack(dzcan8 , populated) - if (nactlyrp1 < ncanlyr) then - opencan8(nactlyrp1:ncanlyr) = 0.d0 - dzcanpop(nactlyrp1:ncanlyr) = 0.d0 - end if - do ico = 1,ncoh - tai_lyr (ico,1:nactlyr) = pack(tai_lyr (ico,:), populated) - eff_tai_lyr (ico,1:nactlyr) = pack(eff_tai_lyr (ico,:), populated) - canfrac_lyr (ico,1:nactlyr) = pack(canfrac_lyr (ico,:), populated) - extinct_full (ico,1:nactlyr) = pack(extinct_full (ico,:), populated) - extinct_half (ico,1:nactlyr) = pack(extinct_half (ico,:), populated) - scatter_vis_lyr (ico,1:nactlyr) = pack(scatter_vis_lyr (ico,:), populated) - backscatter_vis_lyr(ico,1:nactlyr) = pack(backscatter_vis_lyr(ico,:), populated) - scatter_nir_lyr (ico,1:nactlyr) = pack(scatter_nir_lyr (ico,:), populated) - backscatter_nir_lyr(ico,1:nactlyr) = pack(backscatter_nir_lyr(ico,:), populated) - if (nactlyrp1 < ncanlyr) then - tai_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - eff_tai_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - canfrac_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - extinct_full (ico,nactlyrp1:ncanlyr) = 0.d0 - extinct_half (ico,nactlyrp1:ncanlyr) = 0.d0 - scatter_vis_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - backscatter_vis_lyr(ico,nactlyrp1:ncanlyr) = 0.d0 - scatter_nir_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - backscatter_nir_lyr(ico,nactlyrp1:ncanlyr) = 0.d0 - end if - !----- Count the number of layers that have leaves/branches for this cohort. --------! - nlyr_coh (ico) = count(canfrac_lyr(ico,:) > 0.d0) - end do - !---------------------------------------------------------------------------------------! - - - - !----- Loop over bands (currently Visible and near infrared). --------------------------! - bandloop: do iband = 1,2 - select case(iband) - case (1) !----- Visible (or PAR). ---------------------------------------------------! - do il = 1,nactlyr - layer_scatter(il) = sum(scatter_vis_lyr(:,il) * eff_tai_lyr(:,il)) & - / sum(eff_tai_lyr(:,il)) - layer_backscatter(il) = sum(backscatter_vis_lyr(:,il) * eff_tai_lyr(:,il)) & - / sum(eff_tai_lyr(:,il)) - layer_clumping (il) = sum(eff_tai_lyr(:,il)) / sum(tai_lyr(:,il)) - end do - beam_top = par_beam_norm - diff_top = par_diff_norm - albedo = dble(salbedo_par) - case (2) !----- Near infrared (or NIR). ---------------------------------------------! - do il = 1,nactlyr - layer_scatter(il) = sum(scatter_nir_lyr(:,il) * eff_tai_lyr(:,il)) & - / sum(eff_tai_lyr(:,il)) - layer_backscatter(il) = sum(backscatter_nir_lyr(:,il) * eff_tai_lyr(:,il)) & - / sum(eff_tai_lyr(:,il)) - layer_clumping (il) = sum(eff_tai_lyr(:,il)) / sum(tai_lyr(:,il)) - end do - beam_top = nir_beam_norm - diff_top = nir_diff_norm - albedo = dble(salbedo_nir) - end select - - !------------------------------------------------------------------------------------! - !------------------------------------------------------------------------------------! - ! Calculate more factors for this band. We start by calculating the forcings, ! - ! using the effective tree area index, considering the leaf clumpiness and, if the ! - ! user asked for it, the branchwood area index (in case the user doesn't want, ! - ! WAI=0.). We distinguish between the light underneath a crown (beam_bot_crown) and ! - ! the total light passing through a layer (beam_bot). ! - !------------------------------------------------------------------------------------! - !----- Start with the highest layer, moving downwards. ------------------------------! - beam_bot_crown(nactlyr) = beam_top & - * sum(canfrac_lyr(:,nactlyr) * extinct_full(:,nactlyr)) & - / (1.d0 - opencan8(nactlyr) ) - beam_bot (nactlyr) = beam_top & - * ( opencan8(nactlyr) & - + sum(canfrac_lyr(:,nactlyr) * extinct_full(:,nactlyr)) ) - beam_mid (nactlyr) = beam_top & - * ( opencan8(nactlyr) & - + sum(canfrac_lyr(:,nactlyr) * extinct_half(:,nactlyr)) ) - do il = nactlyr-1,1,-1 - beam_bot_crown (il) = beam_bot(il+1) & - * sum(canfrac_lyr(:,il) * extinct_full(:,il)) & - / (1.d0 - opencan8(il)) - beam_bot (il) = beam_bot(il+1) & - * ( opencan8(il) & - + sum(canfrac_lyr(:,il) * extinct_full(:,il)) ) - beam_mid (il) = beam_bot(il+1) & - * ( opencan8(il) & - + sum(canfrac_lyr(:,il) * extinct_half(:,il)) ) - end do - !------------------------------------------------------------------------------------! - - - - - !------------------------------------------------------------------------------------! - srclyrloop: do il=1,nactlyr - this_tai = sum(tai_lyr(:,il)) - this_eff_tai = sum(eff_tai_lyr(:,il)) - eta = layer_clumping(il) & - * (1.0d0 - (1.0d0-layer_backscatter(il)) * layer_scatter(il)) - zeta = layer_scatter(il) * layer_backscatter(il) * layer_clumping(il) - sigma = layer_clumping(il) * lambda - iota = sigma * layer_scatter(il) * beam_backscatter - - - !----- Find derived properties. --------------------------------------------------! - exk = sqrt(eta*eta - zeta*zeta) - exki = 1.0d0/exk - zetai = 1.0d0/zeta - - !----- Sources. ------------------------------------------------------------------! - source_bot = iota * beam_bot_crown(il) - source_top = source_bot * exp(lambda * this_eff_tai) - - !----- Forcing coefficients. -----------------------------------------------------! - rhoo = - (zeta + eta + sigma) * source_bot - - - !----- Calculate exponentials only once. -----------------------------------------! - expkl_bot (il) = 1.d0 - expkl_top (il) = exp( exk * this_tai) - expamk_bot(il) = 1.d0 - expamk_top(il) = exp((sigma-exk) * this_tai) - expapk_bot(il) = 1.d0 - expapk_top(il) = exp((sigma+exk) * this_tai) - - - !---------------------------------------------------------------------------------! - ! Find the terms for the integration. ! - !---------------------------------------------------------------------------------! - a_bot(il) = -source_bot*zetai - a_top(il) = -source_top*zetai & - + 5.d-1*zetai*(eta*exki-1.0d0)*expkl_top(il)*rhoo/(sigma-exk) & - * (expamk_top(il)-expamk_bot(il)) & - - 5.d-1*zetai*(eta*exki+1.0d0) / expkl_top(il)*rhoo/(sigma+exk) & - * (expapk_top(il)-expapk_bot(il)) - b_bot(il) = 5.d-1*zetai*(eta*exki-1.0d0) - b_top(il) = 5.d-1*zetai*(eta*exki-1.0d0)*expkl_top(il) - c_bot(il) = -5.d-1*zetai*(eta*exki+1.0d0) - c_top(il) = -5.d-1*zetai*(eta*exki+1.0d0)/expkl_top(il) - f_bot(il) = 0.0d0 - f_top(il) = 5.d-1*exki*expkl_top(il)*rhoo/(sigma-exk) & - * (expamk_top(il)-expamk_bot(il)) & - - 5.d-1*exki/expkl_top(il)*rhoo/(sigma+exk) & - * (expapk_top(il)-expapk_bot(il)) - g_bot(il) = 5.d-1*exki - g_top(il) = 5.d-1*exki*expkl_top(il) - h_bot(il) = -5.d-1*exki - h_top(il) = -5.d-1*exki/expkl_top(il) - !---------------------------------------------------------------------------------! - end do srclyrloop - !------------------------------------------------------------------------------------! - - - - - !----- Initialise the matrix coefficients. ------------------------------------------! - do j=1,nactlyrt2 - do i=1,nactlyrt2 - masmatcp(i,j) = 0.0d0 - end do - mastervec_beam(j) = 0.0d0 - masveccp_beam(j) = 0.0d0 - mastervec_diffuse(j) = 0.0d0 - masveccp_diffuse(j) = 0.0d0 - end do - !------------------------------------------------------------------------------------! - - masmatcp(1,1) = g_top(nactlyr) - masmatcp(1,2) = h_top(nactlyr) - mastervec_beam(1) = -f_top(nactlyr) - mastervec_diffuse(1) = diff_top - masveccp_beam(1) = mastervec_beam(1) - masveccp_diffuse(1) = mastervec_diffuse(1) - - do i=2,nactlyrt2-2,2 - masmatcp(i,i-1) = g_bot(nint(real(nactlyrt2-i+2)*0.5)) - masmatcp(i,i) = h_bot(nint(real(nactlyrt2-i+2)*0.5)) - - masmatcp(i,i+1) = - g_top(nint(real(nactlyrt2-i)*0.5)) - masmatcp(i,i+2) = - h_top(nint(real(nactlyrt2-i)*0.5)) - mastervec_beam(i) = - f_bot(nint(real(nactlyrt2-i+2)*0.5)) & - + f_top(nint(real(nactlyrt2-i)*0.5)) - mastervec_diffuse(i) = 0.0d0 - masveccp_beam(i) = mastervec_beam(i) - masveccp_diffuse(i) = mastervec_diffuse(i) - end do - - do i=3,nactlyrt2-1,2 - masmatcp(i,i-2) = b_bot(nint(real(nactlyrt2-i+3)*0.5)) - masmatcp(i,i-1) = c_bot(nint(real(nactlyrt2-i+3)*0.5)) - masmatcp(i,i) = - b_top(nint(real(nactlyrt2-i+1)*0.5)) - masmatcp(i,i+1) = - c_top(nint(real(nactlyrt2-i+1)*0.5)) - mastervec_beam(i) = - a_bot(nint(real(nactlyrt2-i+3)*0.5)) & - + a_top(nint(real(nactlyrt2-i+1)*0.5)) - masveccp_beam(i) = mastervec_beam(i) - mastervec_diffuse(i) = 0.0d0 - masveccp_diffuse(i) = mastervec_diffuse(i) - end do - masmatcp(nactlyrt2,nactlyrt2-1) = b_bot(1) - albedo * g_bot(1) - masmatcp(nactlyrt2,nactlyrt2) = c_bot(1) - albedo * h_bot(1) - mastervec_beam(nactlyrt2) = - a_bot(1) + albedo * beam_bot(1) - masveccp_beam(nactlyrt2) = mastervec_beam(nactlyrt2) - mastervec_diffuse(nactlyrt2) = 0.0d0 - masveccp_diffuse(nactlyrt2) = mastervec_diffuse(nactlyrt2) - - !----- Prep for inversion. ----------------------------------------------------------! - mastermat(1,1) = 0.d0 - mastermat(1,2) = 0.d0 - mastermat(1,3) = masmatcp(1,1) - mastermat(1,4) = masmatcp(1,2) - mastermat(1,5) = 0.d0 - - do i=2,nactlyrt2-2,2 - mastermat(i,1) = 0.d0 - mastermat(i,2) = masmatcp(i,i-1) - mastermat(i,3) = masmatcp(i,i) - mastermat(i,4) = masmatcp(i,i+1) - mastermat(i,5) = masmatcp(i,i+2) - end do - - do i=3,nactlyrt2-1,2 - mastermat(i,1) = masmatcp(i,i-2) - mastermat(i,2) = masmatcp(i,i-1) - mastermat(i,3) = masmatcp(i,i) - mastermat(i,4) = masmatcp(i,i+1) - mastermat(i,5) = 0.d0 - end do - - mastermat(nactlyrt2,1) = 0.d0 - mastermat(nactlyrt2,2) = masmatcp(nactlyrt2,nactlyrt2-1) - mastermat(nactlyrt2,3) = masmatcp(nactlyrt2,nactlyrt2) - mastermat(nactlyrt2,4) = 0.d0 - mastermat(nactlyrt2,5) = 0.d0 - - !----- Invert the matrix. -----------------------------------------------------------! - call bandec(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,d) - - !----- Backsubstitute for beam and diffuse. -----------------------------------------! - call banbks(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,mastervec_beam) - call banbks(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,mastervec_diffuse) - - !----- Improve the solution. --------------------------------------------------------! - call mprove(masmatcp,mastermat,matal,ncanlyrt2,nactlyrt2,5,2,indx & - ,masveccp_beam,mastervec_beam) - call mprove(masmatcp,mastermat,matal,ncanlyrt2,nactlyrt2,5,2,indx & - ,masveccp_diffuse,mastervec_diffuse) - - select case (iband) - case (1) - !---- Visible (or PAR) band. -----------------------------------------------------! - do i=3,nactlyrt2-1,2 - ind = nint(real(nactlyrt2-i+1)*0.5)+1 - upward_vis_beam (ind) = a_bot(ind) + b_bot(ind) * mastervec_beam(i-2) & - + c_bot(ind) * mastervec_beam(i-1) - upward_vis_diffuse(ind) = b_bot(ind) * mastervec_diffuse(i-2) & - + c_bot(ind) * mastervec_diffuse(i-1) - end do - - do i=2,nactlyrt2-2,2 - ind = nint(real(nactlyrt2-i)*0.5)+1 - downward_vis_beam (ind) = beam_bot(ind) + f_bot(ind) & - + h_bot(ind) * mastervec_beam(i) & - + g_bot(ind) * mastervec_beam(i-1) - downward_vis_diffuse(ind) = h_bot(ind) * mastervec_diffuse(i) & - + g_bot(ind) * mastervec_diffuse(i-1) - end do - - upward_vis_beam (nactlyr+1) = b_top(nactlyr) * mastervec_beam(1) & - + c_top(nactlyr) * mastervec_beam(2) & - + a_top(nactlyr) - upward_vis_diffuse (nactlyr+1) = b_top(nactlyr) * mastervec_diffuse(1) & - + c_top(nactlyr) * mastervec_diffuse(2) - downward_vis_beam (nactlyr+1) = beam_top - downward_vis_diffuse(nactlyr+1) = diff_top - downward_vis_beam (1) = g_bot(1) * mastervec_beam(nactlyrt2-1) & - + h_bot(1) * mastervec_beam(nactlyrt2) + f_bot(1) & - + beam_bot(1) - downward_vis_diffuse(1) = g_bot(1) * mastervec_diffuse(nactlyrt2-1) & - + h_bot(1) * mastervec_diffuse(nactlyrt2) - upward_vis_beam (1) = albedo * downward_vis_beam(1) - upward_vis_diffuse (1) = albedo * downward_vis_diffuse(1) - case (2) - !---- Near-infrared band. --------------------------------------------------------! - - do i=3,nactlyrt2-1,2 - ind = nint(real(nactlyrt2-i+1)*0.5)+1 - upward_nir_beam (ind) = a_bot(ind) + b_bot(ind) * mastervec_beam(i-2) & - + c_bot(ind) * mastervec_beam(i-1) - upward_nir_diffuse(ind) = b_bot(ind) * mastervec_diffuse(i-2) & - + c_bot(ind) * mastervec_diffuse(i-1) - end do - - do i=2,nactlyrt2-2,2 - ind = nint(real(nactlyrt2-i)*0.5)+1 - downward_nir_beam (ind) = beam_bot(ind) + f_bot(ind) & - + h_bot(ind) * mastervec_beam(i) & - + g_bot(ind) * mastervec_beam(i-1) - downward_nir_diffuse(ind) = h_bot(ind) * mastervec_diffuse(i) & - + g_bot(ind) * mastervec_diffuse(i-1) - end do - - upward_nir_beam (nactlyr+1) = b_top(nactlyr) * mastervec_beam(1) & - + c_top(nactlyr) * mastervec_beam(2) & - + a_top(nactlyr) - upward_nir_diffuse (nactlyr+1) = b_top(nactlyr) * mastervec_diffuse(1) & - + c_top(nactlyr) * mastervec_diffuse(2) - downward_nir_beam (nactlyr+1) = beam_top - downward_nir_diffuse(nactlyr+1) = diff_top - downward_nir_beam(1) = g_bot(1) * mastervec_beam(nactlyrt2-1) & - + h_bot(1) * mastervec_beam(nactlyrt2) + f_bot(1) & - + beam_bot(1) - downward_nir_diffuse(1) = g_bot(1) * mastervec_diffuse(nactlyrt2-1) & - + h_bot(1) * mastervec_diffuse(nactlyrt2) - upward_nir_beam(1) = albedo * downward_nir_beam(1) - upward_nir_diffuse(1) = albedo * downward_nir_diffuse(1) - end select - end do bandloop - - do il=1,nactlyr - - par_beam_layer(il) = sngl( downward_vis_beam (il+1) & - - downward_vis_beam (il ) & - + upward_vis_beam (il ) & - - upward_vis_beam (il+1) ) - - par_diffuse_layer(il) = sngl( downward_vis_diffuse(il+1) & - - downward_vis_diffuse(il ) & - + upward_vis_diffuse (il ) & - - upward_vis_diffuse (il+1) ) - - sw_abs_beam_layer(il) = par_beam_layer(il) + sngl( downward_nir_beam (il+1) & - - downward_nir_beam (il ) & - + upward_nir_beam (il ) & - - upward_nir_beam (il+1) ) - sw_abs_diffuse_layer(il) = par_diffuse_layer(il) + sngl( downward_nir_diffuse(il+1) & - - downward_nir_diffuse(il ) & - + upward_nir_diffuse (il ) & - - upward_nir_diffuse (il+1) ) - - !----- Ensure that we don't get any negative radiation... ---------------------------! - par_beam_layer(il) = max(0.0,par_beam_layer(il) ) - par_diffuse_layer(il) = max(0.0,par_diffuse_layer(il) ) - sw_abs_beam_layer(il) = max(0.0,sw_abs_beam_layer(il) ) - sw_abs_diffuse_layer(il) = max(0.0,sw_abs_diffuse_layer(il) ) - !------------------------------------------------------------------------------------! - end do - - !----- Copying to the output variables. ------------------------------------------------! - dw_vislo_beam = max(0.0,sngl(downward_vis_beam (1) ) ) - dw_vislo_diffuse = max(0.0,sngl(downward_vis_diffuse (1) ) ) - uw_vishi_beam = max(0.0,sngl(upward_vis_beam (nactlyr+1) ) ) - uw_vishi_diffuse = max(0.0,sngl(upward_vis_diffuse (nactlyr+1) ) ) - dw_nirlo_beam = max(0.0,sngl(downward_nir_beam (1) ) ) - dw_nirlo_diffuse = max(0.0,sngl(downward_nir_diffuse (1) ) ) - uw_nirhi_beam = max(0.0,sngl(upward_nir_beam (nactlyr+1) ) ) - uw_nirhi_diffuse = max(0.0,sngl(upward_nir_diffuse (nactlyr+1) ) ) - !---------------------------------------------------------------------------------------! - - - + + downward_nir_diffuse(il ) & + + downward_vis_diffuse(il+1) & + + downward_nir_diffuse(il+1) ) & + / ( par_diff_norm + nir_beam_norm ) + !------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! Integrate the total amount of energy for each cohort. ! - !---------------------------------------------------------------------------------------! - par_beam_flip (:) = 0.0 - par_diffuse_flip (:) = 0.0 - sw_abs_beam_flip (:) = 0.0 - sw_abs_diffuse_flip (:) = 0.0 - do il = 1, nactlyr - this_eff_tai = sum(eff_tai_lyr(:,il)) - this_tai = sum(tai_lyr (:,il)) - do ico = 1,ncoh - par_beam_flip(ico) = par_beam_flip(ico) + par_beam_layer(il) & - * sngloff(eff_tai_lyr(ico,il) / this_eff_tai,tiny_num8) - par_diffuse_flip(ico) = par_diffuse_flip(ico) + par_diffuse_layer(il) & - * sngloff(tai_lyr(ico,il) / this_tai,tiny_num8) - sw_abs_beam_flip(ico) = sw_abs_beam_flip(ico) + sw_abs_beam_layer(il) & - * sngloff(eff_tai_lyr(ico,il) / this_eff_tai,tiny_num8) - sw_abs_diffuse_flip(ico) = sw_abs_diffuse_flip(ico) + sw_abs_diffuse_layer(il) & - * sngloff(tai_lyr(ico,il) / this_tai,tiny_num8) - end do - end do - !---------------------------------------------------------------------------------------! + par_beam_flip(il) = sngl( downward_vis_beam (il+1) & + - downward_vis_beam (il ) & + + upward_vis_beam (il ) & + - upward_vis_beam (il+1) ) + par_diffuse_flip(il) = sngl( downward_vis_diffuse (il+1) & + - downward_vis_diffuse (il ) & + + upward_vis_diffuse (il ) & + - upward_vis_diffuse (il+1) ) + sw_abs_beam_flip(il) = par_beam_flip(il) + sngl( downward_nir_beam (il+1) & + - downward_nir_beam (il ) & + + upward_nir_beam (il ) & + - upward_nir_beam(il+1)) + sw_abs_diffuse_flip(il) = par_diffuse_flip(il) + sngl( downward_nir_diffuse(il+1) & + - downward_nir_diffuse(il ) & + + upward_nir_diffuse (il ) & + - upward_nir_diffuse (il+1) ) - !---------------------------------------------------------------------------------------! - ! Find the light level for beam and diffuse radiation. ! - !---------------------------------------------------------------------------------------! - beam_level (:) = 0.0 - diff_level (:) = 0.0 - light_level (:) = 0.0 - light_beam_level (:) = 0.0 - light_diff_level (:) = 0.0 - do ico = 1,ncoh - do il=kapartial(ico),kzpartial(ico) - diff_level(ico) = diff_level(ico) & - + sngloff( 0.5 * ( downward_vis_diffuse (il) & - + downward_vis_diffuse(il+1) ) * dzcanpop(il) & - / ( (zztop8(kzpartial(ico)) - zzbot8(kapartial(ico))) & - * par_diff_norm ) & - , tiny_num8 ) - beam_level(ico) = beam_level(ico) & - + sngloff( 0.5 * ( downward_vis_beam (il) & - + downward_vis_beam(il+1) ) * dzcanpop(il) & - / ( (zztop8(kzpartial(ico)) - zzbot8(kapartial(ico))) & - * par_beam_norm ) & - , tiny_num8 ) - light_level(ico) = light_level(ico) & - + sngloff( 0.5 * ( downward_vis_beam (il) & - + downward_vis_diffuse (il) & - + downward_nir_beam (il) & - + downward_nir_diffuse (il) & - + downward_vis_beam (il+1) & - + downward_vis_diffuse(il+1) & - + downward_nir_beam (il+1) & - + downward_nir_diffuse(il+1) ) * dzcanpop(il) & - / ( zztop8(kzpartial(ico)) - zzbot8(kapartial(ico)) ) & - , tiny_num8 ) - - light_beam_level(ico) = light_beam_level(ico) & - + sngloff( 0.5 * ( downward_vis_beam (il) & - + downward_nir_beam (il) & - + downward_vis_beam (il+1) & - + downward_nir_beam (il+1) ) & - * dzcanpop(il) & - / ( ( zztop8(kzpartial(ico)) & - - zzbot8(kapartial(ico)) ) & - * (par_beam_norm + nir_beam_norm) ) & - , tiny_num8 ) - - light_diff_level(ico) = light_diff_level(ico) & - + sngloff( 0.5 * ( downward_vis_diffuse (il) & - + downward_nir_diffuse (il) & - + downward_vis_diffuse(il+1) & - + downward_nir_diffuse(il+1) ) & - * dzcanpop(il) & - / ( ( zztop8(kzpartial(ico)) & - - zzbot8(kapartial(ico)) ) & - * (par_diff_norm + nir_diff_norm) ) & - , tiny_num8 ) - end do + !----- Ensure that we don't get any negative radiation... ---------------------------! + par_beam_flip(il) = max(0.0,par_beam_flip(il) ) + par_diffuse_flip(il) = max(0.0,par_diffuse_flip(il) ) + sw_abs_beam_flip(il) = max(0.0,sw_abs_beam_flip(il) ) + sw_abs_diffuse_flip(il) = max(0.0,sw_abs_diffuse_flip(il) ) end do !---------------------------------------------------------------------------------------! @@ -1387,20 +546,19 @@ subroutine sw_twostream_layer(salbedo_par,salbedo_nir,scosz,scosaoi,ncoh,pft - !------ De-allocate the temporary structures. ------------------------------------------! - deallocate(extinct_full ) - deallocate(extinct_half ) - deallocate(canfrac_lyr ) - deallocate(tai_lyr ) - deallocate(eff_tai_lyr ) - deallocate(scatter_vis_lyr ) - deallocate(backscatter_vis_lyr ) - deallocate(scatter_nir_lyr ) - deallocate(backscatter_nir_lyr ) + !----- Copy to the output variables. ---------------------------------------------------! + dw_vislo_beam = max(0.0,sngl(downward_vis_beam (1) ) ) + dw_vislo_diffuse = max(0.0,sngl(downward_vis_diffuse (1) ) ) + uw_vishi_beam = max(0.0,sngl(upward_vis_beam (ncoh+1) ) ) + uw_vishi_diffuse = max(0.0,sngl(upward_vis_diffuse (ncoh+1) ) ) + dw_nirlo_beam = max(0.0,sngl(downward_nir_beam (1) ) ) + dw_nirlo_diffuse = max(0.0,sngl(downward_nir_diffuse (1) ) ) + uw_nirhi_beam = max(0.0,sngl(upward_nir_beam (ncoh+1) ) ) + uw_nirhi_diffuse = max(0.0,sngl(upward_nir_diffuse (ncoh+1) ) ) !---------------------------------------------------------------------------------------! return -end subroutine sw_twostream_layer +end subroutine sw_twostream_clump !==========================================================================================! !==========================================================================================! @@ -1619,13 +777,15 @@ subroutine lw_twostream(ncoh,semgs,sT_grnd, pft,lai,wai,canopy_area,leaf_temp,wo ,lw_v_surf,lw_v_incid,downward_lw_below_surf & ,downward_lw_below_incid,upward_lw_below_surf & ,upward_lw_below_incid,upward_lw_above_surf,upward_lw_above_incid) - use canopy_radiation_coms , only : leaf_emis & ! intent(in) - , wood_emis & ! intent(in) - , mubar ! ! intent(in) - use pft_coms , only : clumping_factor ! ! intent(in) - use consts_coms , only : stefan8 & ! intent(in) - , tiny_num8 ! ! intent(in) - use rk4_coms , only : tiny_offset ! ! intent(in) + use canopy_radiation_coms , only : leaf_emis & ! intent(in) + , wood_emis & ! intent(in) + , leaf_backscatter_tir & ! intent(in) + , wood_backscatter_tir & ! intent(in) + , clumping_factor & ! intent(in) + , mu_bar ! ! intent(in) + use consts_coms , only : stefan8 & ! intent(in) + , tiny_num8 ! ! intent(in) + use rk4_coms , only : tiny_offset ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! integer , intent(in) :: ncoh ! # of cohorts @@ -1687,6 +847,7 @@ subroutine lw_twostream(ncoh,semgs,sT_grnd, pft,lai,wai,canopy_area,leaf_temp,wo real(kind=8) :: lw_v_surf_tmp real(kind=8) :: lw_v_incid_tmp real(kind=8) :: cohort_emis + real(kind=8) :: cohort_backscatter real(kind=8) :: cohort_temp real(kind=8) :: cohort_tai !----- External functions. -------------------------------------------------------------! @@ -1701,13 +862,19 @@ subroutine lw_twostream(ncoh,semgs,sT_grnd, pft,lai,wai,canopy_area,leaf_temp,wo ncoh2 = 2*ncoh do il=1,ncoh - ipft = pft(il) - cohort_tai = lai(il) + wai(il) - cohort_emis = (leaf_emis(ipft) * lai(il) + wood_emis(ipft) * wai(il)) / cohort_tai - cohort_temp = (leaf_temp(il) * lai(il) + wood_temp(il) * wai(il)) / cohort_tai + ipft = pft(il) + cohort_tai = lai(il) + wai(il) + cohort_emis = ( leaf_emis(ipft) * lai(il) + wood_emis(ipft) * wai(il)) & + / cohort_tai + cohort_backscatter = ( leaf_backscatter_tir(ipft) * lai(il) & + + wood_backscatter_tir(ipft) * wai(il) ) & + / cohort_tai + cohort_temp = ( leaf_temp(il) * lai(il) + wood_temp(il) * wai(il)) & + / cohort_tai - zeta = 2.0d0 * (1.0d0 - cohort_emis) / (3.0d0 * mubar) - eta = (2.0d0 + cohort_emis) / (3.0d0 * mubar) + zeta = (1.d0 - cohort_emis) * cohort_backscatter / mu_bar(ipft) + eta = (1.d0 - (1.d0 - cohort_backscatter) * (1.d0 - cohort_emis)) & + / mu_bar(ipft) exk = sqrt(eta * eta - zeta * zeta) exki = 1.0d0 / exk zetai = 1.0d0 / zeta @@ -1869,454 +1036,3 @@ subroutine lw_twostream(ncoh,semgs,sT_grnd, pft,lai,wai,canopy_area,leaf_temp,wo end subroutine lw_twostream !==========================================================================================! !==========================================================================================! - - - - - - -!==========================================================================================! -!==========================================================================================! -! This subroutine will solve the long wave radiation within the canopy. This solves ! -! the two stream approach considering the size distribution of cohorts, acknowledging the ! -! effect of leaves, and, if that's the user's will, the branches. ! -!------------------------------------------------------------------------------------------! -subroutine lw_twostream_layer(ncoh,semgs,sT_grnd, pft,lai,wai,canopy_area,hgttop,hgtbot & - ,leaf_temp,wood_temp,lw_v_surf,lw_v_incid & - ,downward_lw_below_surf,downward_lw_below_incid & - ,upward_lw_below_surf,upward_lw_below_incid & - ,upward_lw_above_surf,upward_lw_above_incid) - use canopy_radiation_coms , only : leaf_emis & ! intent(in) - , wood_emis & ! intent(in) - , mubar ! ! intent(in) - use pft_coms , only : clumping_factor ! ! intent(in) - use consts_coms , only : stefan8 & ! intent(in) - , tiny_num8 ! ! intent(in) - use rk4_coms , only : tiny_offset ! ! intent(in) - use canopy_layer_coms , only : ncanlyr & ! intent(in) - , ncanlyrp1 & ! intent(in) - , ncanlyrt2 & ! intent(in) - , zztop0i8 & ! intent(in) - , ehgti8 & ! intent(in) - , dzcan8 & ! intent(in) - , zztop8 & ! intent(in) - , zzbot8 & ! intent(in) - , indx & ! intent(out) - , populated & ! intent(out) - , mastervec_surf & ! intent(out) - , mastervec_incid & ! intent(out) - , layer_emis & ! intent(out) - , layer_temp & ! intent(out) - , explai & ! intent(out) - , exmlai & ! intent(out) - , downward_lw_incid & ! intent(out) - , downward_lw_surf & ! intent(out) - , upward_lw_incid & ! intent(out) - , upward_lw_surf & ! intent(out) - , source_lw & ! intent(out) - , forcing_lw & ! intent(out) - , A_dw & ! intent(out) - , B_dw & ! intent(out) - , C_dw & ! intent(out) - , D_dw & ! intent(out) - , A_uw & ! intent(out) - , B_uw & ! intent(out) - , C_uw & ! intent(out) - , D_uw & ! intent(out) - , E_uw & ! intent(out) - , F_uw & ! intent(out) - , lw_v_surf_layer & ! intent(out) - , lw_v_incid_layer & ! intent(out) - , matal & ! intent(out) - , mastermat & ! intent(out) - , masmatcp & ! intent(out) - , zero_canopy_layer ! ! subroutine - - implicit none - !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: ncoh ! # of cohorts - real , intent(in) :: semgs ! Gnd. emmissivity - real , intent(in) :: st_grnd ! Gnd. temperature - integer , dimension(ncoh), intent(in) :: pft ! Plant functional type - real(kind=8), dimension(ncoh), intent(in) :: lai ! Leaf Area Index - real(kind=8), dimension(ncoh), intent(in) :: wai ! Wood Area Index - real(kind=8), dimension(ncoh), intent(in) :: leaf_temp ! Leaf temperature - real(kind=8), dimension(ncoh), intent(in) :: wood_temp ! Leaf temperature - real(kind=8), dimension(ncoh), intent(in) :: canopy_area ! canopy area - real(kind=8), dimension(ncoh), intent(in) :: hgttop ! "Tree" Area Index - real(kind=8), dimension(ncoh), intent(in) :: hgtbot ! "Tree" Area Index - real , dimension(ncoh), intent(out) :: lw_v_surf - real , dimension(ncoh), intent(out) :: lw_v_incid - real , intent(out) :: downward_lw_below_surf - real , intent(out) :: upward_lw_above_surf - real , intent(out) :: upward_lw_below_surf - real , intent(out) :: downward_lw_below_incid - real , intent(out) :: upward_lw_above_incid - real , intent(out) :: upward_lw_below_incid - !----- Local variables. ----------------------------------------------------------------! - integer :: il - integer :: ico - integer :: ipft - integer :: i - integer :: j - integer :: ind - integer :: nactlyr - integer :: nactlyrp1 - integer :: nactlyrt2 - integer , dimension(ncoh) :: kapartial - integer , dimension(ncoh) :: kafull - integer , dimension(ncoh) :: kzpartial - integer , dimension(ncoh) :: kzfull - integer , dimension(ncoh) :: nlyr_coh - real(kind=8) :: emgs - real(kind=8) :: T_grnd - real(kind=8) :: zeta - real(kind=8) :: eta - real(kind=8) :: exk - real(kind=8) :: zetai - real(kind=8) :: exki - real(kind=8) :: d - real(kind=8) :: lw_v_surf_tmp - real(kind=8) :: lw_v_incid_tmp - real(kind=8) :: lad - real(kind=8) :: wad - real(kind=8) :: this_tai - !----- Variables that must be allocated every time. ------------------------------------! - real(kind=8), dimension(:,:) , allocatable :: tai_lyr - real(kind=8), dimension(:,:) , allocatable :: emis_lyr - real(kind=8), dimension(:,:) , allocatable :: temp_lyr - !----- External functions. -------------------------------------------------------------! - real(kind=4), external :: sngloff - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! These must be allocated and de-allocated every time as the number of cohorts is ! - ! unbounded and may change. ! - !---------------------------------------------------------------------------------------! - allocate(tai_lyr (ncoh,ncanlyr)) - allocate(emis_lyr (ncoh,ncanlyr)) - allocate(temp_lyr (ncoh,ncanlyr)) - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Reset the temporary variables. ! - !---------------------------------------------------------------------------------------! - call zero_canopy_layer('lw_twostream_layer') - tai_lyr (:,:) = 0.d0 - emis_lyr (:,:) = 0.d0 - temp_lyr (:,:) = 0.d0 - !---------------------------------------------------------------------------------------! - - - - !----- Convert some variables to double precision. -------------------------------------! - emgs = dble(semgs) - t_grnd = dble(st_grnd) - !---------------------------------------------------------------------------------------! - - - - !---------------------------------------------------------------------------------------! - ! Find the crown area for each layer, and determine the layer bounds for each ! - ! cohort. ! - !---------------------------------------------------------------------------------------! - do ico = 1,ncoh - ipft = pft(ico) - - !------ Find the layer bounds. ------------------------------------------------------! - kapartial (ico) = min(ncanlyr,floor ((hgtbot(ico) * zztop0i8)**ehgti8) + 1) - kafull (ico) = min(ncanlyr,ceiling((hgtbot(ico) * zztop0i8)**ehgti8) + 1) - kzpartial (ico) = min(ncanlyr,ceiling((hgttop(ico) * zztop0i8)**ehgti8)) - kzfull (ico) = min(ncanlyr,floor ((hgttop(ico) * zztop0i8)**ehgti8)) - - !------ Find the "tree" area density. -----------------------------------------------! - lad = lai(ico) / (hgttop(ico) - hgtbot(ico)) - wad = wai(ico) / (hgttop(ico) - hgtbot(ico)) - - - !------------------------------------------------------------------------------------! - ! Here we scale the leaf area density to the layer (partial or full), so the ! - ! total leaf area index is preserved. The only special case is when the top and ! - ! bottom of the crown are in the same layer, in which case we simply use the leaf ! - ! area index. If the user is running with branch thermodynamics, then it should be ! - ! total (leaf + branch) area index instead of leaf area index. ! - !------------------------------------------------------------------------------------! - if (kapartial(ico) == kzpartial(ico)) then - il = kapartial(ico) - populated (il) = .true. - tai_lyr (ico,il) = lai(ico) + wai(ico) - emis_lyr (ico,il) = (leaf_emis(ipft) * lai(ico) + wood_emis(ipft) * wai(ico)) & - / tai_lyr (ico,il) - temp_lyr (ico,il) = (leaf_temp(ipft) * lai(ico) + wood_temp(ipft) * wai(ico)) & - / tai_lyr (ico,il) - else - !------ Start with the fully vegetated layers. -----------------------------------! - do il = kafull(ico),kzfull(ico) - populated(il) = .true. - tai_lyr (ico,il) = (lad + wad) * dzcan8(il) - emis_lyr (ico,il) = (leaf_emis(ipft) * lad + wood_emis(ipft) * wad) & - / (lad + wad) - temp_lyr (ico,il) = (leaf_temp(ipft) * lad + wood_temp(ipft) * wad) & - / (lad + wad) - end do - - !---------------------------------------------------------------------------------! - ! Partial layer at the bottom of the crown. This shouldn't be done if the ! - ! partial and full indices are the same, otherwise we double account the layer. ! - !---------------------------------------------------------------------------------! - if (kapartial(ico) /= kafull(ico)) then - il = kapartial(ico) - populated (il) = .true. - tai_lyr (ico,il) = (lad + wad) * dzcan8(il) - emis_lyr (ico,il) = (leaf_emis(ipft) * lad + wood_emis(ipft) * wad) & - / (lad + wad) - temp_lyr (ico,il) = (leaf_temp(ipft) * lad + wood_temp(ipft) * wad) & - / (lad + wad) - end if - if (kzpartial(ico) /= kzfull(ico)) then - il = kzpartial(ico) - populated (il) = .true. - tai_lyr (ico,il) = (lad + wad) * dzcan8(il) - emis_lyr (ico,il) = (leaf_emis(ipft) * lad + wood_emis(ipft) * wad) & - / (lad + wad) - temp_lyr (ico,il) = (leaf_temp(ipft) * lad + wood_temp(ipft) * wad) & - / (lad + wad) - end if - end if - !------------------------------------------------------------------------------------! - end do - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! Pack the information so we skip empty layers in the middle, thus avoinding ! - ! singularities. From this point on we must refer to nactlyr, not ncanlyr. ! - !---------------------------------------------------------------------------------------! - nactlyr = count(populated) - nactlyrp1 = nactlyr+1 - nactlyrt2 = 2 * nactlyr - !----- Squeeze the arrays. -------------------------------------------------------------! - do ico = 1,ncoh - tai_lyr (ico,1:nactlyr) = pack(tai_lyr (ico,:), populated) - emis_lyr (ico,1:nactlyr) = pack(emis_lyr (ico,:), populated) - temp_lyr (ico,1:nactlyr) = pack(temp_lyr (ico,:), populated) - if (nactlyrp1 < ncanlyr) then - tai_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - emis_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - temp_lyr (ico,nactlyrp1:ncanlyr) = 0.d0 - end if - !----- Count the number of layers that have leaves/branches for this cohort. --------! - nlyr_coh (ico) = count(tai_lyr(ico,:) > 0.d0) - end do - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - srclyrloop: do il=1,nactlyr - !------------------------------------------------------------------------------------! - ! Find the terms by averaging them using TAI as the weighting factor. This is ! - ! not the best way of doing it, but it is the simplest I could think, because it ! - ! retains the fact that eta and zeta are constants within each layer. ! - !------------------------------------------------------------------------------------! - this_tai = sum(tai_lyr(:,il)) - layer_emis(il) = sum(emis_lyr(:,il) * tai_lyr(:,il)) / this_tai - layer_temp(il) = sum(temp_lyr(:,il) * tai_lyr(:,il)) / this_tai - - zeta = 2.0d0 * (1.0d0 - layer_emis(il)) / (3.0d0 * mubar) - eta = (2.0d0 + layer_emis(il)) / (3.0d0 * mubar) - exk = sqrt(eta * eta - zeta * zeta) - exki = 1.0d0 / exk - zetai = 1.0d0 / zeta - source_lw (il) = layer_emis(il) * stefan8 * layer_temp(il)**4 - forcing_lw(il) = - (zeta + eta) * source_lw(il) - explai(il) = exp( exk * this_tai) - exmlai(il) = exp(-exk * this_tai) - - - !------------------------------------------------------------------------------------! - ! Coefficient of lambda1 (and minus the coefficient of lambda2) for the bottom ! - ! of a layer, downwelling radiation. ! - !------------------------------------------------------------------------------------! - a_dw(il) = 5.0d-1 * exki - - !----- Coefficient of lambda1, top of layer, downwelling radiation. -----------------! - b_dw(il) = 5.0d-1*exki*explai(il) - - !----- Coefficient of lambda2, top of layer, downwelling radiation. -----------------! - c_dw(il) = -5.0d-1*exki*exmlai(il) - - !----- Term of downwelling radiation not multiplying a lambda. ----------------------! - d_dw(il) = 5.d-1*(exki**2)*forcing_lw(il) * (explai(il) + exmlai(il) - 2.0d0) - - a_uw(il) = 5.d-1 * zetai * (eta * exki - 1.0d0) - b_uw(il) = - 5.d-1 * zetai * (eta * exki + 1.0d0) - c_uw(il) = - source_lw(il) * zetai - d_uw(il) = a_uw(il) * explai(il) - e_uw(il) = b_uw(il) * exmlai(il) - f_uw(il) = -source_lw(il) * zetai & - + 5.d-1 * zetai * (eta*exki - 1.0d0) * explai(il) & - * (forcing_lw(il) * exki * (1.0d0-exmlai(il))) & - - 5.d-1 * zetai * (eta*exki + 1.0d0) * exmlai(il) & - * (forcing_lw(il) * exki * (explai(il)-1.0d0)) - end do srclyrloop - !---------------------------------------------------------------------------------------! - - - - !----- Initialise the matrix coefficients. ---------------------------------------------! - do j=1,nactlyrt2 - do i=1,nactlyrt2 - masmatcp(i,j) = 0.0d0 - end do - mastervec_surf(j) = 0.0d0 - mastervec_incid(j) = 0.0d0 - end do - !---------------------------------------------------------------------------------------! - - - - - !----- Vector is of the form: (lambda_N, lambda_{N-1},...,lambda_1). -------------------! - masmatcp(1,1) = b_dw(nactlyr) - masmatcp(1,2) = c_dw(nactlyr) - mastervec_surf(1) =-d_dw(nactlyr) - mastervec_incid(1) = 1.0d0 - - do i=2,nactlyrt2-2,2 - ind = nint(real(nactlyrt2-i)*0.5) - masmatcp(i,i-1) = -a_dw(ind+1) - masmatcp(i,i) = a_dw(ind+1) - masmatcp(i,i+1) = b_dw(ind) - masmatcp(i,i+2) = c_dw(ind) - mastervec_surf(i) = -d_dw(ind) - mastervec_incid(i) = 0.0d0 - end do - - do i=3,nactlyrt2-1,2 - ind = nint(real(nactlyrt2-i+1)*0.5) - masmatcp(i,i-2) = -a_uw(ind+1) - masmatcp(i,i-1) = -b_uw(ind+1) - masmatcp(i,i) = d_uw(ind) - masmatcp(i,i+1) = e_uw(ind) - mastervec_surf(i) = c_uw(ind+1) - f_uw(ind) - mastervec_incid(i) = 0.0d0 - end do - masmatcp(nactlyrt2,nactlyrt2-1) = a_uw(1) - (1.d0 - emgs) * a_dw(1) - masmatcp(nactlyrt2,nactlyrt2) = b_uw(1) + (1.d0 - emgs) * a_dw(1) - mastervec_surf(nactlyrt2) = emgs * stefan8 * t_grnd**4 - c_uw(1) - mastervec_incid(nactlyrt2) = 0.0d0 - - mastermat(1,1) = 0.d0 - mastermat(1,2) = 0.d0 - mastermat(1,3) = masmatcp(1,1) - mastermat(1,4) = masmatcp(1,2) - mastermat(1,5) = 0.d0 - - do i=2,nactlyrt2-2,2 - mastermat(i,1) = 0.d0 - mastermat(i,2) = masmatcp(i,i-1) - mastermat(i,3) = masmatcp(i,i) - mastermat(i,4) = masmatcp(i,i+1) - mastermat(i,5) = masmatcp(i,i+2) - end do - - do i=3,nactlyrt2-1,2 - mastermat(i,1) = masmatcp(i,i-2) - mastermat(i,2) = masmatcp(i,i-1) - mastermat(i,3) = masmatcp(i,i) - mastermat(i,4) = masmatcp(i,i+1) - mastermat(i,5) = 0.d0 - end do - - mastermat(nactlyrt2,1) = 0.d0 - mastermat(nactlyrt2,2) = masmatcp(nactlyrt2,nactlyrt2-1) - mastermat(nactlyrt2,3) = masmatcp(nactlyrt2,nactlyrt2) - mastermat(nactlyrt2,4) = 0.d0 - mastermat(nactlyrt2,5) = 0.d0 - - !----- Invert matrix. ------------------------------------------------------------------! - call bandec(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,d) - - !----- Backsubstitute for contributions of ground and vegetation. ----------------------! - call banbks(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,mastervec_surf) - - !----- Backsubstitute for contribution of incident longwave at canopy top. -------------! - call banbks(mastermat,ncanlyrt2,nactlyrt2,2,2,matal,indx,mastervec_incid) - - do i=3,nactlyrt2-1,2 - ind = nint(real(nactlyrt2-i+1)*0.5) - upward_lw_surf(ind+1) = masmatcp(i,i) * mastervec_surf(i) & - + masmatcp(i,i+1) * mastervec_surf(i+1) + f_uw(ind) - upward_lw_incid(ind+1) = masmatcp(i,i) * mastervec_incid(i) & - + masmatcp(i,i+1) * mastervec_incid(i+1) - end do - - do i=2,nactlyrt2-2,2 - ind = nint(real(nactlyrt2-i)*0.5) - downward_lw_surf(ind+1) = masmatcp(i,i+1) * mastervec_surf(i+1) & - + masmatcp(i,i+2) * mastervec_surf(i+2) + d_dw(ind) - downward_lw_incid(ind+1) = masmatcp(i,i+1) * mastervec_incid(i+1) & - + masmatcp(i,i+2) * mastervec_incid(i+2) - end do - - upward_lw_surf(nactlyr+1) = d_uw(nactlyr) * mastervec_surf(1) & - + e_uw(nactlyr) * mastervec_surf(2) + f_uw(nactlyr) - upward_lw_incid(nactlyr+1) = d_uw(nactlyr) * mastervec_incid(1) & - + e_uw(nactlyr) * mastervec_incid(2) - downward_lw_surf(nactlyr+1) = 0.0d0 - downward_lw_incid(nactlyr+1) = 1.0d0 - downward_lw_surf(1) = a_dw(1) * (mastervec_surf(nactlyrt2-1) - mastervec_surf(nactlyrt2)) - downward_lw_incid(1) = a_dw(1) * (mastervec_incid(nactlyrt2-1) - mastervec_incid(nactlyrt2)) - upward_lw_surf(1) = (1.0d0-emgs) * downward_lw_surf(1) + emgs * stefan8 * t_grnd**4 - upward_lw_incid(1) = (1.0d0-emgs) * downward_lw_incid(1) - - do il = 1,nactlyr - lw_v_surf_tmp = downward_lw_surf(il+1) - downward_lw_surf(il) + upward_lw_surf(il) - upward_lw_surf(il+1) - lw_v_incid_tmp = downward_lw_incid(il+1) - downward_lw_incid(il) + upward_lw_incid(il) - upward_lw_incid(il+1) - lw_v_surf_layer(il) = sngloff(lw_v_surf_tmp , tiny_num8) - lw_v_incid_layer(il) = sngloff(lw_v_incid_tmp, tiny_num8) - end do - - downward_lw_below_surf = sngloff(downward_lw_surf(1) , tiny_num8) - downward_lw_below_incid = sngloff(downward_lw_incid(1) , tiny_num8) - upward_lw_below_surf = sngloff(upward_lw_surf(1) , tiny_num8) - upward_lw_below_incid = sngloff(upward_lw_incid(1) , tiny_num8) - upward_lw_above_surf = sngloff(upward_lw_surf(nactlyr+1) , tiny_num8) - upward_lw_above_incid = sngloff(upward_lw_incid(nactlyr+1), tiny_num8) - - !---------------------------------------------------------------------------------------! - ! Integrate the total amount of energy for each cohort. ! - !---------------------------------------------------------------------------------------! - lw_v_surf (:) = 0.0 - lw_v_incid(:) = 0.0 - do il = 1, nactlyr - this_tai = sum(tai_lyr(:,il)) - do ico = 1, ncoh - lw_v_surf (ico) = lw_v_surf(ico) + lw_v_surf_layer(il) & - * sngloff(tai_lyr(ico,il) / this_tai, tiny_num8) - lw_v_incid(ico) = lw_v_incid(ico) + lw_v_incid_layer(il) & - * sngloff(tai_lyr(ico,il) / this_tai, tiny_num8) - end do - end do - !---------------------------------------------------------------------------------------! - - - - !------ De-allocate the temporary structure. -------------------------------------------! - deallocate(tai_lyr ) - deallocate(emis_lyr ) - deallocate(temp_lyr ) - !---------------------------------------------------------------------------------------! - - return -end subroutine lw_twostream_layer -!==========================================================================================! -!==========================================================================================! diff --git a/ED/src/dynamics/vegetation_dynamics.f90 b/ED/src/dynamics/vegetation_dynamics.f90 index a1e23cf4c..55bd68a76 100644 --- a/ED/src/dynamics/vegetation_dynamics.f90 +++ b/ED/src/dynamics/vegetation_dynamics.f90 @@ -8,16 +8,14 @@ subroutine vegetation_dynamics(new_month,new_year) use grid_coms , only : ngrids use ed_misc_coms , only : current_time & ! intent(in) , dtlsm & ! intent(in) - , frqsum & ! intent(in) - , ied_init_mode ! ! intent(in) + , frqsum ! ! intent(in) use disturb_coms , only : include_fire ! ! intent(in) use disturbance_utils, only : apply_disturbances & ! subroutine , site_disturbance_rates ! ! subroutine use fuse_fiss_utils , only : fuse_patches ! ! subroutine use ed_state_vars , only : edgrid_g & ! intent(inout) , edtype ! ! variable type - use growth_balive , only : dbalive_dt & ! subroutine - , dbalive_dt_eq_0 ! ! subroutine + use growth_balive , only : dbalive_dt ! ! subroutine use consts_coms , only : day_sec & ! intent(in) , yr_day ! ! intent(in) use mem_polygons , only : maxpatch ! ! intent(in) @@ -62,15 +60,8 @@ subroutine vegetation_dynamics(new_month,new_year) !----- Standardise the fast-scale uptake and respiration, for growth rates. ---------! call normalize_ed_daily_vars(cgrid, tfact1) !----- Update phenology and growth of live tissues. ---------------------------------! - select case (ied_init_mode) - case (-8) - !----- Special case, in which we don't solve the actual vegetation dynamics. -----! - call phenology_driver_eq_0(cgrid,doy,current_time%month, tfact1) - call dbalive_dt_eq_0(cgrid,tfact2) - case default - call phenology_driver(cgrid,doy,current_time%month, tfact1) - call dbalive_dt(cgrid,tfact2) - end select + call phenology_driver(cgrid,doy,current_time%month, tfact1) + call dbalive_dt(cgrid,tfact2) !------------------------------------------------------------------------------------! @@ -90,9 +81,7 @@ subroutine vegetation_dynamics(new_month,new_year) call reproduction(cgrid,current_time%month) !----- Update the fire disturbance rates. ----------------------------------------! - if (include_fire /= 0) then - call fire_frequency(current_time%month,cgrid) - end if + call fire_frequency(cgrid) !----- Update the disturbance rates. ---------------------------------------------! call site_disturbance_rates(current_time%month, current_time%year, cgrid) @@ -137,3 +126,123 @@ subroutine vegetation_dynamics(new_month,new_year) end subroutine vegetation_dynamics !==========================================================================================! !==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This subroutine is the a dummy version of the main driver for the longer-term ! +! vegetation dynamics. Even though all "tendency" terms will be normally computed, none ! +! of them will be applied to the vegetation, so the plant community will remain the same ! +! throughout the entire simulation. ! +!------------------------------------------------------------------------------------------! +subroutine vegetation_dynamics_eq_0(new_month,new_year) + use grid_coms , only : ngrids + use ed_misc_coms , only : current_time & ! intent(in) + , dtlsm & ! intent(in) + , frqsum ! ! intent(in) + use disturb_coms , only : include_fire ! ! intent(in) + use disturbance_utils, only : apply_disturbances & ! subroutine + , site_disturbance_rates ! ! subroutine + use fuse_fiss_utils , only : fuse_patches ! ! subroutine + use ed_state_vars , only : edgrid_g & ! intent(inout) + , edtype ! ! variable type + use growth_balive , only : dbalive_dt & ! subroutine + , dbalive_dt_eq_0 ! ! subroutine + use consts_coms , only : day_sec & ! intent(in) + , yr_day ! ! intent(in) + use mem_polygons , only : maxpatch ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + logical , intent(in) :: new_month + logical , intent(in) :: new_year + !----- Local variables. ----------------------------------------------------------------! + type(edtype), pointer :: cgrid + real :: tfact1 + real :: tfact2 + integer :: doy + integer :: ip + integer :: isite + integer :: ifm + !----- External functions. -------------------------------------------------------------! + integer , external :: julday + !---------------------------------------------------------------------------------------! + + !----- Find the day of year. -----------------------------------------------------------! + doy = julday(current_time%month, current_time%date, current_time%year) + + !----- Time factor for normalizing daily variables updated on the DTLSM step. ----------! + tfact1 = dtlsm / day_sec + !----- Time factor for averaging dailies. ----------------------------------------------! + tfact2 = 1.0 / yr_day + + + !---------------------------------------------------------------------------------------! + ! Loop over all domains. ! + !---------------------------------------------------------------------------------------! + do ifm=1,ngrids + + cgrid => edgrid_g(ifm) + + !------------------------------------------------------------------------------------! + ! The following block corresponds to the daily time-step. ! + !------------------------------------------------------------------------------------! + !----- Standardise the fast-scale uptake and respiration, for growth rates. ---------! + call normalize_ed_daily_vars(cgrid, tfact1) + !----- Update phenology and growth of live tissues. ---------------------------------! + call phenology_driver_eq_0(cgrid,doy,current_time%month, tfact1) + call dbalive_dt_eq_0(cgrid,tfact2) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! The following block corresponds to the monthly time-step: ! + !------------------------------------------------------------------------------------! + if (new_month) then + + !----- Update the mean workload counter. -----------------------------------------! + call update_workload(cgrid) + + !----- Update the growth of the structural biomass. ------------------------------! + call structural_growth_eq_0(cgrid, current_time%month) + + !----- Solve the reproduction rates. ---------------------------------------------! + call reproduction_eq_0(cgrid,current_time%month) + + !----- Update the fire disturbance rates. ----------------------------------------! + call fire_frequency(cgrid) + + !----- Update the disturbance rates. ---------------------------------------------! + call site_disturbance_rates(current_time%month, current_time%year, cgrid) + + !----- We bypass the disturbance routine alltogether. ----------------------------! + end if + !------------------------------------------------------------------------------------! + + !------ update dmean and mmean values for NPP allocation terms ---------------------! + call normalize_ed_dailyNPP_vars(cgrid) + + !------------------------------------------------------------------------------------! + ! This should be done every day, but after the longer-scale steps. We update ! + ! the carbon and nitrogen pools, and re-set the daily variables. ! + !------------------------------------------------------------------------------------! + call update_C_and_N_pools(cgrid) + call zero_ed_daily_vars(cgrid) + !------------------------------------------------------------------------------------! + + + + !----- Recalculate the AGB and basal area at the polygon level. ---------------------! + call update_polygon_derived_props(cgrid) + call print_C_and_N_budgets(cgrid) + !------------------------------------------------------------------------------------! + end do + + return +end subroutine vegetation_dynamics_eq_0 +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/init/ed_init.f90 b/ED/src/init/ed_init.f90 index 9df5b9a58..d77b46e63 100644 --- a/ED/src/init/ed_init.f90 +++ b/ED/src/init/ed_init.f90 @@ -30,6 +30,8 @@ subroutine set_polygon_coordinates() !----- Assign the commonest soil type to the polygon. ----------------------------! edgrid_g(ifm)%ntext_soil(1:nzg,ipy) = work_v(ifm)%ntext(1,ipy) !---------------------------------------------------------------------------------! + + edgrid_g(ifm)%ncol_soil(ipy) = work_v(ifm)%nscol(ipy) end do ploop @@ -157,6 +159,13 @@ subroutine set_site_defprops() !---------------------------------------------------------------------------! + !---------------------------------------------------------------------------! + ! Use the polygon-level soil colour to populate the site-level. ! + !---------------------------------------------------------------------------! + cpoly%ncol_soil(isi) = work_v(ifm)%nscol(ipy) + !---------------------------------------------------------------------------! + + !---------------------------------------------------------------------------! ! Set soil moisture decay function, based on second layer's K value. ! ! We use the second layer instead of the top in case top is organic/peat. ! diff --git a/ED/src/init/ed_nbg_init.f90 b/ED/src/init/ed_nbg_init.f90 index 302634628..866d895d6 100644 --- a/ED/src/init/ed_nbg_init.f90 +++ b/ED/src/init/ed_nbg_init.f90 @@ -205,7 +205,6 @@ subroutine init_nbg_cohorts(csite,lsl,ipa_a,ipa_z) cpatch%nplant(ico) = init_density(ipft) cpatch%hite(ico) = hgt_min(ipft) cpatch%phenology_status(ico) = 0 - cpatch%bstorage(ico) = 0.0 cpatch%dbh(ico) = h2dbh(cpatch%hite(ico),ipft) cpatch%bdead(ico) = dbh2bd(cpatch%dbh(ico),ipft) cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),ipft) @@ -219,6 +218,8 @@ subroutine init_nbg_cohorts(csite,lsl,ipa_a,ipa_z) cpatch%broot(ico) = q(ipft) * cpatch%balive(ico) * salloci cpatch%bsapwood(ico) = qsw(ipft) * cpatch%hite(ico) * cpatch%balive(ico) & * salloci + cpatch%bstorage(ico) = 0.5 * ( cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwood(ico)) !----- Find the initial area indices (LAI, WPA, WAI). ----------------------------! call area_indices(cpatch%nplant(ico),cpatch%bleaf(ico),cpatch%bdead(ico) & diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index bf41e3679..fa0cb5c4a 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -113,20 +113,41 @@ subroutine load_ed_ecosystem_params() ,'load_ecosystem_params','ed_params.f90') end if - !----- Assign many PFT-dependent parameters. -------------------------------------------! + !---------------------------------------------------------------------------------------! + ! Assign many PFT-dependent parameters. Here the order may matter, so think twice ! + ! before changing the order. ! + !---------------------------------------------------------------------------------------! + !----- Photosynthesis and leaf respiration. --------------------------------------------! call init_pft_photo_params() + !----- Root and heterotrophic respiration. ---------------------------------------------! call init_pft_resp_params() + !----- Allometry and some plant traits. ------------------------------------------------! call init_pft_alloc_params() + !----- Mortality. ----------------------------------------------------------------------! call init_pft_mort_params() + !----- Nitrogen. -----------------------------------------------------------------------! call init_pft_nitro_params() + !----- Miscellaneous leaf properties. --------------------------------------------------! call init_pft_leaf_params() + !----- Reproduction. -------------------------------------------------------------------! call init_pft_repro_params() + !----- Miscellaneous parameters that depend on the previous ones. ----------------------! call init_pft_derived_params() + !---------------------------------------------------------------------------------------! - !----- This must be done after defining some PFT parameters. ---------------------------! + + + !---------------------------------------------------------------------------------------! + ! Assign canopy properties. This must be done after defining the PFT stuff. ! + ! Again, check the routines and think twice before changing the order. ! + !---------------------------------------------------------------------------------------! + !----- Canopy turbulence and aerodynamic resistance. -----------------------------------! call init_can_air_params() + !----- Canopy radiation properties. ----------------------------------------------------! call init_can_rad_params() + !----- Canopy splitting into height layers. --------------------------------------------! call init_can_lyr_params() + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! This should be always the last one, since it depends on variables assigned in ! @@ -267,28 +288,34 @@ end subroutine init_ed_misc_coms ! logical forcing. ! !------------------------------------------------------------------------------------------! subroutine init_met_params() + use ed_misc_coms , only : dtlsm ! ! intent(in) + use met_driver_coms, only : rshort_min & ! intent(out) + , rshort_max & ! intent(out) + , rlong_min & ! intent(out) + , rlong_max & ! intent(out) + , dt_radinterp & ! intent(out) + , atm_tmp_min & ! intent(out) + , atm_tmp_max & ! intent(out) + , atm_shv_min & ! intent(out) + , atm_shv_max & ! intent(out) + , atm_rhv_min & ! intent(out) + , atm_rhv_max & ! intent(out) + , atm_co2_min & ! intent(out) + , atm_co2_max & ! intent(out) + , prss_min & ! intent(out) + , prss_max & ! intent(out) + , pcpg_min & ! intent(out) + , pcpg_max & ! intent(out) + , vels_min & ! intent(out) + , vels_max & ! intent(out) + , geoht_min & ! intent(out) + , geoht_max & ! intent(out) + , print_radinterp & ! intent(out) + , vbdsf_file & ! intent(out) + , vddsf_file & ! intent(out) + , nbdsf_file & ! intent(out) + , nddsf_file ! ! intent(out) - use met_driver_coms, only : rshort_min & ! intent(out) - , rshort_max & ! intent(out) - , rlong_min & ! intent(out) - , rlong_max & ! intent(out) - , dt_radinterp & ! intent(out) - , atm_tmp_min & ! intent(out) - , atm_tmp_max & ! intent(out) - , atm_shv_min & ! intent(out) - , atm_shv_max & ! intent(out) - , atm_rhv_min & ! intent(out) - , atm_rhv_max & ! intent(out) - , atm_co2_min & ! intent(out) - , atm_co2_max & ! intent(out) - , prss_min & ! intent(out) - , prss_max & ! intent(out) - , pcpg_min & ! intent(out) - , pcpg_max & ! intent(out) - , vels_min & ! intent(out) - , vels_max & ! intent(out) - , geoht_min & ! intent(out) - , geoht_max ! ! intent(out) !----- Minimum and maximum acceptable shortwave radiation [W/mē]. ----------------------! rshort_min = 0. @@ -337,10 +364,20 @@ subroutine init_met_params() !---------------------------------------------------------------------------------------! ! Time step used to perform the daytime average of the secant of the zenith angle. ! !---------------------------------------------------------------------------------------! - dt_radinterp = 30.0 ! Value in seconds. + dt_radinterp = dtlsm ! Value in seconds. !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! These variables control the detailed interpolation output (for debugging only). ! + !---------------------------------------------------------------------------------------! + print_radinterp = .false. + vbdsf_file = 'visible_beam.txt' + vddsf_file = 'visible_diff.txt' + nbdsf_file = 'near_infrared_beam.txt' + nddsf_file = 'near_infrared_diff.txt' + !---------------------------------------------------------------------------------------! + return end subroutine init_met_params !==========================================================================================! @@ -402,7 +439,15 @@ end subroutine init_lapse_params !------------------------------------------------------------------------------------------! subroutine init_can_rad_params() - use canopy_radiation_coms , only : leaf_reflect_nir & ! intent(out) + use canopy_radiation_coms , only : ltrans_vis & ! intent(in) + , ltrans_nir & ! intent(in) + , lreflect_vis & ! intent(in) + , lreflect_nir & ! intent(in) + , orient_tree & ! intent(in) + , orient_grass & ! intent(in) + , clump_tree & ! intent(in) + , clump_grass & ! intent(in) + , leaf_reflect_nir & ! intent(out) , leaf_trans_nir & ! intent(out) , leaf_scatter_nir & ! intent(out) , leaf_reflect_vis & ! intent(out) @@ -412,6 +457,12 @@ subroutine init_can_rad_params() , leaf_trans_vis & ! intent(out) , leaf_backscatter_vis & ! intent(out) , leaf_backscatter_nir & ! intent(out) + , leaf_backscatter_tir & ! intent(out) + , clumping_factor & ! intent(out) + , orient_factor & ! intent(out) + , phi1 & ! intent(out) + , phi2 & ! intent(out) + , mu_bar & ! intent(out) , leaf_emis & ! intent(out) , wood_reflect_nir & ! intent(out) , wood_trans_nir & ! intent(out) @@ -423,8 +474,8 @@ subroutine init_can_rad_params() , wood_trans_vis & ! intent(out) , wood_backscatter_vis & ! intent(out) , wood_backscatter_nir & ! intent(out) + , wood_backscatter_tir & ! intent(out) , wood_emis & ! intent(out) - , mubar & ! intent(out) , fvis_beam_def & ! intent(out) , fvis_diff_def & ! intent(out) , fnir_beam_def & ! intent(out) @@ -432,30 +483,89 @@ subroutine init_can_rad_params() , rshort_twilight_min & ! intent(out) , cosz_min & ! intent(out) , cosz_min8 ! ! intent(out) - use consts_coms , only : pio180 ! ! intent(out) + use consts_coms , only : pio180 & ! intent(out) + , twothirds8 ! ! intent(out) + use ed_max_dims , only : n_pft ! ! intent(out) implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer :: ipft + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! The following parameters are used to split the shortwave radiation into visible ! + ! and near-infrared radiation. ! + !---------------------------------------------------------------------------------------! + fvis_beam_def = 0.43 + fnir_beam_def = 1.0 - fvis_beam_def + fvis_diff_def = 0.52 + fnir_diff_def = 1.0 - fvis_diff_def + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Clumping factor. This factor indicates the degree of clumpiness of leaves. !a + ! 0 -- black hole ! + ! 1 -- homogeneous, no clumping. ! + !---------------------------------------------------------------------------------------! + clumping_factor(1) = dble(clump_grass) + clumping_factor(2:4) = dble(clump_tree ) + clumping_factor(5) = 8.400d-1 + clumping_factor(6:8) = 7.350d-1 + clumping_factor(9:11) = 8.400d-1 + clumping_factor(12:13) = 8.400d-1 + clumping_factor(14:15) = dble(clump_grass) + clumping_factor(16) = dble(clump_grass) + clumping_factor(17) = 7.350d-1 + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! Leaf angle distribution parameter (dimensionless). Let mu' be the cosine of leaf ! - ! angle and G(mu') be the distribution of mu'. Then, mubar = (integral from 0 to 1) ! - ! (d mu' mu' / G(mu')). See, for example, Dickinson 1983. ! + ! Orientation factor. The numbers come from CLM, and the original value from ! + ! ED-2.1 used to 0. This works in the following way: ! + ! 0 -- leaves are randomly oriented ! + ! 1 -- all leaves are perfectly horizontal ! + ! -1 -- all leaves are perfectly vertical. ! !---------------------------------------------------------------------------------------! - mubar = 1.0d0 + orient_factor( 1) = dble(orient_grass) + orient_factor( 2:4) = dble(orient_tree) + orient_factor( 5) = 0.0d0 ! -3.0d-1 ! CLM value for C3 grass + orient_factor( 6:8) = 0.0d0 ! 1.0d-2 ! CLM value for temperate evergreen needleef tree + orient_factor( 9:11) = 0.0d0 ! 2.5d-1 ! CLM value for temperate deciduous broadleaf tree + orient_factor(12:13) = 0.0d0 ! -3.0d-1 ! CLM value for C3 grass + orient_factor(14:15) = dble(orient_grass) ! -3.0d-1 ! CLM value for C4 grass + orient_factor( 16) = dble(orient_grass) + orient_factor( 17) = 1.0d-2 ! CLM value for temperate evergreen needleef !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! - ! The following parameters are used to split the shortwave radiation into visible ! - ! and near-infrared radiation. ! + ! Emissivity on Thermal infra-red (TIR). ! !---------------------------------------------------------------------------------------! - fvis_beam_def = 0.43 - fnir_beam_def = 1.0 - fvis_beam_def - fvis_diff_def = 0.52 - fnir_diff_def = 1.0 - fvis_diff_def + !----- Leaves. -------------------------------------------------------------------------! + leaf_emis(1) = 9.60d-1 + leaf_emis(2:4) = 9.50d-1 + leaf_emis(5) = 9.60d-1 + leaf_emis(6:8) = 9.70d-1 + leaf_emis(9:11) = 9.50d-1 + leaf_emis(12:15) = 9.60d-1 + leaf_emis(16) = 9.60d-1 + leaf_emis(17) = 9.70d-1 + !----- Branches. -----------------------------------------------------------------------! + wood_emis(1) = 9.60d-1 + wood_emis(2:4) = 9.00d-1 + wood_emis(5) = 9.60d-1 + wood_emis(6:8) = 9.00d-1 + wood_emis(9:11) = 9.00d-1 + wood_emis(12:15) = 9.60d-1 + wood_emis(16) = 9.60d-1 + wood_emis(17) = 9.00d-1 !---------------------------------------------------------------------------------------! @@ -466,25 +576,35 @@ subroutine init_can_rad_params() ! PFTs use the parameters from CLM. I checked the values against some published and ! ! they seem similar at a first glance, at least closer than the original values, which ! ! looked like the visible ignoring the green band. ! + ! ! + ! Tropical / Subtropical values for visible came from: ! + ! - Poorter, L., S. F. Oberbauer, D. B. Clark, 1995: Leaf optical properties along a ! + ! vertical gradient in a tropical rainforest in Costa Rica. American J. of Botany, ! + ! 82, 1257-1263. ! + ! Tropical values for NIR were estimated from: ! + ! - Roberts, D. A., B. W. Nelson, J. B. Adams, F. Palmer, 1998: Spectral changes with ! + ! leaf aging in Amazon caatinga. Trees, 12, 315-325. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! - leaf_reflect_vis(1) = 1.3d-1 ! 6.2d-2 - leaf_reflect_vis(2:4) = 1.3d-1 ! 6.2d-2 - leaf_reflect_vis(5) = 1.1d-1 ! 6.2d-2 - leaf_reflect_vis(6:11) = 1.1d-1 ! 1.1d-1 - leaf_reflect_vis(12:13) = 1.1d-1 ! 1.1d-1 - leaf_reflect_vis(14:15) = 1.1d-1 ! 1.1d-1 - leaf_reflect_vis(16) = 1.3d-1 ! 0.062 - leaf_reflect_vis(17) = 9.0d-2 ! 9.0d-2 + leaf_reflect_vis(1) = dble(lreflect_vis) + leaf_reflect_vis(2) = dble(lreflect_vis) + leaf_reflect_vis(3) = dble(lreflect_vis) + leaf_reflect_vis(4) = dble(lreflect_vis) + leaf_reflect_vis(5) = 1.10d-1 ! 6.2d-2 + leaf_reflect_vis(6:11) = 1.10d-1 ! 1.1d-1 + leaf_reflect_vis(12:13) = 1.10d-1 ! 1.1d-1 + leaf_reflect_vis(14:15) = dble(lreflect_vis) + leaf_reflect_vis(16) = dble(lreflect_vis) + leaf_reflect_vis(17) = 9.00d-2 ! 9.0d-2 !----- Near infrared. ------------------------------------------------------------------! - leaf_reflect_nir(1) = 6.30d-1 - leaf_reflect_nir(2:4) = 6.30d-1 + leaf_reflect_nir(1) = dble(lreflect_nir) + leaf_reflect_nir(2:4) = dble(lreflect_nir) leaf_reflect_nir(5) = 5.77d-1 leaf_reflect_nir( 6:11) = 5.77d-1 leaf_reflect_nir(12:13) = 5.77d-1 - leaf_reflect_nir(14:15) = 5.80d-1 - leaf_reflect_nir(16) = 6.30d-1 - leaf_reflect_nir(17) = 4.60d-1 + leaf_reflect_nir(14:15) = dble(lreflect_nir) + leaf_reflect_nir(16) = dble(lreflect_nir) + leaf_reflect_nir(17) = 5.77d-1 !---------------------------------------------------------------------------------------! @@ -520,25 +640,35 @@ subroutine init_can_rad_params() ! PFTs use the parameters from CLM. I checked the values against some published and ! ! they seem similar at a first glance, at least closer than the original values, which ! ! looked like the visible ignoring the green band. ! + ! ! + ! Tropical / Subtropical values for visible came from: ! + ! - Poorter, L., S. F. Oberbauer, D. B. Clark, 1995: Leaf optical properties along a ! + ! vertical gradient in a tropical rainforest in Costa Rica. American J. of Botany, ! + ! 82, 1257-1263. ! + ! Tropical values for NIR were estimated from: ! + ! - Roberts, D. A., B. W. Nelson, J. B. Adams, F. Palmer, 1998: Spectral changes with ! + ! leaf aging in Amazon caatinga. Trees, 12, 315-325. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! - leaf_trans_vis( 1) = 2.80d-2 ! 7.00d-2 - leaf_trans_vis( 2:4) = 2.80d-2 ! 5.00d-2 + leaf_trans_vis( 1) = dble(ltrans_vis) + leaf_trans_vis( 2) = dble(ltrans_vis) + leaf_trans_vis( 3) = dble(ltrans_vis) + leaf_trans_vis( 4) = dble(ltrans_vis) leaf_trans_vis( 5) = 1.60d-1 ! 0.160 leaf_trans_vis( 6:11) = 1.60d-1 ! 0.160 leaf_trans_vis(12:13) = 1.60d-1 ! 0.160 - leaf_trans_vis(14:15) = 7.00d-2 ! 0.028 - leaf_trans_vis( 16) = 2.80d-2 ! 7.00d-2 + leaf_trans_vis(14:15) = dble(ltrans_vis) + leaf_trans_vis( 16) = dble(ltrans_vis) leaf_trans_vis( 17) = 5.00d-2 ! 0.160 !----- Near infrared. ------------------------------------------------------------------! - leaf_trans_nir( 1) = 2.48d-1 - leaf_trans_nir( 2:4) = 2.48d-1 + leaf_trans_nir( 1) = dble(ltrans_nir) + leaf_trans_nir( 2:4) = dble(ltrans_nir) leaf_trans_nir( 5) = 2.48d-1 leaf_trans_nir( 6:11) = 2.48d-1 leaf_trans_nir(12:13) = 2.48d-1 - leaf_trans_nir(14:15) = 2.48d-1 - leaf_trans_nir( 16) = 2.48d-1 - leaf_trans_nir( 17) = 1.80d-1 + leaf_trans_nir(14:15) = dble(ltrans_nir) + leaf_trans_nir( 16) = dble(ltrans_nir) + leaf_trans_nir( 17) = 2.48d-1 !---------------------------------------------------------------------------------------! @@ -570,59 +700,112 @@ subroutine init_can_rad_params() !---------------------------------------------------------------------------------------! - ! Scattering coefficient. For all PFTs this is just the sum of reflectance and ! - ! transmittance. ! - !---------------------------------------------------------------------------------------! - !----- Visible (PAR). ------------------------------------------------------------------! - leaf_scatter_vis(1:17) = leaf_reflect_vis(1:17) + leaf_trans_vis(1:17) - wood_scatter_vis(1:17) = wood_reflect_vis(1:17) + wood_trans_vis(1:17) - !----- Near infrared. ------------------------------------------------------------------! - leaf_scatter_nir(1:17) = leaf_reflect_nir(1:17) + leaf_trans_nir(1:17) - wood_scatter_nir(1:17) = wood_reflect_nir(1:17) + wood_trans_nir(1:17) + ! Scattering coefficients. Contrary to ED-2.1, these values are based on the ! + ! description by by Sellers (1985) and the CLM technical manual, which includes the ! + ! leaf orientation factor in the backscattering. This DOES NOT reduce to ED-2.1 case ! + ! when the leaf orientation is random. ! !---------------------------------------------------------------------------------------! + do ipft = 1, n_pft + !------------------------------------------------------------------------------------! + ! Forward scattering. ! + !------------------------------------------------------------------------------------! + !----- Visible (PAR). ---------------------------------------------------------------! + leaf_scatter_vis(ipft) = leaf_reflect_vis(ipft) + leaf_trans_vis(ipft) + wood_scatter_vis(ipft) = wood_reflect_vis(ipft) + wood_trans_vis(ipft) + !----- Near infrared (NIR). ---------------------------------------------------------! + leaf_scatter_nir(ipft) = leaf_reflect_nir(ipft) + leaf_trans_nir(ipft) + wood_scatter_nir(ipft) = wood_reflect_nir(ipft) + wood_trans_nir(ipft) + !------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! - ! Back-scattering coefficients. ! - !---------------------------------------------------------------------------------------! - !----- Visible (PAR). ------------------------------------------------------------------! - leaf_backscatter_vis(1:17) = (2.d0 * leaf_reflect_vis(1:17) - leaf_trans_vis(1:17)) & - / (3.d0 * leaf_scatter_vis(1:17)) - wood_backscatter_vis(1:17) = (2.d0 * wood_reflect_vis(1:17) - wood_trans_vis(1:17)) & - / (3.d0 * wood_scatter_vis(1:17)) - !----- Near infrared. ------------------------------------------------------------------! - leaf_backscatter_nir(1:17) = (2.d0 * leaf_reflect_nir(1:17) - leaf_trans_nir(1:17)) & - / (3.d0 * leaf_scatter_nir(1:17)) - wood_backscatter_nir(1:17) = (2.d0 * wood_reflect_nir(1:17) - wood_trans_nir(1:17)) & - / (3.d0 * wood_scatter_nir(1:17)) + !------------------------------------------------------------------------------------! + ! Original back-scattering coefficients. They don't depend on orientation ! + ! factor so I'll be using CLM instead. ! + !------------------------------------------------------------------------------------! + !----- Visible (PAR). ---------------------------------------------------------------! + ! leaf_backscatter_vis(ipft) = ( 2.d0 * leaf_reflect_vis(ipft) & + ! - leaf_trans_vis(ipft)) & + ! / ( 3.d0 * leaf_scatter_vis(ipft)) + ! wood_backscatter_vis(ipft) = ( 2.d0 * wood_reflect_vis(ipft) & + ! - wood_trans_vis(ipft)) & + ! / ( 3.d0 * wood_scatter_vis(ipft)) + !----- Near infrared. ---------------------------------------------------------------! + ! leaf_backscatter_nir(ipft) = ( 2.d0 * leaf_reflect_nir(ipft) & + ! - leaf_trans_nir(ipft)) & + ! / ( 3.d0 * leaf_scatter_nir(ipft)) + ! wood_backscatter_nir(ipft) = ( 2.d0 * wood_reflect_nir(ipft) & + ! - wood_trans_nir(ipft)) & + ! / ( 3.d0 * wood_scatter_nir(ipft)) + !----- Thermal infrared. We assume transmittance to be zero. -----------------------! + ! leaf_backscatter_tir(ipft) = twothirds8 + ! wood_backscatter_tir(ipft) = twothirds8 + !------------------------------------------------------------------------------------! + ! Back-scattering coefficients following CLM. ! + !------------------------------------------------------------------------------------! + !----- Visible (PAR). ---------------------------------------------------------------! + leaf_backscatter_vis(ipft) = ( leaf_scatter_vis(ipft) & + + 2.5d-1 & + * ( leaf_reflect_vis(ipft) - leaf_trans_vis(ipft) ) & + * ( 1.d0 + orient_factor(ipft)) ** 2 ) & + / ( 2.d0 * leaf_scatter_vis(ipft) ) + wood_backscatter_vis(ipft) = ( wood_scatter_vis(ipft) & + + 2.5d-1 & + * ( wood_reflect_vis(ipft) - wood_trans_vis(ipft) ) & + * ( 1.d0 + orient_factor(ipft)) ** 2 ) & + / ( 2.d0 * wood_scatter_vis(ipft) ) + !----- Near infrared (NIR). ---------------------------------------------------------! + leaf_backscatter_nir(ipft) = ( leaf_scatter_nir(ipft) & + + 2.5d-1 & + * ( leaf_reflect_nir(ipft) - leaf_trans_nir(ipft) ) & + * ( 1.d0 + orient_factor(ipft)) ** 2 ) & + / ( 2.d0 * leaf_scatter_nir(ipft) ) + wood_backscatter_nir(ipft) = ( wood_scatter_nir(ipft) & + + 2.5d-1 & + * ( wood_reflect_nir(ipft) - wood_trans_nir(ipft) ) & + * ( 1.d0 + orient_factor(ipft)) ** 2 ) & + / ( 2.d0 * wood_scatter_nir(ipft) ) + !------------------------------------------------------------------------------------! + ! Thermal infra-red (TIR): Here we use the same expression from CLM manual, ! + ! further assuming that the transmittance is zero like Zhao and Qualls (2006) did, ! + ! the backscattering coefficient becomes a function of the leaf orientation only. ! + ! We don't have different orientation factor for wood (we could have), so we assume ! + ! them to be the same as leaves. ! + !------------------------------------------------------------------------------------! + leaf_backscatter_tir(ipft) = 5.d-1 + 1.25d-1 * (1 + orient_factor(ipft)) ** 2 + wood_backscatter_tir(ipft) = 5.d-1 + 1.25d-1 * (1 + orient_factor(ipft)) ** 2 + !------------------------------------------------------------------------------------! + end do !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! - ! Emissivity. ! + ! Light extinction coefficients. These are found following CLM technical manual, ! + ! and the values fall back to ED-2.0 defaults when orient_factor is zero. ! !---------------------------------------------------------------------------------------! - leaf_emis(1) = 9.60d-1 - leaf_emis(2:4) = 9.50d-1 - leaf_emis(5) = 9.60d-1 - leaf_emis(6:8) = 9.70d-1 - leaf_emis(9:11) = 9.50d-1 - leaf_emis(12:15) = 9.60d-1 - leaf_emis(16) = 9.60d-1 - leaf_emis(17) = 9.70d-1 - wood_emis(1) = 9.60d-1 - wood_emis(2:4) = 9.00d-1 - wood_emis(5) = 9.60d-1 - wood_emis(6:8) = 9.00d-1 - wood_emis(9:11) = 9.00d-1 - wood_emis(12:15) = 9.60d-1 - wood_emis(16) = 9.60d-1 - wood_emis(17) = 9.00d-1 + do ipft = 1, n_pft + phi1(ipft) = 5.d-1 & + - orient_factor(ipft) * ( 6.33d-1 + 3.3d-1 * orient_factor(ipft) ) + phi2(ipft) = 8.77d-1 * (1.d0 - 2.d0 * phi1(ipft)) + + + + !------------------------------------------------------------------------------------! + ! Find the average inverse diffuse optical depth per unit leaf and stem area. ! + ! We follow CLM technical manual, equation 3.4 only when the orientation factor is ! + ! non-zero. Otherwise, we make it 1.d0, which is the limit of that equation when ! + ! phi2 approaches zero. ! + !------------------------------------------------------------------------------------! + if (orient_factor(ipft) == 0.d0) then + mu_bar(ipft) = 1.d0 + else + mu_bar(ipft) = ( 1.d0 & + - phi1(ipft) * log(1.d0 + phi2(ipft) / phi1(ipft)) / phi2(ipft) ) & + / phi2(ipft) + end if + end do !---------------------------------------------------------------------------------------! @@ -655,19 +838,21 @@ end subroutine init_can_rad_params subroutine init_can_air_params() use consts_coms , only : onethird & ! intent(in) , twothirds & ! intent(in) + , onesixth & ! intent(in) , vonk ! ! intent(in) use pft_coms , only : hgt_min & ! intent(in) , hgt_max ! ! intent(in) - use canopy_air_coms, only : i_blyr_condct & ! intent(in) + use canopy_air_coms, only : psim & ! function + , psih & ! function , isfclyrm & ! intent(in) + , ugbmin & ! intent(in) + , ubmin & ! intent(in) , ustmin & ! intent(in) - , ggfact & ! intent(in) , gamm & ! intent(in) , gamh & ! intent(in) , tprandtl & ! intent(in) - , vkopr & ! intent(in) - , vh2vr & ! intent(in) - , vh2dh & ! intent(in) + , vh2vr & ! intent(out) + , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_drywhc & ! intent(out) , leaf_maxwhc & ! intent(out) @@ -678,14 +863,11 @@ subroutine init_can_air_params() , minimum_canopy_depth8 & ! intent(out) , exar & ! intent(out) , covr & ! intent(out) - , ugbmin & ! intent(out) - , ubmin & ! intent(out) , exar8 & ! intent(out) , ez & ! intent(out) , ustmin8 & ! intent(out) , ugbmin8 & ! intent(out) , ubmin8 & ! intent(out) - , ggfact8 & ! intent(out) , ez8 & ! intent(out) , vh2dh8 & ! intent(out) , cdrag0 & ! intent(out) @@ -699,6 +881,8 @@ subroutine init_can_air_params() , gamma_mw99 & ! intent(out) , nu_mw99 & ! intent(out) , infunc & ! intent(out) + , cs_dense0 & ! intent(out) + , gamma_clm4 & ! intent(out) , cdrag08 & ! intent(out) , pm08 & ! intent(out) , c1_m978 & ! intent(out) @@ -710,11 +894,13 @@ subroutine init_can_air_params() , gamma_mw99_8 & ! intent(out) , nu_mw99_8 & ! intent(out) , infunc_8 & ! intent(out) + , cs_dense08 & ! intent(out) + , gamma_clm48 & ! intent(out) , bl79 & ! intent(out) , csm & ! intent(out) , csh & ! intent(out) , dl79 & ! intent(out) - , bbeta & ! intent(out) + , beta_s & ! intent(out) , abh91 & ! intent(out) , bbh91 & ! intent(out) , cbh91 & ! intent(out) @@ -728,16 +914,30 @@ subroutine init_can_air_params() , atetf & ! intent(out) , z0moz0h & ! intent(out) , z0hoz0m & ! intent(out) + , beta_vs & ! intent(out) + , chim & ! intent(out) + , chih & ! intent(out) + , zetac_um & ! intent(out) + , zetac_uh & ! intent(out) + , zetac_sm & ! intent(out) + , zetac_sh & ! intent(out) + , zetac_umi & ! intent(out) + , zetac_uhi & ! intent(out) + , zetac_smi & ! intent(out) + , zetac_shi & ! intent(out) + , zetac_umi16 & ! intent(out) + , zetac_uhi13 & ! intent(out) + , psimc_um & ! intent(out) + , psihc_uh & ! intent(out) , bl798 & ! intent(out) , csm8 & ! intent(out) , csh8 & ! intent(out) , dl798 & ! intent(out) - , bbeta8 & ! intent(out) + , beta_s8 & ! intent(out) , gamm8 & ! intent(out) , gamh8 & ! intent(out) , ribmax8 & ! intent(out) , tprandtl8 & ! intent(out) - , vkopr8 & ! intent(out) , abh918 & ! intent(out) , bbh918 & ! intent(out) , cbh918 & ! intent(out) @@ -751,6 +951,21 @@ subroutine init_can_air_params() , atetf8 & ! intent(out) , z0moz0h8 & ! intent(out) , z0hoz0m8 & ! intent(out) + , beta_vs8 & ! intent(out) + , chim8 & ! intent(out) + , chih8 & ! intent(out) + , zetac_um8 & ! intent(out) + , zetac_uh8 & ! intent(out) + , zetac_sm8 & ! intent(out) + , zetac_sh8 & ! intent(out) + , zetac_umi8 & ! intent(out) + , zetac_uhi8 & ! intent(out) + , zetac_smi8 & ! intent(out) + , zetac_shi8 & ! intent(out) + , zetac_umi168 & ! intent(out) + , zetac_uhi138 & ! intent(out) + , psimc_um8 & ! intent(out) + , psihc_uh8 & ! intent(out) , aflat_turb & ! intent(out) , aflat_lami & ! intent(out) , bflat_turb & ! intent(out) @@ -769,12 +984,6 @@ subroutine init_can_air_params() , ncyli_lami & ! intent(out) , mcyli_turb & ! intent(out) , mcyli_lami & ! intent(out) - , beta_r1 & ! intent(out) - , beta_r2 & ! intent(out) - , beta_re0 & ! intent(out) - , beta_g1 & ! intent(out) - , beta_g2 & ! intent(out) - , beta_gr0 & ! intent(out) , aflat_turb8 & ! intent(out) , aflat_lami8 & ! intent(out) , bflat_turb8 & ! intent(out) @@ -793,19 +1002,15 @@ subroutine init_can_air_params() , ncyli_lami8 & ! intent(out) , mcyli_turb8 & ! intent(out) , mcyli_lami8 & ! intent(out) - , beta_r18 & ! intent(out) - , beta_r28 & ! intent(out) - , beta_re08 & ! intent(out) - , beta_g18 & ! intent(out) - , beta_g28 & ! intent(out) - , beta_gr08 & ! intent(out) , ggsoil0 & ! intent(out) , kksoil & ! intent(out) , ggsoil08 & ! intent(out) , kksoil8 ! ! intent(out) implicit none !----- Arguments. ----------------------------------------------------------------------! - integer :: ican + integer :: ican + !----- External functions. -------------------------------------------------------------! + real , external :: cbrt !---------------------------------------------------------------------------------------! @@ -821,14 +1026,8 @@ subroutine init_can_air_params() ! Variables to define the vegetation aerodynamic resistance. They are currently ! ! not PFT dependent. ! !---------------------------------------------------------------------------------------! - select case (i_blyr_condct) - case (-1) - rb_slope = 25.0 - rb_inter = 0.0 - case default - rb_slope = 0.0 - rb_inter = 1.e9 - end select + rb_slope = 0.0 + rb_inter = 1.e9 !---------------------------------------------------------------------------------------! ! veg_height_min - This is the minimum vegetation height allowed [m]. Vegetation ! @@ -839,7 +1038,7 @@ subroutine init_can_air_params() ! the canopy air space. ! !---------------------------------------------------------------------------------------! veg_height_min = minval(hgt_min) ! alternative: minval(hgt_min) - minimum_canopy_depth = veg_height_min ! alternative: minval(hgt_min) + minimum_canopy_depth = 1.5 ! alternative: minval(hgt_min) !----- This is the dimensionless exponential wind atenuation factor. -------------------! exar = 2.5 @@ -851,19 +1050,22 @@ subroutine init_can_air_params() !---------------------------------------------------------------------------------------! ! Parameters for surface layer models. ! !---------------------------------------------------------------------------------------! - !----- This is the minimum wind speed for boundary layer conductivity. -----------------! - ugbmin = 0.10 - !----- This is the minimum wind scale under stable and unstable conditions. ------------! - ubmin = 0.10 + !----- Vegetation roughness:vegetation height ratio. -----------------------------------! + vh2vr = 0.13 + !----- Displacement height:vegetation height ratio. ------------------------------------! + vh2dh = 0.63 !---------------------------------------------------------------------------------------! + + + !----- Louis (1979) model. -------------------------------------------------------------! bl79 = 5.0 ! b prime parameter csm = 7.5 ! C* for momentum (eqn. 20, not co2 char. scale) csh = 5.0 ! C* for heat (eqn.20, not co2 char. scale) dl79 = 5.0 ! ??? !----- Oncley and Dudhia (1995) model. -------------------------------------------------! - bbeta = 5.0 ! Beta + beta_s = 5.0 ! Beta !----- Beljaars and Holtslag (1991) model. ---------------------------------------------! abh91 = -1.00 ! -a from equation (28) and (32) bbh91 = -twothirds ! -b from equation (28) and (32) @@ -878,6 +1080,31 @@ subroutine init_can_air_params() atetf = ate * fbh91 ! a * e * f z0moz0h = 1.0 ! z0(M)/z0(h) z0hoz0m = 1. / z0moz0h ! z0(M)/z0(h) + !----- Similar to CLM (2004), but with different phi_m for very unstable case. ---------! + zetac_um = -1.5 + zetac_uh = -0.5 + zetac_sm = 1.0 + zetac_sh = zetac_sm + !----- Define chim and chih so the functions are continuous. ---------------------------! + chim = (-zetac_um) ** onesixth / sqrt(sqrt(1.0 - gamm * zetac_um)) + chih = cbrt(-zetac_uh) / sqrt(1.0 - gamh * zetac_uh) + beta_vs = 1.0 - (1.0 - beta_s) * zetac_sm + !----- Define derived values to speed up the code a little. ----------------------------! + zetac_umi = 1.0 / zetac_um + zetac_uhi = 1.0 / zetac_uh + zetac_smi = 1.0 / zetac_sm + zetac_shi = 1.0 / zetac_sh + zetac_umi16 = 1.0 / (- zetac_um) ** onesixth + zetac_uhi13 = 1.0 / cbrt(-zetac_uh) + + !---------------------------------------------------------------------------------------! + ! Initialise these values with dummies, it will be updated after we define the ! + ! functions. ! + !---------------------------------------------------------------------------------------! + psimc_um = 0. + psimc_um = psim(zetac_um,.false.) + psihc_uh = 0. + psihc_uh = psih(zetac_uh,.false.) !---------------------------------------------------------------------------------------! @@ -901,6 +1128,10 @@ subroutine init_can_air_params() ! ! ! M08 - Monteith, J. L., M. H. Unsworth, 2008. Principles of Environmental Physics, ! ! 3rd. edition, Academic Press, Amsterdam, 418pp. (Mostly Chapter 10). ! + ! ! + ! The coefficient B for flat plates under turbulent flow was changed to 0.19 so the ! + ! transition from laminar to turbulent regime will happen at Gr ~ 100,000, the ! + ! number suggested by M08. ! !---------------------------------------------------------------------------------------! aflat_lami = 0.600 ! A (forced convection), laminar flow nflat_lami = 0.500 ! n (forced convection), laminar flow @@ -908,7 +1139,7 @@ subroutine init_can_air_params() nflat_turb = 0.800 ! n (forced convection), turbulent flow bflat_lami = 0.500 ! B (free convection), laminar flow mflat_lami = 0.250 ! m (free convection), laminar flow - bflat_turb = 0.130 ! B (free convection), turbulent flow + bflat_turb = 0.190 ! B (free convection), turbulent flow mflat_turb = onethird ! m (free convection), turbulent flow ocyli_lami = 0.320 ! intercept (forced convection), laminar flow acyli_lami = 0.510 ! A (forced convection), laminar flow @@ -923,44 +1154,6 @@ subroutine init_can_air_params() !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! - ! Both free and forced convection tend to underestimate the Nusselt number under ! - ! different conditions. Based on M08 review on the subject, I wrote the following ! - ! functional form to expand the Nusselt number by a factor beta: ! - ! - beta_forced = R1 + R2 * tanh[log(Re/Re0)] ! - ! - beta_free = G1 + G2 * tanh[log(Gr/Gr0)] ! - ! The values of beta change depending on the boundary layer conductance method. ! - ! Currently only the forced convection varies, as we believe that the Reynolds number ! - ! is the one that influences the most. ! - !---------------------------------------------------------------------------------------! - select case (i_blyr_condct) - case (-1,0) - beta_r1 = 1. - beta_r2 = 0. - beta_re0 = 2000. - beta_g1 = 1. - beta_g2 = 0. - beta_gr0 = 100000. - case (1) - beta_r1 = 7./4. - beta_r2 = 3./4. - beta_re0 = 2000. - beta_g1 = 3./2. - beta_g2 = -1./2. - beta_gr0 = 100000. - case (2) - beta_r1 = 11./2. - beta_r2 = 9. /2. - beta_re0 = 2000. - beta_g1 = 3./2. - beta_g2 = -1./2. - beta_gr0 = 100000. - end select - !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! Define the variables that are going to be used by Massman (1997) and Massman and ! ! Weil (1999). Full reference: ! @@ -997,6 +1190,17 @@ subroutine init_can_air_params() !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! Parameters for CLM, at equation 5.103 of CLM-4 techical note. ! + ! Oleson, K. W., et al.; Technical description of version 4.0 of the community land ! + ! model (CLM) NCAR Technical Note NCAR/TN-478+STR, Boulder, CO, April 2010. ! + !---------------------------------------------------------------------------------------! + cs_dense0 = 0.004 + gamma_clm4 = 0.5 + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! Gamma and nu are the parameters that close equation 10 in Massman and Weil (1999). ! ! VERY IMPORTANT: If you mess with gamma, you must recompute nu! ! @@ -1034,19 +1238,17 @@ subroutine init_can_air_params() ubmin8 = dble(ubmin ) ugbmin8 = dble(ugbmin ) ustmin8 = dble(ustmin ) - ggfact8 = dble(ggfact ) ez8 = dble(ez ) vh2dh8 = dble(vh2dh ) bl798 = dble(bl79 ) csm8 = dble(csm ) csh8 = dble(csh ) dl798 = dble(dl79 ) - bbeta8 = dble(bbeta ) + beta_s8 = dble(beta_s ) gamm8 = dble(gamm ) gamh8 = dble(gamh ) ribmax8 = dble(ribmax ) tprandtl8 = dble(tprandtl ) - vkopr8 = dble(vkopr ) abh918 = dble(abh91 ) bbh918 = dble(bbh91 ) cbh918 = dble(cbh91 ) @@ -1078,12 +1280,6 @@ subroutine init_can_air_params() mcyli_lami8 = dble(mcyli_lami ) bcyli_turb8 = dble(bcyli_turb ) mcyli_turb8 = dble(mcyli_turb ) - beta_r18 = dble(beta_r1 ) - beta_r28 = dble(beta_r2 ) - beta_re08 = dble(beta_re0 ) - beta_g18 = dble(beta_g1 ) - beta_g28 = dble(beta_g2 ) - beta_gr08 = dble(beta_gr0 ) cdrag08 = dble(cdrag0 ) pm08 = dble(pm0 ) c1_m978 = dble(c1_m97 ) @@ -1095,8 +1291,26 @@ subroutine init_can_air_params() gamma_mw99_8 = dble(gamma_mw99 ) nu_mw99_8 = dble(nu_mw99 ) infunc_8 = dble(infunc ) + cs_dense08 = dble(cs_dense0 ) ggsoil08 = dble(ggsoil0 ) kksoil8 = dble(kksoil ) + zetac_um8 = dble(zetac_um ) + zetac_uh8 = dble(zetac_uh ) + zetac_sm8 = dble(zetac_sm ) + zetac_sh8 = dble(zetac_sh ) + chim8 = dble(chim ) + chih8 = dble(chih ) + beta_vs8 = dble(beta_vs ) + zetac_umi8 = dble(zetac_umi ) + zetac_uhi8 = dble(zetac_uhi ) + zetac_smi8 = dble(zetac_smi ) + zetac_shi8 = dble(zetac_shi ) + zetac_umi168 = dble(zetac_umi16 ) + zetac_uhi138 = dble(zetac_uhi13 ) + psimc_um8 = dble(psimc_um ) + psimc_um8 = dble(psimc_um ) + psihc_uh8 = dble(psihc_uh ) + psihc_uh8 = dble(psihc_uh ) !---------------------------------------------------------------------------------------! return @@ -1224,28 +1438,41 @@ subroutine init_pft_photo_params() , umol_2_mol & ! intent(in) , yr_sec ! ! intent(in) use physiology_coms , only: iphysiol & ! intent(in) - , vmfact & ! intent(in) - , mfact & ! intent(in) - , gamfact & ! intent(in) - , d0fact & ! intent(in) - , alphafact & ! intent(in) - , kfact & ! intent(in) - , lwfact & ! intent(in) - , thioff ! ! intent(in) + , vmfact_c3 & ! intent(in) + , vmfact_c4 & ! intent(in) + , mphoto_trc3 & ! intent(in) + , mphoto_tec3 & ! intent(in) + , mphoto_c4 & ! intent(in) + , bphoto_blc3 & ! intent(in) + , bphoto_nlc3 & ! intent(in) + , bphoto_c4 & ! intent(in) + , gamma_c3 & ! intent(in) + , gamma_c4 & ! intent(in) + , d0_grass & ! intent(in) + , d0_tree & ! intent(in) + , alpha_c3 & ! intent(in) + , alpha_c4 & ! intent(in) + , kw_grass & ! intent(in) + , kw_tree & ! intent(in) + , lwidth_grass & ! intent(in) + , lwidth_bltree & ! intent(in) + , lwidth_nltree & ! intent(in) + , q10_c3 & ! intent(in) + , q10_c4 ! ! intent(in) implicit none !---------------------------------------------------------------------------------------! - D0(1) = 0.020 ! 0.010 * d0fact - D0(2:4) = 0.015 ! 0.010 * d0fact - D0(5) = 0.010 - D0(6:8) = 0.010 - D0(9:11) = 0.010 - D0(12:13) = 0.010 - D0(14:15) = 0.010 - D0(16) = 0.015 ! 0.010 * d0fact - D0(17) = 0.015 ! 0.010 * d0fact + D0(1) = d0_grass + D0(2:4) = d0_tree + D0(5) = d0_grass + D0(6:8) = d0_tree + D0(9:11) = d0_tree + D0(12:13) = d0_tree + D0(14:15) = d0_tree + D0(16) = d0_grass + D0(17) = d0_tree - Vm_low_temp(1) = 13.0 ! c4 grass + Vm_low_temp(1) = 8.0 ! c4 grass Vm_low_temp(2) = 8.0 ! early tropical Vm_low_temp(3) = 8.0 ! mid tropical Vm_low_temp(4) = 8.0 ! late tropical @@ -1258,28 +1485,28 @@ subroutine init_pft_photo_params() Vm_low_temp(11) = 4.7137 ! late hardwoods Vm_low_temp(12) = 4.7137 ! c3 pasture Vm_low_temp(13) = 4.7137 ! c3 crop - Vm_low_temp(14) = 13.0 ! c4 pasture - Vm_low_temp(15) = 13.0 ! c4 crop + Vm_low_temp(14) = 8.0 ! c4 pasture + Vm_low_temp(15) = 8.0 ! c4 crop Vm_low_temp(16) = 4.7137 ! subtropical C3 grass Vm_low_temp(17) = 4.7137 ! Araucaria - Vm_high_temp(1) = 45.0 + thioff ! C4 - Vm_high_temp(2) = 45.0 + thioff ! C3 - Vm_high_temp(3) = 45.0 + thioff ! C3 - Vm_high_temp(4) = 45.0 + thioff ! C3 - Vm_high_temp(5) = 45.0 + thioff ! C3 - Vm_high_temp(6) = 45.0 + thioff ! C3 - Vm_high_temp(7) = 45.0 + thioff ! C3 - Vm_high_temp(8) = 45.0 + thioff ! C3 - Vm_high_temp(9) = 45.0 + thioff ! C3 - Vm_high_temp(10) = 45.0 + thioff ! C3 - Vm_high_temp(11) = 45.0 + thioff ! C3 - Vm_high_temp(12) = 45.0 + thioff ! C3 - Vm_high_temp(13) = 45.0 + thioff ! C3 - Vm_high_temp(14) = 45.0 + thioff ! C4 - Vm_high_temp(15) = 45.0 + thioff ! C4 - Vm_high_temp(16) = 45.0 + thioff ! C3 - Vm_high_temp(17) = 45.0 + thioff ! C3 + Vm_high_temp(1) = 45.0 ! C4 + Vm_high_temp(2) = 45.0 ! C3 + Vm_high_temp(3) = 45.0 ! C3 + Vm_high_temp(4) = 45.0 ! C3 + Vm_high_temp(5) = 45.0 ! C3 + Vm_high_temp(6) = 45.0 ! C3 + Vm_high_temp(7) = 45.0 ! C3 + Vm_high_temp(8) = 45.0 ! C3 + Vm_high_temp(9) = 45.0 ! C3 + Vm_high_temp(10) = 45.0 ! C3 + Vm_high_temp(11) = 45.0 ! C3 + Vm_high_temp(12) = 45.0 ! C3 + Vm_high_temp(13) = 45.0 ! C3 + Vm_high_temp(14) = 45.0 ! C4 + Vm_high_temp(15) = 45.0 ! C4 + Vm_high_temp(16) = 45.0 ! C3 + Vm_high_temp(17) = 45.0 ! C3 !---------------------------------------------------------------------------------------! ! Vm_decay_e is the correction term for high and low temperatures when running the ! @@ -1295,21 +1522,21 @@ subroutine init_pft_photo_params() !------ Vm0 is the maximum photosynthesis capacity in ĩmol/m2/s. -----------------------! - Vm0(1) = 13.75 ! 12.500 * vmfact - Vm0(2) = 18.750 ! 18.750 * vmfact - Vm0(3) = 12.500 ! 12.500 * vmfact - Vm0(4) = 6.250 ! 6.250 * vmfact - Vm0(5) = 18.300 - Vm0(6) = 11.350 ! 15.625 * 0.7264 - Vm0(7) = 11.350 ! 15.625 * 0.7264 - Vm0(8) = 4.540 ! 6.250 * 0.7264 - Vm0(9) = 20.387 ! 18.250 * 1.1171 - Vm0(10) = 17.455 ! 15.625 * 1.1171 - Vm0(11) = 6.981 ! 6.250 * 1.1171 - Vm0(12:13) = 18.300 ! 18.300 - Vm0(14:15) = 15.000 ! 12.500 * vmfact - Vm0(16) = 24.0625 ! 21.875 * vmfact - Vm0(17) = 18.750 ! 15.625 * vmfact + Vm0(1) = 12.500000 * vmfact_c4 + Vm0(2) = 18.750000 * vmfact_c3 + Vm0(3) = 12.500000 * vmfact_c3 + Vm0(4) = 6.250000 * vmfact_c3 + Vm0(5) = 18.300000 * vmfact_c3 + Vm0(6) = 11.350000 * vmfact_c3 + Vm0(7) = 11.350000 * vmfact_c3 + Vm0(8) = 4.540000 * vmfact_c3 + Vm0(9) = 20.387075 * vmfact_c3 + Vm0(10) = 17.454687 * vmfact_c3 + Vm0(11) = 6.981875 * vmfact_c3 + Vm0(12:13) = 18.300000 * vmfact_c3 + Vm0(14:15) = 12.500000 * vmfact_c4 + Vm0(16) = 25.000000 * vmfact_c3 + Vm0(17) = 15.625000 * vmfact_c3 !---------------------------------------------------------------------------------------! @@ -1320,33 +1547,33 @@ subroutine init_pft_photo_params() !---------------------------------------------------------------------------------------! vm_hor(1:17) = 3000. !----- Here we distinguish between C3 and C4 photosynthesis as in Collatz et al 91/92. -! - vm_q10(1) = 2.0 - vm_q10(2:13) = 2.4 - vm_q10(14:15) = 2.0 - vm_q10(16:17) = 2.4 + vm_q10(1) = q10_c4 + vm_q10(2:13) = q10_c3 + vm_q10(14:15) = q10_c4 + vm_q10(16:17) = q10_c3 !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! Dark_respiration_factor is the lower-case gamma in Moorcroft et al. (2001). ! !---------------------------------------------------------------------------------------! - dark_respiration_factor(1) = 0.036 - dark_respiration_factor(2) = 0.015 ! 0.020 * gamfact - dark_respiration_factor(3) = 0.015 ! 0.020 * gamfact - dark_respiration_factor(4) = 0.015 ! 0.020 * gamfact - dark_respiration_factor(5) = 0.020 - dark_respiration_factor(6) = 0.020 - dark_respiration_factor(7) = 0.020 - dark_respiration_factor(8) = 0.020 - dark_respiration_factor(9) = 0.020 - dark_respiration_factor(10) = 0.020 - dark_respiration_factor(11) = 0.020 - dark_respiration_factor(12) = 0.020 - dark_respiration_factor(13) = 0.020 - dark_respiration_factor(14) = 0.035 - dark_respiration_factor(15) = 0.035 - dark_respiration_factor(16) = 0.015 - dark_respiration_factor(17) = 0.020 + dark_respiration_factor(1) = gamma_c4 + dark_respiration_factor(2) = gamma_c3 + dark_respiration_factor(3) = gamma_c3 + dark_respiration_factor(4) = gamma_c3 + dark_respiration_factor(5) = gamma_c3 + dark_respiration_factor(6) = gamma_c3 + dark_respiration_factor(7) = gamma_c3 + dark_respiration_factor(8) = gamma_c3 + dark_respiration_factor(9) = gamma_c3 + dark_respiration_factor(10) = gamma_c3 + dark_respiration_factor(11) = gamma_c3 + dark_respiration_factor(12) = gamma_c3 + dark_respiration_factor(13) = gamma_c3 + dark_respiration_factor(14) = gamma_c3 + dark_respiration_factor(15) = gamma_c3 + dark_respiration_factor(16) = gamma_c3 + dark_respiration_factor(17) = gamma_c3 * 0.028 / 0.020 !---------------------------------------------------------------------------------------! @@ -1381,65 +1608,73 @@ subroutine init_pft_photo_params() !----- Define the stomatal slope (aka the M factor). -----------------------------------! - stomatal_slope(1) = 5.0 - stomatal_slope(2) = 9.0 ! 8.0 * mfact - stomatal_slope(3) = 9.0 ! 8.0 * mfact - stomatal_slope(4) = 9.0 ! 8.0 * mfact - stomatal_slope(5) = 8.0 - stomatal_slope(6) = 6.3949 - stomatal_slope(7) = 6.3949 - stomatal_slope(8) = 6.3949 - stomatal_slope(9) = 6.3949 - stomatal_slope(10) = 6.3949 - stomatal_slope(11) = 6.3949 - stomatal_slope(12) = 8.0 - stomatal_slope(13) = 8.0 - stomatal_slope(14) = 5.0 - stomatal_slope(15) = 5.0 - stomatal_slope(16) = 9.0 - stomatal_slope(17) = 6.4 + stomatal_slope(1) = mphoto_c4 + stomatal_slope(2) = mphoto_trc3 + stomatal_slope(3) = mphoto_trc3 + stomatal_slope(4) = mphoto_trc3 + stomatal_slope(5) = mphoto_trc3 + stomatal_slope(6) = mphoto_tec3 + stomatal_slope(7) = mphoto_tec3 + stomatal_slope(8) = mphoto_tec3 + stomatal_slope(9) = mphoto_tec3 + stomatal_slope(10) = mphoto_tec3 + stomatal_slope(11) = mphoto_tec3 + stomatal_slope(12) = mphoto_trc3 + stomatal_slope(13) = mphoto_trc3 + stomatal_slope(14) = mphoto_c4 + stomatal_slope(15) = mphoto_c4 + stomatal_slope(16) = mphoto_trc3 + stomatal_slope(17) = mphoto_tec3 - cuticular_cond(1) = 8000.0 - cuticular_cond(2) = 10000.0 - cuticular_cond(3) = 10000.0 - cuticular_cond(4) = 10000.0 - cuticular_cond(5) = 10000.0 - cuticular_cond(6) = 1000.0 - cuticular_cond(7) = 1000.0 - cuticular_cond(8) = 1000.0 - cuticular_cond(9) = 20000.0 - cuticular_cond(10) = 20000.0 - cuticular_cond(11) = 20000.0 - cuticular_cond(12) = 10000.0 - cuticular_cond(13) = 10000.0 - cuticular_cond(14) = 8000.0 - cuticular_cond(15) = 8000.0 - cuticular_cond(16) = 10000.0 - cuticular_cond(17) = 1000.0 - - quantum_efficiency(1) = 0.053 - quantum_efficiency(2) = 0.070 ! 0.08 * alphafact - quantum_efficiency(3) = 0.070 ! 0.08 * alphafact - quantum_efficiency(4) = 0.070 ! 0.08 * alphafact - quantum_efficiency(5) = 0.080 - quantum_efficiency(6) = 0.080 - quantum_efficiency(7) = 0.080 - quantum_efficiency(8) = 0.080 - quantum_efficiency(9) = 0.080 - quantum_efficiency(10) = 0.080 - quantum_efficiency(11) = 0.080 - quantum_efficiency(12) = 0.080 - quantum_efficiency(13) = 0.080 - quantum_efficiency(14) = 0.053 - quantum_efficiency(15) = 0.053 - quantum_efficiency(16) = 0.070 ! 0.08 * alphafact - quantum_efficiency(17) = 0.070 ! 0.08 * alphafact - - !---------------------------------------------------------------------------------------! - ! The KW parameter. Medvigy et al. (2009) and Moorcroft et al. (2001) give the ! - ! number in mē/yr/kg_C_root. Here we must define it in mē/s/kg_C_root. ! - !---------------------------------------------------------------------------------------! - water_conductance(1:17) = 450. / yr_sec ! 150. / yr_sec * kfact + !----- Define the stomatal slope (aka the b term, given in umol/m2/s). -----------------! + cuticular_cond(1) = bphoto_c4 + cuticular_cond(2) = bphoto_blc3 + cuticular_cond(3) = bphoto_blc3 + cuticular_cond(4) = bphoto_blc3 + cuticular_cond(5) = bphoto_blc3 + cuticular_cond(6) = bphoto_nlc3 + cuticular_cond(7) = bphoto_nlc3 + cuticular_cond(8) = bphoto_nlc3 + cuticular_cond(9) = bphoto_blc3 + cuticular_cond(10) = bphoto_blc3 + cuticular_cond(11) = bphoto_blc3 + cuticular_cond(12) = bphoto_blc3 + cuticular_cond(13) = bphoto_blc3 + cuticular_cond(14) = bphoto_c4 + cuticular_cond(15) = bphoto_c4 + cuticular_cond(16) = bphoto_blc3 + cuticular_cond(17) = bphoto_nlc3 + + quantum_efficiency(1) = alpha_c4 + quantum_efficiency(2) = alpha_c3 + quantum_efficiency(3) = alpha_c3 + quantum_efficiency(4) = alpha_c3 + quantum_efficiency(5) = alpha_c3 + quantum_efficiency(6) = alpha_c3 + quantum_efficiency(7) = alpha_c3 + quantum_efficiency(8) = alpha_c3 + quantum_efficiency(9) = alpha_c3 + quantum_efficiency(10) = alpha_c3 + quantum_efficiency(11) = alpha_c3 + quantum_efficiency(12) = alpha_c3 + quantum_efficiency(13) = alpha_c3 + quantum_efficiency(14) = alpha_c4 + quantum_efficiency(15) = alpha_c4 + quantum_efficiency(16) = alpha_c3 + quantum_efficiency(17) = alpha_c3 + + !---------------------------------------------------------------------------------------! + ! The KW parameter. Medvigy et al. (2009) and Moorcroft et al. (2001), and the ! + ! namelist, give the number in mē/yr/kg_C_root. Here we must convert it to ! + ! mē/s/kg_C_root. ! + !---------------------------------------------------------------------------------------! + water_conductance(1) = kw_grass / yr_sec + water_conductance(2:4) = kw_tree / yr_sec + water_conductance(5) = kw_grass / yr_sec + water_conductance(6:11) = kw_tree / yr_sec + water_conductance(12:15) = kw_grass / yr_sec + water_conductance(16) = kw_grass / yr_sec + water_conductance(17) = kw_tree / yr_sec !---------------------------------------------------------------------------------------! @@ -1451,23 +1686,23 @@ subroutine init_pft_photo_params() photosyn_pathway(16:17) = 3 !----- Leaf width [m]. This controls the boundary layer conductance. ------------------! - leaf_width( 1) = 0.20 - leaf_width( 2) = 0.20 - leaf_width( 3) = 0.20 - leaf_width( 4) = 0.20 - leaf_width( 5) = 0.05 - leaf_width( 6) = 0.05 - leaf_width( 7) = 0.05 - leaf_width( 8) = 0.05 - leaf_width( 9) = 0.05 - leaf_width(10) = 0.05 - leaf_width(11) = 0.05 - leaf_width(12) = 0.05 - leaf_width(13) = 0.05 - leaf_width(14) = 0.20 - leaf_width(15) = 0.20 - leaf_width(16) = 0.20 - leaf_width(17) = 0.05 + leaf_width( 1) = lwidth_grass + leaf_width( 2) = lwidth_bltree + leaf_width( 3) = lwidth_bltree + leaf_width( 4) = lwidth_bltree + leaf_width( 5) = lwidth_grass + leaf_width( 6) = lwidth_nltree + leaf_width( 7) = lwidth_nltree + leaf_width( 8) = lwidth_nltree + leaf_width( 9) = lwidth_bltree + leaf_width(10) = lwidth_bltree + leaf_width(11) = lwidth_bltree + leaf_width(12) = lwidth_grass + leaf_width(13) = lwidth_grass + leaf_width(14) = lwidth_grass + leaf_width(15) = lwidth_grass + leaf_width(16) = lwidth_grass + leaf_width(17) = lwidth_nltree !---------------------------------------------------------------------------------------! return @@ -1524,21 +1759,34 @@ end subroutine init_decomp_params !==========================================================================================! !==========================================================================================! subroutine init_pft_resp_params() - - use pft_coms , only : growth_resp_factor & ! intent(out) + use physiology_coms, only : iphysiol & ! intent(in) + , rrffact & ! intent(in) + , growthresp ! ! intent(in) + use pft_coms , only : rd_low_temp & ! intent(in) + , rd_high_temp & ! intent(in) + , rd_decay_e & ! intent(in) + , rd_hor & ! intent(in) + , rd_q10 & ! intent(in) + , growth_resp_factor & ! intent(out) , leaf_turnover_rate & ! intent(out) , root_turnover_rate & ! intent(out) , storage_turnover_rate & ! intent(out) - , root_respiration_factor ! ! intent(out) + , root_respiration_factor & ! intent(out) + , rrf_low_temp & ! intent(out) + , rrf_high_temp & ! intent(out) + , rrf_decay_e & ! intent(out) + , rrf_hor & ! intent(out) + , rrf_q10 ! ! intent(out) use decomp_coms , only : f_labile ! ! intent(out) use consts_coms , only : onesixth & ! intent(in) - , onethird ! ! intent(in) + , onethird & ! intent(in) + , t00 ! ! intent(in) implicit none - growth_resp_factor(1) = onethird - growth_resp_factor(2) = onethird - growth_resp_factor(3) = onethird - growth_resp_factor(4) = onethird + growth_resp_factor(1) = growthresp + growth_resp_factor(2) = growthresp + growth_resp_factor(3) = growthresp + growth_resp_factor(4) = growthresp growth_resp_factor(5) = onethird growth_resp_factor(6) = 0.4503 ! 0.333 growth_resp_factor(7) = 0.4503 @@ -1550,10 +1798,10 @@ subroutine init_pft_resp_params() growth_resp_factor(13) = onethird growth_resp_factor(14) = onethird growth_resp_factor(15) = onethird - growth_resp_factor(16) = onethird + growth_resp_factor(16) = growthresp growth_resp_factor(17) = 0.4503 - leaf_turnover_rate(1) = 2.0 + leaf_turnover_rate(1) = 4.0 leaf_turnover_rate(2) = 1.0 leaf_turnover_rate(3) = 0.5 leaf_turnover_rate(4) = onethird @@ -1568,14 +1816,14 @@ subroutine init_pft_resp_params() leaf_turnover_rate(13) = 2.0 leaf_turnover_rate(14) = 2.0 leaf_turnover_rate(15) = 2.0 - leaf_turnover_rate(16) = 2.0 + leaf_turnover_rate(16) = 4.0 leaf_turnover_rate(17) = onesixth !----- Root turnover rate. ------------------------------------------------------------! - root_turnover_rate(1) = 2.0 - root_turnover_rate(2) = 1.0 - root_turnover_rate(3) = 0.5 - root_turnover_rate(4) = onethird + root_turnover_rate(1) = leaf_turnover_rate(1) + root_turnover_rate(2) = leaf_turnover_rate(2) + root_turnover_rate(3) = leaf_turnover_rate(3) + root_turnover_rate(4) = leaf_turnover_rate(4) root_turnover_rate(5) = 2.0 root_turnover_rate(6) = 3.927218 ! 0.333 root_turnover_rate(7) = 4.117847 ! 0.333 @@ -1585,10 +1833,10 @@ subroutine init_pft_resp_params() root_turnover_rate(11) = 5.070992 root_turnover_rate(12) = onethird root_turnover_rate(13) = onethird - root_turnover_rate(14) = 2.0 - root_turnover_rate(15) = 2.0 - root_turnover_rate(16) = 2.0 - root_turnover_rate(17) = onesixth + root_turnover_rate(14) = leaf_turnover_rate(14) + root_turnover_rate(15) = leaf_turnover_rate(15) + root_turnover_rate(16) = leaf_turnover_rate(16) + root_turnover_rate(17) = leaf_turnover_rate(17) storage_turnover_rate(1) = 0.00 ! 0.25 storage_turnover_rate(2) = 0.00 ! 0.25 @@ -1608,14 +1856,60 @@ subroutine init_pft_resp_params() storage_turnover_rate(16) = 0.00 ! 0.25 storage_turnover_rate(17) = 0.00 ! 0.25 - root_respiration_factor(1:17) = 0.528 - f_labile(1:5) = 1.0 f_labile(6:11) = 0.79 f_labile(12:15) = 1.0 f_labile(16) = 1.0 f_labile(17) = 0.79 + !---------------------------------------------------------------------------------------! + ! This variable sets the contribution of roots to respiration at the reference ! + ! temperature of 15C. Its units is ĩmol_CO2/kg_fine_roots/s. ! + !---------------------------------------------------------------------------------------! + select case (iphysiol) + case (0,1) + !----- Arrhenius function. ----------------------------------------------------------! + root_respiration_factor(1) = 0.528 * rrffact + root_respiration_factor(2:4) = 0.528 * rrffact + root_respiration_factor(5) = 0.528 * rrffact + root_respiration_factor(6:8) = 0.528 * rrffact + root_respiration_factor(9:11) = 0.528 * rrffact + root_respiration_factor(12:13) = 0.528 * rrffact + root_respiration_factor(14:15) = 0.528 * rrffact + root_respiration_factor(16) = 0.528 * rrffact + root_respiration_factor(17) = 0.528 * rrffact + case (2,3) + !----- Collatz function. ------------------------------------------------------------! + root_respiration_factor(1) = 0.280 * rrffact + root_respiration_factor(2:4) = 0.280 * rrffact + root_respiration_factor(5) = 0.280 * rrffact + root_respiration_factor(6:8) = 0.280 * rrffact + root_respiration_factor(9:11) = 0.280 * rrffact + root_respiration_factor(12:13) = 0.280 * rrffact + root_respiration_factor(14:15) = 0.280 * rrffact + root_respiration_factor(16) = 0.280 * rrffact + root_respiration_factor(17) = 0.280 * rrffact + end select + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Following Moorcroft et al. (2001), we use the same shape for both leaf and root ! + ! respiration. ! + !---------------------------------------------------------------------------------------! + !----- Temperature [°C] below which root metabolic activity begins to rapidly decline. -! + rrf_low_temp(1:17) = rd_low_temp(1:17) + !----- Temperature [°C] above which root metabolic activity begins to rapidly decline. -! + rrf_high_temp(1:17) = rd_high_temp(1:17) + !----- Decay factor for the exponential correction. ------------------------------------! + rrf_decay_e(1:17) = rd_decay_e(1:17) + !----- Exponent for Rr in the Arrhenius equation [K]. ----------------------------------! + rrf_hor(1:17) = rd_hor(1:17) + !----- Base (Q10 term) for respiration in Collatz equation . ---------------------------! + rrf_q10(1:17) = rd_q10(1:17) + !---------------------------------------------------------------------------------------! + return end subroutine init_pft_resp_params !==========================================================================================! @@ -1642,7 +1936,8 @@ subroutine init_pft_mort_params() , plant_min_temp & ! intent(out) , frost_mort ! ! intent(out) use consts_coms , only : t00 & ! intent(in) - , lnexp_max ! ! intent(in) + , lnexp_max & ! intent(in) + , twothirds ! ! intent(in) use disturb_coms, only : treefall_disturbance_rate & ! intent(inout) , time2canopy ! ! intent(in) @@ -1854,38 +2149,35 @@ subroutine init_pft_alloc_params() , qsw & ! intent(out) , init_density & ! intent(out) , agf_bs & ! intent(out) - , agf_bsi & ! intent(out) + , brf_wd & ! intent(out) , hgt_min & ! intent(out) , hgt_ref & ! intent(out) , hgt_max & ! intent(out) , min_dbh & ! intent(out) - , max_dbh & ! intent(out) + , dbh_crit & ! intent(out) + , min_bdead & ! intent(out) + , bdead_crit & ! intent(out) , b1Ht & ! intent(out) , b2Ht & ! intent(out) , b1Bs_small & ! intent(out) , b2Bs_small & ! intent(out) - , b1Bs_big & ! intent(out) - , b2Bs_big & ! intent(out) + , b1Bs_large & ! intent(out) + , b2Bs_large & ! intent(out) , b1Ca & ! intent(out) , b2Ca & ! intent(out) , b1Rd & ! intent(out) , b2Rd & ! intent(out) , b1Vol & ! intent(out) , b2Vol & ! intent(out) - , bdead_crit & ! intent(out) , b1Bl & ! intent(out) , b2Bl & ! intent(out) + , b1WAI & ! intent(out) + , b2WAI & ! intent(out) , C2B & ! intent(out) - , sapwood_ratio & ! intent(out) - , rbranch & ! intent(out) - , rdiamet & ! intent(out) - , rlength & ! intent(out) - , diammin & ! intent(out) - , ntrunk & ! intent(out) - , conijn_a & ! intent(out) - , conijn_b & ! intent(out) - , conijn_c & ! intent(out) - , conijn_d ! ! intent(out) + , sla_scale & ! intent(out) + , sla_inter & ! intent(out) + , sla_slope & ! intent(out) + , sapwood_ratio ! ! intent(out) use allometry , only : h2dbh & ! function , dbh2bd ! ! function use consts_coms , only : twothirds & ! intent(in) @@ -1931,18 +2223,23 @@ subroutine init_pft_alloc_params() ! The "z" parameters were obtaining by using the original balive and computing ! ! bdead as the difference between the total biomass and the original balive. ! !---------------------------------------------------------------------------------------! - real, dimension(3) , parameter :: aleaf = (/ -1.259299, 1.679213, 4.985562 /) - real, dimension(3) , parameter :: adead_small = (/ -1.494639, 2.453309, 1.597272 /) - real, dimension(3) , parameter :: adead_big = (/ 2.105856, 2.423031, 50.198984 /) - real, dimension(3) , parameter :: zdead_small = (/ -1.113827, 2.440483, 2.180632 /) - real, dimension(3) , parameter :: zdead_big = (/ 0.1362546, 2.421739, 6.9483532/) + real, dimension(3) , parameter :: odead_small = (/-1.1138270, 2.4404830, 2.1806320/) + real, dimension(3) , parameter :: odead_large = (/ 0.1362546, 2.4217390, 6.9483532/) + real, dimension(3) , parameter :: ndead_small = (/-1.8822770, 2.4407750, 1.0082490/) + real, dimension(3) , parameter :: ndead_large = (/-1.8229460, 2.4259890, 1.0011870/) + real, dimension(3) , parameter :: nleaf = (/-2.5108071, 1.2818788, 0.5912507/) + real, dimension(2) , parameter :: ncrown_area = (/ 0.1184295, 1.0521197 /) !----- Other constants. ----------------------------------------------------------------! logical , parameter :: write_allom = .false. character(len=str_len), parameter :: allom_file = 'allom_param.txt' !---------------------------------------------------------------------------------------! + + !----- Carbon-to-biomass ratio of plant tissues. ---------------------------------------! C2B = 2.0 + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! ! This flag should be used to define whether the plant is tropical/subtropical or ! @@ -1987,22 +2284,39 @@ subroutine init_pft_alloc_params() rho(17) = 0.54 !---------------------------------------------------------------------------------------! - !----- Specific leaf area [mē leaf / kg C] ---------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Specific leaf area [mē leaf / kg C]. For tropical PFTs, this is a turnover rate ! + ! defined by the slope, intercept and scale. ! + !---------------------------------------------------------------------------------------! + !----- Old parameters. -----------------------------------------------------------------! + ! sla_scale = 1.0000 + ! sla_inter = 1.6923 + ! sla_slope = -0.3305 + !----- New parameters. -----------------------------------------------------------------! + sla_scale = 0.1 * C2B + sla_inter = 2.4 + sla_slope = -0.46 + !----- [KIM] - new tropical parameters. ------------------------------------------------! - SLA(1:4) = 10.0**(2.4-0.46*log10(12.0/leaf_turnover_rate(1:4))) * C2B * 0.1 - ! SLA(1:4) = 10.0**(1.6923-0.3305*log10(12.0/leaf_turnover_rate(1:4))) - SLA(5) = 22.0 - SLA(6) = 6.0 - SLA(7) = 9.0 - SLA(8) = 10.0 - SLA(9) = 30.0 - SLA(10) = 24.2 - SLA(11) = 60.0 - SLA(12:13) = 22.0 - SLA(14:15) = 10.0**((2.4-0.46*log10(12.0/leaf_turnover_rate(14:15)))) * C2B * 0.1 - ! SLA(14:15) = 10.0**(1.6923-0.3305*log10(12.0/leaf_turnover_rate(14:15))) - SLA(16) = 10.0**(2.4-0.46*log10(12.0/leaf_turnover_rate(16))) * C2B * 0.1 - SLA(17) = 10.0 + SLA( 1) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate( 1))) * sla_scale + SLA( 2) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate( 2))) * sla_scale + SLA( 3) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate( 3))) * sla_scale + SLA( 4) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate( 4))) * sla_scale + SLA( 5) = 22.0 + SLA( 6) = 6.0 + SLA( 7) = 9.0 + SLA( 8) = 10.0 + SLA( 9) = 30.0 + SLA(10) = 24.2 + SLA(11) = 60.0 + SLA(12) = 22.0 + SLA(13) = 22.0 + SLA(14) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(14))) * sla_scale + SLA(15) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(15))) * sla_scale + SLA(16) = 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(16))) * sla_scale + SLA(17) = 10.0 !---------------------------------------------------------------------------------------! ! Fraction of vertical branches. Values are from Poorter et al. (2006): ! @@ -2076,45 +2390,6 @@ subroutine init_pft_alloc_params() - !---------------------------------------------------------------------------------------! - ! Minimum height of an individual. ! - !---------------------------------------------------------------------------------------! - hgt_min(1) = 0.50 - hgt_min(2:4) = 0.50 - hgt_min(5) = 0.15 - hgt_min(6) = 1.50 - hgt_min(7) = 1.50 - hgt_min(8) = 1.50 - hgt_min(9) = 1.50 - hgt_min(10) = 1.50 - hgt_min(11) = 1.50 - hgt_min(12) = 0.15 - hgt_min(13) = 0.15 - hgt_min(14) = 0.50 - hgt_min(15) = 0.50 - hgt_min(16) = 0.50 - hgt_min(17) = 0.50 - !---------------------------------------------------------------------------------------! - - - - !----- Reference height for diameter/height allometry (temperates only). ---------------! - hgt_ref(1:5) = 0.0 - hgt_ref(6:11) = 1.3 - hgt_ref(12:15) = 0.0 - hgt_ref(16) = 0.0 - hgt_ref(17) = 0.0 - !---------------------------------------------------------------------------------------! - - - - !----- Fraction of structural stem that is assumed to be above ground. -----------------! - agf_bs = 0.7 - agf_bsi = 1. / agf_bs - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! ! DBH/height allometry parameters. ! ! ! @@ -2125,10 +2400,11 @@ subroutine init_pft_alloc_params() ! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ! ! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ! ! ! - ! These parameters have different meaning for tropical and temperate PFTs... ! + ! b1Ht, b2Ht, and hgt_ref are parameters that have different meaning for tropical and ! + ! temperate PFTs, and the meaning for tropical PFTs depends on IALLOM... ! !---------------------------------------------------------------------------------------! !----- DBH-height allometry intercept [m]. ---------------------------------------------! - b1Ht(1:4) = 0.37 * log(10.0) + b1Ht(1:4) = 0.0 b1Ht(5) = 0.4778 b1Ht(6) = 27.14 b1Ht(7) = 27.14 @@ -2137,11 +2413,11 @@ subroutine init_pft_alloc_params() b1Ht(10) = 25.18 b1Ht(11) = 23.3874 b1Ht(12:13) = 0.4778 - b1Ht(14:15) = 0.37 * log(10.0) - b1Ht(16) = 0.37 * log(10.0) - b1Ht(17) = 0.37 * log(10.0) + b1Ht(14:15) = 0.0 + b1Ht(16) = 0.0 + b1Ht(17) = 0.0 !----- DBH-height allometry slope [1/cm]. ----------------------------------------------! - b2Ht(1:4) = 0.64 + b2Ht(1:4) = 0.00 b2Ht(5) = -0.75 b2Ht(6) = -0.03884 b2Ht(7) = -0.03884 @@ -2150,10 +2426,72 @@ subroutine init_pft_alloc_params() b2Ht(10) = -0.04964 b2Ht(11) = -0.05404 b2Ht(12:13) = -0.75 - b2Ht(14:15) = 0.64 - b2Ht(16) = 0.64 - b2Ht(17) = 0.64 + b2Ht(14:15) = 0.00 + b2Ht(16) = 0.00 + b2Ht(17) = 0.00 + !----- Reference height for diameter/height allometry. ---------------------------------! + hgt_ref(1:5) = 0.0 + hgt_ref(6:11) = 1.3 + hgt_ref(12:15) = 0.0 + hgt_ref(16) = 0.0 + hgt_ref(17) = 0.0 + !----- Assign the parameters for tropical PFTs depending on the chosen allometry. ------! + select case (iallom) + case (0:1) + !------------------------------------------------------------------------------------! + ! Use the original ED allometry, based on an unpublished paper by O'Brien et al. ! + ! (1999). There is an older reference from a similar group of authors, but it is ! + ! not the allometry used by ED. ! + !------------------------------------------------------------------------------------! + do ipft=1,n_pft + if (is_tropical(ipft)) then + !----- Regular log-log fit, b1 is the intercept and b2 is the slope. ----------! + b1Ht (ipft) = 0.37 * log(10.0) + b2Ht (ipft) = 0.64 + !----- hgt_ref is not used. ---------------------------------------------------! + ! hgt_ref(ipft) = 0.0 + end if + end do + case (2) + !------------------------------------------------------------------------------------! + ! Use the allometry proposed by: ! + ! ! + ! Poorter, L., L. Bongers, F. Bongers, 2006: Architecture of 54 moist-forest tree ! + ! species: traits, trade-offs, and functional groups. Ecology, 87, 1289-1301. ! + ! ! + !------------------------------------------------------------------------------------! + do ipft=1,n_pft + if (is_tropical(ipft)) then + !----- b1Ht is their "a" and b2Ht is their "b". -------------------------------! + b1Ht (ipft) = 0.0352 + b2Ht (ipft) = 0.694 + !----- hgt_ref is their "Hmax". -----------------------------------------------! + hgt_ref(ipft) = 61.7 + end if + end do + end select + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Minimum and maximum height allowed for each cohort. ! + !---------------------------------------------------------------------------------------! + hgt_min(1) = 0.50 + hgt_min(2:4) = 0.50 + hgt_min(5) = 0.15 + hgt_min(6) = 1.50 + hgt_min(7) = 1.50 + hgt_min(8) = 1.50 + hgt_min(9) = 1.50 + hgt_min(10) = 1.50 + hgt_min(11) = 1.50 + hgt_min(12) = 0.15 + hgt_min(13) = 0.15 + hgt_min(14) = 0.50 + hgt_min(15) = 0.50 + hgt_min(16) = 0.50 + hgt_min(17) = 0.50 !----- Maximum Height. -----------------------------------------------------------------! hgt_max( 1) = 1.50 hgt_max( 2) = 35.0 @@ -2172,12 +2510,19 @@ subroutine init_pft_alloc_params() hgt_max(15) = 1.50 hgt_max(16) = 1.50 hgt_max(17) = 35.0 + !---------------------------------------------------------------------------------------! - !----- Maximum DBH. --------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! MIN_DBH -- minimum DBH allowed for the PFT. ! + ! DBH_CRIT -- minimum DBH that brings the PFT to its tallest possible height. ! + !---------------------------------------------------------------------------------------! do ipft=1,n_pft - min_dbh(ipft) = h2dbh(hgt_min(ipft),ipft) - max_dbh(ipft) = h2dbh(hgt_max(ipft),ipft) + min_dbh (ipft) = h2dbh(hgt_min(ipft),ipft) + dbh_crit(ipft) = h2dbh(hgt_max(ipft),ipft) end do + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! @@ -2210,20 +2555,22 @@ subroutine init_pft_alloc_params() b2Bl(14:15) = 0.0 b2Bl(16) = 0.0 b2Bl(17) = 0.0 + !---------------------------------------------------------------------------------------! + !------- Fill in the tropical PFTs, which are functions of wood density. ---------------! do ipft=1,n_pft if (is_tropical(ipft)) then select case(iallom) - case (0,2:4) + case (0,1) !---- ED-2.1 allometry. -------------------------------------------------------! b1Bl(ipft) = exp(a1 + c1l * b1Ht(ipft) + d1l * log(rho(ipft))) aux = ( (a2l - a1) + b1Ht(ipft) * (c2l - c1l) + log(rho(ipft)) & - * (d2l - d1l)) * (1.0/log(dcrit)) + * (d2l - d1l)) * (1.0/log(dcrit)) b2Bl(ipft) = C2B * b2l + c2l * b2Ht(ipft) + aux - case (1) + case (2) !---- Based on modified Chave et al. (2001) allometry. ------------------------! - b1Bl(ipft) = C2B * exp(aleaf(1)) * rho(ipft) / aleaf(3) - b2Bl(ipft) = aleaf(2) + b1Bl(ipft) = C2B * exp(nleaf(1) + nleaf(3) * log(rho(ipft))) + b2Bl(ipft) = nleaf(2) end select end if end do @@ -2266,8 +2613,8 @@ subroutine init_pft_alloc_params() ! The temperate PFTs use the same b1Bs and b2Bs for small and big trees, copy the ! ! values. ! !---------------------------------------------------------------------------------------! - b1Bs_big(:) = b1Bs_small(:) - b2Bs_big(:) = b2Bs_small(:) + b1Bs_large(:) = b1Bs_small(:) + b2Bs_large(:) = b2Bs_small(:) !------- Fill in the tropical PFTs, which are functions of wood density. ---------------! do ipft = 1, n_pft if (is_tropical(ipft)) then @@ -2275,7 +2622,7 @@ subroutine init_pft_alloc_params() case (0) !---- ED-2.1 allometry. -------------------------------------------------------! b1Bs_small(ipft) = exp(a1 + c1d * b1Ht(ipft) + d1d * log(rho(ipft))) - b1Bs_big (ipft) = exp(a1 + c1d * log(hgt_max(ipft)) + d1d * log(rho(ipft))) + b1Bs_large(ipft) = exp(a1 + c1d * log(hgt_max(ipft)) + d1d * log(rho(ipft))) aux = ( (a2d - a1) + b1Ht(ipft) * (c2d - c1d) + log(rho(ipft)) & * (d2d - d1d)) * (1.0/log(dcrit)) @@ -2283,27 +2630,38 @@ subroutine init_pft_alloc_params() aux = ( (a2d - a1) + log(hgt_max(ipft)) * (c2d - c1d) & + log(rho(ipft)) * (d2d - d1d)) * (1.0/log(dcrit)) - b2Bs_big (ipft) = C2B * b2d + aux + b2Bs_large(ipft) = C2B * b2d + aux case (1) !---- Based on modified Chave et al. (2001) allometry. ------------------------! - b1Bs_small(ipft) = C2B * exp(adead_small(1)) * rho(ipft) / adead_small(3) - b2Bs_small(ipft) = adead_small(2) - b1Bs_big(ipft) = C2B * exp(adead_big(1)) * rho(ipft) / adead_big(3) - b2Bs_big(ipft) = adead_big(2) + b1Bs_small(ipft) = C2B * exp(odead_small(1)) * rho(ipft) / odead_small(3) + b2Bs_small(ipft) = odead_small(2) + b1Bs_large(ipft) = C2B * exp(odead_large(1)) * rho(ipft) / odead_large(3) + b2Bs_large(ipft) = odead_large(2) - case (2:4) + case (2) !---- Based an alternative modification of Chave et al. (2001) allometry. -----! - b1Bs_small(ipft) = C2B * exp(zdead_small(1)) * rho(ipft) / zdead_small(3) - b2Bs_small(ipft) = zdead_small(2) - b1Bs_big(ipft) = C2B * exp(zdead_big(1)) * rho(ipft) / zdead_big(3) - b2Bs_big(ipft) = zdead_big(2) + b1Bs_small(ipft) = C2B * exp(ndead_small(1) + ndead_small(3) * log(rho(ipft))) + b2Bs_small(ipft) = ndead_small(2) + b1Bs_large(ipft) = C2B * exp(ndead_large(1) + ndead_large(3) * log(rho(ipft))) + b2Bs_large(ipft) = ndead_large(2) end select end if + !------------------------------------------------------------------------------------! - !----- Assigned for both cases, although it is really only needed for tropical. -----! - bdead_crit(ipft) = dbh2bd(max_dbh(ipft),ipft) + + + !------------------------------------------------------------------------------------! + ! -- MIN_BDEAD is the minimum structural biomass possible. This is used in the ! + ! initialisation only, to prevent cohorts to be less than the minimum size due to ! + ! change in allometry. ! + ! -- BDEAD_CRIT corresponds to BDEAD when DBH is exactly at DBH_CRIT. This is ! + ! used to determine which b1Bs/b2Bs pair to use. ! + !------------------------------------------------------------------------------------! + min_bdead (ipft) = dbh2bd(min_dbh (ipft),ipft) + bdead_crit(ipft) = dbh2bd(dbh_crit(ipft),ipft) + !------------------------------------------------------------------------------------! end do !---------------------------------------------------------------------------------------! @@ -2323,9 +2681,82 @@ subroutine init_pft_alloc_params() b2Ca(1:4) = b2Ht(1:4) * 1.888 b2Ca(5:13) = 0.8068806 b2Ca(14:17) = b2Ht(14:17) * 1.888 + !------ Allometric coefficents. --------------------------------------------------------! + select case (iallom) + case (0,1) + !----- Original ED-2.1 --------------------------------------------------------------! + do ipft=1,n_pft + if (is_tropical(ipft)) then + b1Ca(ipft) = exp(-1.853) * exp(b1Ht(ipft)) ** 1.888 + b2Ca(ipft) = b2Ht(ipft) * 1.888 + end if + end do + case (2) + !----- Fitted values obtained using Poorter h->DBH to obtain function of DBH. -------! + do ipft=1,n_pft + if (is_tropical(ipft)) then + b1Ca(ipft) = exp(ncrown_area(1)) + b2Ca(ipft) = ncrown_area(2) + end if + end do + end select + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Use the equation by: ! + ! Ahrends, B., C. Penne, O. Panferov, 2010: Impact of target diameter harvesting on ! + ! spatial and temporal pattern of drought risk in forest ecosystems under ! + ! climate change conditions. The Open Geography Journal, 3, 91-102 (they ! + ! didn't develop the allometry, but the original reference is in German...) ! + !---------------------------------------------------------------------------------------! + !----- Intercept. ----------------------------------------------------------------------! + b1WAI(1) = 0.0 ! No WAI for grasses + b1WAI(2:4) = 0.0192 * 0.5 ! Broadleaf + b1WAI(5) = 0.0 ! No WAI for grasses + b1WAI(6:8) = 0.0553 * 0.5 ! Needleleaf + b1WAI(9:11) = 0.0192 * 0.5 ! Broadleaf + b1WAI(12:16) = 0.0 ! No WAI for grasses + b1WAI(17) = 0.0553 * 0.5 ! Needleleaf + !----- Slope. --------------------------------------------------------------------------! + b2WAI(1) = 1.0 ! No WAI for grasses + b2WAI(2:4) = 2.0947 ! Broadleaf + b2WAI(5) = 1.0 ! No WAI for grasses + b2WAI(6:8) = 1.9769 ! Needleleaf + b2WAI(9:11) = 2.0947 ! Broadleaf + b2WAI(12:16) = 1.0 ! No WAI for grasses + b2WAI(17) = 1.9769 ! Needleleaf + !---------------------------------------------------------------------------------------! + + + + !----- Fraction of structural stem that is assumed to be above ground. -----------------! + agf_bs(1:17) = 0.7 !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! Fraction of above-ground wood that is assumed to be in branches and twigs. Here ! + ! we must be careful to make sure that the fraction is 0 in case WAI is going to be ! + ! zero (e.g. grasses). ! + !---------------------------------------------------------------------------------------! + where (b1WAI(:) == 0.0) + !----- WAI is going to be zero, so branch biomass should be zero as well. -----------! + brf_wd(:) = 0.0 + !------------------------------------------------------------------------------------! + elsewhere + !------------------------------------------------------------------------------------! + ! This may go outside the where loop eventually, for the time being assume the ! + ! same for all tree PFTs. ! + !------------------------------------------------------------------------------------! + brf_wd(:) = 0.16 + !------------------------------------------------------------------------------------! + end where + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! DBH-Root depth allometry. Check which allometry to use. Notice that b?Rd have ! ! different meanings depending on the allometry. b?Vol is always defined because we ! @@ -2336,7 +2767,7 @@ subroutine init_pft_alloc_params() b2Vol(1:17) = 2.0 select case (iallom) - case (0:2) + case (0) b1Rd(1) = - 0.700 b1Rd(2:4) = - exp(0.545 * log(10.)) b1Rd(5) = - 0.700 @@ -2350,17 +2781,7 @@ subroutine init_pft_alloc_params() b2Rd(6:11) = 0.277 b2Rd(12:16) = 0.000 b2Rd(17) = 0.277 - case (3) - !------------------------------------------------------------------------------------! - ! Based on Kenzo et al. (2009), but we had to apply some correction to make it ! - ! dependent on DBH rather than Diameter at 0m. ! - ! Source: Kenzo, T., and co-authors: 2009. Development of allometric relationships ! - ! for accurate estimation of above- and below-ground biomass in tropical ! - ! secondary forests in Sarawak, Malaysia. J. Trop. Ecology, 25, 371-386. ! - !------------------------------------------------------------------------------------! - b1Rd(1:17) = -0.2185333 - b2Rd(1:17) = 0.5436442 - case (4) + case (1:2) !------------------------------------------------------------------------------------! ! This is just a test, not based on any paper. This is simply a fit that would ! ! put the roots 0.5m deep for plants 0.15m-tall and 5 m for plants 35-m tall. ! @@ -2372,89 +2793,27 @@ subroutine init_pft_alloc_params() if (write_allom) then open (unit=18,file=trim(allom_file),status='replace',action='write') - write(unit=18,fmt='(209a)') ('-',n=1,209) - write(unit=18,fmt='(18(1x,a))') ' PFT',' Tropical',' Rho' & - ,' b1Ht',' b2Ht',' b1Bl' & - ,' b2Bl',' b1Bs_Small',' b2Bs_Small' & - ,' b1Bs_Big',' b1Bs_Big',' b1Bl' & - ,' b2Bl',' Hgt_min',' Hgt_max' & - ,' Min_DBH',' Max_DBH',' Bdead_CRT' - write(unit=18,fmt='(209a)') ('-',n=1,209) + write(unit=18,fmt='(260a)') ('-',n=1,260) + write(unit=18,fmt='(20(1x,a))') ' PFT',' Tropical',' Grass' & + ,' Rho',' b1Ht',' b2Ht' & + ,' Hgt_ref',' b1Bl',' b2Bl' & + ,' b1Bs_Small',' b2Bs_Small',' b1Bs_Large' & + ,' b1Bs_Large',' b1Ca',' b2Ca' & + ,' Hgt_min',' Hgt_max',' Min_DBH' & + ,' DBH_Crit',' Bdead_Crit' + write(unit=18,fmt='(260a)') ('-',n=1,260) do ipft=1,n_pft - write (unit=18,fmt='(8x,i5,12x,l1,16(1x,es12.5))') & - ipft,is_tropical(ipft),rho(ipft),b1Ht(ipft),b2Ht(ipft),b1Bl(ipft) & - ,b2Bl(ipft),b1Bs_small(ipft),b2Bs_small(ipft),b1Bs_big(ipft) & - ,b2Bs_big(ipft),b1Ca(ipft),b2Ca(ipft),hgt_min(ipft),hgt_max(ipft) & - ,min_dbh(ipft),max_dbh(ipft),bdead_crit(ipft) + write (unit=18,fmt='(8x,i5,2(12x,l1),17(1x,es12.5))') & + ipft,is_tropical(ipft),is_grass(ipft),rho(ipft),b1Ht(ipft) & + ,b2Ht(ipft),hgt_ref(ipft),b1Bl(ipft),b2Bl(ipft),b1Bs_small(ipft) & + ,b2Bs_small(ipft),b1Bs_large(ipft),b2Bs_large(ipft),b1Ca(ipft) & + ,b2Ca(ipft),hgt_min(ipft),hgt_max(ipft),min_dbh(ipft) & + ,dbh_crit(ipft),bdead_crit(ipft) end do - write(unit=18,fmt='(209a)') ('-',n=1,209) + write(unit=18,fmt='(260a)') ('-',n=1,260) close(unit=18,status='keep') end if - !---------------------------------------------------------------------------------------! - ! Define the branching parameters, following Järvelä (2004) ! - !---------------------------------------------------------------------------------------! - !----- Branching ratio -----------------------------------------------------------------! - rbranch(1) = 4.24 - rbranch(2:4) = 4.23 - rbranch(5) = 4.24 - rbranch(6:8) = 4.44 - rbranch(9:11) = 4.24 - rbranch(12:15) = 4.24 - rbranch(16) = 4.24 - rbranch(17) = 4.44 - !----- Diameter ratio ------------------------------------------------------------------! - rdiamet(1) = 5.00 - rdiamet(2:4) = 1.86 - rdiamet(5) = 5.00 - rdiamet(6:8) = 2.04 - rdiamet(9:11) = 1.86 - rdiamet(12:15) = 5.00 - rdiamet(16) = 5.00 - rdiamet(17) = 2.04 - !----- Length ratio. Järvelä used rdiamet^2/3, so do we... -----------------------------! - rlength(1:17) = rdiamet(1:17)**twothirds - !----- Minimum diameter to consider [cm]. ----------------------------------------------! - diammin(1:17) = 1.0 - !----- Number of trunks. Usually this is 1. -------------------------------------------! - ntrunk(1:17) = 1.0 - - !---------------------------------------------------------------------------------------! - ! The following variables are used to fit a smooth curve in the (sparse) values ! - ! provided by Conijn (1995). This should be definitely improved... The fitting curve ! - ! is a + b*erf(c*bbranch+d) - !---------------------------------------------------------------------------------------! - conijn_a(1) = 1.0 - conijn_a(2:4) = 0.96305883 - conijn_a(5) = 1.0 - conijn_a(6:11) = 0.96305883 - conijn_a(12:15) = 1.0 - conijn_a(16) = 1.0 - conijn_a(17) = 0.96305883 - - conijn_b(1) = 0.0 - conijn_b(2:4) = -0.7178682 - conijn_b(5) = 0.0 - conijn_b(6:11) = -0.7178682 - conijn_b(12:15) = 0.0 - conijn_b(16) = 0.0 - conijn_b(17) = -0.7178682 - - conijn_c(1) = 0.0 - conijn_c(2:4) = 0.00490734 - conijn_c(5) = 0.0 - conijn_c(6:11) = 0.00490734 - conijn_c(12:15) = 0.0 - conijn_c(16) = 0.0 - conijn_c(17) = 0.00490734 - - conijn_d(1) = 0.0 - conijn_d(2:4) = -0.0456370 - conijn_d(5) = 0.0 - conijn_d(6:11) = -0.0456370 - conijn_d(12:15) = 0.0 - conijn_d(16) = 0.0 - conijn_d(17) = -0.0456370 return end subroutine init_pft_alloc_params !==========================================================================================! @@ -2513,7 +2872,6 @@ end subroutine init_pft_nitro_params subroutine init_pft_leaf_params() use rk4_coms , only : ibranch_thermo ! ! intent(in) use pft_coms , only : phenology & ! intent(out) - , clumping_factor & ! intent(out) , b1Cl & ! intent(out) , b2Cl & ! intent(out) , c_grn_leaf_dry & ! intent(out) @@ -2560,16 +2918,6 @@ subroutine init_pft_leaf_params() phenology(17) = 0 end select - clumping_factor(1) = 1.000d0 - clumping_factor(2:4) = 1.000d0 ! 7.350d-1 - clumping_factor(5) = 8.400d-1 - clumping_factor(6:8) = 7.350d-1 - clumping_factor(9:11) = 8.400d-1 - clumping_factor(12:13) = 8.400d-1 - clumping_factor(14:15) = 1.000d0 - clumping_factor(16) = 1.000d0 ! 8.400d-1 - clumping_factor(17) = 1.000d0 ! 7.350d-1 - !---------------------------------------------------------------------------------------! ! The following parameters are second sources found in Gu et al. (2007) ! !---------------------------------------------------------------------------------------! @@ -2651,14 +2999,19 @@ subroutine init_pft_repro_params() seed_rain(1:17) = 0.01 - nonlocal_dispersal(1:5) = 1.0 - nonlocal_dispersal(6:7) = 0.766 - nonlocal_dispersal(8) = 0.001 - nonlocal_dispersal(9) = 1.0 - nonlocal_dispersal(10) = 0.325 - nonlocal_dispersal(11) = 0.074 - nonlocal_dispersal(16) = 1.0 - nonlocal_dispersal(17) = 0.766 + nonlocal_dispersal(1) = 1.000 ! 1.000 + nonlocal_dispersal(2) = 1.000 ! 0.900 + nonlocal_dispersal(3) = 1.000 ! 0.550 + nonlocal_dispersal(4) = 1.000 ! 0.200 + nonlocal_dispersal(5) = 1.000 ! 1.000 + nonlocal_dispersal(6) = 0.766 ! 0.766 + nonlocal_dispersal(7) = 0.766 ! 0.766 + nonlocal_dispersal(8) = 0.001 ! 0.001 + nonlocal_dispersal(9) = 1.000 ! 1.000 + nonlocal_dispersal(10) = 0.325 ! 0.325 + nonlocal_dispersal(11) = 0.074 ! 0.074 + nonlocal_dispersal(16) = 1.000 ! 1.000 + nonlocal_dispersal(17) = 0.766 ! 0.600 repro_min_h(1) = 0.0 repro_min_h(2:4) = 5.0 @@ -2701,7 +3054,7 @@ subroutine init_pft_derived_params() , sla & ! intent(in) , pft_name16 & ! intent(in) , hgt_max & ! intent(in) - , max_dbh & ! intent(in) + , dbh_crit & ! intent(in) , min_recruit_size & ! intent(out) , min_cohort_size & ! intent(out) , negligible_nplant & ! intent(out) @@ -2745,7 +3098,7 @@ subroutine init_pft_derived_params() ,' INIT_DENS','MIN_REC_SIZE' & ,'MIN_COH_SIZE',' NEGL_NPLANT' & ,' SLA',' LAI_MIN' & - ,' HGT_MAX',' MAX_DBH' + ,' HGT_MAX',' DBH_CRIT' end if min_plant_dens = onesixth * minval(init_density) do ipft = 1,n_pft @@ -2761,8 +3114,8 @@ subroutine init_pft_derived_params() ! nplant so we ensure that the cohort is always terminated if its mortality rate is ! ! very high. ! !------------------------------------------------------------------------------------! - huge_dbh = 3. * max_dbh(ipft) - huge_height = dbh2h(ipft, max_dbh(ipft)) + huge_dbh = 3. * dbh_crit(ipft) + huge_height = dbh2h(ipft, dbh_crit(ipft)) bleaf_max = dbh2bl(huge_dbh,ipft) bdead_max = dbh2bd(huge_dbh,ipft) balive_max = bleaf_max * (1.0 + q(ipft) + qsw(ipft) * huge_height) @@ -2813,7 +3166,8 @@ subroutine init_pft_derived_params() ! The minimum LAI is the LAI of a plant at the minimum cohort size that is at ! ! approaching the minimum elongation factor that supports leaves. ! !------------------------------------------------------------------------------------! - lai_min(ipft) = min(1.e-4,min_plant_dens * sla(ipft) * bleaf_min * (5. * elongf_min)) + lai_min(ipft) = 1.e-3 + !lai_min(ipft) = min(1.e-4,min_plant_dens * sla(ipft) * bleaf_min * (5. * elongf_min)) !------------------------------------------------------------------------------------! @@ -2827,7 +3181,7 @@ subroutine init_pft_derived_params() ,min_cohort_size(ipft) & ,negligible_nplant(ipft) & ,sla(ipft),lai_min(ipft) & - ,hgt_max(ipft),max_dbh(ipft) + ,hgt_max(ipft),dbh_crit(ipft) end if !------------------------------------------------------------------------------------! end do @@ -2850,8 +3204,7 @@ end subroutine init_pft_derived_params !==========================================================================================! subroutine init_disturb_params - use disturb_coms , only : sm_fire & ! intent(in) - , min_new_patch_area & ! intent(out) + use disturb_coms , only : min_new_patch_area & ! intent(out) , treefall_hite_threshold & ! intent(out) , forestry_on & ! intent(out) , agriculture_on & ! intent(out) @@ -2859,7 +3212,6 @@ subroutine init_disturb_params , plantation_rotation & ! intent(out) , mature_harvest_age & ! intent(out) , fire_dryness_threshold & ! intent(out) - , fire_smoist_threshold & ! intent(out) , fire_smoist_depth & ! intent(out) , k_fire_first & ! intent(out) , fire_parameter & ! intent(out) @@ -2867,6 +3219,8 @@ subroutine init_disturb_params , max_plantation_dist ! ! intent(out) use consts_coms , only : erad & ! intent(in) , pio180 ! ! intent(in) + use soil_coms , only : slz ! ! intent(in) + use grid_coms , only : nzg ! ! intent(in) implicit none !----- Minimum area that a patch must have to be created. ------------------------------! @@ -2895,20 +3249,24 @@ subroutine init_disturb_params ! converted to meters falls below this threshold. ! !---------------------------------------------------------------------------------------! fire_dryness_threshold = 0.2 - - !---------------------------------------------------------------------------------------! - ! If include_fire is 2, then fire may occur if total (ground + underground) water ! - ! falls below a threshold defined by the total water of a soil column with average soil ! - ! moisture equal to soilcp + (slmsts-soilcp) * fire_smoist_threshold [m3_H2O/m3_gnd] ! - ! would have. ! !---------------------------------------------------------------------------------------! - fire_smoist_threshold = sm_fire !----- Maximum depth that will be considered in the average soil -----------------------! fire_smoist_depth = -1.0 + !---------------------------------------------------------------------------------------! !----- Dimensionless parameter controlling speed of fire spread. -----------------------! fire_parameter = 1.0 + !---------------------------------------------------------------------------------------! + + !----- Determine the top layer to consider for fires in case include_fire is 2. --------! + kfireloop: do k_fire_first=nzg-1,1,-1 + if (slz(k_fire_first) < fire_smoist_depth) exit kfireloop + end do kfireloop + k_fire_first = k_fire_first + 1 + !---------------------------------------------------------------------------------------! + + !----- Minimum plantation fraction to consider the site a plantation. ------------------! min_plantation_frac = 0.125 @@ -2967,7 +3325,8 @@ end subroutine init_disturb_params ! ! !------------------------------------------------------------------------------------------! subroutine init_physiology_params() - use physiology_coms, only : iphysiol & ! intent(out) + use physiology_coms, only : iphysiol & ! intent(in) + , klowco2in & ! intent(in) , c34smin_lint_co2 & ! intent(out) , c34smax_lint_co2 & ! intent(out) , c34smax_gsw & ! intent(out) @@ -3182,9 +3541,9 @@ subroutine init_physiology_params() !---------------------------------------------------------------------------------------! ! The following parameter is the k coefficient in Foley et al. (1996) that is used ! ! to determine the CO2-limited photosynthesis for C4 grasses. Notice that Foley et al. ! - ! (1996) didn't correct for molar mass (the mmdoc term here). ! + ! (1996) didn't correct for molar mass (the mmcod term here). ! !---------------------------------------------------------------------------------------! - klowco2 = 18000. * mmdoc ! coefficient for low CO2 [ mol/mol] + klowco2 = klowco2in * mmcod ! coefficient for low CO2 [ mol/mol] !---------------------------------------------------------------------------------------! @@ -3327,11 +3686,13 @@ subroutine init_soil_coms use soil_coms , only : ed_nstyp & ! intent(in) , isoilflg & ! intent(in) , nslcon & ! intent(in) + , isoilcol & ! intent(in) , slxclay & ! intent(in) , slxsand & ! intent(in) , soil & ! intent(in) - , betapower & ! intent(in) , soil_class & ! type + , soilcol & ! intent(in) + , soilcol_class & ! type , soil8 & ! intent(out) , water_stab_thresh & ! intent(out) , snowmin & ! intent(out) @@ -3342,12 +3703,13 @@ subroutine init_soil_coms , infiltration_method & ! intent(out) , soil_rough8 & ! intent(out) , snow_rough8 & ! intent(out) - , betapower8 & ! intent(out) , freezecoef & ! intent(out) , freezecoef8 ! ! intent(out) - + use phenology_coms , only : thetacrit ! ! intent(in) + use disturb_coms , only : sm_fire ! ! intent(in) use grid_coms , only : ngrids ! ! intent(in) use consts_coms , only : grav & ! intent(in) + , wdns & ! intent(in) , hr_sec & ! intent(in) , day_sec ! ! intent(in) @@ -3356,13 +3718,13 @@ subroutine init_soil_coms integer :: nsoil integer :: ifm !----- Local constants. ----------------------------------------------------------------! - real , parameter :: fieldcp_K = 0.1 ! hydraulic conduct. at field cap. [mm/day] - real , parameter :: soilcp_MPa = 3.1 ! soil-water pot. for air dry soil [ MPa] - real , parameter :: soilwp_MPa = 1.5 ! soil-water pot. at wil. point [ MPa] - real , parameter :: sand_hcapv = 2.128e6 ! Sand vol. heat capacity [J/m3/K] - real , parameter :: clay_hcapv = 2.385e6 ! Clay vol. heat capacity [J/m3/K] - real , parameter :: silt_hcapv = 2.286e6 ! Silt vol. heat capacity (*) [J/m3/K] - real , parameter :: air_hcapv = 1.212e6 ! Air vol. heat capacity [J/m3/K] + real , parameter :: fieldcp_K = 0.1 ! hydraulic conduct. at field cap. [mm/day] + real , parameter :: soilcp_MPa = -3.1 ! soil-water pot. for air dry soil [ MPa] + real , parameter :: soilwp_MPa = -1.5 ! soil-water pot. at wil. point [ MPa] + real , parameter :: sand_hcapv = 2.128e6 ! Sand vol. heat capacity [J/m3/K] + real , parameter :: clay_hcapv = 2.385e6 ! Clay vol. heat capacity [J/m3/K] + real , parameter :: silt_hcapv = 2.286e6 ! Silt vol. heat capacity (*) [J/m3/K] + real , parameter :: air_hcapv = 1.212e6 ! Air vol. heat capacity [J/m3/K] !---------------------------------------------------------------------------------------! ! (*) If anyone has the heat capacity for silt, please feel free to add it in here, I ! ! didn't find any. Apparently no one knows, and I've seen in other models that ! @@ -3399,94 +3761,112 @@ subroutine init_soil_coms ! (1st line) slpots slmsts slbs slcpd soilcp ! ! (2nd line) soilwp slcons slcons0 soilcond0 soilcond1 ! ! (3rd line) soilcond2 sfldcap albwet albdry xsand ! - ! (4th line) xclay xsilt xrobulk slden ! + ! (4th line) xclay xsilt xrobulk slden soilld ! + ! (5th line) soilfr slpotwp slpotfc slpotld ! !---------------------------------------------------------------------------------------! soil = (/ & !----- 1. Sand. ---------------------------------------------------------------------! soil_class( -0.049831046, 0.373250, 3.295000, 1584640., 0.026183447 & , 0.032636854, 2.446421e-5, 0.000500000, 0.3000, 4.8000 & , -2.7000, 0.132130936, 0.229, 0.352, 0.920 & - , 0.030, 0.050, 1200., 1600. ) & + , 0.030, 0.050, 1200., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 2. Loamy sand. ---------------------------------------------------------------! ,soil_class( -0.067406224, 0.385630, 3.794500, 1584809., 0.041560499 & , 0.050323046, 1.776770e-5, 0.000600000, 0.3000, 4.6600 & , -2.6000, 0.155181959, 0.212, 0.335, 0.825 & - , 0.060, 0.115, 1250., 1600. ) & + , 0.060, 0.115, 1250., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 3. Sandy loam. ---------------------------------------------------------------! ,soil_class( -0.114261521, 0.407210, 4.629000, 1587042., 0.073495043 & , 0.085973722, 1.022660e-5, 0.000769000, 0.2900, 4.2700 & , -2.3100, 0.194037750, 0.183, 0.307, 0.660 & - , 0.110, 0.230, 1300., 1600. ) & + , 0.110, 0.230, 1300., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 4. Silt loam. ----------------------------------------------------------------! ,soil_class( -0.566500112, 0.470680, 5.552000, 1568225., 0.150665475 & , 0.171711257, 2.501101e-6, 0.000010600, 0.2700, 3.4700 & , -1.7400, 0.273082063, 0.107, 0.250, 0.200 & - , 0.160, 0.640, 1400., 1600. ) & + , 0.160, 0.640, 1400., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 5. Loam. ---------------------------------------------------------------------! ,soil_class( -0.260075834, 0.440490, 5.646000, 1588082., 0.125192234 & , 0.142369513, 4.532431e-6, 0.002200000, 0.2800, 3.6300 & , -1.8500, 0.246915025, 0.140, 0.268, 0.410 & - , 0.170, 0.420, 1350., 1600. ) & + , 0.170, 0.420, 1350., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 6. Sandy clay loam. ----------------------------------------------------------! ,soil_class( -0.116869181, 0.411230, 7.162000, 1636224., 0.136417267 & , 0.150969505, 6.593731e-6, 0.001500000, 0.2800, 3.7800 & , -1.9600, 0.249629687, 0.163, 0.260, 0.590 & - , 0.270, 0.140, 1350., 1600. ) & + , 0.270, 0.140, 1350., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 7. Silty clay loam. ----------------------------------------------------------! ,soil_class( -0.627769194, 0.478220, 8.408000, 1621562., 0.228171947 & , 0.248747504, 1.435262e-6, 0.000107000, 0.2600, 2.7300 & , -1.2000, 0.333825332, 0.081, 0.195, 0.100 & - , 0.340, 0.560, 1500., 1600. ) & + , 0.340, 0.560, 1500., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 8. Clayey loam. --------------------------------------------------------------! ,soil_class( -0.281968114, 0.446980, 8.342000, 1636911., 0.192624431 & , 0.210137962, 2.717260e-6, 0.002200000, 0.2700, 3.2300 & , -1.5600, 0.301335491, 0.116, 0.216, 0.320 & - , 0.340, 0.340, 1450., 1600. ) & + , 0.340, 0.340, 1450., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 9. Sandy clay. ---------------------------------------------------------------! ,soil_class( -0.121283019, 0.415620, 9.538000, 1673422., 0.182198910 & , 0.196607427, 4.314507e-6, 0.000002167, 0.2700, 3.3200 & , -1.6300, 0.286363001, 0.144, 0.216, 0.520 & - , 0.420, 0.060, 1450., 1600. ) & + , 0.420, 0.060, 1450., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 10. Silty clay. --------------------------------------------------------------! ,soil_class( -0.601312179, 0.479090, 10.461000, 1652723., 0.263228486 & , 0.282143846, 1.055191e-6, 0.000001033, 0.2500, 2.5800 & , -1.0900, 0.360319788, 0.068, 0.159, 0.060 & - , 0.470, 0.470, 1650., 1600. ) & + , 0.470, 0.470, 1650., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 11. Clay. --------------------------------------------------------------------! ,soil_class( -0.299226464, 0.454400, 12.460000, 1692037., 0.259868987 & , 0.275459057, 1.307770e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.353255209, 0.083, 0.140, 0.200 & - , 0.600, 0.200, 1700., 1600. ) & + , 0.600, 0.200, 1700., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 12. Peat. --------------------------------------------------------------------! ,soil_class( -0.534564359, 0.469200, 6.180000, 874000., 0.167047523 & , 0.187868805, 2.357930e-6, 0.000008000, 0.0600, 0.4600 & , 0.0000, 0.285709966, 0.070, 0.140, 0.2000 & - , 0.2000, 0.6000, 500., 300. ) & + , 0.2000, 0.6000, 500., 300., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 13. Bedrock. -----------------------------------------------------------------! ,soil_class( 0.0000000, 0.000000, 0.000000, 2130000., 0.000000000 & , 0.000000000, 0.000000e+0, 0.000000000, 4.6000, 0.0000 & , 0.0000, 0.000000001, 0.320, 0.320, 0.0000 & - , 0.0000, 0.0000, 0., 0. ) & + , 0.0000, 0.0000, 0., 0., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 14. Silt. --------------------------------------------------------------------! ,soil_class( -1.047128548, 0.492500, 3.862500, 1510052., 0.112299080 & , 0.135518820, 2.046592e-6, 0.000010600, 0.2700, 3.4700 & , -1.7400, 0.245247642, 0.092, 0.265, 0.075 & - , 0.050, 0.875, 1400., 1600. ) & + , 0.050, 0.875, 1400., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 15. Heavy clay. --------------------------------------------------------------! ,soil_class( -0.322106879, 0.461200, 15.630000, 1723619., 0.296806035 & , 0.310916364, 7.286705e-7, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.382110712, 0.056, 0.080, 0.100 & - , 0.800, 0.100, 1700., 1600. ) & + , 0.800, 0.100, 1700., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 16. Clayey sand. -------------------------------------------------------------! ,soil_class( -0.176502150, 0.432325, 11.230000, 1688353., 0.221886929 & , 0.236704039, 2.426785e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.320146708, 0.115, 0.175, 0.375 & - , 0.525, 0.100, 1700., 1600. ) & + , 0.525, 0.100, 1700., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & !----- 17. Clayey silt. -------------------------------------------------------------! ,soil_class( -0.438278332, 0.467825, 11.305000, 1670103., 0.261376708 & , 0.278711303, 1.174982e-6, 0.000001283, 0.2500, 2.4000 & , -0.9600, 0.357014719, 0.075, 0.151, 0.125 & - , 0.525, 0.350, 1700., 1600. ) & + , 0.525, 0.350, 1700., 1600., 0.000 & + , 0.000, 0.000, 0.000, 0.000 ) & /) !---------------------------------------------------------------------------------------! @@ -3519,15 +3899,15 @@ subroutine init_soil_coms soil(nslcon)%slmsts = (50.5 - 14.2*slxsand - 3.7*slxclay) / 100. !----- Soil field capacity[ m^3/m^3 ]. -------------------------------------------! soil(nslcon)%sfldcap = soil(nslcon)%slmsts & - * ( (fieldcp_K/1000./day_sec)/soil(nslcon)%slcons) & + * ( (fieldcp_K/wdns/day_sec)/soil(nslcon)%slcons) & ** (1. / (2.*soil(nslcon)%slbs+3.)) !----- Dry soil capacity (at -3.1MPa) [ m^3/m^3 ]. -------------------------------! soil(nslcon)%soilcp = soil(nslcon)%slmsts & - * ( -1.*soil(nslcon)%slpots / (soilcp_MPa * 1000. / grav)) & + * ( soil(nslcon)%slpots / (soilcp_MPa * wdns / grav)) & ** (1. / soil(nslcon)%slbs) !----- Wilting point capacity (at -1.5MPa) [ m^3/m^3 ]. --------------------------! soil(nslcon)%soilwp = soil(nslcon)%slmsts & - * ( -1.*soil(nslcon)%slpots / (soilwp_MPa * 1000. / grav)) & + * ( soil(nslcon)%slpots / (soilwp_MPa * wdns / grav)) & ** ( 1. / soil(nslcon)%slbs) !---------------------------------------------------------------------------------! @@ -3585,6 +3965,121 @@ subroutine init_soil_coms + !---------------------------------------------------------------------------------------! + ! Find two remaining properties, that depend on the user choices. ! + ! SOILLD -- the critical soil moisture below which drought deciduous plants start drop- ! + ! ping their leaves. The sign of input variable THETACRIT matters here. If ! + ! the user gave a positive number (or 0), then the soil moisture is a ! + ! fraction above wilting point. If it is negative, the value is the ! + ! potential in MPa. This is not done for bedrock because it doesn't make ! + ! sense. ! + ! SOILFR -- the critical soil moisture below which fires may happen, provided that the ! + ! user wants fires, and that there is enough biomass to burn. The sign of ! + ! the input variable SM_FIRE matters here. If the user gave a positive ! + ! number (or 0), then the soil moisture is a fraction above dry air soil. If ! + ! it is negative, the value is the potential in MPa. This is not done for ! + ! bedrock because it doesn't make sense. ! + ! ! + ! And find these two remaining properties: ! + ! SLPOTWP -- Soil potential at wilting point ! + ! SLPOTFC -- Soil potential at field capacity ! + ! SLPOTLD -- Soil potential at leaf drop critical soil moisture ! + !---------------------------------------------------------------------------------------! + do nsoil=1,ed_nstyp + select case (nsoil) + case (13) + soil(nsoil)%soilld = 0.0 + soil(nsoil)%soilfr = 0.0 + soil(nsoil)%slpotwp = 0.0 + soil(nsoil)%slpotfc = 0.0 + case default + !---------------------------------------------------------------------------------! + ! Critical point for leaf drop. ! + !---------------------------------------------------------------------------------! + if (thetacrit >= 0.0) then + !----- Soil moisture fraction. ------------------------------------------------! + soil(nsoil)%soilld = soil(nsoil)%soilwp & + + thetacrit * (soil(nsoil)%slmsts - soil(nsoil)%soilwp) + else + !----- Water potential. -------------------------------------------------------! + soil(nsoil)%soilld = soil(nsoil)%slmsts & + * ( soil(nsoil)%slpots / (thetacrit * 1000. / grav)) & + ** ( 1. / soil(nsoil)%slbs) + end if + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Critical point for fire. ! + !---------------------------------------------------------------------------------! + if (sm_fire >= 0.0) then + !----- Soil moisture fraction. ------------------------------------------------! + soil(nsoil)%soilfr = soil(nsoil)%soilcp & + + sm_fire * (soil(nsoil)%slmsts - soil(nsoil)%soilcp) + else + !----- Water potential. -------------------------------------------------------! + soil(nsoil)%soilfr = soil(nsoil)%slmsts & + * ( soil(nsoil)%slpots / (sm_fire * 1000. / grav)) & + ** ( 1. / soil(nsoil)%slbs) + end if + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Soil potential at wilting point and field capacity. ! + !---------------------------------------------------------------------------------! + soil(nsoil)%slpotwp = soil(nsoil)%slpots & + / (soil(nsoil)%soilwp / soil(nsoil)%slmsts) & + ** soil(nsoil)%slbs + soil(nsoil)%slpotfc = soil(nsoil)%slpots & + / (soil(nsoil)%sfldcap / soil(nsoil)%slmsts) & + ** soil(nsoil)%slbs + soil(nsoil)%slpotld = soil(nsoil)%slpots & + / (soil(nsoil)%soilld / soil(nsoil)%slmsts) & + ** soil(nsoil)%slbs + !---------------------------------------------------------------------------------! + + end select + end do + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! Fill in the albedo information regarding the soil colour classes. ! + !---------------------------------------------------------------------------------------! + ! | Dry soil | Saturated | ! + ! Soil class |---------------+---------------| ! + ! | VIS | NIR | VIS | NIR | ! + !---------------------------------------------------------------------------------------! + soilcol = (/ & ! + soilcol_class ( 0.36, 0.61, 0.25, 0.50 ) & ! 01 - Brightest + ,soilcol_class ( 0.34, 0.57, 0.23, 0.46 ) & ! 02 + ,soilcol_class ( 0.32, 0.53, 0.21, 0.42 ) & ! 03 + ,soilcol_class ( 0.31, 0.51, 0.20, 0.40 ) & ! 04 + ,soilcol_class ( 0.30, 0.49, 0.19, 0.38 ) & ! 05 + ,soilcol_class ( 0.29, 0.48, 0.18, 0.36 ) & ! 06 + ,soilcol_class ( 0.28, 0.45, 0.17, 0.34 ) & ! 07 + ,soilcol_class ( 0.27, 0.43, 0.16, 0.32 ) & ! 08 + ,soilcol_class ( 0.26, 0.41, 0.15, 0.30 ) & ! 09 + ,soilcol_class ( 0.25, 0.39, 0.14, 0.28 ) & ! 10 + ,soilcol_class ( 0.24, 0.37, 0.13, 0.26 ) & ! 11 + ,soilcol_class ( 0.23, 0.35, 0.12, 0.24 ) & ! 12 + ,soilcol_class ( 0.22, 0.33, 0.11, 0.22 ) & ! 13 + ,soilcol_class ( 0.20, 0.31, 0.10, 0.20 ) & ! 14 + ,soilcol_class ( 0.18, 0.29, 0.09, 0.18 ) & ! 15 + ,soilcol_class ( 0.16, 0.27, 0.08, 0.16 ) & ! 16 + ,soilcol_class ( 0.14, 0.25, 0.07, 0.14 ) & ! 17 + ,soilcol_class ( 0.12, 0.23, 0.06, 0.12 ) & ! 18 + ,soilcol_class ( 0.10, 0.21, 0.05, 0.10 ) & ! 19 + ,soilcol_class ( 0.08, 0.16, 0.04, 0.08 ) & ! 20 - Darkest + ,soilcol_class ( 0.00, 0.00, 0.00, 0.00 ) & ! 21 - ED-2.1, unused + /) + !---------------------------------------------------------------------------------------! + !----- Here we fill soil8, which will be used in Runge-Kutta (double precision). -------! @@ -3608,8 +4103,12 @@ subroutine init_soil_coms soil8(nsoil)%xsilt = dble(soil(nsoil)%xsilt ) soil8(nsoil)%xrobulk = dble(soil(nsoil)%xrobulk ) soil8(nsoil)%slden = dble(soil(nsoil)%slden ) + soil8(nsoil)%soilld = dble(soil(nsoil)%soilld ) + soil8(nsoil)%soilfr = dble(soil(nsoil)%soilfr ) + soil8(nsoil)%slpotwp = dble(soil(nsoil)%slpotwp ) + soil8(nsoil)%slpotfc = dble(soil(nsoil)%slpotfc ) + soil8(nsoil)%slpotld = dble(soil(nsoil)%slpotld ) end do - betapower8 = dble(betapower) soil_rough8 = dble(soil_rough) snow_rough8 = dble(snow_rough) freezecoef8 = dble(freezecoef) @@ -3628,46 +4127,85 @@ end subroutine init_soil_coms subroutine init_phen_coms use consts_coms , only : erad & ! intent(in) , pio180 ! ! intent(in) - use phenology_coms, only : retained_carbon_fraction & ! intent(out) + use phenology_coms, only : radint & ! intent(in) + , radslp & ! intent(in) + , thetacrit & ! intent(in) + , retained_carbon_fraction & ! intent(out) , elongf_min & ! intent(out) - , theta_crit & ! intent(out) + , spot_phen & ! intent(out) , dl_tr & ! intent(out) , st_tr1 & ! intent(out) , st_tr2 & ! intent(out) , phen_a & ! intent(out) , phen_b & ! intent(out) , phen_c & ! intent(out) - , rad_turnover_int & ! intent(out) - , rad_turnover_slope & ! intent(out) - , vm_tran & ! intent(out) - , vm_slop & ! intent(out) - , vm_amp & ! intent(out) - , vm_min & ! intent(out) , max_phenology_dist & ! intent(out) - , radint & ! intent(out) - , radslp & ! intent(out) - , thetacrit ! ! intent(in) + , turnamp_window & ! intent(out) + , turnamp_wgt & ! intent(out) + , turnamp_min & ! intent(out) + , turnamp_max & ! intent(out) + , radto_min & ! intent(out) + , radto_max & ! intent(out) + , llspan_window & ! intent(out) + , llspan_wgt & ! intent(out) + , llspan_min & ! intent(out) + , llspan_max & ! intent(out) + , llspan_inf & ! intent(out) + , vm0_window & ! intent(out) + , vm0_wgt & ! intent(out) + , vm0_tran & ! intent(out) + , vm0_slope & ! intent(out) + , vm0_amp & ! intent(out) + , vm0_min ! ! intent(out) + implicit none - + !---------------------------------------------------------------------------------------! + ! Before plants drop their leaves, they retain this fraction of their leaf carbon ! + ! and nitrogen and put it into storage. ! + !---------------------------------------------------------------------------------------! retained_carbon_fraction = 0.5 - elongf_min = 0.02 - theta_crit = thetacrit + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Minimum elongation factor before plants give up completely and shed all remain- ! + ! ing leaves. ! + !---------------------------------------------------------------------------------------! + elongf_min = 0.05 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Flag that checks whether to Use soil potential rather than soil moisture to drive ! + ! phenology. ! + !---------------------------------------------------------------------------------------! + spot_phen = thetacrit < 0. + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Leaf offset parameters are from: ! + ! White et al. 1997, Global Biogeochemical Cycles 11(2) 217-234 ! + !---------------------------------------------------------------------------------------! dl_tr = 655.0 st_tr1 = 284.3 st_tr2 = 275.15 - + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Phenology parameters for cold deciduous trees: ! + ! Botta et al. 2000, Global Change Biology, 6, 709--725 ! + !---------------------------------------------------------------------------------------! phen_a = -68.0 phen_b = 638.0 phen_c = -0.01 - - rad_turnover_int = dble(radint) !-11.3868 - rad_turnover_slope = dble(radslp) !0.0824 - - vm_tran = 8.5 - vm_slop = 7.0 - vm_amp = 42.0 - vm_min = 18.0 + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! This variable is the maximum distance between the coordinates of a prescribed ! @@ -3679,6 +4217,44 @@ subroutine init_phen_coms max_phenology_dist = 1.25 * erad * pio180 !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Variables controlling the light phenology as in Kim et al. (20??) ! + !---------------------------------------------------------------------------------------! + !----- Turnover window for running average [days] --------------------------------------! + turnamp_window = 10. + !----- Turnover weight, the inverse of the window. -------------------------------------! + turnamp_wgt = 1. / turnamp_window + !----- Minimum instantaneous turnover rate amplitude [n/d]. ----------------------------! + turnamp_min = 0.01 + !----- Maximum instantaneous turnover rate amplitude [n/d]. ----------------------------! + turnamp_max = 100. + !----- Minimum radiation [W/m2], below which the turnover no longer responds. ----------! + radto_min = (turnamp_min - radint) / radslp + !----- Maximum radiation [W/m2], above which the turnover no longer responds. ----------! + radto_max = (turnamp_max - radint) / radslp + !----- Lifespan window for running average [days]. -------------------------------------! + llspan_window = 60. + !----- Lifespan weight, the inverse of the window. -------------------------------------! + llspan_wgt = 1. / llspan_window + !----- Minimum instantaneous life span [months]. ---------------------------------------! + llspan_min = 2.0 + !----- Maximum instantaneous life span [months]. ---------------------------------------! + llspan_max = 60. + !----- Instantaneous life span in case the turnover rate is 0. -------------------------! + llspan_inf = 9999. + !----- Vm0 window for running average [days]. ------------------------------------------! + vm0_window = 60. + !----- Vm0 weight, the inverse of the window. ------------------------------------------! + vm0_wgt = 1. / vm0_window + !----- Parameters that define the instantaneous Vm0 as a function of leaf life span. ---! + vm0_tran =1.98 ! 8.5 + vm0_slope =6.53 ! 7.0 + vm0_amp =57.2 ! 42.0 + vm0_min = 7.31 ! 18.0 + !---------------------------------------------------------------------------------------! + return end subroutine init_phen_coms !==========================================================================================! @@ -3902,9 +4478,9 @@ subroutine init_rk4_params() rk4min_can_temp = 1.8400d2 ! Minimum canopy temperature [ K] rk4max_can_temp = 3.5100d2 ! Maximum canopy temperature [ K] rk4min_can_shv = 1.0000d-8 ! Minimum canopy specific humidity [kg/kg_air] - rk4max_can_shv = 4.6000d-2 ! Maximum canopy specific humidity [kg/kg_air] + rk4max_can_shv = 8.0000d-2 ! Maximum canopy specific humidity [kg/kg_air] rk4max_can_rhv = 1.1000d0 ! Maximum canopy relative humidity (**) [ ---] - rk4min_can_co2 = 6.0000d1 ! Minimum canopy CO2 mixing ratio [ ĩmol/mol] + rk4min_can_co2 = 3.0000d1 ! Minimum canopy CO2 mixing ratio [ ĩmol/mol] rk4max_can_co2 = 5.0000d4 ! Maximum canopy CO2 mixing ratio [ ĩmol/mol] rk4min_soil_temp = 1.8400d2 ! Minimum soil temperature [ K] rk4max_soil_temp = 3.5100d2 ! Maximum soil temperature [ K] diff --git a/ED/src/init/ed_type_init.f90 b/ED/src/init/ed_type_init.f90 index 732d183f9..c12d9e36f 100644 --- a/ED/src/init/ed_type_init.f90 +++ b/ED/src/init/ed_type_init.f90 @@ -7,16 +7,18 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) use ed_state_vars , only : patchtype ! ! structure use allometry , only : dbh2krdepth ! ! function - use pft_coms , only : leaf_turnover_rate & ! intent(in) + use pft_coms , only : phenology & ! intent(in) + , leaf_turnover_rate & ! intent(in) , Vm0 & ! intent(in) , sla ! ! intent(in) use ed_misc_coms , only : imoutput & ! intent(in) , idoutput & ! intent(in) , iqoutput ! ! intent(in) - use phenology_coms, only : vm_tran & ! intent(in) - , vm_slop & ! intent(in) - , vm_amp & ! intent(in) - , vm_min ! ! intent(in) + use phenology_coms, only : vm0_tran & ! intent(in) + , vm0_slope & ! intent(in) + , vm0_amp & ! intent(in) + , vm0_min & ! intent(in) + , llspan_inf ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! type(patchtype), target :: cpatch ! Current patch @@ -321,9 +323,9 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) ! we assign a meaningless number just to make sure the variable is initialised. ! !---------------------------------------------------------------------------------------! if (leaf_turnover_rate(cpatch%pft(ico)) > 0.0) then - cpatch%llspan(ico) = 12.0/leaf_turnover_rate(cpatch%pft(ico)) + cpatch%llspan(ico) = 12.0 / leaf_turnover_rate(cpatch%pft(ico)) else - cpatch%llspan(ico) = 9999. + cpatch%llspan(ico) = llspan_inf end if !---------------------------------------------------------------------------------------! @@ -333,8 +335,13 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) ! specific leaf area (SLA) must be assigned with the default values. These numbers ! ! will change only if the PFT uses a light-controlled phenology. ! !---------------------------------------------------------------------------------------! - !cpatch%vm_bar(ico) = Vm0(cpatch%pft(ico)) - cpatch%vm_bar(ico)= vm_amp / (1.0 + (cpatch%llspan(ico)/vm_tran)**vm_slop) + vm_min + select case(phenology(cpatch%pft(ico))) + case (3) + cpatch%vm_bar(ico) = vm0_amp / (1.0 + (cpatch%llspan(ico)/vm0_tran)**vm0_slope) & + + vm0_min + case default + cpatch%vm_bar(ico) = Vm0(cpatch%pft(ico)) + end select cpatch%sla(ico) = sla(cpatch%pft(ico)) !---------------------------------------------------------------------------------------! @@ -412,7 +419,8 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%rlong_s(ip1:ip2) = 0.0 - csite%avg_daily_temp(ip1:ip2) = 0.0 + csite%avg_daily_temp (ip1:ip2) = 0.0 + csite%avg_monthly_gndwater(ip1:ip2) = 0.0 csite%mean_rh(ip1:ip2) = 0.0 csite%mean_nep(ip1:ip2) = 0.0 @@ -505,15 +513,19 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%qmean_albedo_diffuse (:,ip1:ip2) = 0.0 end if - !----------------------------------------------------------------------------------------! - ! These variables need to be initialized here otherwise it will fail when new patches ! - ! are created. ! - !----------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! These variables need to be initialized here otherwise it will fail when new ! + ! patches are created. ! + !---------------------------------------------------------------------------------------! csite%avg_rk4step (ip1:ip2) = 0.0 + csite%avg_ustar (ip1:ip2) = 0.0 + csite%avg_tstar (ip1:ip2) = 0.0 + csite%avg_qstar (ip1:ip2) = 0.0 + csite%avg_cstar (ip1:ip2) = 0.0 csite%avg_carbon_ac (ip1:ip2) = 0.0 + csite%avg_carbon_st (ip1:ip2) = 0.0 csite%avg_vapor_lc (ip1:ip2) = 0.0 csite%avg_vapor_wc (ip1:ip2) = 0.0 - csite%avg_dew_cg (ip1:ip2) = 0.0 csite%avg_vapor_gc (ip1:ip2) = 0.0 csite%avg_wshed_vg (ip1:ip2) = 0.0 csite%avg_intercepted (ip1:ip2) = 0.0 @@ -523,6 +535,11 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%avg_evap (ip1:ip2) = 0.0 csite%avg_rshort_gnd (ip1:ip2) = 0.0 csite%avg_rlong_gnd (ip1:ip2) = 0.0 + csite%avg_rlongup (ip1:ip2) = 0.0 + csite%avg_albedo (ip1:ip2) = 0.0 + csite%avg_albedo_beam (ip1:ip2) = 0.0 + csite%avg_albedo_diffuse (ip1:ip2) = 0.0 + csite%avg_rlong_albedo (ip1:ip2) = 0.0 csite%avg_runoff (ip1:ip2) = 0.0 csite%avg_drainage (ip1:ip2) = 0.0 csite%avg_drainage_heat (ip1:ip2) = 0.0 @@ -554,6 +571,12 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%rshort_g (ip1:ip2) = 0.0 csite%rshort_g_beam (ip1:ip2) = 0.0 csite%rshort_g_diffuse (ip1:ip2) = 0.0 + csite%par_b (ip1:ip2) = 0.0 + csite%par_b_beam (ip1:ip2) = 0.0 + csite%par_b_diffuse (ip1:ip2) = 0.0 + csite%nir_b (ip1:ip2) = 0.0 + csite%nir_b_beam (ip1:ip2) = 0.0 + csite%nir_b_diffuse (ip1:ip2) = 0.0 csite%rlong_g (ip1:ip2) = 0.0 csite%rlong_g_surf (ip1:ip2) = 0.0 csite%rlong_g_incid (ip1:ip2) = 0.0 diff --git a/ED/src/init/init_hydro_sites.f90 b/ED/src/init/init_hydro_sites.f90 index 40c8e24cc..9580fed00 100644 --- a/ED/src/init/init_hydro_sites.f90 +++ b/ED/src/init/init_hydro_sites.f90 @@ -80,6 +80,8 @@ subroutine read_site_file(cgrid,igr) cpoly%ntext_soil(k,1) = cgrid%ntext_soil(k,ipy) enddo + cpoly%ncol_soil(1) = cgrid%ncol_soil(ipy) + ! Set soil moisture decay function, based on second layer's K value ! use the second layer instead of the top in case top is organic/peat sc = cpoly%ntext_soil(nzg-1,1) @@ -203,6 +205,8 @@ subroutine read_site_file(cgrid,igr) do k=1,nzg cpoly%ntext_soil(k,isi) = cgrid%ntext_soil(k,ipy) enddo + + cpoly%ncol_soil(isi) = cgrid%ncol_soil(ipy) area_sum = area_sum + dble(area) cpoly%sitenum(isi) = sitenum @@ -230,6 +234,7 @@ subroutine read_site_file(cgrid,igr) cpoly%ntext_soil(i,isi) = soilclass(1) end do end if + !//Currently do nothing with setting site-level soils sc = cpoly%ntext_soil(nzg-1,1) diff --git a/ED/src/init/landuse_init.f90 b/ED/src/init/landuse_init.f90 index d13f93fad..f7e3a03e0 100644 --- a/ED/src/init/landuse_init.f90 +++ b/ED/src/init/landuse_init.f90 @@ -19,7 +19,6 @@ subroutine landuse_init use ed_misc_coms , only : iyeara & ! intent(in) , iyearz ! ! intent(in) use grid_coms , only : ngrids ! ! intent(in) - use pft_coms , only : is_grass ! ! intent(in) use ed_max_dims , only : str_len & ! intent(in) , huge_lu & ! intent(in) , n_pft & ! intent(in) diff --git a/ED/src/io/average_utils.f90 b/ED/src/io/average_utils.f90 index c17b2f737..06557e58b 100644 --- a/ED/src/io/average_utils.f90 +++ b/ED/src/io/average_utils.f90 @@ -196,7 +196,6 @@ subroutine normalize_averaged_vars(cgrid,frqsum,dtlsm) csite%aux (ipa) = csite%aux (ipa) * frqsumi csite%avg_vapor_lc (ipa) = csite%avg_vapor_lc (ipa) * frqsumi csite%avg_vapor_wc (ipa) = csite%avg_vapor_wc (ipa) * frqsumi - csite%avg_dew_cg (ipa) = csite%avg_dew_cg (ipa) * frqsumi csite%avg_vapor_gc (ipa) = csite%avg_vapor_gc (ipa) * frqsumi csite%avg_wshed_vg (ipa) = csite%avg_wshed_vg (ipa) * frqsumi csite%avg_intercepted (ipa) = csite%avg_intercepted (ipa) * frqsumi @@ -214,11 +213,17 @@ subroutine normalize_averaged_vars(cgrid,frqsum,dtlsm) csite%avg_sensible_gc (ipa) = csite%avg_sensible_gc (ipa) * frqsumi csite%avg_sensible_ac (ipa) = csite%avg_sensible_ac (ipa) * frqsumi csite%avg_carbon_ac (ipa) = csite%avg_carbon_ac (ipa) * frqsumi + csite%avg_carbon_st (ipa) = csite%avg_carbon_st (ipa) * frqsumi csite%avg_runoff_heat (ipa) = csite%avg_runoff_heat (ipa) * frqsumi csite%avg_drainage_heat (ipa) = csite%avg_drainage_heat (ipa) * frqsumi csite%avg_rk4step (ipa) = csite%avg_rk4step (ipa) * frqsumi - + csite%avg_ustar (ipa) = csite%avg_ustar (ipa) * frqsumi + csite%avg_tstar (ipa) = csite%avg_tstar (ipa) * frqsumi + csite%avg_qstar (ipa) = csite%avg_qstar (ipa) * frqsumi + csite%avg_cstar (ipa) = csite%avg_cstar (ipa) * frqsumi + + do k=cpoly%lsl(isi),nzg csite%avg_sensible_gg(k,ipa) = csite%avg_sensible_gg(k,ipa) * frqsumi csite%avg_smoist_gg(k,ipa) = csite%avg_smoist_gg(k,ipa) * frqsumi @@ -371,9 +376,13 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_soil_fracliq (:,ipy) = 0.0 cgrid%avg_soil_rootfrac (:,ipy) = 0.0 + cgrid%avg_ustar (ipy) = 0.0 + cgrid%avg_tstar (ipy) = 0.0 + cgrid%avg_qstar (ipy) = 0.0 + cgrid%avg_cstar (ipy) = 0.0 + cgrid%avg_vapor_lc (ipy) = 0.0 cgrid%avg_vapor_wc (ipy) = 0.0 - cgrid%avg_dew_cg (ipy) = 0.0 cgrid%avg_vapor_gc (ipy) = 0.0 cgrid%avg_wshed_vg (ipy) = 0.0 cgrid%avg_intercepted (ipy) = 0.0 @@ -386,6 +395,7 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_drainage_heat (ipy) = 0.0 cgrid%aux (ipy) = 0.0 cgrid%avg_carbon_ac (ipy) = 0.0 + cgrid%avg_carbon_st (ipy) = 0.0 cgrid%avg_sensible_lc (ipy) = 0.0 cgrid%avg_sensible_wc (ipy) = 0.0 cgrid%avg_qwshed_vg (ipy) = 0.0 @@ -501,10 +511,14 @@ subroutine reset_averaged_vars(cgrid) csite%ebudget_residual(ipa) = 0.0 !----------------------------------------------------------------! + csite%avg_ustar (ipa) = 0.0 + csite%avg_tstar (ipa) = 0.0 + csite%avg_qstar (ipa) = 0.0 + csite%avg_cstar (ipa) = 0.0 csite%avg_carbon_ac(ipa) = 0.0 + csite%avg_carbon_st(ipa) = 0.0 csite%avg_vapor_lc(ipa) = 0.0 csite%avg_vapor_wc(ipa) = 0.0 - csite%avg_dew_cg(ipa) = 0.0 csite%avg_vapor_gc(ipa) = 0.0 csite%avg_wshed_vg(ipa) = 0.0 csite%avg_intercepted(ipa) = 0.0 @@ -1361,6 +1375,20 @@ subroutine integrate_ed_daily_output_flux(cgrid) + cgrid%avg_sensible_gc(ipy) cgrid%dmean_sensible_ac(ipy) = cgrid%dmean_sensible_ac(ipy) & + cgrid%avg_sensible_ac(ipy) + cgrid%dmean_carbon_ac (ipy) = cgrid%dmean_carbon_ac (ipy) & + + cgrid%avg_carbon_ac (ipy) + cgrid%dmean_carbon_st (ipy) = cgrid%dmean_carbon_st (ipy) & + + cgrid%avg_carbon_st (ipy) + + cgrid%dmean_ustar (ipy) = cgrid%dmean_ustar (ipy) & + + cgrid%avg_ustar (ipy) + cgrid%dmean_tstar (ipy) = cgrid%dmean_tstar (ipy) & + + cgrid%avg_tstar (ipy) + cgrid%dmean_qstar (ipy) = cgrid%dmean_qstar (ipy) & + + cgrid%avg_qstar (ipy) + cgrid%dmean_cstar (ipy) = cgrid%dmean_cstar (ipy) & + + cgrid%avg_cstar (ipy) + cgrid%dmean_rshort_gnd (ipy) = cgrid%dmean_rshort_gnd (ipy) & + cgrid%avg_rshort_gnd (ipy) @@ -1370,9 +1398,6 @@ subroutine integrate_ed_daily_output_flux(cgrid) + cgrid%avg_rlongup (ipy) cgrid%dmean_rlong_albedo(ipy) = cgrid%dmean_rlong_albedo (ipy) & + cgrid%avg_rlong_albedo (ipy) - !------ Integrate the NEE with the conventional NEE sign (< 0 = uptake). ------------! - cgrid%dmean_nee (ipy) = cgrid%dmean_nee (ipy) & - - cgrid%avg_carbon_ac (ipy) * umols_2_kgCyr cgrid%dmean_leaf_resp (ipy) = cgrid%dmean_leaf_resp (ipy) & + cgrid%avg_leaf_resp (ipy) * umols_2_kgCyr cgrid%dmean_root_resp (ipy) = cgrid%dmean_root_resp (ipy) & @@ -1430,10 +1455,21 @@ subroutine integrate_ed_daily_output_flux(cgrid) cgrid%qmean_rh (it,ipy) = cgrid%qmean_rh (it,ipy) & + cgrid%avg_htroph_resp (ipy) & * umols_2_kgCyr - !------ Integrate the NEE with the conventional NEE sign (< 0 = uptake). ---------! - cgrid%qmean_nee (it,ipy) = cgrid%qmean_nee (it,ipy) & - - cgrid%avg_carbon_ac (ipy) & - * umols_2_kgCyr + + cgrid%qmean_ustar (it,ipy) = cgrid%qmean_ustar (it,ipy) & + + cgrid%avg_ustar (ipy) + cgrid%qmean_tstar (it,ipy) = cgrid%qmean_tstar (it,ipy) & + + cgrid%avg_tstar (ipy) + cgrid%qmean_qstar (it,ipy) = cgrid%qmean_qstar (it,ipy) & + + cgrid%avg_qstar (ipy) + cgrid%qmean_cstar (it,ipy) = cgrid%qmean_cstar (it,ipy) & + + cgrid%avg_cstar (ipy) + + cgrid%qmean_carbon_ac (it,ipy) = cgrid%qmean_carbon_ac (it,ipy) & + + cgrid%avg_carbon_ac (ipy) + cgrid%qmean_carbon_st (it,ipy) = cgrid%qmean_carbon_st (it,ipy) & + + cgrid%avg_carbon_st (ipy) + !----- Variables that were previously integrated to this time step. --------------! cgrid%qmean_sensible_lc (it,ipy) = cgrid%qmean_sensible_lc (it,ipy) & + cgrid%avg_sensible_lc (ipy) @@ -1528,10 +1564,13 @@ subroutine integrate_ed_daily_output_flux(cgrid) * cgrid%avg_htroph_resp (ipy) & * umols_2_kgCyr * umols_2_kgCyr - cgrid%qmsqu_nee (it,ipy) = cgrid%qmsqu_nee (it,ipy) & + cgrid%qmsqu_carbon_ac (it,ipy) = cgrid%qmsqu_carbon_ac (it,ipy) & + cgrid%avg_carbon_ac (ipy) & - * cgrid%avg_carbon_ac (ipy) & - * umols_2_kgCyr * umols_2_kgCyr + * cgrid%avg_carbon_ac (ipy) + + cgrid%qmsqu_carbon_st (it,ipy) = cgrid%qmsqu_carbon_st (it,ipy) & + + cgrid%avg_carbon_st (ipy) & + * cgrid%avg_carbon_st (ipy) cgrid%qmsqu_sensible_ac (it,ipy) = cgrid%qmsqu_sensible_ac (it,ipy) & + cgrid%avg_sensible_ac (ipy) & @@ -2150,8 +2189,14 @@ subroutine normalize_ed_daily_output_vars(cgrid) ! Flux variables, updated every frqsum, so these are normalized by ! ! frqsum/day_sec. ! !------------------------------------------------------------------------------------! + cgrid%dmean_ustar (ipy) = cgrid%dmean_ustar (ipy) * frqsum_o_daysec + cgrid%dmean_tstar (ipy) = cgrid%dmean_tstar (ipy) * frqsum_o_daysec + cgrid%dmean_qstar (ipy) = cgrid%dmean_qstar (ipy) * frqsum_o_daysec + cgrid%dmean_cstar (ipy) = cgrid%dmean_cstar (ipy) * frqsum_o_daysec cgrid%dmean_evap (ipy) = cgrid%dmean_evap (ipy) * frqsum_o_daysec cgrid%dmean_transp (ipy) = cgrid%dmean_transp (ipy) * frqsum_o_daysec + cgrid%dmean_carbon_ac (ipy) = cgrid%dmean_carbon_ac (ipy) * frqsum_o_daysec + cgrid%dmean_carbon_st (ipy) = cgrid%dmean_carbon_st (ipy) * frqsum_o_daysec cgrid%dmean_sensible_lc (ipy) = cgrid%dmean_sensible_lc (ipy) * frqsum_o_daysec cgrid%dmean_sensible_wc (ipy) = cgrid%dmean_sensible_wc (ipy) * frqsum_o_daysec cgrid%dmean_sensible_gc (ipy) = cgrid%dmean_sensible_gc (ipy) * frqsum_o_daysec @@ -2166,7 +2211,6 @@ subroutine normalize_ed_daily_output_vars(cgrid) ! point in umol/m2/s. We just multiply by one year in seconds and convert to kgC, ! ! so the units will be kgC/m2/yr. ! !------------------------------------------------------------------------------------! - cgrid%dmean_nee (ipy) = cgrid%dmean_nee (ipy) * frqsum_o_daysec cgrid%dmean_plresp (ipy) = cgrid%dmean_plresp (ipy) * frqsum_o_daysec cgrid%dmean_nep (ipy) = cgrid%dmean_nep (ipy) * frqsum_o_daysec cgrid%dmean_gpp_dbh (:,ipy) = cgrid%dmean_gpp_dbh(:,ipy) * frqsum_o_daysec @@ -2578,7 +2622,13 @@ subroutine zero_ed_daily_output_vars(cgrid) cgrid%dmean_albedo_beam (ipy) = 0. cgrid%dmean_albedo_diffuse (ipy) = 0. - cgrid%dmean_nee (ipy) = 0. + cgrid%dmean_ustar (ipy) = 0. + cgrid%dmean_tstar (ipy) = 0. + cgrid%dmean_qstar (ipy) = 0. + cgrid%dmean_cstar (ipy) = 0. + + cgrid%dmean_carbon_ac (ipy) = 0. + cgrid%dmean_carbon_st (ipy) = 0. cgrid%dmean_plresp (ipy) = 0. cgrid%dmean_rh (ipy) = 0. cgrid%dmean_leaf_resp (ipy) = 0. @@ -2768,8 +2818,18 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_albedo_beam (ipy) cgrid%mmean_albedo_diffuse(ipy) = cgrid%mmean_albedo_diffuse(ipy) & + cgrid%dmean_albedo_diffuse(ipy) - cgrid%mmean_nee (ipy) = cgrid%mmean_nee (ipy) & - + cgrid%dmean_nee (ipy) + cgrid%mmean_ustar (ipy) = cgrid%mmean_ustar (ipy) & + + cgrid%dmean_ustar (ipy) + cgrid%mmean_tstar (ipy) = cgrid%mmean_tstar (ipy) & + + cgrid%dmean_tstar (ipy) + cgrid%mmean_qstar (ipy) = cgrid%mmean_qstar (ipy) & + + cgrid%dmean_qstar (ipy) + cgrid%mmean_cstar (ipy) = cgrid%mmean_cstar (ipy) & + + cgrid%dmean_cstar (ipy) + cgrid%mmean_carbon_ac (ipy) = cgrid%mmean_carbon_ac (ipy) & + + cgrid%dmean_carbon_ac (ipy) + cgrid%mmean_carbon_st (ipy) = cgrid%mmean_carbon_st (ipy) & + + cgrid%dmean_carbon_st (ipy) cgrid%mmean_nep (ipy) = cgrid%mmean_nep (ipy) & + cgrid%dmean_nep (ipy) cgrid%mmean_plresp (ipy) = cgrid%mmean_plresp (ipy) & @@ -2875,9 +2935,12 @@ subroutine integrate_ed_monthly_output_vars(cgrid) cgrid%mmsqu_plresp (ipy) = cgrid%mmsqu_plresp (ipy) & + cgrid%dmean_plresp (ipy) & * cgrid%dmean_plresp (ipy) - cgrid%mmsqu_nee (ipy) = cgrid%mmsqu_nee (ipy) & - + cgrid%dmean_nee (ipy) & - * cgrid%dmean_nee (ipy) + cgrid%mmsqu_carbon_ac (ipy) = cgrid%mmsqu_carbon_ac (ipy) & + + cgrid%dmean_carbon_ac (ipy) & + * cgrid%dmean_carbon_ac (ipy) + cgrid%mmsqu_carbon_st (ipy) = cgrid%mmsqu_carbon_st (ipy) & + + cgrid%dmean_carbon_st (ipy) & + * cgrid%dmean_carbon_st (ipy) cgrid%mmsqu_nep (ipy) = cgrid%mmsqu_nep (ipy) & + cgrid%dmean_nep (ipy) & * cgrid%dmean_nep (ipy) @@ -3159,7 +3222,12 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%mmean_albedo (ipy) = cgrid%mmean_albedo (ipy) * ndaysi cgrid%mmean_albedo_beam (ipy) = cgrid%mmean_albedo_beam (ipy) * ndaysi cgrid%mmean_albedo_diffuse (ipy) = cgrid%mmean_albedo_diffuse (ipy) * ndaysi - cgrid%mmean_nee (ipy) = cgrid%mmean_nee (ipy) * ndaysi + cgrid%mmean_ustar (ipy) = cgrid%mmean_ustar (ipy) * ndaysi + cgrid%mmean_tstar (ipy) = cgrid%mmean_tstar (ipy) * ndaysi + cgrid%mmean_qstar (ipy) = cgrid%mmean_qstar (ipy) * ndaysi + cgrid%mmean_cstar (ipy) = cgrid%mmean_cstar (ipy) * ndaysi + cgrid%mmean_carbon_ac (ipy) = cgrid%mmean_carbon_ac (ipy) * ndaysi + cgrid%mmean_carbon_st (ipy) = cgrid%mmean_carbon_st (ipy) * ndaysi cgrid%mmean_nep (ipy) = cgrid%mmean_nep (ipy) * ndaysi cgrid%mmean_plresp (ipy) = cgrid%mmean_plresp (ipy) * ndaysi cgrid%mmean_rh (ipy) = cgrid%mmean_rh (ipy) * ndaysi @@ -3222,7 +3290,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%mmsqu_leaf_resp (ipy) = cgrid%mmsqu_leaf_resp (ipy) * ndaysi cgrid%mmsqu_root_resp (ipy) = cgrid%mmsqu_root_resp (ipy) * ndaysi cgrid%mmsqu_plresp (ipy) = cgrid%mmsqu_plresp (ipy) * ndaysi - cgrid%mmsqu_nee (ipy) = cgrid%mmsqu_nee (ipy) * ndaysi + cgrid%mmsqu_carbon_ac (ipy) = cgrid%mmsqu_carbon_ac (ipy) * ndaysi + cgrid%mmsqu_carbon_st (ipy) = cgrid%mmsqu_carbon_st (ipy) * ndaysi cgrid%mmsqu_nep (ipy) = cgrid%mmsqu_nep (ipy) * ndaysi cgrid%mmsqu_rh (ipy) = cgrid%mmsqu_rh (ipy) * ndaysi cgrid%mmsqu_sensible_ac (ipy) = cgrid%mmsqu_sensible_ac (ipy) * ndaysi @@ -3649,7 +3718,12 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%qmean_albedo (t,ipy) = cgrid%qmean_albedo (t,ipy) * ndaysi cgrid%qmean_albedo_beam (t,ipy) = cgrid%qmean_albedo_beam (t,ipy) * ndaysi cgrid%qmean_albedo_diffuse(t,ipy) = cgrid%qmean_albedo_diffuse(t,ipy) * ndaysi - cgrid%qmean_nee (t,ipy) = cgrid%qmean_nee (t,ipy) * ndaysi + cgrid%qmean_ustar (t,ipy) = cgrid%qmean_ustar (t,ipy) * ndaysi + cgrid%qmean_tstar (t,ipy) = cgrid%qmean_tstar (t,ipy) * ndaysi + cgrid%qmean_qstar (t,ipy) = cgrid%qmean_qstar (t,ipy) * ndaysi + cgrid%qmean_cstar (t,ipy) = cgrid%qmean_cstar (t,ipy) * ndaysi + cgrid%qmean_carbon_ac (t,ipy) = cgrid%qmean_carbon_ac (t,ipy) * ndaysi + cgrid%qmean_carbon_st (t,ipy) = cgrid%qmean_carbon_st (t,ipy) * ndaysi cgrid%qmean_pcpg (t,ipy) = cgrid%qmean_pcpg (t,ipy) * ndaysi cgrid%qmean_evap (t,ipy) = cgrid%qmean_evap (t,ipy) * ndaysi cgrid%qmean_transp (t,ipy) = cgrid%qmean_transp (t,ipy) * ndaysi @@ -3666,7 +3740,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%qmsqu_leaf_resp (t,ipy) = cgrid%qmsqu_leaf_resp (t,ipy) * ndaysi cgrid%qmsqu_root_resp (t,ipy) = cgrid%qmsqu_root_resp (t,ipy) * ndaysi cgrid%qmsqu_plresp (t,ipy) = cgrid%qmsqu_plresp (t,ipy) * ndaysi - cgrid%qmsqu_nee (t,ipy) = cgrid%qmsqu_nee (t,ipy) * ndaysi + cgrid%qmsqu_carbon_ac (t,ipy) = cgrid%qmsqu_carbon_ac (t,ipy) * ndaysi + cgrid%qmsqu_carbon_st (t,ipy) = cgrid%qmsqu_carbon_st (t,ipy) * ndaysi cgrid%qmsqu_nep (t,ipy) = cgrid%qmsqu_nep (t,ipy) * ndaysi cgrid%qmsqu_rh (t,ipy) = cgrid%qmsqu_rh (t,ipy) * ndaysi cgrid%qmsqu_sensible_ac (t,ipy) = cgrid%qmsqu_sensible_ac (t,ipy) * ndaysi @@ -3778,7 +3853,12 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmean_albedo (ipy) = 0. cgrid%mmean_albedo_beam (ipy) = 0. cgrid%mmean_albedo_diffuse (ipy) = 0. - cgrid%mmean_nee (ipy) = 0. + cgrid%mmean_ustar (ipy) = 0. + cgrid%mmean_tstar (ipy) = 0. + cgrid%mmean_qstar (ipy) = 0. + cgrid%mmean_cstar (ipy) = 0. + cgrid%mmean_carbon_ac (ipy) = 0. + cgrid%mmean_carbon_st (ipy) = 0. cgrid%mmean_nep (ipy) = 0. cgrid%mmean_plresp (ipy) = 0. cgrid%mmean_rh (ipy) = 0. @@ -3829,7 +3909,8 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmsqu_leaf_resp (ipy) = 0. cgrid%mmsqu_root_resp (ipy) = 0. cgrid%mmsqu_plresp (ipy) = 0. - cgrid%mmsqu_nee (ipy) = 0. + cgrid%mmsqu_carbon_ac (ipy) = 0. + cgrid%mmsqu_carbon_st (ipy) = 0. cgrid%mmsqu_nep (ipy) = 0. cgrid%mmsqu_rh (ipy) = 0. cgrid%mmsqu_sensible_ac (ipy) = 0. @@ -3980,7 +4061,12 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmean_albedo (:,ipy) = 0.0 cgrid%qmean_albedo_beam (:,ipy) = 0.0 cgrid%qmean_albedo_diffuse(:,ipy) = 0.0 - cgrid%qmean_nee (:,ipy) = 0.0 + cgrid%qmean_ustar (:,ipy) = 0.0 + cgrid%qmean_tstar (:,ipy) = 0.0 + cgrid%qmean_qstar (:,ipy) = 0.0 + cgrid%qmean_cstar (:,ipy) = 0.0 + cgrid%qmean_carbon_ac (:,ipy) = 0.0 + cgrid%qmean_carbon_st (:,ipy) = 0.0 cgrid%qmean_pcpg (:,ipy) = 0.0 cgrid%qmean_evap (:,ipy) = 0.0 cgrid%qmean_transp (:,ipy) = 0.0 @@ -3997,7 +4083,8 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmsqu_leaf_resp (:,ipy) = 0.0 cgrid%qmsqu_root_resp (:,ipy) = 0.0 cgrid%qmsqu_plresp (:,ipy) = 0.0 - cgrid%qmsqu_nee (:,ipy) = 0.0 + cgrid%qmsqu_carbon_ac (:,ipy) = 0.0 + cgrid%qmsqu_carbon_st (:,ipy) = 0.0 cgrid%qmsqu_nep (:,ipy) = 0.0 cgrid%qmsqu_rh (:,ipy) = 0.0 cgrid%qmsqu_sensible_ac (:,ipy) = 0.0 diff --git a/ED/src/io/ed_init_full_history.F90 b/ED/src/io/ed_init_full_history.F90 index 7eba9be22..4ca5091b7 100644 --- a/ED/src/io/ed_init_full_history.F90 +++ b/ED/src/io/ed_init_full_history.F90 @@ -514,6 +514,8 @@ end subroutine hdf_getslab_i call hdf_getslab_i(cgrid%lsl(ipy:ipy),'LSL ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cgrid%ncol_soil(ipy:ipy),'NCOL_SOIL ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.) call hdf_getslab_r(cgrid%Te(ipy:ipy),'TE ',dsetrank,iparallel,.true.) @@ -652,12 +654,32 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%dmean_vapor_ac (ipy:ipy) ,'DMEAN_VAPOR_AC ' & ,dsetrank,iparallel,.false.) + if (associated(cgrid%dmean_ustar )) & + call hdf_getslab_r(cgrid%dmean_ustar (ipy:ipy) ,'DMEAN_USTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%dmean_tstar )) & + call hdf_getslab_r(cgrid%dmean_tstar (ipy:ipy) ,'DMEAN_TSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%dmean_qstar )) & + call hdf_getslab_r(cgrid%dmean_qstar (ipy:ipy) ,'DMEAN_QSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%dmean_cstar )) & + call hdf_getslab_r(cgrid%dmean_cstar (ipy:ipy) ,'DMEAN_CSTAR ' & + ,dsetrank,iparallel,.false.) + if (associated(cgrid%dmean_nep )) & call hdf_getslab_r(cgrid%dmean_nep (ipy:ipy) ,'DMEAN_NEP ' & ,dsetrank,iparallel,.false.) - if (associated(cgrid%dmean_nee )) & - call hdf_getslab_r(cgrid%dmean_nee (ipy:ipy) ,'DMEAN_NEE ' & + if (associated(cgrid%dmean_carbon_ac )) & + call hdf_getslab_r(cgrid%dmean_carbon_ac (ipy:ipy) ,'DMEAN_CARBON_AC ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%dmean_carbon_st )) & + call hdf_getslab_r(cgrid%dmean_carbon_st (ipy:ipy) ,'DMEAN_CARBON_ST ' & ,dsetrank,iparallel,.false.) if (associated(cgrid%dmean_plresp )) & @@ -909,8 +931,28 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%mmean_nep (ipy:ipy) ,'MMEAN_NEP ' & ,dsetrank,iparallel,.false.) - if (associated(cgrid%mmean_nee )) & - call hdf_getslab_r(cgrid%mmean_nee (ipy:ipy) ,'MMEAN_NEE ' & + if (associated(cgrid%mmean_ustar )) & + call hdf_getslab_r(cgrid%mmean_ustar (ipy:ipy) ,'MMEAN_USTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmean_tstar )) & + call hdf_getslab_r(cgrid%mmean_tstar (ipy:ipy) ,'MMEAN_TSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmean_qstar )) & + call hdf_getslab_r(cgrid%mmean_qstar (ipy:ipy) ,'MMEAN_QSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmean_cstar )) & + call hdf_getslab_r(cgrid%mmean_cstar (ipy:ipy) ,'MMEAN_CSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmean_carbon_ac )) & + call hdf_getslab_r(cgrid%mmean_carbon_ac (ipy:ipy) ,'MMEAN_CARBON_AC ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmean_carbon_st )) & + call hdf_getslab_r(cgrid%mmean_carbon_st (ipy:ipy) ,'MMEAN_CARBON_ST ' & ,dsetrank,iparallel,.false.) if (associated(cgrid%mmean_plresp )) & @@ -1089,8 +1131,12 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%mmsqu_plresp (ipy:ipy) ,'MMSQU_PLRESP ' & ,dsetrank,iparallel,.false.) - if (associated(cgrid%mmsqu_nee )) & - call hdf_getslab_r(cgrid%mmsqu_nee (ipy:ipy) ,'MMSQU_NEE ' & + if (associated(cgrid%mmsqu_carbon_ac )) & + call hdf_getslab_r(cgrid%mmsqu_carbon_ac (ipy:ipy) ,'MMSQU_CARBON_AC ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%mmsqu_carbon_st )) & + call hdf_getslab_r(cgrid%mmsqu_carbon_st (ipy:ipy) ,'MMSQU_CARBON_ST ' & ,dsetrank,iparallel,.false.) if (associated(cgrid%mmsqu_nep )) & @@ -1264,12 +1310,32 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%qmean_vapor_ac (:,ipy) ,'QMEAN_VAPOR_AC ' & ,dsetrank,iparallel,.false.) + if (associated(cgrid%qmean_ustar )) & + call hdf_getslab_r(cgrid%qmean_ustar (:,ipy) ,'QMEAN_USTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%qmean_tstar )) & + call hdf_getslab_r(cgrid%qmean_tstar (:,ipy) ,'QMEAN_TSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%qmean_qstar )) & + call hdf_getslab_r(cgrid%qmean_qstar (:,ipy) ,'QMEAN_QSTAR ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%qmean_cstar )) & + call hdf_getslab_r(cgrid%qmean_cstar (:,ipy) ,'QMEAN_CSTAR ' & + ,dsetrank,iparallel,.false.) + if (associated(cgrid%qmean_nep )) & call hdf_getslab_r(cgrid%qmean_nep (:,ipy) ,'QMEAN_NEP ' & ,dsetrank,iparallel,.false.) - if (associated(cgrid%qmean_nee )) & - call hdf_getslab_r(cgrid%qmean_nee (:,ipy) ,'QMEAN_NEE ' & + if (associated(cgrid%qmean_carbon_ac )) & + call hdf_getslab_r(cgrid%qmean_carbon_ac (:,ipy) ,'QMEAN_CARBON_AC ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%qmean_carbon_st )) & + call hdf_getslab_r(cgrid%qmean_carbon_st (:,ipy) ,'QMEAN_CARBON_ST ' & ,dsetrank,iparallel,.false.) if (associated(cgrid%qmean_plresp )) & @@ -1424,8 +1490,12 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cgrid%qmsqu_plresp (:,ipy) ,'QMSQU_PLRESP ' & ,dsetrank,iparallel,.false.) - if (associated(cgrid%qmsqu_nee )) & - call hdf_getslab_r(cgrid%qmsqu_nee (:,ipy) ,'QMSQU_NEE ' & + if (associated(cgrid%qmsqu_carbon_ac)) & + call hdf_getslab_r(cgrid%qmsqu_carbon_ac (:,ipy) ,'QMSQU_CARBON_AC ' & + ,dsetrank,iparallel,.false.) + + if (associated(cgrid%qmsqu_carbon_st)) & + call hdf_getslab_r(cgrid%qmsqu_carbon_st (:,ipy) ,'QMSQU_CARBON_ST ' & ,dsetrank,iparallel,.false.) if (associated(cgrid%qmsqu_nep )) & @@ -1722,6 +1792,7 @@ end subroutine hdf_getslab_i call hdf_getslab_i(cpoly%sitenum,'SITENUM ',dsetrank,iparallel,.true.) call hdf_getslab_i(cpoly%lsl,'LSL_SI ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%ncol_soil,'NCOL_SOIL_SI ',dsetrank,iparallel,.true.) call hdf_getslab_r(cpoly%area,'AREA_SI ',dsetrank,iparallel,.true.) call hdf_getslab_r(cpoly%patch_area,'PATCH_AREA ',dsetrank,iparallel,.true.) call hdf_getslab_r(cpoly%elevation,'ELEVATION ',dsetrank,iparallel,.true.) @@ -1850,22 +1921,6 @@ end subroutine hdf_getslab_i call hdf_getslab_r(cpoly%lambda_fire,'LAMBDA_FIRE ',dsetrank,iparallel,.true.) - dsetrank = 2_8 - globdims(1) = int(n_dist_types,8) - chnkdims(1) = int(n_dist_types,8) - memdims(1) = int(n_dist_types,8) - memsize(1) = int(n_dist_types,8) - chnkoffs(1) = 0_8 - memoffs(1) = 0_8 - globdims(2) = int(nsites_global,8) - chnkdims(2) = int(cpoly%nsites,8) - chnkoffs(2) = int(pysi_index - 1,8) - memdims(2) = int(cpoly%nsites,8) - memsize(2) = int(cpoly%nsites,8) - memoffs(2) = 0_8 - - call hdf_getslab_r(cpoly%loss_fraction,'LOSS_FRACTION ',dsetrank,iparallel,.true.) - dsetrank = 3_8 globdims(1:2) = int(n_dist_types,8) chnkdims(1:2) = int(n_dist_types,8) @@ -2042,6 +2097,7 @@ end subroutine hdf_getslab_i call hdf_getslab_r(csite%ground_fliq,'GROUND_FLIQ ',dsetrank,iparallel,.false.) call hdf_getslab_r(csite%rough,'ROUGH ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%avg_daily_temp,'AVG_DAILY_TEMP ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%avg_monthly_gndwater,'AVG_MONTHLY_GNDWATER ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%mean_rh,'MEAN_RH ',dsetrank,iparallel,.true.) if (associated(csite%dmean_rh )) & @@ -2112,6 +2168,12 @@ end subroutine hdf_getslab_i call hdf_getslab_r(csite%rshort_g,'RSHORT_G ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%rshort_g_beam,'RSHORT_G_BEAM ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%rshort_g_diffuse,'RSHORT_G_DIFFUSE ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%par_b,'PAR_B ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%par_b_beam,'PAR_B_BEAM ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%par_b_diffuse,'PAR_B_DIFFUSE ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%nir_b,'NIR_B ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%nir_b_beam,'NIR_B_BEAM ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%nir_b_diffuse,'NIR_B_DIFFUSE ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%rlong_g,'RLONG_G ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%rlong_g_surf,'RLONG_G_SURF ',dsetrank,iparallel,.true.) call hdf_getslab_r(csite%rlong_g_incid,'RLONG_G_INCID ',dsetrank,iparallel,.true.) diff --git a/ED/src/io/ed_load_namelist.f90 b/ED/src/io/ed_load_namelist.f90 index 7291ce8df..17efd0e7b 100644 --- a/ED/src/io/ed_load_namelist.f90 +++ b/ED/src/io/ed_load_namelist.f90 @@ -50,6 +50,7 @@ subroutine copy_nl(copy_type) use soil_coms , only : find_soil_class & ! function , isoilflg & ! intent(out) , nslcon & ! intent(out) + , isoilcol & ! intent(out) , slxclay & ! intent(out) , slxsand & ! intent(out) , slmstr & ! intent(out) @@ -62,7 +63,6 @@ subroutine copy_nl(copy_type) , soilstate_db & ! intent(out) , soildepth_db & ! intent(out) , runoff_time & ! intent(out) - , betapower & ! intent(out) , slz & ! intent(out) , veg_database ! ! intent(out) use met_driver_coms , only : ed_met_driver_db & ! intent(out) @@ -90,17 +90,32 @@ subroutine copy_nl(copy_type) , maxpatch & ! intent(out) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) - , istoma_scheme & ! intent(out) , h2o_plant_lim & ! intent(out) , n_plant_lim & ! intent(out) - , vmfact & ! intent(out) - , mfact & ! intent(out) - , kfact & ! intent(out) - , gamfact & ! intent(out) - , d0fact & ! intent(out) - , alphafact & ! intent(out) - , lwfact & ! intent(out) - , thioff & ! intent(out) + , vmfact_c3 & ! intent(out) + , vmfact_c4 & ! intent(out) + , mphoto_trc3 & ! intent(out) + , mphoto_tec3 & ! intent(out) + , mphoto_c4 & ! intent(out) + , bphoto_blc3 & ! intent(out) + , bphoto_nlc3 & ! intent(out) + , bphoto_c4 & ! intent(out) + , kw_grass & ! intent(out) + , kw_tree & ! intent(out) + , gamma_c3 & ! intent(out) + , gamma_c4 & ! intent(out) + , d0_grass & ! intent(out) + , d0_tree & ! intent(out) + , alpha_c3 & ! intent(out) + , alpha_c4 & ! intent(out) + , klowco2in & ! intent(out) + , rrffact & ! intent(out) + , growthresp & ! intent(out) + , lwidth_grass & ! intent(out) + , lwidth_bltree & ! intent(out) + , lwidth_nltree & ! intent(out) + , q10_c3 & ! intent(out) + , q10_c4 & ! intent(out) , quantum_efficiency_T ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -150,6 +165,7 @@ subroutine copy_nl(copy_type) , thsums_database & ! intent(out) , end_time & ! intent(out) , radfrq & ! intent(out) + , ivegt_dynamics & ! intent(out) , integration_scheme & ! intent(out) , ffilout & ! intent(out) , idoutput & ! intent(out) @@ -195,20 +211,25 @@ subroutine copy_nl(copy_type) use canopy_air_coms , only : icanturb & ! intent(out) , isfclyrm & ! intent(out) , ied_grndvap & ! intent(out) - , i_blyr_condct & ! intent(out) + , ubmin & ! intent(out) + , ugbmin & ! intent(out) , ustmin & ! intent(out) - , ggfact & ! intent(out) , gamm & ! intent(out) , gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc ! ! intent(out) use optimiz_coms , only : ioptinpt ! ! intent(out) use canopy_layer_coms , only : crown_mod ! ! intent(out) - use canopy_radiation_coms, only : ican_swrad ! ! intent(out) + use canopy_radiation_coms, only : icanrad & ! intent(out) + , ltrans_vis & ! intent(out) + , ltrans_nir & ! intent(out) + , lreflect_vis & ! intent(out) + , lreflect_nir & ! intent(out) + , orient_tree & ! intent(out) + , orient_grass & ! intent(out) + , clump_tree & ! intent(out) + , clump_grass ! ! intent(out) use rk4_coms , only : ibranch_thermo & ! intent(out) , ipercol & ! intent(out) , rk4_tolerance ! ! intent(out) @@ -277,6 +298,7 @@ subroutine copy_nl(copy_type) isoilflg = nl%isoilflg nslcon = nl%nslcon + isoilcol = nl%isoilcol slxclay = nl%slxclay slxsand = nl%slxsand slmstr(1:nzgmax) = nl%slmstr(1:nzgmax) @@ -308,27 +330,51 @@ subroutine copy_nl(copy_type) ed_reg_lonmin = nl%ed_reg_lonmin ed_reg_lonmax = nl%ed_reg_lonmax + ivegt_dynamics = nl%ivegt_dynamics integration_scheme = nl%integration_scheme rk4_tolerance = nl%rk4_tolerance ibranch_thermo = nl%ibranch_thermo iphysiol = nl%iphysiol - istoma_scheme = nl%istoma_scheme iallom = nl%iallom iphen_scheme = nl%iphen_scheme repro_scheme = nl%repro_scheme lapse_scheme = nl%lapse_scheme crown_mod = nl%crown_mod - ican_swrad = nl%ican_swrad + icanrad = nl%icanrad + ltrans_vis = nl%ltrans_vis + ltrans_nir = nl%ltrans_nir + lreflect_vis = nl%lreflect_vis + lreflect_nir = nl%lreflect_nir + orient_tree = nl%orient_tree + orient_grass = nl%orient_grass + clump_tree = nl%clump_tree + clump_grass = nl%clump_grass h2o_plant_lim = nl%h2o_plant_lim - vmfact = nl%vmfact - mfact = nl%mfact - kfact = nl%kfact - gamfact = nl%gamfact - d0fact = nl%d0fact - alphafact = nl%alphafact + vmfact_c3 = nl%vmfact_c3 + vmfact_c4 = nl%vmfact_c4 + mphoto_trc3 = nl%mphoto_trc3 + mphoto_tec3 = nl%mphoto_tec3 + mphoto_c4 = nl%mphoto_c4 + bphoto_blc3 = nl%bphoto_blc3 + bphoto_nlc3 = nl%bphoto_nlc3 + bphoto_c4 = nl%bphoto_c4 + kw_grass = nl%kw_grass + kw_tree = nl%kw_tree + gamma_c3 = nl%gamma_c3 + gamma_c4 = nl%gamma_c4 + d0_grass = nl%d0_grass + d0_tree = nl%d0_tree + alpha_c3 = nl%alpha_c3 + alpha_c4 = nl%alpha_c4 + klowco2in = nl%klowco2in + rrffact = nl%rrffact + growthresp = nl%growthresp + lwidth_grass = nl%lwidth_grass + lwidth_bltree = nl%lwidth_bltree + lwidth_nltree = nl%lwidth_nltree + q10_c3 = nl%q10_c3 + q10_c4 = nl%q10_c4 thetacrit = nl%thetacrit - lwfact = nl%lwfact - thioff = nl%thioff quantum_efficiency_T = nl%quantum_efficiency_T radint = nl%radint radslp = nl%radslp @@ -342,14 +388,11 @@ subroutine copy_nl(copy_type) LloydTaylor = nl%decomp_scheme == 1 icanturb = nl%icanturb - i_blyr_condct = nl%i_blyr_condct isfclyrm = nl%isfclyrm ied_grndvap = nl%ied_grndvap gamm = nl%gamm gamh = nl%gamh tprandtl = nl%tprandtl - vh2vr = nl%vh2vr - vh2dh = nl%vh2dh ribmax = nl%ribmax leaf_maxwhc = nl%leaf_maxwhc ipercol = nl%ipercol @@ -362,9 +405,9 @@ subroutine copy_nl(copy_type) treefall_disturbance_rate = nl%treefall_disturbance_rate time2canopy = nl%time2canopy runoff_time = nl%runoff_time - betapower = nl%betapower + ubmin = nl%ubmin + ugbmin = nl%ugbmin ustmin = nl%ustmin - ggfact = nl%ggfact !----- Print control parameters. ----------------------------------------------------! iprintpolys = nl%iprintpolys @@ -550,20 +593,6 @@ subroutine copy_nl(copy_type) !---------------------------------------------------------------------------------------! - - !----- Find von-Karman/Prandtl number ratio. -------------------------------------------! - if (tprandtl /= 0.0) then - vkopr = vonk / tprandtl - else - !------------------------------------------------------------------------------------! - ! It doesn't make sense, but tprandtl is wrong and the run will crash at ! - ! ed_opspec. ! - !------------------------------------------------------------------------------------! - vkopr = 0.0 - end if - !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! Check whether we must re-define the default soil type (nslcon) based on the ! ! fractions of sand and clay. ! diff --git a/ED/src/io/ed_opspec.F90 b/ED/src/io/ed_opspec.F90 index f4485ab85..1335b792a 100644 --- a/ED/src/io/ed_opspec.F90 +++ b/ED/src/io/ed_opspec.F90 @@ -1103,47 +1103,62 @@ subroutine ed_opspec_misc , iclobber & ! intent(in) , runtype & ! intent(in) , ied_init_mode & ! intent(in) + , ivegt_dynamics & ! intent(in) , integration_scheme & ! intent(in) , iallom & ! intent(in) , min_site_area ! ! intent(in) use canopy_air_coms , only : icanturb & ! intent(in) - , i_blyr_condct & ! intent(in) , isfclyrm & ! intent(in) , ied_grndvap & ! intent(in) + , ubmin & ! intent(in) + , ugbmin & ! intent(in) , ustmin & ! intent(in) - , ggfact & ! intent(in) , gamm & ! intent(in) , gamh & ! intent(in) , tprandtl & ! intent(in) - , vh2vr & ! intent(in) - , vh2dh & ! intent(in) , ribmax & ! intent(in) , leaf_maxwhc ! ! intent(in) use soil_coms , only : ed_nstyp & ! intent(in) + , ed_nscol & ! intent(in) , isoilflg & ! intent(in) , nslcon & ! intent(in) + , isoilcol & ! intent(in) , slxclay & ! intent(in) , slxsand & ! intent(in) , isoilstateinit & ! intent(in) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) , zrough & ! intent(in) - , betapower & ! intent(in) , runoff_time ! ! intent(in) use mem_polygons , only : maxsite ! ! intent(in) use grid_coms , only : ngrids ! ! intent(in) use physiology_coms , only : iphysiol & ! intent(in) - , istoma_scheme & ! intent(in) , h2o_plant_lim & ! intent(in) , n_plant_lim & ! intent(in) - , vmfact & ! intent(in) - , mfact & ! intent(in) - , kfact & ! intent(in) - , gamfact & ! intent(in) - , d0fact & ! intent(in) - , alphafact & ! intent(in) - , lwfact & ! intent(in) - , thioff & ! intent(in) + , vmfact_c3 & ! intent(in) + , vmfact_c4 & ! intent(in) + , mphoto_trc3 & ! intent(in) + , mphoto_tec3 & ! intent(in) + , mphoto_c4 & ! intent(in) + , bphoto_blc3 & ! intent(in) + , bphoto_nlc3 & ! intent(in) + , bphoto_c4 & ! intent(in) + , kw_grass & ! intent(in) + , kw_tree & ! intent(in) + , gamma_c3 & ! intent(in) + , gamma_c4 & ! intent(in) + , d0_grass & ! intent(in) + , d0_tree & ! intent(in) + , alpha_c3 & ! intent(in) + , alpha_c4 & ! intent(in) + , klowco2in & ! intent(in) + , rrffact & ! intent(in) + , growthresp & ! intent(in) + , lwidth_grass & ! intent(in) + , lwidth_bltree & ! intent(in) + , lwidth_nltree & ! intent(in) + , q10_c3 & ! intent(in) + , q10_c4 & ! intent(in) , quantum_efficiency_T ! ! intent(in) use decomp_coms , only : n_decomp_lim ! ! intent(in) use disturb_coms , only : include_fire & ! intent(in) @@ -1160,7 +1175,15 @@ subroutine ed_opspec_misc , agri_stock & ! intent(in) , plantation_stock ! ! intent(in) use canopy_layer_coms , only : crown_mod ! ! intent(in) - use canopy_radiation_coms , only : ican_swrad ! ! intent(in) + use canopy_radiation_coms , only : icanrad & ! intent(in) + , ltrans_vis & ! intent(in) + , ltrans_nir & ! intent(in) + , lreflect_vis & ! intent(in) + , lreflect_nir & ! intent(in) + , orient_tree & ! intent(in) + , orient_grass & ! intent(in) + , clump_tree & ! intent(in) + , clump_grass ! ! intent(in) use rk4_coms , only : ibranch_thermo & ! intent(in) , ipercol & ! intent(in) , rk4_tolerance ! ! intent(in) @@ -1308,6 +1331,14 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if + if (isoilcol < 1 .or. isoilcol > ed_nscol) then + write (reason,fmt='(2(a,1x,i4),a)') & + 'Invalid ISOILCOL, it must be between 1 and ',ed_nscol,'. Yours is set to' & + ,isoilcol,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + do ifm=1,ngrids if (isoilflg(ifm)==1 .and. slxclay>0. .and. slxclay<1. .and. slxsand>0. .and. slxsand<1.) then write (unit=*,fmt='(a)') '===========================================================' @@ -1408,6 +1439,14 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if + if (ivegt_dynamics < 0 .or. ivegt_dynamics > 1) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid IVEGT_DYNAMICS, it must be between 0 and 1. Yours is set to' & + ,ivegt_dynamics,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + !---------------------------------------------------------------------------------------! ! Integration scheme can be only 0 (Euler) or 1 (4th order Runge-Kutta). The ! ! branch thermodynamics is currently working only with Runge-Kutta, so we won't allow ! @@ -1418,9 +1457,9 @@ subroutine ed_opspec_misc !------------------------------------------------------------------------------------! ! Check the branch thermodynamics. ! !------------------------------------------------------------------------------------! - if (ibranch_thermo < 0 .or. ibranch_thermo > 3) then + if (ibranch_thermo < 0 .or. ibranch_thermo > 2) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid IBRANCH_THERMO, it must be between 0 and 3. Yours is set to' & + 'Invalid IBRANCH_THERMO, it must be between 0 and 2. Yours is set to' & ,ibranch_thermo,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 @@ -1453,17 +1492,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (istoma_scheme < 0 .or. istoma_scheme > 1) then - write (reason,fmt='(a,1x,i4,a)') & - 'Invalid ISTOMA_SCHEME, it must be between 0 and 1. Yours is set to' & - ,istoma_scheme,'...' - call opspec_fatal(reason,'opspec_misc') - ifaterr = ifaterr +1 - end if - - if (iallom < 0 .or. iallom > 4) then + if (iallom < 0 .or. iallom > 2) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid IALLOM, it must be between 0 and 4. Yours is set to' & + 'Invalid IALLOM, it must be between 0 and 2. Yours is set to' & ,iallom,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 @@ -1494,80 +1525,208 @@ subroutine ed_opspec_misc end if if (h2o_plant_lim < 0 .or. h2o_plant_lim > 2) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid H2O_PLANT_LIM, it must be between 0 and 2. Yours is set to' & + 'Invalid H2O_PLANT_LIM, it must be between 0 and 2. Yours is set to' & ,h2o_plant_lim,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - if (vmfact < 0. .or. vmfact > 100.) then + if (vmfact_c3 < 0.01 .or. vmfact_c3 > 100.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid VMFACT, it must be between 0 and 100. Yours is set to' & - ,vmfact,'...' + 'Invalid VMFACT_C3, it must be between 0.01 and 100. Yours is set to' & + ,vmfact_c3,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - - if (kfact < 0. .or. kfact > 100.) then + + if (vmfact_c4 < 0.01 .or. vmfact_c4 > 100.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid KFACT, it must be between 0 and 100. Yours is set to' & - ,kfact,'...' + 'Invalid VMFACT_C4, it must be between 0.01 and 100. Yours is set to' & + ,vmfact_c4,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - - if (mfact < 0. .or. mfact > 100.) then + + if (mphoto_trc3 < 0.1 .or. mphoto_trc3 > 20.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid MFACT, it must be between 0 and 100. Yours is set to' & - ,mfact,'...' + 'Invalid MPHOTO_TRC3, it must be between 0.1 and 20. Yours is set to' & + ,mphoto_trc3,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - - if (gamfact < 0. .or. gamfact > 100.) then + + if (mphoto_tec3 < 0.1 .or. mphoto_tec3 > 20.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid MPHOTO_TEC3, it must be between 0.1 and 20. Yours is set to' & + ,mphoto_trc3,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (mphoto_c4 < 0.1 .or. mphoto_c4 > 20.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid MPHOTO_C4, it must be between 0.1 and 20. Yours is set to' & + ,mphoto_c4,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (bphoto_blc3 < 500. .or. bphoto_blc3 > 50000.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid BPHOTO_BLC3, it must be between 500. and 50000. Yours is set to' & + ,bphoto_blc3,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (bphoto_nlc3 < 500. .or. bphoto_nlc3 > 50000.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid BPHOTO_NLC3, it must be between 500. and 50000. Yours is set to' & + ,bphoto_nlc3,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (bphoto_c4 < 500. .or. bphoto_c4 > 50000.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid BPHOTO_C4, it must be between 500. and 50000. Yours is set to' & + ,bphoto_c4,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (kw_grass < 15. .or. kw_grass > 15000.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid GAMFACT, it must be between 0 and 100. Yours is set to' & - ,gamfact,'...' + 'Invalid KW_GRASS, it must be between 15 and 15000. Yours is set to' & + ,kw_grass,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - if (d0fact < 0.01 .or. d0fact > 100.) then + if (kw_tree < 15. .or. kw_tree > 15000.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid KW_TREE, it must be between 15 and 15000. Yours is set to' & + ,kw_tree,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (gamma_c3 < 0.001 .or. gamma_c3 > 0.10) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid GAMMA_C3, it must be between 0.001 and 0.1. Yours is set to' & + ,gamma_c3,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (gamma_c4 < 0.001 .or. gamma_c4 > 0.10) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid D0FACT, it must be between 0.01 and 100. Yours is set to' & - ,d0fact,'...' + 'Invalid GAMMA_C4, it must be between 0.001 and 0.1. Yours is set to' & + ,gamma_c4,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (d0_grass < 0.01 .or. d0_grass > 1.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid D0_GRASS, it must be between 0.01 and 1. Yours is set to' & + ,d0_grass,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (d0_tree < 0.01 .or. d0_tree > 1.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid D0_TREE, it must be between 0.01 and 1. Yours is set to' & + ,d0_tree,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - if (alphafact < 0.1 .or. d0fact > 10.) then + if (alpha_c3 < 0.001 .or. alpha_c3 > 1.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid ALPHA_C3, it must be between 0.001 and 1. Yours is set to' & + ,alpha_c3,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (alpha_c4 < 0.001 .or. alpha_c4 > 1.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid ALPHA_C4, it must be between 0.001 and 1. Yours is set to' & + ,alpha_c4,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (klowco2in < 10. .or. klowco2in > 1000000.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid KLOWCO2IN, it must be between 10. and 1.e6. Yours is set to' & + ,klowco2in,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (rrffact < 0.1 .or. rrffact > 10.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid ALPHAFACT, it must be between 0.1 and 10. Yours is set to' & - ,alphafact,'...' + 'Invalid RRFFACT, it must be between 0.1 and 10. Yours is set to' & + ,rrffact,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (growthresp < 0.0 .or. growthresp > 1.0) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid GROWTHRESP, it must be between 0 and 1. Yours is set to' & + ,growthresp,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (lwidth_grass < 0.01 .or. lwidth_grass > 0.30) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid LWIDTH_GRASS, it must be between 0.01 and 0.30 Yours is set to' & + ,lwidth_grass,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (lwidth_bltree < 0.01 .or. lwidth_bltree > 0.30) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid LWIDTH_BLTREE, it must be between 0.01 and 0.30 Yours is set to' & + ,lwidth_bltree,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (lwidth_nltree < 0.01 .or. lwidth_nltree > 0.30) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid LWIDTH_NLTREE, it must be between 0.01 and 0.30 Yours is set to' & + ,lwidth_nltree,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - if (thetacrit < 0. .or. thetacrit > 1.) then + if (q10_c3 < 1.0 .or. q10_c3 > 10.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid THETACRIT, it must be between 0 and 1. Yours is set to' & - ,thetacrit,'...' + 'Invalid Q10_C3, it must be between 1.0 and 10. Yours is set to' & + ,q10_c3,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - if (lwfact < 0. .or. lwfact > 100.) then + if (q10_c4 < 1.0 .or. q10_c4 > 10.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid LWFACT, it must be between 0 and 100. Yours is set to' & - ,lwfact,'...' + 'Invalid Q10_C4, it must be between 1.0 and 10. Yours is set to' & + ,q10_c4,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if - - if (thioff < -20. .or. thioff > 20.) then + + if (thetacrit < -1.49 .or. thetacrit > 1.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid THIOFF, it must be between -20 and 20. Yours is set to' & - ,lwfact,'...' + 'Invalid THETACRIT, it must be between -1.49 and 1. Yours is set to' & + ,thetacrit,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if @@ -1604,9 +1763,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (sm_fire < 0. .or. sm_fire > 1.) then + if (sm_fire < -3.1 .or. sm_fire > 1.) then write (reason,fmt='(a,1x,es12.5,a)') & - 'Invalid SM_FIRE, it must be between 0 and 1. Yours is set to' & + 'Invalid SM_FIRE, it must be between -3.1 and 1. Yours is set to' & ,sm_fire,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 @@ -1620,23 +1779,15 @@ subroutine ed_opspec_misc end if select case (icanturb) - case (0:3) + case (0:4) continue case default write (reason,fmt='(a,1x,i4,a)') & - 'Invalid ICANTURB, it must be between 0 and 3. Yours is set to',icanturb,'...' + 'Invalid ICANTURB, it must be between 0 and 4. Yours is set to',icanturb,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end select - if (i_blyr_condct < 0 .or. i_blyr_condct > 2) then - write (reason,fmt='(a,1x,i4,a)') & - 'Invalid I_BLYR_CONDCT, it must be between 0 and 2. Yours is set to' & - ,i_blyr_condct,'...' - call opspec_fatal(reason,'opspec_misc') - ifaterr = ifaterr +1 - end if - if (isfclyrm < 1 .or. isfclyrm > 5) then write (reason,fmt='(a,1x,i4,a)') & 'Invalid ISFCLYRM, it must be between 1 and 5. Yours is set to',isfclyrm,'...' @@ -1644,9 +1795,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (ied_grndvap < 0 .or. ied_grndvap > 4) then + if (ied_grndvap < 0 .or. ied_grndvap > 5) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid IED_GRNDVAP, it must be between 0 and 4. Yours is set to',ied_grndvap & + 'Invalid IED_GRNDVAP, it must be between 0 and 5. Yours is set to',ied_grndvap & ,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 @@ -1737,25 +1888,109 @@ subroutine ed_opspec_misc call opspec_fatal(reason,'opspec_misc') end if - if (crown_mod < 0 .or. crown_mod > 2) then + if (crown_mod < 0 .or. crown_mod > 1) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid CROWN_MOD, it must be between 0 and 2. Yours is set to' & + 'Invalid CROWN_MOD, it must be between 0 or 1. Yours is set to' & ,crown_mod,'...' ifaterr = ifaterr +1 call opspec_fatal(reason,'opspec_misc') end if - if (ican_swrad == 0 .and. crown_mod == 2) then - write (reason,fmt='(a)') 'You cannot run with ICAN_SWRAD = 0 and CROWN_MOD = 2.' + if (icanrad <0 .or. icanrad > 1) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid ICANRAD, it must be between 0 or 1. Yours is set to' & + ,icanrad,'...' ifaterr = ifaterr +1 call opspec_fatal(reason,'opspec_misc') - elseif (ican_swrad <0 .or. ican_swrad > 1) then - write (reason,fmt='(a,1x,i4,a)') & - 'Invalid CROWN_MOD, it must be between 0 and 2. Yours is set to' & - ,crown_mod,'...' + end if + + if (ltrans_vis < 0.01 .or. ltrans_vis > 0.99) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid LTRANS_VIS, it must be between 0.01 and 0.99.' & + ,'Yours is set to',ltrans_vis,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (ltrans_nir < 0.01 .or. ltrans_nir > 0.99) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid LTRANS_NIR, it must be between 0.01 and 0.99.' & + ,'Yours is set to',ltrans_nir,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (lreflect_vis < 0.01 .or. lreflect_vis > 0.99) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid LREFLECT_VIS, it must be between 0.01 and 0.99.' & + ,'Yours is set to',lreflect_vis,'...' ifaterr = ifaterr +1 call opspec_fatal(reason,'opspec_misc') end if + + if (lreflect_nir < 0.01 .or. lreflect_nir > 0.99) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid LREFLECT_NIR, it must be between 0.01 and 0.99.' & + ,'Yours is set to',lreflect_nir,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (lreflect_vis + ltrans_vis > 0.99) then + write (unit=*,fmt='(a,1x,es12.5)') ' LTRANS_VIS = ',ltrans_vis + write (unit=*,fmt='(a,1x,es12.5)') ' LREFLECT_VIS = ',lreflect_vis + write (unit=*,fmt='(a,1x,es12.5)') ' LABSORPT_VIS = ',1. - ltrans_vis - lreflect_vis + write (reason,fmt='(a,2x,a)') & + 'LTRANS_VIS + LREFLECT_VIS cannot exceed 0.99.' & + ,'This causes absorptance to be weird (a bad thing).' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (lreflect_nir + ltrans_nir > 0.99) then + write (unit=*,fmt='(a,1x,es12.5)') ' LTRANS_NIR = ',ltrans_nir + write (unit=*,fmt='(a,1x,es12.5)') ' LREFLECT_NIR = ',lreflect_nir + write (unit=*,fmt='(a,1x,es12.5)') ' LABSORPT_NIR = ',1. - ltrans_nir - lreflect_nir + write (reason,fmt='(a,2x,a)') & + 'LTRANS_NIR + LREFLECT_NIR cannot exceed 0.99.' & + ,'This causes absorptance to be weird (a bad thing).' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (orient_tree < -0.40 .or. orient_tree > 0.60) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid ORIENT_TREE, it must be between -0.40 and 0.60.' & + ,'Yours is set to',orient_tree,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (orient_grass < -0.40 .or. orient_grass > 0.60) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid ORIENT_GRASS, it must be between -0.40 and 0.60.' & + ,'Yours is set to',orient_grass,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (clump_tree < 0.01 .or. clump_tree > 1.00) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid CLUMP_TREE, it must be between 0.01 and 1.00.' & + ,'Yours is set to',clump_tree,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (clump_grass < 0.01 .or. clump_grass > 1.00) then + write (reason,fmt='(a,2x,a,1x,es12.5,a)') & + 'Invalid CLUMP_GRASS, it must be between 0.01 and 1.00.' & + ,'Yours is set to',clump_grass,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (zrough <= 0.0) then write (reason,fmt='(a,1x,es14.7,a)') & @@ -1798,10 +2033,10 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (betapower < 0.0 .or. betapower > 10.0) then + if (ubmin < 0.0001 .or. ubmin > 2.0) then write (reason,fmt='(a,1x,es14.7,a)') & - 'Invalid BETAPOWER, it must be between 0.0 and 10.0. Yours is set to' & - ,betapower,'...' + 'Invalid UBMIN, it must be between 0.0001 and 2.0. Yours is set to' & + ,ustmin,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if @@ -1812,12 +2047,20 @@ subroutine ed_opspec_misc ,ustmin,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 + elseif (ustmin > ubmin) then + write (unit=*,fmt='(a,1x,es12.5)') ' UBMIN = ',ubmin + write (unit=*,fmt='(a,1x,es12.5)') ' UGBMIN = ',ugbmin + write (unit=*,fmt='(a,1x,es12.5)') ' USTMIN = ',ustmin + write (reason,fmt='(a)') 'Invalid USTMIN, it can''t be greater than UBMIN...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 end if - - if (ggfact < 0.0 .or. ggfact > 100.0) then - write (reason,fmt='(a,1x,es14.7,a)') & - 'Invalid GGFACT, it must be between 0.0 and 100.0. Yours is set to' & - ,ggfact,'...' + + if (ugbmin < ustmin .or. ugbmin > ubmin) then + write (unit=*,fmt='(a,1x,es12.5)') ' UBMIN = ',ubmin + write (unit=*,fmt='(a,1x,es12.5)') ' UGBMIN = ',ugbmin + write (unit=*,fmt='(a,1x,es12.5)') ' USTMIN = ',ustmin + write (reason,fmt='(a)') 'Invalid UGBMIN, it can''t be between USTMIN and UBMIN...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if @@ -1846,25 +2089,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (vh2vr < 0.001 .or. vh2vr > 0.99) then - write (reason,fmt='(a,1x,es14.7,a)') & - 'Invalid VH2VR, it must be between 0.001 and 0.99. Yours is set to' & - ,vh2vr,'...' - call opspec_fatal(reason,'opspec_misc') - ifaterr = ifaterr +1 - end if - - if (vh2dh < 0.0 .or. vh2dh > 0.99) then - write (reason,fmt='(a,1x,es14.7,a)') & - 'Invalid VH2DH, it must be between 0.0 and 0.99. Yours is set to' & - ,vh2dh,'...' - call opspec_fatal(reason,'opspec_misc') - ifaterr = ifaterr +1 - end if - - if (ribmax < 0.01 .or. ribmax > 20.) then + if (ribmax < 0.01 .or. ribmax > 1.0) then write (reason,fmt='(a,1x,es14.7,a)') & - 'Invalid RIBMAX, it must be between 0.01 and 20.. Yours is set to' & + 'Invalid RIBMAX, it must be between 0.01 and 1.0.. Yours is set to' & ,ribmax,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 @@ -1887,9 +2114,9 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 call opspec_fatal(reason,'opspec_misc') end if - if (imetavg < -1 .and. imetavg > 3) then + if (imetavg < -1 .or. imetavg > 3) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid IMETAVG, it must be between -1 and 3. Yours is set to' & + 'Invalid IMETAVG, it must be between -1 and 3. Yours is set to' & ,imetavg,'...' ifaterr = ifaterr +1 call opspec_fatal(reason,'opspec_misc') diff --git a/ED/src/io/ed_read_ed10_20_history.f90 b/ED/src/io/ed_read_ed10_20_history.f90 index 8a9a64dfc..02dbdde41 100644 --- a/ED/src/io/ed_read_ed10_20_history.f90 +++ b/ED/src/io/ed_read_ed10_20_history.f90 @@ -18,10 +18,11 @@ subroutine read_ed10_ed20_history_file , q & ! intent(in) , qsw & ! intent(in) , hgt_min & ! intent(in) + , min_dbh & ! intent(in) + , min_bdead & ! intent(in) , is_grass & ! intent(in) , include_pft & ! intent(in) , include_pft_ag & ! intent(in) - , phenology & ! intent(in) , pft_1st_check & ! intent(in) , include_these_pft ! ! intent(in) use ed_misc_coms , only : sfilin & ! intent(in) @@ -200,6 +201,7 @@ subroutine read_ed10_ed20_history_file cgrid%ntext_soil(2,ipy) = 2 cgrid%ntext_soil(3,ipy) = 3 cgrid%ntext_soil(4,ipy) = 3 + cgrid%ncol_soil(ipy) = 10 end if @@ -242,15 +244,11 @@ subroutine read_ed10_ed20_history_file !----- Read the other information from the header (if there is any...). -------! nwater = 1 - select case (ied_init_mode) - case (1) + if (ied_init_mode == 1 ) then read (unit=12,fmt=*) cdum,nwater read (unit=12,fmt=*) cdum,depth(1:nwater) read (unit=12,fmt=*) - - case (2) - ! read(unit=12,fmt=*)!water patch - end select + end if !------------------------------------------------------------------------------! ! Now we loop over all patches and decide whether they should be included ! @@ -666,7 +664,7 @@ subroutine read_ed10_ed20_history_file select case(ied_init_mode) case (6) !----- Inventory. Read DBH and find the other stuff. ----------! - cpatch%dbh(ic2) = dbh(ic) + cpatch%dbh(ic2) = max(dbh(ic),min_dbh(ipft(ic))) cpatch%hite(ic2) = dbh2h(ipft(ic),dbh(ic)) cpatch%bdead(ic2) = dbh2bd(dbh(ic),ipft(ic)) @@ -679,7 +677,7 @@ subroutine read_ed10_ed20_history_file ! equations. ! !---------------------------------------------------------------! if (bdead(ic) > 0.0) then - cpatch%bdead(ic2) = bdead(ic) + cpatch%bdead(ic2) = max(bdead(ic),min_bdead(ipft(ic))) cpatch%dbh(ic2) = bd2dbh(ipft(ic),bdead(ic)) cpatch%hite(ic2) = dbh2h(ipft(ic),dbh(ic)) else diff --git a/ED/src/io/ed_read_ed21_history.F90 b/ED/src/io/ed_read_ed21_history.F90 index 37ccfc82b..ef8c9b750 100644 --- a/ED/src/io/ed_read_ed21_history.F90 +++ b/ED/src/io/ed_read_ed21_history.F90 @@ -16,10 +16,11 @@ subroutine read_ed21_history_file , q & ! intent(in) , qsw & ! intent(in) , hgt_min & ! intent(in) + , min_dbh & ! intent(in) + , min_bdead & ! intent(in) , is_grass & ! intent(in) , include_pft & ! intent(in) , include_pft_ag & ! intent(in) - , phenology & ! intent(in) , pft_1st_check & ! intent(in) , include_these_pft ! ! intent(in) use ed_misc_coms , only : sfilin & ! intent(in) @@ -323,6 +324,7 @@ subroutine read_ed21_history_file !---- The ipy:ipy notation is needed for ifort when checking interfaces. ---------! call hdf_getslab_i(cgrid%load_adjacency(ipy:ipy),'LOAD_ADJACENCY ' & ,dsetrank,iparallel,.true.) + call hdf_getslab_i(cgrid%ncol_soil(ipy:ipy),'NCOL_SOIL ',dsetrank,iparallel,.true.) call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.) !----- Load the workload (2D). ---------------------------------------------------! @@ -333,11 +335,11 @@ subroutine read_ed21_history_file memsize(1) = int(13,8) chnkoffs(1) = 0_8 memoffs(1) = 0_8 - globdims(2) = int(pysi_n(py_index),8) - chnkdims(2) = int(pysi_n(py_index),8) - memdims(2) = int(pysi_n(py_index),8) - memsize(2) = int(pysi_n(py_index),8) - chnkoffs(2) = 0_8 + globdims(2) = int(dset_npolygons_global,8) + chnkdims(2) = 1_8 + chnkoffs(2) = int(py_index - 1,8) + memdims(2) = 1_8 + memsize(2) = 1_8 memoffs(2) = 0_8 call hdf_getslab_r(cgrid%workload(:,ipy),'WORKLOAD ',dsetrank,iparallel,.false.) !---------------------------------------------------------------------------------! @@ -352,12 +354,12 @@ subroutine read_ed21_history_file memsize(1) = int(1,8) ! On both sides chnkoffs(1) = int(dset_nzg - 1,8) ! Take the top layer, not the bottom memoffs(1) = 0_8 - globdims(2) = int(pysi_n(py_index),8) - chnkdims(2) = int(pysi_n(py_index),8) - memdims(2) = int(pysi_n(py_index),8) - memsize(2) = int(pysi_n(py_index),8) - chnkoffs(2) = 0_8 - memoffs(2) = 0_8 + globdims(2) = int(dset_npolygons_global,8) + chnkdims(2) = 1_8 + memdims(2) = 1_8 + memsize(2) = 1_8 + chnkoffs(2) = int(py_index - 1,8) + memoffs(2) = 0_8 call hdf_getslab_i(cgrid%ntext_soil(nzg:nzg,ipy),'NTEXT_SOIL ',dsetrank & ,iparallel,.true.) !----- Now fill the soil column based on the top layer data. ---------------------! @@ -396,15 +398,16 @@ subroutine read_ed21_history_file memdims(1) = int(cpoly%nsites,8) memsize(1) = int(cpoly%nsites,8) memoffs(1) = 0_8 - - call hdf_getslab_r(cpoly%area ,'AREA_SI ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_f ,'MOIST_F ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_W ,'MOIST_W ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%elevation ,'ELEVATION ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%slope ,'SLOPE ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%aspect ,'ASPECT ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%TCI ,'TCI ' ,dsetrank,iparallel,.true.) - call hdf_getslab_i(cpoly%patch_count,'PATCH_COUNT ',dsetrank,iparallel,.true.) + + call hdf_getslab_r(cpoly%area ,'AREA_SI ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%moist_f ,'MOIST_F ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%moist_W ,'MOIST_W ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%elevation ,'ELEVATION ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%slope ,'SLOPE ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%aspect ,'ASPECT ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%TCI ,'TCI ' ,dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%patch_count,'PATCH_COUNT ' ,dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%ncol_soil ,'NCOL_SOIL_SI ',dsetrank,iparallel,.true.) !----- Load 2D dataset. ----------------------------------------------------------! dsetrank = 2_8 @@ -549,9 +552,11 @@ subroutine read_ed21_history_file ipft = cpatch%pft(ico) if (cpatch%bdead(ico) > 0.0) then + cpatch%bdead(ico) = max(cpatch%bdead(ico),min_bdead(ipft)) cpatch%dbh(ico) = bd2dbh(cpatch%pft(ico),cpatch%bdead(ico)) cpatch%hite(ico) = dbh2h (cpatch%pft(ico),cpatch%dbh (ico)) else + cpatch%dbh(ico) = max(cpatch%dbh(ico),min_dbh(ipft)) cpatch%hite(ico) = dbh2h (cpatch%pft(ico),cpatch%dbh (ico)) cpatch%bdead(ico) = dbh2bd(cpatch%dbh(ico),cpatch%pft (ico)) end if @@ -799,10 +804,11 @@ subroutine read_ed21_history_unstruct , q & ! intent(in) , qsw & ! intent(in) , hgt_min & ! intent(in) + , min_dbh & ! intent(in) + , min_bdead & ! intent(in) , is_grass & ! intent(in) , include_pft & ! intent(in) , include_pft_ag & ! intent(in) - , phenology & ! intent(in) , pft_1st_check & ! intent(in) , include_these_pft & ! intent(in) , min_cohort_size ! ! intent(in) @@ -1315,11 +1321,11 @@ subroutine read_ed21_history_unstruct memsize(1) = int(13,8) chnkoffs(1) = 0_8 memoffs(1) = 0_8 - globdims(2) = int(pysi_n(py_index),8) - chnkdims(2) = int(pysi_n(py_index),8) - memdims(2) = int(pysi_n(py_index),8) - memsize(2) = int(pysi_n(py_index),8) - chnkoffs(2) = 0_8 + globdims(2) = int(dset_npolygons_global,8) + chnkdims(2) = 1_8 + chnkoffs(2) = int(py_index - 1,8) + memdims(2) = 1_8 + memsize(2) = 1_8 memoffs(2) = 0_8 call hdf_getslab_r(cgrid%workload(:,ipy),'WORKLOAD ',dsetrank & ,iparallel,.false.) @@ -1611,14 +1617,16 @@ subroutine read_ed21_history_unstruct ipft = cpatch%pft(ico) if (cpatch%bdead(ico) > 0.0) then - cpatch%dbh(ico) = bd2dbh(cpatch%pft(ico),cpatch%bdead(ico)) - cpatch%hite(ico) = dbh2h (cpatch%pft(ico),cpatch%dbh (ico)) + cpatch%bdead(ico) = max(cpatch%bdead(ico),min_bdead(ipft)) + cpatch%dbh(ico) = bd2dbh(ipft,cpatch%bdead(ico)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) else - cpatch%hite(ico) = dbh2h (cpatch%pft(ico),cpatch%dbh (ico)) - cpatch%bdead(ico) = dbh2bd(cpatch%dbh(ico),cpatch%pft (ico)) + cpatch%dbh(ico) = max(cpatch%dbh(ico),min_dbh(ipft)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdead(ico) = dbh2bd(cpatch%dbh (ico),ipft) end if - cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),cpatch%pft(ico)) + cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),ipft) !----- Find the other pools. -----------------------------------! salloc = (1.0 + q(ipft) + qsw(ipft) * cpatch%hite(ico)) diff --git a/ED/src/io/ed_xml_config.f90 b/ED/src/io/ed_xml_config.f90 index a266bb21b..b31d249cf 100644 --- a/ED/src/io/ed_xml_config.f90 +++ b/ED/src/io/ed_xml_config.f90 @@ -140,6 +140,8 @@ recursive subroutine read_ed_xml_config(filename) call getConfigSTRING ('history_out_filepath','misc',i,cval,texist) if(texist) sfilout = trim(cval) + call getConfigINT ('ivegt_dynamics','misc',i,ival,texist) + if(texist) ivegt_dynamics = ival call getConfigINT ('integration_scheme','misc',i,ival,texist) if(texist) integration_scheme = ival @@ -211,18 +213,22 @@ recursive subroutine read_ed_xml_config(filename) call getConfigREAL ('SLA','pft',i,rval,texist) if(texist) SLA(myPFT) = real(rval) call getConfigREAL ('b1Bl','pft',i,rval,texist) - if(texist) b1Bl(myPFT) = real(rval) + if (texist) then + b1Bl(myPFT) = real(rval) + end if call getConfigREAL ('b2Bl','pft',i,rval,texist) - if(texist) b2Bl(myPFT) = real(rval) + if (texist) then + b2Bl(myPFT) = real(rval) + end if call getConfigREAL ('b1Bs','pft',i,rval,texist) if (texist) then b1Bs_small(myPFT) = real(rval) - b1Bs_big(myPFT) = real(rval) + b1Bs_large(myPFT) = real(rval) end if call getConfigREAL ('b2Bs','pft',i,rval,texist) if (texist) then b2Bs_small(myPFT) = real(rval) - b2Bs_big (myPFT) = real(rval) + b2Bs_large(myPFT) = real(rval) end if call getConfigREAL ('b1Ht','pft',i,rval,texist) if(texist) b1Ht(myPFT) = real(rval) @@ -288,8 +294,8 @@ recursive subroutine read_ed_xml_config(filename) if(texist) c2n_recruit(myPFT) = real(rval) !!$ call getConfigREAL ('c2n_storage','pft',i,rval,texist) !!$ if(texist) c2n_storage(myPFT) = real(rval) - call getConfigREAL ('max_dbh','pft',i,rval,texist) - if(texist) max_dbh(myPFT) = real(rval) + call getConfigREAL ('dbh_crit','pft',i,rval,texist) + if(texist) dbh_crit(myPFT) = real(rval) call getConfigREAL ('rho','pft',i,rval,texist) if(texist) rho(myPFT) = real(rval) call getConfigREAL ('D0','pft',i,rval,texist) @@ -361,7 +367,7 @@ recursive subroutine read_ed_xml_config(filename) call getConfigREAL ('C2B','pftconst',i,rval,texist) if(texist) C2B = real(rval) call getConfigREAL ('agf_bs','pftconst',i,rval,texist) - if(texist) agf_bs = real(rval) + if(texist) agf_bs(:) = real(rval) call getConfigREAL ('frost_mort','pftconst',i,rval,texist) if(texist) frost_mort = real(rval) @@ -490,8 +496,6 @@ recursive subroutine read_ed_xml_config(filename) if(texist) rlong_min = real(rval) call getConfigREAL ('veg_temp_min','radiation',i,rval,texist) if(texist) rk4min_veg_temp = rval ! This is double precision. - call getConfigREAL ('mubar','radiation',i,rval,texist) - if(texist) mubar = rval call getConfigREAL ('visible_fraction','radiation',i,rval,texist) if(texist) visible_fraction = real(rval) call getConfigREAL ('visible_fraction_dir','radiation',i,rval,texist) @@ -701,7 +705,7 @@ recursive subroutine read_ed_xml_config(filename) call getConfigREAL ('retained_carbon_fraction','phenology',i,rval,texist) if(texist) retained_carbon_fraction = real(rval) call getConfigREAL ('theta_crit','phenology',i,rval,texist) - if(texist) theta_crit= real(rval) + if(texist) thetacrit= real(rval) call getConfigREAL ('dl_tr','phenology',i,rval,texist) if(texist) dl_tr = real(rval) call getConfigREAL ('st_tr1','phenology',i,rval,texist) @@ -742,8 +746,6 @@ recursive subroutine read_ed_xml_config(filename) call libxml2f90__ll_selecttag('DOWN','physiology',i) - call getConfigINT ('istoma_scheme','physiology',i,ival,texist) - if(texist) istoma_scheme = ival call getConfigINT ('n_plant_lim','physiology',i,ival,texist) if(texist) n_plant_lim = ival @@ -980,9 +982,7 @@ subroutine write_ed_xml_config call putConfigREAL("b1Bl",b1Bl(i)) call putConfigREAL("b2Bl",b2Bl(i)) call putConfigREAL("b1Bs",b1Bs_small(i)) - b1Bs_big(i) = b1Bs_big(i) call putConfigREAL("b2Bs",b2Bs_small(i)) - b2Bs_big(i) = b2Bs_big(i) call putConfigREAL("b1Ht",b1Ht(i)) call putConfigREAL("b2Ht",b2Ht(i)) call putConfigREAL("Vm0",Vm0(i)) @@ -1005,7 +1005,7 @@ subroutine write_ed_xml_config call putConfigREAL("qsw",qsw(i)) call putConfigREAL("c2n_leaf",c2n_leaf(i)) call putConfigREAL("c2n_recruit",c2n_recruit(i)) - call putConfigREAL("max_dbh",max_dbh(i)) + call putConfigREAL("dbh_crit",dbh_crit(i)) call putConfigREAL("rho",rho(i)) call putConfigREAL("D0",D0(i)) call putConfigREAL("mort1",mort1(i)) diff --git a/ED/src/io/edio.f90 b/ED/src/io/edio.f90 index d8b184a7e..c6d6362ed 100644 --- a/ED/src/io/edio.f90 +++ b/ED/src/io/edio.f90 @@ -453,9 +453,9 @@ subroutine spatial_averages cpoly%avg_rlong_gnd(isi) = sum(csite%avg_rlong_gnd * csite%area ) * site_area_i cpoly%avg_rlongup(isi) = sum(csite%avg_rlongup * csite%area ) * site_area_i cpoly%avg_carbon_ac(isi) = sum(csite%avg_carbon_ac * csite%area ) * site_area_i + cpoly%avg_carbon_st(isi) = sum(csite%avg_carbon_st * csite%area ) * site_area_i cpoly%avg_vapor_lc(isi) = sum(csite%avg_vapor_lc * csite%area ) * site_area_i cpoly%avg_vapor_wc(isi) = sum(csite%avg_vapor_wc * csite%area ) * site_area_i - cpoly%avg_dew_cg(isi) = sum(csite%avg_dew_cg * csite%area ) * site_area_i cpoly%avg_vapor_gc(isi) = sum(csite%avg_vapor_gc * csite%area ) * site_area_i cpoly%avg_wshed_vg(isi) = sum(csite%avg_wshed_vg * csite%area ) * site_area_i cpoly%avg_vapor_ac(isi) = sum(csite%avg_vapor_ac * csite%area ) * site_area_i @@ -497,6 +497,13 @@ subroutine spatial_averages cpoly%avg_rlong_albedo (isi) = sum(csite%avg_rlong_albedo * csite%area) & * site_area_i + + !----- Characteristic scales. -------------------------------------------------! + cpoly%avg_ustar (isi) = sum(csite%avg_ustar * csite%area) * site_area_i + cpoly%avg_tstar (isi) = sum(csite%avg_tstar * csite%area) * site_area_i + cpoly%avg_qstar (isi) = sum(csite%avg_qstar * csite%area) * site_area_i + cpoly%avg_cstar (isi) = sum(csite%avg_cstar * csite%area) * site_area_i + !----- Extra variables for NACP intercomparision (MCD) ------------------------! cpoly%avg_fsc(isi) = sum(csite%fast_soil_C * csite%area ) & * site_area_i @@ -1155,9 +1162,9 @@ subroutine spatial_averages cgrid%avg_rlong_gnd(ipy) = sum(cpoly%avg_rlong_gnd *cpoly%area)*poly_area_i cgrid%avg_rlongup (ipy) = sum(cpoly%avg_rlongup *cpoly%area)*poly_area_i cgrid%avg_carbon_ac(ipy) = sum(cpoly%avg_carbon_ac *cpoly%area)*poly_area_i + cgrid%avg_carbon_st(ipy) = sum(cpoly%avg_carbon_st *cpoly%area)*poly_area_i cgrid%avg_vapor_lc(ipy) = sum(cpoly%avg_vapor_lc *cpoly%area)*poly_area_i cgrid%avg_vapor_wc(ipy) = sum(cpoly%avg_vapor_wc *cpoly%area)*poly_area_i - cgrid%avg_dew_cg(ipy) = sum(cpoly%avg_dew_cg *cpoly%area)*poly_area_i cgrid%avg_vapor_gc(ipy) = sum(cpoly%avg_vapor_gc *cpoly%area)*poly_area_i cgrid%avg_wshed_vg(ipy) = sum(cpoly%avg_wshed_vg *cpoly%area)*poly_area_i cgrid%avg_intercepted(ipy) = sum(cpoly%avg_intercepted *cpoly%area)*poly_area_i @@ -1183,6 +1190,12 @@ subroutine spatial_averages cgrid%avg_sensible_gc(ipy) = sum(cpoly%avg_sensible_gc *cpoly%area)*poly_area_i cgrid%avg_sensible_ac(ipy) = sum(cpoly%avg_sensible_ac *cpoly%area)*poly_area_i + !----- Average stars (characteristic scales). ------------------------------------! + cgrid%avg_ustar (ipy) = sum(cpoly%avg_ustar * cpoly%area) * poly_area_i + cgrid%avg_tstar (ipy) = sum(cpoly%avg_tstar * cpoly%area) * poly_area_i + cgrid%avg_qstar (ipy) = sum(cpoly%avg_qstar * cpoly%area) * poly_area_i + cgrid%avg_cstar (ipy) = sum(cpoly%avg_cstar * cpoly%area) * poly_area_i + !----- Average albedo values. ----------------------------------------------------! cgrid%avg_albedo (ipy) = sum(cpoly%avg_albedo * cpoly%area) & * poly_area_i diff --git a/ED/src/io/h5_output.F90 b/ED/src/io/h5_output.F90 index a6a450829..a812ee093 100644 --- a/ED/src/io/h5_output.F90 +++ b/ED/src/io/h5_output.F90 @@ -323,7 +323,7 @@ subroutine h5_output(vtype) if (hdferr /= 0) then write(unit=*,fmt='(a)' ) '--------------------------------------------' write(unit=*,fmt='(a)' ) ' Could not create the HDF5 file.' - write(unit=*,fmt='(a,1x,i)' ) ' - File : ',trim(anamel) + write(unit=*,fmt='(a,1x,a)' ) ' - File : ',trim(anamel) write(unit=*,fmt='(a,1x,i)' ) ' - file_id: ',file_id write(unit=*,fmt='(a,1x,i)' ) ' - hdferr : ',hdferr write(unit=*,fmt='(a)' ) '--------------------------------------------' @@ -334,7 +334,7 @@ subroutine h5_output(vtype) if (hdferr /= 0) then write(unit=*,fmt='(a)' ) '--------------------------------------------' write(unit=*,fmt='(a)' ) ' Could not open the HDF5 file.' - write(unit=*,fmt='(a,1x,i)' ) ' - File : ',trim(anamel) + write(unit=*,fmt='(a,1x,a)' ) ' - File : ',trim(anamel) write(unit=*,fmt='(a,1x,i)' ) ' - file_id: ',file_id write(unit=*,fmt='(a,1x,i)' ) ' - hdferr : ',hdferr write(unit=*,fmt='(a)' ) '--------------------------------------------' @@ -676,7 +676,7 @@ subroutine h5_output(vtype) ,'cmp') open (unit=79,file=trim(anamel),form='formatted',status='replace') write(unit=79,fmt='(a)') 'history write completed' - write(unit=* ,fmt=* ) 'Completed History Write: ',trim(anamel) + write(unit=* ,fmt='(2a)') ' - Completed History Write: ',trim(anamel) close(unit=79,status='keep') end if diff --git a/ED/src/io/leaf_database.f90 b/ED/src/io/leaf_database.f90 index 0466c16a6..91918d941 100644 --- a/ED/src/io/leaf_database.f90 +++ b/ED/src/io/leaf_database.f90 @@ -6,6 +6,7 @@ subroutine leaf_database(ofn,nsite,nlandsea,iaction,lat,lon,classout,pctout) , shdf5_close_f & ! subroutine , shdf5_irec_f ! ! subroutine use soil_coms , only : nslcon & ! intent(in) + , isoilcol & ! intent(in) , ed_nstyp & ! intent(in) , ed_nvtyp ! ! intent(in) implicit none @@ -283,6 +284,8 @@ subroutine leaf_database(ofn,nsite,nlandsea,iaction,lat,lon,classout,pctout) call shdf5_irec_f(ndims,idims,'oge2',ivara=idato) case ('soil_text') call shdf5_irec_f(ndims,idims,'fao',ivara=idato) + case ('soil_col') + call shdf5_irec_f(ndims,idims,'colour',ivara=idato) case default call fatal_error('Incorrect action specified in leaf_database' & ,'leaf_database','leaf_database.f90') @@ -290,8 +293,19 @@ subroutine leaf_database(ofn,nsite,nlandsea,iaction,lat,lon,classout,pctout) call shdf5_close_f() else - call fatal_error( 'In landuse_input, '//trim(iaction)//' file is missing' & - ,'leaf_database','leaf_database.f90') + write (unit=*,fmt='(a,1x,a,a)') ' -> File:',trim(title3) & + ,'doesn''t exist. Using default values...' + select case (trim(iaction)) + case ('leaf_class') + idato(:,:) = 0 + case ('soil_text') + idato(:,:) = nslcon + case ('soil_col') + idato(:,:) = isoilcol + case default + call fatal_error('Incorrect action specified in leaf_database' & + ,'leaf_database','leaf_database.f90') + end select end if !------------------------------------------------------------------------------! @@ -339,7 +353,7 @@ subroutine leaf_database(ofn,nsite,nlandsea,iaction,lat,lon,classout,pctout) end do end do - case ('soil_text') + case ('soil_text','soil_col') do j=j1,j2 do i=i1,i2 dq = idato(i,j) diff --git a/ED/src/memory/canopy_air_coms.f90 b/ED/src/memory/canopy_air_coms.f90 index af4150976..0e81ae4c3 100644 --- a/ED/src/memory/canopy_air_coms.f90 +++ b/ED/src/memory/canopy_air_coms.f90 @@ -46,16 +46,6 @@ module canopy_air_coms ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! 4. Test # 4 of Mahfouf and Noilhan (1991) - integer :: i_blyr_condct ! Methods to estimate the leaf boundary layer conductance: - ! 0. The Nusselt number for forced convection is estimated - ! using the average winds, with no corrections - ! 1. The actual Nusselt number for forced convection is - ! multiplied by 2.5 as the Reynolds number gets close or - ! greater than 10,000. - ! 2. The actual Nusselt number for forced convection is - ! multiplied by 10. as the Reynolds number gets close or - ! greater than 10,000. - real :: leaf_maxwhc ! Maximum amount of water that can stay on top of the leaf ! surface. If this amount is reached, the leaf stops collect- ! ing water, thus increasing the through fall fraction. This @@ -63,16 +53,16 @@ module canopy_air_coms ! by LAI. !---------------------------------------------------------------------------------------! + !----- Minimum speed for stars [m/s]. --------------------------------------------------! + real :: ubmin + !----- Minimum speed for conductances [m/s]. -------------------------------------------! + real :: ugbmin !----- Minimum Ustar [m/s]. ------------------------------------------------------------! real :: ustmin - !----- Factor to be applied to the ground->canopy conductance. -------------------------! - real :: ggfact !----- Used by OD95 and BH91. ----------------------------------------------------------! real :: gamm ! Gamma for momentum. real :: gamh ! Gamma for heat. real :: tprandtl ! Turbulent Prandtl number. - real :: vkopr ! Von Karman / Prandtl number (not read by namelist, but defined - ! based on the namelist TPRANDTL real :: vh2vr ! vegetation roughness:vegetation height ratio real :: vh2dh ! displacement height:vegetation height ratio real :: ribmax ! Maximum bulk Richardson number (ignored when ISFCLYRM = 1) @@ -86,10 +76,6 @@ module canopy_air_coms real :: exar !----- Scaling factor of Tree Area Index, for computing wtveg [dimensionless]. ---------! real :: covr - !----- Minimum speed for conductances [m/s]. -------------------------------------------! - real :: ugbmin - !----- Minimum speed for stars [m/s]. --------------------------------------------------! - real :: ubmin !----- Some parameters that were used in ED-2.0, added here for some tests. ------------! real :: ez @@ -101,7 +87,6 @@ module canopy_air_coms real(kind=8) :: ubmin8 real(kind=8) :: ez8 real(kind=8) :: vh2dh8 - real(kind=8) :: ggfact8 real(kind=8) :: rasveg_min8 real(kind=8) :: taumin8 !=======================================================================================! @@ -155,6 +140,19 @@ module canopy_air_coms real(kind=4) :: infunc !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Parameters for CLM, at equation 5.103 of CLM-4 techical note. ! + ! Oleson, K. W., et al.; Technical description of version 4.0 of the community land ! + ! model (CLM) NCAR Technical Note NCAR/TN-478+STR, Boulder, CO, April 2010. ! + !---------------------------------------------------------------------------------------! + real(kind=4) :: cs_dense0 + real(kind=4) :: gamma_clm4 + !---------------------------------------------------------------------------------------! + + + !----- Double precision version of all variables above. --------------------------------! real(kind=8) :: dz_m978 real(kind=8) :: cdrag08 @@ -168,6 +166,8 @@ module canopy_air_coms real(kind=8), dimension(3) :: gamma_mw99_8 real(kind=8), dimension(3) :: nu_mw99_8 real(kind=8) :: infunc_8 + real(kind=8) :: cs_dense08 + real(kind=8) :: gamma_clm48 !=======================================================================================! !=======================================================================================! @@ -232,26 +232,6 @@ module canopy_air_coms real(kind=8) :: beta_lami8 ! Correction term for Nusselt #, laminar flow real(kind=8) :: beta_turb8 ! Correction term for Nusselt #, turbulent flow - - !---------------------------------------------------------------------------------------! - ! Both free and forced convection tend to underestimate the Nusselt number under ! - ! different conditions. Based on M08 review on the subject, I wrote the following ! - ! functional form to expand the Nusselt number by a factor beta: ! - ! - beta_forced = R1 + R2 * tanh[log(Re/Re0)] ! - ! - beta_free = G1 + G2 * tanh[log(Gr/Gr0)] ! - !---------------------------------------------------------------------------------------! - real :: beta_r1 - real :: beta_r2 - real :: beta_re0 - real :: beta_g1 - real :: beta_g2 - real :: beta_gr0 - real(kind=8) :: beta_r18 - real(kind=8) :: beta_r28 - real(kind=8) :: beta_re08 - real(kind=8) :: beta_g18 - real(kind=8) :: beta_g28 - real(kind=8) :: beta_gr08 !=======================================================================================! !=======================================================================================! @@ -270,7 +250,7 @@ module canopy_air_coms real :: csh ! C* for heat (eqn.20, not co2 char. scale) real :: dl79 ! ??? !----- Oncley and Dudhia (1995) model. -------------------------------------------------! - real :: bbeta ! Beta + real :: beta_s ! Beta for the stable case !----- Beljaars and Holtslag (1991) model. ---------------------------------------------! real :: abh91 ! -a from equation (28) and (32) real :: bbh91 ! -b from equation (28) and (32) @@ -285,6 +265,22 @@ module canopy_air_coms real :: atetf ! a * e * f real :: z0moz0h ! z0(M)/z0(h) real :: z0hoz0m ! z0(M)/z0(h) + !----- Modified CLM (2004) model. ------------------------------------------------------! + real :: beta_vs ! Beta for the very stable case (CLM eq. 5.30) + real :: chim ! CLM coefficient for very unstable case (momentum) + real :: chih ! CLM coefficient for very unstable case (heat) + real :: zetac_um ! critical zeta below which it becomes very unstable (momentum) + real :: zetac_uh ! critical zeta below which it becomes very unstable (heat) + real :: zetac_sm ! critical zeta above which it becomes very stable (momentum) + real :: zetac_sh ! critical zeta above which it becomes very stable (heat) + real :: zetac_umi ! 1. / zetac_umi + real :: zetac_uhi ! 1. / zetac_uhi + real :: zetac_smi ! 1. / zetac_smi + real :: zetac_shi ! 1. / zetac_shi + real :: zetac_umi16 ! 1/(-zetac_umi)^(1/6) + real :: zetac_uhi13 ! 1/(-zetac_umi)^(1/6) + real :: psimc_um ! psim evaluation at zetac_um + real :: psihc_uh ! psih evaluation at zetac_uh !---------------------------------------------------------------------------------------! !----- Double precision of all these variables. ----------------------------------------! @@ -292,12 +288,11 @@ module canopy_air_coms real(kind=8) :: csm8 real(kind=8) :: csh8 real(kind=8) :: dl798 - real(kind=8) :: bbeta8 + real(kind=8) :: beta_s8 real(kind=8) :: gamm8 real(kind=8) :: gamh8 real(kind=8) :: ribmax8 real(kind=8) :: tprandtl8 - real(kind=8) :: vkopr8 real(kind=8) :: abh918 real(kind=8) :: bbh918 real(kind=8) :: cbh918 @@ -311,6 +306,21 @@ module canopy_air_coms real(kind=8) :: atetf8 real(kind=8) :: z0moz0h8 real(kind=8) :: z0hoz0m8 + real(kind=8) :: beta_vs8 + real(kind=8) :: chim8 + real(kind=8) :: chih8 + real(kind=8) :: zetac_um8 + real(kind=8) :: zetac_uh8 + real(kind=8) :: zetac_sm8 + real(kind=8) :: zetac_sh8 + real(kind=8) :: zetac_umi8 + real(kind=8) :: zetac_uhi8 + real(kind=8) :: zetac_smi8 + real(kind=8) :: zetac_shi8 + real(kind=8) :: zetac_umi168 + real(kind=8) :: zetac_uhi138 + real(kind=8) :: psimc_um8 + real(kind=8) :: psihc_uh8 !=======================================================================================! !=======================================================================================! @@ -393,7 +403,8 @@ module canopy_air_coms ! This function computes the stability correction function for momentum. ! !---------------------------------------------------------------------------------------! real function psim(zeta,stable) - use consts_coms, only : halfpi + use consts_coms, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -403,17 +414,40 @@ real function psim(zeta,stable) !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psim = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psim = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psim = abh91 * zeta & + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) & + bcod + case (4) !----- CLM (2004) (including neglected terms). --------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + psim = (1.0 - beta_vs) * log(zeta * zetac_smi) & + + (1.0 - beta_s ) * zetac_sm - zeta + else + !----- Normal stable case. -------------------------------------------------! + psim = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psim = log(zeta * zetac_umi) & + + 6.0 * chim * ((- zeta) ** (-onesixth) - zetac_umi16) & + + psimc_um + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) & + - 2.0*atan(xx) + halfpi + end if + end select end if return end function psim @@ -437,19 +471,43 @@ real function psih(zeta,stable) logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psih = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psih = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psih = 1.0 - (1.0 + ate * zeta)**fbh91 & + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) + bcod + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + psih = (1.0 - beta_vs) * log(zeta * zetac_shi) & + + (1.0 - beta_s ) * zetac_sh - zeta + else + !----- Normal stable case. -------------------------------------------------! + psih = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - psih = log(0.25 * (1.0+yy) * (1.0+yy)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psih = log(zeta * zetac_uhi) & + + 3.0 * chih * (1./cbrt(-zeta) - zetac_uhi13) & + + psihc_uh + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + end if + end select end if return end function psih @@ -466,7 +524,8 @@ end function psih ! This function computes the stability correction function for momentum. ! !---------------------------------------------------------------------------------------! real(kind=8) function psim8(zeta,stable) - use consts_coms, only : halfpi8 + use consts_coms, only : halfpi8 & ! intent(in) + , onesixth8 ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real(kind=8), intent(in) :: zeta ! z/L, z = height, and L = Obukhov length [ ---] @@ -476,18 +535,41 @@ real(kind=8) function psim8(zeta,stable) !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psim8 = - bbeta8 * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psim8 = - beta_s8 * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psim8 = abh918 * zeta & + bbh918 * (zeta - cod8) * exp(max(-3.8d1,-dbh918 * zeta)) & + bcod8 + case (4) !----- CLM (2004) (including neglected terms). --------------------------! + if (zeta > zetac_sm8) then + !----- Very stable case. ---------------------------------------------------! + psim8 = (1.d0 - beta_vs8) * log(zeta * zetac_smi8) & + + (1.d0 - beta_s8 ) * zetac_sm8 - zeta + else + !----- Normal stable case. -------------------------------------------------! + psim8 = - beta_s8 * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) - psim8 = log(1.25d-1 * (1.d0+xx) * (1.d0+xx) * (1.d0 + xx*xx)) & - - 2.d0*atan(xx) + halfpi8 + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) + psim8 = log(1.25d-1 * (1.d0+xx) * (1.d0+xx) * (1.d0 + xx*xx)) & + - 2.d0*atan(xx) + halfpi8 + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um8) then + !----- Very unstable case. -------------------------------------------------! + psim8 = log(zeta * zetac_umi8) & + + 6.d0 * chim8 * ((-zeta) ** (-onesixth8) - zetac_umi168) & + + psimc_um + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) + psim8 = log(1.25d-1 * (1.d0+xx) * (1.d0+xx) * (1.d0 + xx*xx)) & + - 2.d0*atan(xx) + halfpi8 + end if + end select end if return end function psim8 @@ -511,19 +593,43 @@ real(kind=8) function psih8(zeta,stable) logical , intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real(kind=8) :: yy + !----- External functions. ----------------------------------------------------------! + real(kind=8), external :: cbrt8 !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psih8 = - bbeta8 * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psih8 = - beta_s8 * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psih8 = 1.d0 - (1.d0 + ate8 * zeta)**fbh918 & + bbh918 * (zeta - cod8) * exp(max(-3.8d1,-dbh918 * zeta)) + bcod8 + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh8) then + !----- Very stable case. ---------------------------------------------------! + psih8 = (1.d0 - beta_vs8) * log(zeta * zetac_shi8) & + + (1.d0 - beta_s8 ) * zetac_sh8 - zeta + else + !----- Normal stable case. -------------------------------------------------! + psih8 = - beta_s8 * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.d0 - gamh8 * zeta) - psih8 = log(2.5d-1 * (1.d0+yy) * (1.d0+yy)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.d0 - gamh8 * zeta) + psih8 = log(2.5d-1 * (1.d0+yy) * (1.d0+yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psih8 = log(zeta * zetac_uhi8) & + + 3.d0 * chih8 * (1.d0/cbrt8(-zeta) - zetac_uhi138) & + + psihc_uh8 + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.d0 - gamh8 * zeta) + psih8 = log(2.5d-1 * (1.d0+yy) * (1.d0+yy)) + end if + end select end if return end function psih8 @@ -541,25 +647,47 @@ end function psih8 ! momentum with respect to zeta. ! !---------------------------------------------------------------------------------------! real function dpsimdzeta(zeta,stable) + use consts_coms, only : onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real :: xx + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsimdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsimdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsimdzeta = abh91 + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + dpsimdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsimdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsimdzeta = (1.0 - chim * (-zeta)**onesixth) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + end if + end select end if return end function dpsimdzeta @@ -583,20 +711,41 @@ real function dpsihdzeta(zeta,stable) logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsihdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsihdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsihdzeta = - atetf * (1.0 + ate * zeta)**fm1 & + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + dpsihdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsihdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - dpsihdzeta = -gamh / (yy * (1.0 + yy)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsihdzeta = (1.0 + chih / cbrt(zeta)) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + end if + end select end if return end function dpsihdzeta @@ -614,27 +763,49 @@ end function dpsihdzeta ! momentum with respect to zeta. ! !---------------------------------------------------------------------------------------! real(kind=8) function dpsimdzeta8(zeta,stable) - use consts_coms, only : halfpi8 + use consts_coms, only : halfpi8 & ! intent(in) + , onesixth8 ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real(kind=8), intent(in) :: zeta ! z/L, z = height, and L = Obukhov length [ ---] logical , intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real(kind=8) :: xx + !----- External functions. ----------------------------------------------------------! + real(kind=8), external :: cbrt8 !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsimdzeta8 = - bbeta8 - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsimdzeta8 = - beta_s8 + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsimdzeta8 = abh918 & + bbh918 * (1.d0 - dbh918 * zeta + cbh918) & * exp(max(-3.8d1,-dbh918 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sm8) then + !----- Very stable case. ---------------------------------------------------! + dpsimdzeta8 = (1.d0 - beta_vs8) / zeta - 1.d0 + else + !----- Normal stable case. -------------------------------------------------! + dpsimdzeta8 = - beta_s8 + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) - dpsimdzeta8 = - gamm8 / (xx * (1.d0+xx) * (1.d0 + xx*xx)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) + dpsimdzeta8 = - gamm8 / (xx * (1.d0+xx) * (1.d0 + xx*xx)) + case (4) !----- Modified CLM (2004). -------------------------------------------! + if (zeta < zetac_um8) then + !----- Very unstable case. -------------------------------------------------! + dpsimdzeta8 = (1.d0 - chim8 * (-zeta)**onesixth8) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.d0 - gamm8 * zeta)) + dpsimdzeta8 = - gamm8 / (xx * (1.d0+xx) * (1.d0 + xx*xx)) + end if + end select end if return end function dpsimdzeta8 @@ -658,20 +829,41 @@ real(kind=8) function dpsihdzeta8(zeta,stable) logical , intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! real(kind=8) :: yy + !----- External functions. ----------------------------------------------------------! + real(kind=8), external :: cbrt8 !------------------------------------------------------------------------------------! if (stable) then select case (isfclyrm) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsihdzeta8 = - bbeta8 - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsihdzeta8 = - beta_s8 + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsihdzeta8 = - atetf8 * (1.d0 + ate8 * zeta)**fm18 & + bbh918 * (1.d0 - dbh918 * zeta + cbh918) & * exp(max(-3.8d1,-dbh918 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh8) then + !----- Very stable case. ---------------------------------------------------! + dpsihdzeta8 = (1.d0 - beta_vs8) / zeta - 1.d0 + else + !----- Normal stable case. -------------------------------------------------! + dpsihdzeta8 = - beta_s8 + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.d0 - gamh8 * zeta) - dpsihdzeta8 = -gamh8 / (yy * (1.d0 + yy)) + select case (isfclyrm) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.d0 - gamh8 * zeta) + dpsihdzeta8 = -gamh8 / (yy * (1.d0 + yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um8) then + !----- Very unstable case. -------------------------------------------------! + dpsihdzeta8 = (1.d0 + chih8 / cbrt8(zeta)) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.d0 - gamh8 * zeta) + dpsihdzeta8 = -gamh8 / (yy * (1.d0 + yy)) + end if + end select end if return end function dpsihdzeta8 @@ -708,6 +900,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) real , intent(in) :: lnzoz0h ! ln[zref/roughness(heat)] [ ---] logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! + real :: ribuse ! Richardson number to use [ ---] real :: fm ! lnzoz0 - psim(zeta) + psim(zeta0) [ ---] real :: fh ! lnzoz0 - psih(zeta) + psih(zeta0) [ ---] real :: dfmdzeta ! d(fm)/d(zeta) [ ---] @@ -722,6 +915,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) real :: fun ! Function for which we seek a root. [ ---] real :: funa ! Smallest guess function. [ ---] real :: funz ! Largest guess function. [ ---] + real :: delta0 ! Aux. var --- 2nd guess for bisection [ ---] real :: delta ! Aux. var --- 2nd guess for bisection [ ---] real :: zetamin ! Minimum zeta for stable case. [ ---] real :: zetamax ! Maximum zeta for unstable case. [ ---] @@ -733,22 +927,56 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) logical :: zside ! Flag... I'm on the z-side. [ T|F] !------------------------------------------------------------------------------------! + + + !----- Define some values that won't change during the iterative method. ------------! + z0moz = 1. / zoz0m + z0hoz = 1. / zoz0h !------------------------------------------------------------------------------------! - ! First thing: if the bulk Richardson number is zero or almost zero, then we ! - ! rather just assign z/L to be the one given by Oncley and Dudhia (1995). This ! - ! saves time and also avoids the risk of having zeta with the opposite sign. ! + + + + !------------------------------------------------------------------------------------! + ! First thing, check whether this is a stable case and we are running methods 2 ! + ! or 4. In these methods, there is a singularity that must be avoided. ! + !------------------------------------------------------------------------------------! + select case (isfclyrm) + case (2,4) + ribuse = min(rib, (1.0 - toler) * tprandtl / (beta_s * (1.0 - min(z0moz,z0hoz)))) + + !---------------------------------------------------------------------------------! + ! Stable case, using Oncley and Dudhia, we can solve it analytically. ! + !---------------------------------------------------------------------------------! + if (stable .and. isfclyrm == 2) then + zoobukhov = ribuse * min(lnzoz0m,lnzoz0h) & + / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) *ribuse) + return + end if + !---------------------------------------------------------------------------------! + case default + ribuse = rib + end select + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! - zetasmall = vkopr * rib * min(lnzoz0m,lnzoz0h) - if (rib <= 0. .and. zetasmall > - z0moz0h * toler) then - zoobukhov = zetasmall + ! If the bulk Richardson number is zero or almost zero, then we rather just ! + ! assign z/L to be the one similar to Oncley and Dudhia (1995). This saves time and ! + ! also avoids the risk of having zeta with the opposite sign. ! + !------------------------------------------------------------------------------------! + zetasmall = ribuse * min(lnzoz0m,lnzoz0h) + if (ribuse <= 0. .and. zetasmall > - z0moz0h * toler) then + zoobukhov = zetasmall / tprandtl return - elseif (rib > 0. .and. zetasmall < z0moz0h * toler) then - zoobukhov = zetasmall / (1.1 - 5.0 * rib) + elseif (ribuse > 0. .and. zetasmall < z0moz0h * toler) then + zoobukhov = zetasmall / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) * ribuse) return else zetamin = toler zetamax = -toler end if + !------------------------------------------------------------------------------------! !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.20. ! + ! Ri is too positive. ! + !------------------------------------------------------------------------------------! + zetaa = rib * lnzoz0m / tprandtl !------------------------------------------------------------------------------------! - zetaa = vkopr * rib * lnzoz0m + + !----- Finding the function and its derivative. -------------------------------------! zeta0m = zetaa * z0moz @@ -778,9 +1005,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) fh = lnzoz0h - psih(zetaa,stable) + psih(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable) - dpsimdzeta(zetaa,stable) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable) - dpsihdzeta(zetaa,stable) - funa = vkopr * rib * fm * fm / fh - zetaa - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + funa = ribuse * fm * fm / (tprandtl * fh) - zetaa + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !----- Copying just in case it fails at the first iteration. ------------------------! zetaz = zetaa @@ -828,9 +1055,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) fh = lnzoz0h - psih(zetaz,stable) + psih(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable) - dpsimdzeta(zetaz,stable) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable) - dpsihdzeta(zetaz,stable) - fun = vkopr * rib * fm * fm / fh - zetaz - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + fun = ribuse * fm * fm / (tprandtl * fh) - zetaz + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.0)) then write (unit=*,fmt='(a)') '-------------------------------------------------------' write (unit=*,fmt='(a)') ' Zeta finding didn''t converge!!!' write (unit=*,fmt='(a,1x,i5,1x,a)') ' I gave up, after',maxfpo,'iterations...' @@ -972,6 +1200,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable) write (unit=*,fmt='(a)') ' Input values.' write (unit=*,fmt='(a)') ' ' write (unit=*,fmt='(a,1x,f12.4)' ) 'rib [ ---] =',rib + write (unit=*,fmt='(a,1x,f12.4)' ) 'ribuse [ ---] =',ribuse write (unit=*,fmt='(a,1x,f12.4)' ) 'zref [ m] =',zref write (unit=*,fmt='(a,1x,f12.4)' ) 'rough [ m] =',rough write (unit=*,fmt='(a,1x,f12.4)' ) 'zoz0m [ ---] =',zoz0m @@ -1034,6 +1263,7 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab real(kind=8), intent(in) :: lnzoz0h ! ln[zref/roughness(heat)] [ ---] logical , intent(in) :: stable ! Flag... This surface layer is stable [ T|F] !----- Local variables. -------------------------------------------------------------! + real(kind=8) :: ribuse ! Richardson number to use [ ---] real(kind=8) :: fm ! lnzoz0 - psim(zeta) + psim(zeta0) [ ---] real(kind=8) :: fh ! lnzoz0 - psih(zeta) + psih(zeta0) [ ---] real(kind=8) :: dfmdzeta ! d(fm)/d(zeta) [ ---] @@ -1048,6 +1278,7 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab real(kind=8) :: fun ! Function for which we seek a root. [ ---] real(kind=8) :: funa ! Smallest guess function. [ ---] real(kind=8) :: funz ! Largest guess function. [ ---] + real(kind=8) :: delta0 ! Aux. var --- 2nd guess for bisection [ ---] real(kind=8) :: delta ! Aux. var --- 2nd guess for bisection [ ---] real(kind=8) :: zetamin ! Minimum zeta for stable case. [ ---] real(kind=8) :: zetamax ! Maximum zeta for unstable case. [ ---] @@ -1060,17 +1291,49 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab !------------------------------------------------------------------------------------! + + !----- Define some values that won't change during the iterative method. ------------! + z0moz = 1.d0 / zoz0m + z0hoz = 1.d0 / zoz0h + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! First thing, check whether this is a stable case and we are running methods 2 ! + ! or 4. In these methods, there is a singularity that must be avoided. ! + !------------------------------------------------------------------------------------! + select case (isfclyrm) + case (2,4) + ribuse = min(rib & + , (1.d0 - toler8) * tprandtl8 / (beta_s8 * (1.d0 - min(z0moz,z0hoz)))) + + !---------------------------------------------------------------------------------! + ! Stable case, using Oncley and Dudhia, we can solve it analytically. ! + !---------------------------------------------------------------------------------! + if (stable .and. isfclyrm == 2) then + zoobukhov8 = ribuse * min(lnzoz0m,lnzoz0h) & + / (tprandtl8 - beta_s8 * (1.d0 - min(z0moz,z0hoz)) *ribuse) + return + end if + !---------------------------------------------------------------------------------! + case default + ribuse = rib + end select + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! ! First thing: if the bulk Richardson number is zero or almost zero, then we ! ! rather just assign z/L to be the one given by Oncley and Dudhia (1995). This ! ! saves time and also avoids the risk of having zeta with the opposite sign. ! !------------------------------------------------------------------------------------! - zetasmall = vkopr8 * rib * min(lnzoz0m,lnzoz0h) - if (rib <= 0.d0 .and. zetasmall > - z0moz0h8 * toler8) then - zoobukhov8 = zetasmall + zetasmall = ribuse * min(lnzoz0m,lnzoz0h) + if (ribuse <= 0.d0 .and. zetasmall > - z0moz0h8 * toler8) then + zoobukhov8 = zetasmall / tprandtl8 return - elseif (rib > 0.d0 .and. zetasmall < z0moz0h8 * toler8) then - zoobukhov8 = zetasmall / (1.1d0 - 5.0d0 * rib) + elseif (ribuse > 0.d0 .and. zetasmall < z0moz0h8 * toler8) then + zoobukhov8 = zetasmall / (tprandtl8 - beta_s8 * (1.d0 - min(z0moz,z0hoz))*ribuse) return else zetamin = toler8 @@ -1087,16 +1350,12 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.20. ! + ! Ri is too positive. ! !------------------------------------------------------------------------------------! - zetaa = vkopr8 * rib * lnzoz0m + zetaa = ribuse * lnzoz0m / tprandtl8 !----- Finding the function and its derivative. -------------------------------------! zeta0m = zetaa * z0moz @@ -1105,9 +1364,9 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab fh = lnzoz0h - psih8(zetaa,stable) + psih8(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta8(zeta0m,stable) - dpsimdzeta8(zetaa,stable) dfhdzeta = z0hoz * dpsihdzeta8(zeta0h,stable) - dpsihdzeta8(zetaa,stable) - funa = vkopr8 * rib * fm * fm / fh - zetaa - deriv = vkopr8 * rib * (2.d0 * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1.d0 + funa = ribuse * fm * fm / (tprandtl8 * fh) - zetaa + deriv = ribuse * (2.d0 * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl8 * fh * fh) - 1.d0 !----- Copying just in case it fails at the first iteration. ------------------------! zetaz = zetaa @@ -1155,9 +1414,9 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab fh = lnzoz0h - psih8(zetaz,stable) + psih8(zeta0h,stable) dfmdzeta = z0moz * dpsimdzeta8(zeta0m,stable) - dpsimdzeta8(zetaz,stable) dfhdzeta = z0hoz * dpsihdzeta8(zeta0h,stable) - dpsihdzeta8(zetaz,stable) - fun = vkopr8 * rib * fm * fm / fh - zetaz - deriv = vkopr8 * rib * (2.d0 * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1.d0 + fun = ribuse * fm * fm / (tprandtl8 * fh) - zetaz + deriv = ribuse * (2.d0 * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl8 * fh * fh) - 1.d0 !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.d0)) then write (unit=*,fmt='(a)') '-------------------------------------------------------' write (unit=*,fmt='(a)') ' Zeta finding didn''t converge!!!' write (unit=*,fmt='(a,1x,i5,1x,a)') ' I gave up, after',maxfpo,'iterations...' @@ -1299,6 +1559,7 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab write (unit=*,fmt='(a)') ' Input values.' write (unit=*,fmt='(a)') ' ' write (unit=*,fmt='(a,1x,f12.4)' ) 'rib [ ---] =',rib + write (unit=*,fmt='(a,1x,f12.4)' ) 'ribuse [ ---] =',ribuse write (unit=*,fmt='(a,1x,f12.4)' ) 'zref [ m] =',zref write (unit=*,fmt='(a,1x,f12.4)' ) 'rough [ m] =',rough write (unit=*,fmt='(a,1x,f12.4)' ) 'zoz0m [ ---] =',zoz0m @@ -1307,7 +1568,7 @@ real(kind=8) function zoobukhov8(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stab write (unit=*,fmt='(a,1x,f12.4)' ) 'lnzoz0h [ ---] =',lnzoz0h write (unit=*,fmt='(a,1x,l1)' ) 'stable [ T|F] =',stable write (unit=*,fmt='(a)') ' ' - write (unit=*,fmt='(a)') ' Last iteration outcome (downdraft values).' + write (unit=*,fmt='(a)') ' Last iteration outcome (zoobukhov8 values).' write (unit=*,fmt='(a,1x,f12.4)' ) 'zetaa [ ---] =',zetaa write (unit=*,fmt='(a,1x,f12.4)' ) 'zetaz [ ---] =',zetaz write (unit=*,fmt='(a,1x,f12.4)' ) 'fun [ ---] =',fun diff --git a/ED/src/memory/canopy_radiation_coms.f90 b/ED/src/memory/canopy_radiation_coms.f90 index 577a4970b..271b36c9e 100644 --- a/ED/src/memory/canopy_radiation_coms.f90 +++ b/ED/src/memory/canopy_radiation_coms.f90 @@ -13,28 +13,43 @@ module canopy_radiation_coms !---------------------------------------------------------------------------------------! - ! This variable controls which short wave radiation model to use. 0 means Beers' ! - ! law, and 1 means two-stream. Longwave will be always solved by the two-stream model. ! - ! Important: option 0 cannot be used with CROWN_MOD = 2. ! + ! ICANRAD -- Specifies how canopy radiation is solved. This variable sets both short- ! + ! wave and longwave. ! + ! 0. Two-stream model (Medvigy 2006), with the possibility to apply ! + ! finite crown area to direct shortwave radiation. ! + ! 1. Multiple-scattering model (Zhao and Qualls 2005,2006), with the ! + ! possibility to apply finite crown area to all radiation fluxes. ! !---------------------------------------------------------------------------------------! - integer :: ican_swrad + integer :: icanrad !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! Leaf angle distribution parameter (dimensionless). Let mu' be the cosine of leaf ! - ! angle and G(mu') be the distribution of mu'. Then, mubar = (integral from 0 to 1) ! - ! (d mu' mu' / G(mu')). See, for example, Dickinson 1983. ! + ! The following variables are temporary namelist variables used to control the ! + ! radiation properties of leaves. ! + ! LTRANS_VIS -- Leaf transmittance on visible. ! + ! LTRANS_NIR -- Leaf transmittance on near infrared. ! + ! LREFLECT_VIS -- Leaf reflectance on visible. ! + ! LREFLECT_NIR -- Leaf reflectance on near infrared. ! + ! ORIENT_TREE -- Leaf orientation parameter for tropical trees ! + ! ORIENT_GRASS -- Leaf orientation parameter for tropical grasses ! + ! CLUMP_TREE -- Leaf clumping factor for tropical trees ! + ! CLUMP_GRASS -- Leaf clumping factor for tropical grasses ! !---------------------------------------------------------------------------------------! - real(kind=8) :: mubar + real :: ltrans_vis + real :: ltrans_nir + real :: lreflect_vis + real :: lreflect_nir + real :: orient_tree + real :: orient_grass + real :: clump_tree + real :: clump_grass !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! Fraction of solar radiation in the PAR band. Used every time step. ! !---------------------------------------------------------------------------------------! @@ -88,7 +103,28 @@ module canopy_radiation_coms !---------------------------------------------------------------------------------------! - ! Fraction of radiation that is reflected. ! + ! Factors that define the orientation and clumping of leaves. ! + ! CLUMPING FACTOR - factor indicating the degree of clumpiness of leaves. ! + ! ORIENT_FACTOR - mean leaf orientation. ! + ! 0 -- leaves are randomly oriented ! + ! 1 -- all leaves are perfectly horizontal ! + ! -1 -- all leaves are perfectly vertical. ! + ! PHI1 - The phi1 term from the CLM technical manual ! + ! PHI2 - The phi2 term from the CLM technical manual ! + ! MU_BAR - average cosine of incidence angle for hemispheric (diffuse) ! + ! radiation (for both short wave and long wave) ! + !---------------------------------------------------------------------------------------! + real(kind=8), dimension(n_pft) :: clumping_factor + real(kind=8), dimension(n_pft) :: orient_factor + real(kind=8), dimension(n_pft) :: phi1 + real(kind=8), dimension(n_pft) :: phi2 + real(kind=8), dimension(n_pft) :: mu_bar + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Reflectance coefficients. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! real(kind=8), dimension(n_pft) :: leaf_reflect_vis @@ -102,7 +138,7 @@ module canopy_radiation_coms !---------------------------------------------------------------------------------------! - ! Fraction of scattered PAR that is transmitted. ! + ! Transmittance coefficients. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! real(kind=8), dimension(n_pft) :: leaf_trans_vis @@ -116,7 +152,7 @@ module canopy_radiation_coms !---------------------------------------------------------------------------------------! - ! Fraction of scattered PAR that is scattered. ! + ! Scattering coefficients. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! real(kind=8), dimension(n_pft) :: leaf_scatter_vis @@ -130,7 +166,7 @@ module canopy_radiation_coms !---------------------------------------------------------------------------------------! - ! Fraction of scattered PAR that is back-scattered. ! + ! Fraction of diffuse radiation that is upscattered. ! !---------------------------------------------------------------------------------------! !----- Visible (PAR). ------------------------------------------------------------------! real(kind=8), dimension(n_pft) :: leaf_backscatter_vis @@ -151,6 +187,14 @@ module canopy_radiation_coms + !----- Backscattering of thermal infrared. ---------------------------------------------! + real(kind=8), dimension(n_pft) :: leaf_backscatter_tir + real(kind=8), dimension(n_pft) :: wood_backscatter_tir + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! The following variables control whether to call things that should be called ! diff --git a/ED/src/memory/consts_coms.F90 b/ED/src/memory/consts_coms.F90 index c0d3cf508..02b67b2f7 100644 --- a/ED/src/memory/consts_coms.F90 +++ b/ED/src/memory/consts_coms.F90 @@ -44,7 +44,7 @@ Module consts_coms , b_gr_coeff => gr_coeff , b_mmh2oi => mmh2oi , b_lnexp_min => lnexp_min & , b_lnexp_max => lnexp_max , b_huge_num => huge_num , b_tiny_num => tiny_num & , b_mmo2 => mmo2 , b_mmo3 => mmo3 , b_prefsea => prefsea & - , b_solar => solar + , b_solar => solar , b_euler_gam => euler_gam implicit none @@ -104,6 +104,7 @@ Module consts_coms real, parameter :: huge_num = b_huge_num , tiny_num = b_tiny_num real, parameter :: mmo2 = b_mmo2 , mmo3 = b_mmo3 real, parameter :: prefsea = b_prefsea , solar = b_solar + real, parameter :: euler_gam = b_euler_gam !---------------------------------------------------------------------------------------! #else @@ -121,6 +122,7 @@ Module consts_coms real, parameter :: pio180 = pi1/ 180. ! Pi/180 (deg -> rad) [ ---] real, parameter :: pi4 = pi1 * 4. ! 4 Pi [ ---] real, parameter :: pio4 = pi1 /4. ! Pi/4 [ ---] + real, parameter :: euler_gam = 0.577215664901533 ! Euler's constant [ ---] !---------------------------------------------------------------------------------------! @@ -510,6 +512,7 @@ Module consts_coms real(kind=8), parameter :: lnexp_max8 = dble(lnexp_max ) real(kind=8), parameter :: huge_num8 = dble(huge_num ) real(kind=8), parameter :: tiny_num8 = dble(tiny_num ) + real(kind=8), parameter :: euler_gam8 = dble(euler_gam ) !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/disturb_coms.f90 b/ED/src/memory/disturb_coms.f90 index c5a3ece73..6f2c39050 100644 --- a/ED/src/memory/disturb_coms.f90 +++ b/ED/src/memory/disturb_coms.f90 @@ -161,7 +161,7 @@ module disturb_coms ! Units: relative fraction. ! !---------------------------------------------------------------------------------------! real :: sm_fire - real :: fire_smoist_threshold + !---------------------------------------------------------------------------------------! ! Depth to be compared with the soil average when include_fire is 2. Units: meters. ! !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ed_max_dims.F90 b/ED/src/memory/ed_max_dims.F90 index fd8f459fc..29b6c1302 100644 --- a/ED/src/memory/ed_max_dims.F90 +++ b/ED/src/memory/ed_max_dims.F90 @@ -53,7 +53,7 @@ module ed_max_dims integer, parameter :: nxpmax = 666 integer, parameter :: nypmax = 666 integer, parameter :: nzpmax = 132 - integer, parameter :: nzgmax = 25 + integer, parameter :: nzgmax = 100 integer, parameter :: maxdim = 666 integer, parameter :: maxdimp = maxdim + 2 integer, parameter :: nxyzpm = nzpmax * nxpmax * nypmax diff --git a/ED/src/memory/ed_misc_coms.f90 b/ED/src/memory/ed_misc_coms.f90 index e9809d27c..152c3f87e 100644 --- a/ED/src/memory/ed_misc_coms.f90 +++ b/ED/src/memory/ed_misc_coms.f90 @@ -95,7 +95,33 @@ Module ed_misc_coms real :: max_poihist_dist !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! IVEGT_DYNAMICS -- The vegetation dynamics scheme. ! + ! 0. No vegetation dynamics, the initial state will be preserved, ! + ! even though the model will compute the potential values. This ! + ! option is useful for theoretical simulations only. ! + ! 1. Normal ED vegetation dynamics (Moorcroft et al 2001). ! + ! The normal option for almost any simulation. ! + !---------------------------------------------------------------------------------------! + integer :: ivegt_dynamics + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! INTEGRATION_SCHEME -- The biophysics integration scheme. ! + ! 0. Euler step. The fastest, but it doesn't estimate ! + ! errors. ! + ! 1. Fourth-order Runge-Kutta method. ED-2.1 default method ! + ! 2. Heun's method (a second-order Runge-Kutta). ! + !---------------------------------------------------------------------------------------! integer :: integration_scheme + !---------------------------------------------------------------------------------------! ! Control parameters for printing. Read in the namelist diff --git a/ED/src/memory/ed_state_vars.f90 b/ED/src/memory/ed_state_vars.f90 index 560223fea..1764f442a 100644 --- a/ED/src/memory/ed_state_vars.f90 +++ b/ED/src/memory/ed_state_vars.f90 @@ -708,6 +708,9 @@ module ed_state_vars ! Average daily temperature [K] real , pointer,dimension(:) :: avg_daily_temp + ! Average monthly ground water [kg/m2], used for fire ignition + real , pointer,dimension(:) :: avg_monthly_gndwater + ! average of rh [umol/m2/s] over FRQSTATE real , pointer,dimension(:) :: mean_rh @@ -866,7 +869,25 @@ module ed_state_vars ! Short wave radiation absorbed by the ground, diffuse component (W/m2) real , pointer,dimension(:) :: rshort_g_diffuse - + + ! Photosynthetically active radiation incident at the ground(W/m2) + real , pointer,dimension(:) :: par_b + + ! Photosynthetically active radiation incident at the ground, beam component (W/m2) + real , pointer,dimension(:) :: par_b_beam + + ! Photosynthetically active radiation incident at the ground, diffuse component (W/m2) + real , pointer,dimension(:) :: par_b_diffuse + + ! Near infrared radiation incident at the ground(W/m2) + real , pointer,dimension(:) :: nir_b + + ! Near infrared radiation incident at the ground, beam component (W/m2) + real , pointer,dimension(:) :: nir_b_beam + + ! Near infrared radiation incident at the ground, diffuse component (W/m2) + real , pointer,dimension(:) :: nir_b_diffuse + ! Long wave radiation absorbed by the ground (W/m2) real , pointer,dimension(:) :: rlong_g @@ -1011,12 +1032,15 @@ module ed_state_vars ! Notation ! ATM - atmosphere, CAS - canopy air space - !----- Moisture --------------------------------------------------- - real,pointer,dimension(:) :: avg_carbon_ac ! Average carbon flux, ATM -> CAS, [umol/m2/s] + real,pointer,dimension(:) :: avg_ustar ! Average u* [ m/s] + real,pointer,dimension(:) :: avg_tstar ! Average Theta* [ K] + real,pointer,dimension(:) :: avg_qstar ! Average q* [ kg/kg] + real,pointer,dimension(:) :: avg_cstar ! Average CO2* [ umol/mol] + real,pointer,dimension(:) :: avg_carbon_ac ! Average carbon flux, ATM -> CAS [umol/m2/s] + real,pointer,dimension(:) :: avg_carbon_st ! Average carbon flux storage [umol/m2/s] real,pointer,dimension(:) :: avg_vapor_lc ! Average water vapor flux, Leaf -> CAS [kg/m2/s] real,pointer,dimension(:) :: avg_vapor_wc ! Average water vapor flux, wood -> CAS [kg/m2/s] - real,pointer,dimension(:) :: avg_dew_cg ! Average dew flux, CAS -> GND [kg/m2/s] real,pointer,dimension(:) :: avg_vapor_gc ! Average water vapor flux, GND -> CAS [kg/m2/s] real,pointer,dimension(:) :: avg_wshed_vg ! Average precip that falls from leaves [kg/m2/s] real,pointer,dimension(:) :: avg_intercepted ! Average precip that is intercepted [kg/m2/s] @@ -1174,6 +1198,9 @@ module ed_state_vars real,pointer,dimension(:) :: moist_zi ! TOPMODEL "equilibrium" water table depth real,pointer,dimension(:) :: baseflow ! loss of water from site to watershed discharge (kg/m2/s) + integer,pointer,dimension(:) :: ncol_soil ! The soil colour category, used to + ! determine ground albedo. + integer,pointer,dimension(:,:) :: ntext_soil ! The soil classifications index of the soil layer ! refer to soil_coms to view the soil parameters ! associated with each of these classes @@ -1248,9 +1275,6 @@ module ed_state_vars ! the disturbance matrix (to,from) real,pointer,dimension(:,:,:) :: disturbance_rates !(n_dist_types,n_dist_types,nsites) - ! fraction of non-surviving a.g. material removed from patch - real,pointer,dimension(:,:) :: loss_fraction !(n_dist_types,nsites) - real,pointer,dimension(:,:):: green_leaf_factor !(n_pft,nsites) real,pointer,dimension(:,:) :: leaf_aging_factor !(n_pft,nsites) @@ -1285,13 +1309,17 @@ module ed_state_vars !------------------------------------------- real,pointer,dimension(:) :: avg_rshort_gnd ! Total absorbed radiation at the ground real,pointer,dimension(:) :: avg_rlong_gnd ! Total absorbed radiation at the ground + real,pointer,dimension(:) :: avg_ustar ! Average u* [ m/s] + real,pointer,dimension(:) :: avg_tstar ! Average Theta* [ K] + real,pointer,dimension(:) :: avg_qstar ! Average q* [ kg/kg] + real,pointer,dimension(:) :: avg_cstar ! Average CO2* [ umol/mol] real,pointer,dimension(:) :: avg_carbon_ac ! Vegetation to Canopy carbon dioxide flux - + real,pointer,dimension(:) :: avg_carbon_st ! Canopy carbon dioxide storage + !----- Moisture ---------------------------- ! | Description real,pointer,dimension(:) :: avg_vapor_lc ! Leaf to canopy air water flux [kg/m2/s] real,pointer,dimension(:) :: avg_vapor_wc ! wood to canopy air water flux [kg/m2/s] - real,pointer,dimension(:) :: avg_dew_cg ! Dew to ground flux real,pointer,dimension(:) :: avg_vapor_gc ! Ground to canopy air latent heat flux [kg/m2/s] real,pointer,dimension(:) :: avg_wshed_vg ! Water shedding real,pointer,dimension(:) :: avg_intercepted ! Intercepted @@ -1469,6 +1497,8 @@ module ed_state_vars real,pointer,dimension(:) :: sensflux_py ! of dimension npolys + integer,pointer,dimension(:) :: ncol_soil ! Soil colour classification (npolygon) + integer,pointer,dimension(:,:) :: ntext_soil ! Soil texture classification ! (nzg,polygon) @@ -1569,12 +1599,16 @@ module ed_state_vars real,pointer,dimension(:) :: avg_rshort_gnd ! Total absorbed radiation at the ground real,pointer,dimension(:) :: avg_rlong_gnd ! Total absorbed radiation at the ground + real,pointer,dimension(:) :: avg_ustar ! Average u* [ m/s] + real,pointer,dimension(:) :: avg_tstar ! Average Theta* [ K] + real,pointer,dimension(:) :: avg_qstar ! Average q* [ kg/kg] + real,pointer,dimension(:) :: avg_cstar ! Average CO2* [ umol/mol] real,pointer,dimension(:) :: avg_carbon_ac ! Vegetation to Canopy carbon dioxide flux + real,pointer,dimension(:) :: avg_carbon_st ! Canopy carbon dioxide storage !----- Moisture Flux ---------------------------- real,pointer,dimension(:) :: avg_vapor_lc ! Leaf to canopy air water flux real,pointer,dimension(:) :: avg_vapor_wc ! wood to canopy air water flux - real,pointer,dimension(:) :: avg_dew_cg ! Dew to ground flux real,pointer,dimension(:) :: avg_vapor_gc ! Ground to canopy air latent heat flux [kg/m2/s] real,pointer,dimension(:) :: avg_wshed_vg ! Water shedding from the leaves real,pointer,dimension(:) :: avg_intercepted ! Intercepted @@ -1776,7 +1810,12 @@ module ed_state_vars real, pointer, dimension(:) :: dmean_sensible_wc ! [ W/m2] real, pointer, dimension(:) :: dmean_sensible_gc ! [ W/m2] real, pointer, dimension(:) :: dmean_sensible_ac ! [ W/m2] - real, pointer, dimension(:) :: dmean_nee ! [ kgC/mē/yr] + real, pointer, dimension(:) :: dmean_ustar ! [ m/s] + real, pointer, dimension(:) :: dmean_tstar ! [ K] + real, pointer, dimension(:) :: dmean_qstar ! [ kg/kg] + real, pointer, dimension(:) :: dmean_cstar ! [ umol/mol] + real, pointer, dimension(:) :: dmean_carbon_ac ! [ umol/mē/s] + real, pointer, dimension(:) :: dmean_carbon_st ! [ umol/mē/s] real, pointer, dimension(:) :: dmean_gpp ! [ kgC/mē/yr] real, pointer, dimension(:) :: dmean_nep ! [ kgC/mē/yr] real, pointer, dimension(:) :: dmean_plresp ! [ kgC/mē/yr] @@ -1848,7 +1887,12 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmean_sensible_wc ! [ W/m2] real, pointer, dimension(:,:) :: qmean_sensible_gc ! [ W/m2] real, pointer, dimension(:,:) :: qmean_sensible_ac ! [ W/m2] - real, pointer, dimension(:,:) :: qmean_nee ! [ kgC/mē/yr] + real, pointer, dimension(:,:) :: qmean_ustar ! [ m/s] + real, pointer, dimension(:,:) :: qmean_tstar ! [ K] + real, pointer, dimension(:,:) :: qmean_qstar ! [ kg/kg] + real, pointer, dimension(:,:) :: qmean_cstar ! [ umol/mol] + real, pointer, dimension(:,:) :: qmean_carbon_ac ! [ umol/mē/s] + real, pointer, dimension(:,:) :: qmean_carbon_st ! [ umol/mē/s] real, pointer, dimension(:,:) :: qmean_gpp ! [ kgC/mē/yr] real, pointer, dimension(:,:) :: qmean_nep ! [ kgC/mē/yr] real, pointer, dimension(:,:) :: qmean_plresp ! [ kgC/mē/yr] @@ -1903,7 +1947,8 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmsqu_leaf_resp real, pointer, dimension(:,:) :: qmsqu_root_resp real, pointer, dimension(:,:) :: qmsqu_plresp - real, pointer, dimension(:,:) :: qmsqu_nee + real, pointer, dimension(:,:) :: qmsqu_carbon_ac + real, pointer, dimension(:,:) :: qmsqu_carbon_st real, pointer, dimension(:,:) :: qmsqu_nep real, pointer, dimension(:,:) :: qmsqu_rh real, pointer, dimension(:,:) :: qmsqu_sensible_ac @@ -1970,7 +2015,12 @@ module ed_state_vars real, pointer, dimension(:) :: mmean_sensible_wc ! [ W/mē] real, pointer, dimension(:) :: mmean_sensible_gc ! [ W/mē] real, pointer, dimension(:) :: mmean_sensible_ac ! [ W/mē] - real, pointer, dimension(:) :: mmean_nee ! [ kgC/mē/yr] + real, pointer, dimension(:) :: mmean_ustar ! [ m/s] + real, pointer, dimension(:) :: mmean_tstar ! [ K] + real, pointer, dimension(:) :: mmean_qstar ! [ kg/kg] + real, pointer, dimension(:) :: mmean_cstar ! [ umol/mol] + real, pointer, dimension(:) :: mmean_carbon_ac ! [ umol/mē/s] + real, pointer, dimension(:) :: mmean_carbon_st ! [ umol/mē/s] real, pointer, dimension(:) :: mmean_gpp ! [ kgC/mē/yr] real, pointer, dimension(:) :: mmean_nppleaf ! [ kgC/mē/yr] real, pointer, dimension(:) :: mmean_nppfroot ! [ kgC/mē/yr] @@ -2036,7 +2086,8 @@ module ed_state_vars real, pointer, dimension(:) :: mmsqu_leaf_resp real, pointer, dimension(:) :: mmsqu_root_resp real, pointer, dimension(:) :: mmsqu_plresp - real, pointer, dimension(:) :: mmsqu_nee + real, pointer, dimension(:) :: mmsqu_carbon_ac + real, pointer, dimension(:) :: mmsqu_carbon_st real, pointer, dimension(:) :: mmsqu_nep real, pointer, dimension(:) :: mmsqu_rh real, pointer, dimension(:) :: mmsqu_sensible_ac @@ -2215,6 +2266,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%lon(npolygons)) allocate(cgrid%xatm(npolygons)) allocate(cgrid%yatm(npolygons)) + allocate(cgrid%ncol_soil(npolygons)) allocate(cgrid%ntext_soil(nzg,npolygons)) allocate(cgrid%lsl(npolygons)) @@ -2272,7 +2324,6 @@ subroutine allocate_edtype(cgrid,npolygons) ! --------------------------------------------- allocate(cgrid%avg_vapor_lc (npolygons)) allocate(cgrid%avg_vapor_wc (npolygons)) - allocate(cgrid%avg_dew_cg (npolygons)) allocate(cgrid%avg_vapor_gc (npolygons)) allocate(cgrid%avg_wshed_vg (npolygons)) allocate(cgrid%avg_intercepted (npolygons)) @@ -2289,7 +2340,12 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%aux_s (nzg,npolygons)) allocate(cgrid%avg_rshort_gnd (npolygons)) allocate(cgrid%avg_rlong_gnd (npolygons)) + allocate(cgrid%avg_ustar (npolygons)) + allocate(cgrid%avg_tstar (npolygons)) + allocate(cgrid%avg_qstar (npolygons)) + allocate(cgrid%avg_cstar (npolygons)) allocate(cgrid%avg_carbon_ac (npolygons)) + allocate(cgrid%avg_carbon_st (npolygons)) allocate(cgrid%avg_qwshed_vg (npolygons)) allocate(cgrid%avg_qintercepted (npolygons)) allocate(cgrid%avg_qthroughfall (npolygons)) @@ -2452,7 +2508,12 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%dmean_vapor_gc ( npolygons)) allocate(cgrid%dmean_vapor_lc ( npolygons)) allocate(cgrid%dmean_vapor_wc ( npolygons)) - allocate(cgrid%dmean_nee ( npolygons)) + allocate(cgrid%dmean_ustar ( npolygons)) + allocate(cgrid%dmean_tstar ( npolygons)) + allocate(cgrid%dmean_qstar ( npolygons)) + allocate(cgrid%dmean_cstar ( npolygons)) + allocate(cgrid%dmean_carbon_ac ( npolygons)) + allocate(cgrid%dmean_carbon_st ( npolygons)) allocate(cgrid%dmean_gpp ( npolygons)) allocate(cgrid%dmean_nppleaf ( npolygons)) allocate(cgrid%dmean_nppfroot ( npolygons)) @@ -2544,7 +2605,12 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmean_sensible_gc ( npolygons)) allocate(cgrid%mmean_sensible_lc ( npolygons)) allocate(cgrid%mmean_sensible_wc ( npolygons)) - allocate(cgrid%mmean_nee ( npolygons)) + allocate(cgrid%mmean_ustar ( npolygons)) + allocate(cgrid%mmean_tstar ( npolygons)) + allocate(cgrid%mmean_qstar ( npolygons)) + allocate(cgrid%mmean_cstar ( npolygons)) + allocate(cgrid%mmean_carbon_ac ( npolygons)) + allocate(cgrid%mmean_carbon_st ( npolygons)) allocate(cgrid%mmean_gpp ( npolygons)) allocate(cgrid%mmean_nppleaf ( npolygons)) allocate(cgrid%mmean_nppfroot ( npolygons)) @@ -2614,7 +2680,8 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmsqu_leaf_resp ( npolygons)) allocate(cgrid%mmsqu_root_resp ( npolygons)) allocate(cgrid%mmsqu_plresp ( npolygons)) - allocate(cgrid%mmsqu_nee ( npolygons)) + allocate(cgrid%mmsqu_carbon_ac ( npolygons)) + allocate(cgrid%mmsqu_carbon_st ( npolygons)) allocate(cgrid%mmsqu_nep ( npolygons)) allocate(cgrid%mmsqu_rh ( npolygons)) allocate(cgrid%mmsqu_sensible_ac ( npolygons)) @@ -2654,7 +2721,12 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmean_sensible_gc ( ndcycle, npolygons)) allocate(cgrid%qmean_sensible_lc ( ndcycle, npolygons)) allocate(cgrid%qmean_sensible_wc ( ndcycle, npolygons)) - allocate(cgrid%qmean_nee ( ndcycle, npolygons)) + allocate(cgrid%qmean_ustar ( ndcycle, npolygons)) + allocate(cgrid%qmean_tstar ( ndcycle, npolygons)) + allocate(cgrid%qmean_qstar ( ndcycle, npolygons)) + allocate(cgrid%qmean_cstar ( ndcycle, npolygons)) + allocate(cgrid%qmean_carbon_ac ( ndcycle, npolygons)) + allocate(cgrid%qmean_carbon_st ( ndcycle, npolygons)) allocate(cgrid%qmean_gpp ( ndcycle, npolygons)) allocate(cgrid%qmean_nep ( ndcycle, npolygons)) allocate(cgrid%qmean_plresp ( ndcycle, npolygons)) @@ -2703,7 +2775,8 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmsqu_leaf_resp ( ndcycle, npolygons)) allocate(cgrid%qmsqu_root_resp ( ndcycle, npolygons)) allocate(cgrid%qmsqu_plresp ( ndcycle, npolygons)) - allocate(cgrid%qmsqu_nee ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_carbon_ac ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_carbon_st ( ndcycle, npolygons)) allocate(cgrid%qmsqu_nep ( ndcycle, npolygons)) allocate(cgrid%qmsqu_rh ( ndcycle, npolygons)) allocate(cgrid%qmsqu_sensible_ac ( ndcycle, npolygons)) @@ -2775,6 +2848,7 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%moist_tau(nsites)) allocate(cpoly%moist_zi(nsites)) allocate(cpoly%baseflow(nsites)) + allocate(cpoly%ncol_soil(nsites)) allocate(cpoly%ntext_soil(nzg,nsites)) allocate(cpoly%min_monthly_temp(nsites)) allocate(cpoly%plantation(nsites)) @@ -2792,7 +2866,6 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%nat_dist_type(nsites)) allocate(cpoly%disturbance_memory(n_dist_types,n_dist_types,nsites)) allocate(cpoly%disturbance_rates(n_dist_types,n_dist_types,nsites)) - allocate(cpoly%loss_fraction(n_dist_types,nsites)) allocate(cpoly%green_leaf_factor(n_pft,nsites)) allocate(cpoly%leaf_aging_factor(n_pft,nsites)) @@ -2828,7 +2901,6 @@ subroutine allocate_polygontype(cpoly,nsites) ! --------------------------------------------- allocate(cpoly%avg_vapor_lc (nsites)) allocate(cpoly%avg_vapor_wc (nsites)) - allocate(cpoly%avg_dew_cg (nsites)) allocate(cpoly%avg_vapor_gc (nsites)) allocate(cpoly%avg_wshed_vg (nsites)) allocate(cpoly%avg_intercepted (nsites)) @@ -2846,7 +2918,12 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%aux_s (nzg,nsites)) allocate(cpoly%avg_rshort_gnd (nsites)) allocate(cpoly%avg_rlong_gnd (nsites)) + allocate(cpoly%avg_ustar (nsites)) + allocate(cpoly%avg_tstar (nsites)) + allocate(cpoly%avg_qstar (nsites)) + allocate(cpoly%avg_cstar (nsites)) allocate(cpoly%avg_carbon_ac (nsites)) + allocate(cpoly%avg_carbon_st (nsites)) allocate(cpoly%avg_sensible_lc (nsites)) allocate(cpoly%avg_sensible_wc (nsites)) allocate(cpoly%avg_qwshed_vg (nsites)) @@ -3013,6 +3090,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%old_stoma_vector_max(n_stoma_atts,n_pft,npatches)) allocate(csite%avg_daily_temp(npatches)) + allocate(csite%avg_monthly_gndwater(npatches)) allocate(csite%mean_rh(npatches)) allocate(csite%mean_nep(npatches)) allocate(csite%wbudget_loss2atm(npatches)) @@ -3054,6 +3132,12 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%rshort_g(npatches)) allocate(csite%rshort_g_beam(npatches)) allocate(csite%rshort_g_diffuse(npatches)) + allocate(csite%par_b(npatches)) + allocate(csite%par_b_beam(npatches)) + allocate(csite%par_b_diffuse(npatches)) + allocate(csite%nir_b(npatches)) + allocate(csite%nir_b_beam(npatches)) + allocate(csite%nir_b_diffuse(npatches)) allocate(csite%rlong_g(npatches)) allocate(csite%rlong_g_surf(npatches)) allocate(csite%rlong_g_incid(npatches)) @@ -3102,7 +3186,12 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%avg_rshort_gnd (npatches)) allocate(csite%avg_rlong_gnd (npatches)) + allocate(csite%avg_ustar (npatches)) + allocate(csite%avg_tstar (npatches)) + allocate(csite%avg_qstar (npatches)) + allocate(csite%avg_cstar (npatches)) allocate(csite%avg_carbon_ac (npatches)) + allocate(csite%avg_carbon_st (npatches)) allocate(csite%avg_rlongup (npatches)) allocate(csite%avg_albedo (npatches)) allocate(csite%avg_albedo_beam (npatches)) @@ -3113,7 +3202,6 @@ subroutine allocate_sitetype(csite,npatches) ! --------------------------------------------- allocate(csite%avg_vapor_lc (npatches)) allocate(csite%avg_vapor_wc (npatches)) - allocate(csite%avg_dew_cg (npatches)) allocate(csite%avg_vapor_gc (npatches)) allocate(csite%avg_wshed_vg (npatches)) allocate(csite%avg_intercepted (npatches)) @@ -3449,6 +3537,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%lon ) nullify(cgrid%xatm ) nullify(cgrid%yatm ) + nullify(cgrid%ncol_soil ) nullify(cgrid%ntext_soil ) nullify(cgrid%lsl ) @@ -3505,7 +3594,6 @@ subroutine nullify_edtype(cgrid) ! --------------------------------------------- nullify(cgrid%avg_vapor_lc ) nullify(cgrid%avg_vapor_wc ) - nullify(cgrid%avg_dew_cg ) nullify(cgrid%avg_vapor_gc ) nullify(cgrid%avg_wshed_vg ) nullify(cgrid%avg_intercepted ) @@ -3522,7 +3610,12 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%aux_s ) nullify(cgrid%avg_rshort_gnd ) nullify(cgrid%avg_rlong_gnd ) + nullify(cgrid%avg_ustar ) + nullify(cgrid%avg_tstar ) + nullify(cgrid%avg_qstar ) + nullify(cgrid%avg_cstar ) nullify(cgrid%avg_carbon_ac ) + nullify(cgrid%avg_carbon_st ) nullify(cgrid%avg_sensible_lc ) nullify(cgrid%avg_sensible_wc ) nullify(cgrid%avg_qwshed_vg ) @@ -3670,7 +3763,12 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%dmean_vapor_gc ) nullify(cgrid%dmean_vapor_lc ) nullify(cgrid%dmean_vapor_wc ) - nullify(cgrid%dmean_nee ) + nullify(cgrid%dmean_ustar ) + nullify(cgrid%dmean_tstar ) + nullify(cgrid%dmean_qstar ) + nullify(cgrid%dmean_cstar ) + nullify(cgrid%dmean_carbon_ac ) + nullify(cgrid%dmean_carbon_st ) nullify(cgrid%dmean_gpp ) nullify(cgrid%dmean_nppleaf ) nullify(cgrid%dmean_nppfroot ) @@ -3739,7 +3837,12 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%lai_pft ) nullify(cgrid%wpa_pft ) nullify(cgrid%wai_pft ) - nullify(cgrid%mmean_nee ) + nullify(cgrid%mmean_ustar ) + nullify(cgrid%mmean_tstar ) + nullify(cgrid%mmean_qstar ) + nullify(cgrid%mmean_cstar ) + nullify(cgrid%mmean_carbon_ac ) + nullify(cgrid%mmean_carbon_st ) nullify(cgrid%mmean_gpp ) nullify(cgrid%mmean_nppleaf ) nullify(cgrid%mmean_nppfroot ) @@ -3823,7 +3926,8 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmsqu_leaf_resp ) nullify(cgrid%mmsqu_root_resp ) nullify(cgrid%mmsqu_plresp ) - nullify(cgrid%mmsqu_nee ) + nullify(cgrid%mmsqu_carbon_ac ) + nullify(cgrid%mmsqu_carbon_st ) nullify(cgrid%mmsqu_nep ) nullify(cgrid%mmsqu_rh ) nullify(cgrid%mmsqu_sensible_ac ) @@ -3853,7 +3957,12 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmean_sensible_gc ) nullify(cgrid%qmean_sensible_wc ) nullify(cgrid%qmean_sensible_lc ) - nullify(cgrid%qmean_nee ) + nullify(cgrid%qmean_ustar ) + nullify(cgrid%qmean_tstar ) + nullify(cgrid%qmean_qstar ) + nullify(cgrid%qmean_cstar ) + nullify(cgrid%qmean_carbon_ac ) + nullify(cgrid%qmean_carbon_st ) nullify(cgrid%qmean_gpp ) nullify(cgrid%qmean_nep ) nullify(cgrid%qmean_plresp ) @@ -3902,7 +4011,8 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmsqu_leaf_resp ) nullify(cgrid%qmsqu_root_resp ) nullify(cgrid%qmsqu_plresp ) - nullify(cgrid%qmsqu_nee ) + nullify(cgrid%qmsqu_carbon_ac ) + nullify(cgrid%qmsqu_carbon_st ) nullify(cgrid%qmsqu_nep ) nullify(cgrid%qmsqu_rh ) nullify(cgrid%qmsqu_sensible_ac ) @@ -3966,6 +4076,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%moist_tau) nullify(cpoly%moist_zi) nullify(cpoly%baseflow) + nullify(cpoly%ncol_soil) nullify(cpoly%ntext_soil) nullify(cpoly%min_monthly_temp) nullify(cpoly%plantation) @@ -3983,8 +4094,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%nat_dist_type) nullify(cpoly%disturbance_memory) nullify(cpoly%disturbance_rates) - nullify(cpoly%loss_fraction) - nullify(cpoly%green_leaf_factor) + nullify(cpoly%green_leaf_factor) nullify(cpoly%leaf_aging_factor) nullify(cpoly%met) nullify(cpoly%basal_area) @@ -4016,7 +4126,6 @@ subroutine nullify_polygontype(cpoly) ! --------------------------------------------- nullify(cpoly%avg_vapor_lc ) nullify(cpoly%avg_vapor_wc ) - nullify(cpoly%avg_dew_cg ) nullify(cpoly%avg_vapor_gc ) nullify(cpoly%avg_wshed_vg ) nullify(cpoly%avg_intercepted) @@ -4033,7 +4142,12 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%aux_s ) nullify(cpoly%avg_rshort_gnd ) nullify(cpoly%avg_rlong_gnd ) + nullify(cpoly%avg_ustar ) + nullify(cpoly%avg_tstar ) + nullify(cpoly%avg_qstar ) + nullify(cpoly%avg_cstar ) nullify(cpoly%avg_carbon_ac ) + nullify(cpoly%avg_carbon_st ) nullify(cpoly%avg_sensible_lc ) nullify(cpoly%avg_sensible_wc ) nullify(cpoly%avg_qwshed_vg ) @@ -4186,7 +4300,8 @@ subroutine nullify_sitetype(csite) nullify(csite%A_c_max) nullify(csite%old_stoma_data_max) nullify(csite%old_stoma_vector_max) - nullify(csite%avg_daily_temp) + nullify(csite%avg_daily_temp) + nullify(csite%avg_monthly_gndwater) nullify(csite%mean_rh) nullify(csite%dmean_rh) nullify(csite%mmean_rh) @@ -4244,6 +4359,12 @@ subroutine nullify_sitetype(csite) nullify(csite%rshort_g) nullify(csite%rshort_g_beam) nullify(csite%rshort_g_diffuse) + nullify(csite%par_b) + nullify(csite%par_b_beam) + nullify(csite%par_b_diffuse) + nullify(csite%nir_b) + nullify(csite%nir_b_beam) + nullify(csite%nir_b_diffuse) nullify(csite%rlong_g) nullify(csite%rlong_g_surf) nullify(csite%rlong_g_incid) @@ -4295,7 +4416,12 @@ subroutine nullify_sitetype(csite) nullify(csite%avg_rshort_gnd ) nullify(csite%avg_rlong_gnd ) + nullify(csite%avg_ustar ) + nullify(csite%avg_tstar ) + nullify(csite%avg_qstar ) + nullify(csite%avg_cstar ) nullify(csite%avg_carbon_ac ) + nullify(csite%avg_carbon_st ) nullify(csite%avg_rlongup ) nullify(csite%avg_albedo ) nullify(csite%avg_albedo_beam ) @@ -4306,7 +4432,6 @@ subroutine nullify_sitetype(csite) ! --------------------------------------------- nullify(csite%avg_vapor_lc ) nullify(csite%avg_vapor_wc ) - nullify(csite%avg_dew_cg ) nullify(csite%avg_vapor_gc ) nullify(csite%avg_wshed_vg ) nullify(csite%avg_intercepted) @@ -4596,6 +4721,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%lon )) deallocate(cgrid%lon ) if(associated(cgrid%xatm )) deallocate(cgrid%xatm ) if(associated(cgrid%yatm )) deallocate(cgrid%yatm ) + if(associated(cgrid%ncol_soil )) deallocate(cgrid%ncol_soil ) if(associated(cgrid%ntext_soil )) deallocate(cgrid%ntext_soil ) if(associated(cgrid%lsl )) deallocate(cgrid%lsl ) @@ -4651,7 +4777,6 @@ subroutine deallocate_edtype(cgrid) ! --------------------------------------------- if(associated(cgrid%avg_vapor_lc )) deallocate(cgrid%avg_vapor_lc ) if(associated(cgrid%avg_vapor_wc )) deallocate(cgrid%avg_vapor_wc ) - if(associated(cgrid%avg_dew_cg )) deallocate(cgrid%avg_dew_cg ) if(associated(cgrid%avg_vapor_gc )) deallocate(cgrid%avg_vapor_gc ) if(associated(cgrid%avg_wshed_vg )) deallocate(cgrid%avg_wshed_vg ) if(associated(cgrid%avg_intercepted )) deallocate(cgrid%avg_intercepted ) @@ -4668,7 +4793,12 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%aux_s )) deallocate(cgrid%aux_s ) if(associated(cgrid%avg_rshort_gnd )) deallocate(cgrid%avg_rshort_gnd ) if(associated(cgrid%avg_rlong_gnd )) deallocate(cgrid%avg_rlong_gnd ) + if(associated(cgrid%avg_ustar )) deallocate(cgrid%avg_ustar ) + if(associated(cgrid%avg_tstar )) deallocate(cgrid%avg_tstar ) + if(associated(cgrid%avg_qstar )) deallocate(cgrid%avg_qstar ) + if(associated(cgrid%avg_cstar )) deallocate(cgrid%avg_cstar ) if(associated(cgrid%avg_carbon_ac )) deallocate(cgrid%avg_carbon_ac ) + if(associated(cgrid%avg_carbon_st )) deallocate(cgrid%avg_carbon_st ) if(associated(cgrid%avg_sensible_lc )) deallocate(cgrid%avg_sensible_lc ) if(associated(cgrid%avg_sensible_wc )) deallocate(cgrid%avg_sensible_wc ) if(associated(cgrid%avg_qwshed_vg )) deallocate(cgrid%avg_qwshed_vg ) @@ -4830,7 +4960,12 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%dmean_vapor_gc )) deallocate(cgrid%dmean_vapor_gc ) if(associated(cgrid%dmean_vapor_lc )) deallocate(cgrid%dmean_vapor_lc ) if(associated(cgrid%dmean_vapor_wc )) deallocate(cgrid%dmean_vapor_wc ) - if(associated(cgrid%dmean_nee )) deallocate(cgrid%dmean_nee ) + if(associated(cgrid%dmean_ustar )) deallocate(cgrid%dmean_ustar ) + if(associated(cgrid%dmean_tstar )) deallocate(cgrid%dmean_tstar ) + if(associated(cgrid%dmean_qstar )) deallocate(cgrid%dmean_qstar ) + if(associated(cgrid%dmean_cstar )) deallocate(cgrid%dmean_cstar ) + if(associated(cgrid%dmean_carbon_ac )) deallocate(cgrid%dmean_carbon_ac ) + if(associated(cgrid%dmean_carbon_st )) deallocate(cgrid%dmean_carbon_st ) if(associated(cgrid%dmean_gpp )) deallocate(cgrid%dmean_gpp ) if(associated(cgrid%dmean_nppleaf )) deallocate(cgrid%dmean_nppleaf ) if(associated(cgrid%dmean_nppfroot )) deallocate(cgrid%dmean_nppfroot ) @@ -4918,7 +5053,12 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmean_sensible_wc )) deallocate(cgrid%mmean_sensible_wc ) if(associated(cgrid%mmean_sensible_gc )) deallocate(cgrid%mmean_sensible_gc ) if(associated(cgrid%mmean_sensible_ac )) deallocate(cgrid%mmean_sensible_ac ) - if(associated(cgrid%mmean_nee )) deallocate(cgrid%mmean_nee ) + if(associated(cgrid%mmean_ustar )) deallocate(cgrid%mmean_ustar ) + if(associated(cgrid%mmean_tstar )) deallocate(cgrid%mmean_tstar ) + if(associated(cgrid%mmean_qstar )) deallocate(cgrid%mmean_qstar ) + if(associated(cgrid%mmean_cstar )) deallocate(cgrid%mmean_cstar ) + if(associated(cgrid%mmean_carbon_ac )) deallocate(cgrid%mmean_carbon_ac ) + if(associated(cgrid%mmean_carbon_st )) deallocate(cgrid%mmean_carbon_st ) if(associated(cgrid%mmean_nep )) deallocate(cgrid%mmean_nep ) if(associated(cgrid%mmean_soil_temp )) deallocate(cgrid%mmean_soil_temp ) if(associated(cgrid%mmean_soil_water )) deallocate(cgrid%mmean_soil_water ) @@ -4985,7 +5125,8 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmsqu_leaf_resp )) deallocate(cgrid%mmsqu_leaf_resp ) if(associated(cgrid%mmsqu_root_resp )) deallocate(cgrid%mmsqu_root_resp ) if(associated(cgrid%mmsqu_plresp )) deallocate(cgrid%mmsqu_plresp ) - if(associated(cgrid%mmsqu_nee )) deallocate(cgrid%mmsqu_nee ) + if(associated(cgrid%mmsqu_carbon_ac )) deallocate(cgrid%mmsqu_carbon_ac ) + if(associated(cgrid%mmsqu_carbon_st )) deallocate(cgrid%mmsqu_carbon_st ) if(associated(cgrid%mmsqu_nep )) deallocate(cgrid%mmsqu_nep ) if(associated(cgrid%mmsqu_rh )) deallocate(cgrid%mmsqu_rh ) if(associated(cgrid%mmsqu_sensible_ac )) deallocate(cgrid%mmsqu_sensible_ac ) @@ -5015,7 +5156,12 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmean_sensible_gc )) deallocate(cgrid%qmean_sensible_gc ) if(associated(cgrid%qmean_sensible_lc )) deallocate(cgrid%qmean_sensible_lc ) if(associated(cgrid%qmean_sensible_wc )) deallocate(cgrid%qmean_sensible_wc ) - if(associated(cgrid%qmean_nee )) deallocate(cgrid%qmean_nee ) + if(associated(cgrid%qmean_ustar )) deallocate(cgrid%qmean_ustar ) + if(associated(cgrid%qmean_tstar )) deallocate(cgrid%qmean_tstar ) + if(associated(cgrid%qmean_qstar )) deallocate(cgrid%qmean_qstar ) + if(associated(cgrid%qmean_cstar )) deallocate(cgrid%qmean_cstar ) + if(associated(cgrid%qmean_carbon_ac )) deallocate(cgrid%qmean_carbon_ac ) + if(associated(cgrid%qmean_carbon_st )) deallocate(cgrid%qmean_carbon_st ) if(associated(cgrid%qmean_gpp )) deallocate(cgrid%qmean_gpp ) if(associated(cgrid%qmean_nep )) deallocate(cgrid%qmean_nep ) if(associated(cgrid%qmean_plresp )) deallocate(cgrid%qmean_plresp ) @@ -5063,7 +5209,8 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmsqu_leaf_resp )) deallocate(cgrid%qmsqu_leaf_resp ) if(associated(cgrid%qmsqu_root_resp )) deallocate(cgrid%qmsqu_root_resp ) if(associated(cgrid%qmsqu_plresp )) deallocate(cgrid%qmsqu_plresp ) - if(associated(cgrid%qmsqu_nee )) deallocate(cgrid%qmsqu_nee ) + if(associated(cgrid%qmsqu_carbon_ac )) deallocate(cgrid%qmsqu_carbon_ac ) + if(associated(cgrid%qmsqu_carbon_st )) deallocate(cgrid%qmsqu_carbon_st ) if(associated(cgrid%qmsqu_nep )) deallocate(cgrid%qmsqu_nep ) if(associated(cgrid%qmsqu_rh )) deallocate(cgrid%qmsqu_rh ) if(associated(cgrid%qmsqu_sensible_ac )) deallocate(cgrid%qmsqu_sensible_ac ) @@ -5129,6 +5276,7 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%moist_tau )) deallocate(cpoly%moist_tau ) if(associated(cpoly%moist_zi )) deallocate(cpoly%moist_zi ) if(associated(cpoly%baseflow )) deallocate(cpoly%baseflow ) + if(associated(cpoly%ncol_soil )) deallocate(cpoly%ncol_soil ) if(associated(cpoly%ntext_soil )) deallocate(cpoly%ntext_soil ) if(associated(cpoly%min_monthly_temp )) deallocate(cpoly%min_monthly_temp ) if(associated(cpoly%plantation )) deallocate(cpoly%plantation ) @@ -5146,7 +5294,6 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%nat_dist_type )) deallocate(cpoly%nat_dist_type ) if(associated(cpoly%disturbance_memory )) deallocate(cpoly%disturbance_memory ) if(associated(cpoly%disturbance_rates )) deallocate(cpoly%disturbance_rates ) - if(associated(cpoly%loss_fraction )) deallocate(cpoly%loss_fraction ) if(associated(cpoly%green_leaf_factor )) deallocate(cpoly%green_leaf_factor ) if(associated(cpoly%leaf_aging_factor )) deallocate(cpoly%leaf_aging_factor ) if(associated(cpoly%met )) deallocate(cpoly%met ) @@ -5180,7 +5327,6 @@ subroutine deallocate_polygontype(cpoly) ! --------------------------------------------- if(associated(cpoly%avg_vapor_lc )) deallocate(cpoly%avg_vapor_lc ) if(associated(cpoly%avg_vapor_wc )) deallocate(cpoly%avg_vapor_wc ) - if(associated(cpoly%avg_dew_cg )) deallocate(cpoly%avg_dew_cg ) if(associated(cpoly%avg_vapor_gc )) deallocate(cpoly%avg_vapor_gc ) if(associated(cpoly%avg_wshed_vg )) deallocate(cpoly%avg_wshed_vg ) if(associated(cpoly%avg_intercepted )) deallocate(cpoly%avg_intercepted ) @@ -5197,7 +5343,12 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%aux_s )) deallocate(cpoly%aux_s ) if(associated(cpoly%avg_rshort_gnd )) deallocate(cpoly%avg_rshort_gnd ) if(associated(cpoly%avg_rlong_gnd )) deallocate(cpoly%avg_rlong_gnd ) + if(associated(cpoly%avg_ustar )) deallocate(cpoly%avg_ustar ) + if(associated(cpoly%avg_tstar )) deallocate(cpoly%avg_tstar ) + if(associated(cpoly%avg_qstar )) deallocate(cpoly%avg_qstar ) + if(associated(cpoly%avg_cstar )) deallocate(cpoly%avg_cstar ) if(associated(cpoly%avg_carbon_ac )) deallocate(cpoly%avg_carbon_ac ) + if(associated(cpoly%avg_carbon_st )) deallocate(cpoly%avg_carbon_st ) if(associated(cpoly%avg_sensible_lc )) deallocate(cpoly%avg_sensible_lc ) if(associated(cpoly%avg_sensible_wc )) deallocate(cpoly%avg_sensible_wc ) if(associated(cpoly%avg_qwshed_vg )) deallocate(cpoly%avg_qwshed_vg ) @@ -5352,6 +5503,7 @@ subroutine deallocate_sitetype(csite) if(associated(csite%old_stoma_vector_max )) deallocate(csite%old_stoma_vector_max ) if(associated(csite%avg_daily_temp )) deallocate(csite%avg_daily_temp ) + if(associated(csite%avg_monthly_gndwater )) deallocate(csite%avg_monthly_gndwater ) if(associated(csite%mean_rh )) deallocate(csite%mean_rh ) if(associated(csite%dmean_rh )) deallocate(csite%dmean_rh ) if(associated(csite%qmean_rh )) deallocate(csite%qmean_rh ) @@ -5409,6 +5561,12 @@ subroutine deallocate_sitetype(csite) if(associated(csite%rshort_g )) deallocate(csite%rshort_g ) if(associated(csite%rshort_g_beam )) deallocate(csite%rshort_g_beam ) if(associated(csite%rshort_g_diffuse )) deallocate(csite%rshort_g_diffuse ) + if(associated(csite%par_b )) deallocate(csite%par_b ) + if(associated(csite%par_b_beam )) deallocate(csite%par_b_beam ) + if(associated(csite%par_b_diffuse )) deallocate(csite%par_b_diffuse ) + if(associated(csite%nir_b )) deallocate(csite%nir_b ) + if(associated(csite%nir_b_beam )) deallocate(csite%nir_b_beam ) + if(associated(csite%nir_b_diffuse )) deallocate(csite%nir_b_diffuse ) if(associated(csite%rlong_g )) deallocate(csite%rlong_g ) if(associated(csite%rlong_g_surf )) deallocate(csite%rlong_g_surf ) if(associated(csite%rlong_g_incid )) deallocate(csite%rlong_g_incid ) @@ -5459,7 +5617,12 @@ subroutine deallocate_sitetype(csite) if(associated(csite%avg_rshort_gnd )) deallocate(csite%avg_rshort_gnd ) if(associated(csite%avg_rlong_gnd )) deallocate(csite%avg_rlong_gnd ) + if(associated(csite%avg_ustar )) deallocate(csite%avg_ustar ) + if(associated(csite%avg_tstar )) deallocate(csite%avg_tstar ) + if(associated(csite%avg_qstar )) deallocate(csite%avg_qstar ) + if(associated(csite%avg_cstar )) deallocate(csite%avg_cstar ) if(associated(csite%avg_carbon_ac )) deallocate(csite%avg_carbon_ac ) + if(associated(csite%avg_carbon_st )) deallocate(csite%avg_carbon_st ) if(associated(csite%avg_rlongup )) deallocate(csite%avg_rlongup ) if(associated(csite%avg_albedo )) deallocate(csite%avg_albedo ) if(associated(csite%avg_albedo_beam )) deallocate(csite%avg_albedo_beam ) @@ -5468,7 +5631,6 @@ subroutine deallocate_sitetype(csite) if(associated(csite%avg_vapor_lc )) deallocate(csite%avg_vapor_lc ) if(associated(csite%avg_vapor_wc )) deallocate(csite%avg_vapor_wc ) - if(associated(csite%avg_dew_cg )) deallocate(csite%avg_dew_cg ) if(associated(csite%avg_vapor_gc )) deallocate(csite%avg_vapor_gc ) if(associated(csite%avg_wshed_vg )) deallocate(csite%avg_wshed_vg ) if(associated(csite%avg_intercepted )) deallocate(csite%avg_intercepted ) @@ -5833,6 +5995,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%wpa(opa) = isite%wpa(ipa) osite%wai(opa) = isite%wai(ipa) osite%avg_daily_temp(opa) = isite%avg_daily_temp(ipa) + osite%avg_monthly_gndwater(opa) = isite%avg_monthly_gndwater(ipa) osite%mean_rh(opa) = isite%mean_rh(ipa) osite%mean_nep(opa) = isite%mean_nep(ipa) osite%wbudget_loss2atm(opa) = isite%wbudget_loss2atm(ipa) @@ -5872,6 +6035,12 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%rshort_g(opa) = isite%rshort_g(ipa) osite%rshort_g_beam(opa) = isite%rshort_g_beam(ipa) osite%rshort_g_diffuse(opa) = isite%rshort_g_diffuse(ipa) + osite%par_b(opa) = isite%par_b(ipa) + osite%par_b_beam(opa) = isite%par_b_beam(ipa) + osite%par_b_diffuse(opa) = isite%par_b_diffuse(ipa) + osite%nir_b(opa) = isite%nir_b(ipa) + osite%nir_b_beam(opa) = isite%nir_b_beam(ipa) + osite%nir_b_diffuse(opa) = isite%nir_b_diffuse(ipa) osite%rlong_g(opa) = isite%rlong_g(ipa) osite%rlong_g_surf(opa) = isite%rlong_g_surf(ipa) osite%rlong_g_incid(opa) = isite%rlong_g_incid(ipa) @@ -5923,7 +6092,12 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%avg_rshort_gnd (opa) = isite%avg_rshort_gnd (ipa) osite%avg_rlong_gnd (opa) = isite%avg_rlong_gnd (ipa) + osite%avg_ustar (opa) = isite%avg_ustar (ipa) + osite%avg_tstar (opa) = isite%avg_tstar (ipa) + osite%avg_qstar (opa) = isite%avg_qstar (ipa) + osite%avg_cstar (opa) = isite%avg_cstar (ipa) osite%avg_carbon_ac (opa) = isite%avg_carbon_ac (ipa) + osite%avg_carbon_st (opa) = isite%avg_carbon_st (ipa) osite%avg_rlongup (opa) = isite%avg_rlongup (ipa) osite%avg_albedo (opa) = isite%avg_albedo (ipa) osite%avg_albedo_beam (opa) = isite%avg_albedo_beam (ipa) @@ -5932,7 +6106,6 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%avg_vapor_lc(opa) = isite%avg_vapor_lc(ipa) osite%avg_vapor_wc(opa) = isite%avg_vapor_wc(ipa) - osite%avg_dew_cg(opa) = isite%avg_dew_cg(ipa) osite%avg_vapor_gc(opa) = isite%avg_vapor_gc(ipa) osite%avg_wshed_vg(opa) = isite%avg_wshed_vg(ipa) osite%avg_intercepted(opa) = isite%avg_intercepted(ipa) @@ -6153,6 +6326,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%wpa(1:inc) = pack(sitein%wpa,logmask) siteout%wai(1:inc) = pack(sitein%wai,logmask) siteout%avg_daily_temp(1:inc) = pack(sitein%avg_daily_temp,logmask) + siteout%avg_monthly_gndwater(1:inc) = pack(sitein%avg_monthly_gndwater,logmask) siteout%mean_rh(1:inc) = pack(sitein%mean_rh,logmask) siteout%mean_nep(1:inc) = pack(sitein%mean_nep,logmask) siteout%wbudget_loss2atm(1:inc) = pack(sitein%wbudget_loss2atm,logmask) @@ -6192,6 +6366,12 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%rshort_g(1:inc) = pack(sitein%rshort_g,logmask) siteout%rshort_g_beam(1:inc) = pack(sitein%rshort_g_beam,logmask) siteout%rshort_g_diffuse(1:inc) = pack(sitein%rshort_g_diffuse,logmask) + siteout%par_b(1:inc) = pack(sitein%par_b,logmask) + siteout%par_b_beam(1:inc) = pack(sitein%par_b_beam,logmask) + siteout%par_b_diffuse(1:inc) = pack(sitein%par_b_diffuse,logmask) + siteout%nir_b(1:inc) = pack(sitein%nir_b,logmask) + siteout%nir_b_beam(1:inc) = pack(sitein%nir_b_beam,logmask) + siteout%nir_b_diffuse(1:inc) = pack(sitein%nir_b_diffuse,logmask) siteout%rlong_g(1:inc) = pack(sitein%rlong_g,logmask) siteout%rlong_g_surf(1:inc) = pack(sitein%rlong_g_surf,logmask) siteout%rlong_g_incid(1:inc) = pack(sitein%rlong_g_incid,logmask) @@ -6243,7 +6423,12 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%avg_rshort_gnd (1:inc) = pack(sitein%avg_rshort_gnd ,logmask) siteout%avg_rlong_gnd (1:inc) = pack(sitein%avg_rlong_gnd ,logmask) + siteout%avg_ustar (1:inc) = pack(sitein%avg_ustar ,logmask) + siteout%avg_tstar (1:inc) = pack(sitein%avg_tstar ,logmask) + siteout%avg_qstar (1:inc) = pack(sitein%avg_qstar ,logmask) + siteout%avg_cstar (1:inc) = pack(sitein%avg_cstar ,logmask) siteout%avg_carbon_ac (1:inc) = pack(sitein%avg_carbon_ac ,logmask) + siteout%avg_carbon_st (1:inc) = pack(sitein%avg_carbon_st ,logmask) siteout%avg_rlongup (1:inc) = pack(sitein%avg_rlongup ,logmask) siteout%avg_albedo (1:inc) = pack(sitein%avg_albedo ,logmask) siteout%avg_albedo_beam (1:inc) = pack(sitein%avg_albedo_beam ,logmask) @@ -6252,7 +6437,6 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%avg_vapor_lc(1:inc) = pack(sitein%avg_vapor_lc,logmask) siteout%avg_vapor_wc(1:inc) = pack(sitein%avg_vapor_wc,logmask) - siteout%avg_dew_cg(1:inc) = pack(sitein%avg_dew_cg,logmask) siteout%avg_vapor_gc(1:inc) = pack(sitein%avg_vapor_gc,logmask) siteout%avg_wshed_vg(1:inc) = pack(sitein%avg_wshed_vg,logmask) siteout%avg_intercepted(1:inc) = pack(sitein%avg_intercepted,logmask) @@ -6296,7 +6480,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%rshort_s_beam(k,1:inc) = pack(sitein%rshort_s_beam(k,:),logmask) siteout%rshort_s_diffuse(k,1:inc) = pack(sitein%rshort_s_diffuse(k,:),logmask) siteout%sfcwater_tempk(k,1:inc) = pack(sitein%sfcwater_tempk(k,:),logmask) - siteout%sfcwater_fracliq(k,1:inc) = pack(sitein%sfcwater_fracliq(k,:),logmask) + siteout%sfcwater_fracliq(k,1:inc) = pack(sitein%sfcwater_fracliq(k,:),logmask) end do ! Soil layers 1:nzg @@ -7648,6 +7832,15 @@ subroutine filltab_edtype_p10(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva end if + if (associated(cgrid%ncol_soil)) then + nvar=nvar+1 + call vtable_edio_i(npts,cgrid%ncol_soil,nvar,igr,init,cgrid%pyglob_id & + ,var_len,var_len_global,max_ptrs & + ,'NCOL_SOIL :10:hist:anal:dail:mont:dcyc:year') + call metadata_edio(nvar,igr,'Soil colour','NA','ipoly') + + end if + if (associated(cgrid%load_adjacency)) then nvar=nvar+1 call vtable_edio_i(npts,cgrid%load_adjacency,nvar,igr,init,cgrid%pyglob_id, & @@ -7866,13 +8059,6 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'polygon wood to canopy air vapor flux','[kg/m2/s]','ipoly') end if - if (associated(cgrid%avg_dew_cg)) then - nvar=nvar+1 - call vtable_edio_r(npts,cgrid%avg_dew_cg,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'AVG_DEW_CG :11:hist:anal:opti') - call metadata_edio(nvar,igr,'Polygon averaged dew to ground flux','[kg/m2/s]','ipoly') - end if - if (associated(cgrid%avg_vapor_gc)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_vapor_gc,nvar,igr,init,cgrid%pyglob_id, & @@ -7965,6 +8151,34 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon averaged ground absorbed LW radiation','[W/m2]','ipoly') end if + if (associated(cgrid%avg_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_USTAR :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon averaged friction velocity','[m/s]','ipoly') + end if + + if (associated(cgrid%avg_tstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_tstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_TSTAR :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon averaged characteristic temp. gradient','[K]','ipoly') + end if + + if (associated(cgrid%avg_qstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_qstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_QSTAR :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon averaged characteristic specific humidity gradient','[kg/kg]','ipoly') + end if + + if (associated(cgrid%avg_cstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_cstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CSTAR :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon averaged characteristic CO2 gradient','[umol/mol]','ipoly') + end if + if (associated(cgrid%avg_carbon_ac)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & @@ -7972,6 +8186,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon averaged vegetation to canopy air CO2 flux','[umol/m2/s]','ipoly') end if + if (associated(cgrid%avg_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CARBON_ST :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon averaged canopy CO2 storage flux','[umol/m2/s]','ipoly') + end if + if (associated(cgrid%avg_sensible_lc)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_sensible_lc,nvar,igr,init,cgrid%pyglob_id, & @@ -8891,11 +9112,46 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva end if - if(associated(cgrid%dmean_nee)) then + if(associated(cgrid%dmean_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_USTAR :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily friction velocity','[m/s]','ipoly') + end if + + if(associated(cgrid%dmean_tstar)) then nvar=nvar+1 - call vtable_edio_r(npts,cgrid%dmean_nee,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'DMEAN_NEE :11:hist:dail') - call metadata_edio(nvar,igr,'Polygon Average Daily Integrated Net Ecosystem Exchange','[kgC/m2/yr]','ipoly') + call vtable_edio_r(npts,cgrid%dmean_tstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_TSTAR :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily temperature gradient scale','[K]','ipoly') + end if + + if(associated(cgrid%dmean_qstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_qstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_QSTAR :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily sp. humidity gradient scale','[K]','ipoly') + end if + + if(associated(cgrid%dmean_cstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_cstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CSTAR :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily CO2 gradient scale','[K]','ipoly') + end if + + if(associated(cgrid%dmean_carbon_ac)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CARBON_AC :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily Integrated CO2 flux','[umol/m2/s]','ipoly') + end if + + if(associated(cgrid%dmean_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CARBON_ST :11:hist:dail') + call metadata_edio(nvar,igr,'Polygon Average Daily Integrated CO2 storage flux','[umol/m2/s]','ipoly') end if @@ -9370,10 +9626,45 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon Average Monthly NPP daily','[kgC/m2/yr]','ipoly') end if - if(associated(cgrid%mmean_nee)) then + if(associated(cgrid%mmean_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_USTAR :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmean_tstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_tstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_TSTAR :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmean_qstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_qstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_QSTAR :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmean_cstar)) then nvar=nvar+1 - call vtable_edio_r(npts,cgrid%mmean_nee,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'MMEAN_NEE :11:hist:mont:dcyc') + call vtable_edio_r(npts,cgrid%mmean_cstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CSTAR :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmean_carbon_ac)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CARBON_AC :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmean_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CARBON_ST :11:hist:mont:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -9820,10 +10111,17 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if - if(associated(cgrid%mmsqu_nee)) then + if(associated(cgrid%mmsqu_carbon_ac)) then nvar=nvar+1 - call vtable_edio_r(npts,cgrid%mmsqu_nee,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'MMSQU_NEE :11:hist:mont:dcyc') + call vtable_edio_r(npts,cgrid%mmsqu_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_CARBON_AC :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%mmsqu_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_CARBON_ST :11:hist:mont:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -10040,10 +10338,45 @@ subroutine filltab_edtype_m11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if - if(associated(cgrid%qmean_nee)) then + if(associated(cgrid%qmean_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_ustar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_USTAR :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_tstar)) then nvar=nvar+1 - call vtable_edio_r(npts,cgrid%qmean_nee,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'QMEAN_NEE :-11:hist:dcyc') + call vtable_edio_r(npts,cgrid%qmean_tstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_TSTAR :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_qstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_qstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_QSTAR :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_cstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_cstar,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CSTAR :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_carbon_ac)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CARBON_AC :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmean_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CARBON_ST :-11:hist:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -10362,10 +10695,17 @@ subroutine filltab_edtype_m11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if - if(associated(cgrid%qmsqu_nee)) then + if(associated(cgrid%qmsqu_carbon_ac)) then nvar=nvar+1 - call vtable_edio_r(npts,cgrid%qmsqu_nee,nvar,igr,init,cgrid%pyglob_id, & - var_len,var_len_global,max_ptrs,'QMSQU_NEE :-11:hist:dcyc') + call vtable_edio_r(npts,cgrid%qmsqu_carbon_ac,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_CARBON_AC :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if(associated(cgrid%qmsqu_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_carbon_st,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_CARBON_ST :-11:hist:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -11253,6 +11593,13 @@ subroutine filltab_polygontype(igr,ipy,init) var_len,var_len_global,max_ptrs,'LSL_SI :20:hist:dail:mont:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + + if (associated(cpoly%ncol_soil)) then + nvar=nvar+1 + call vtable_edio_i(npts,cpoly%ncol_soil,nvar,igr,init,cpoly%siglob_id, & + var_len,var_len_global,max_ptrs,'NCOL_SOIL_SI :20:hist:dail:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if if (associated(cpoly%num_landuse_years)) then nvar=nvar+1 @@ -11571,27 +11918,6 @@ subroutine filltab_polygontype(igr,ipy,init) - !------------------------------------------------------------------------------------! - !------------------------------------------------------------------------------------! - ! This is the 2-D block, with dimensions being nsites and n_dist_types. Make ! - ! sure to include only variables of type 25 here, as they will all use the same ! - ! npts. ! - !------------------------------------------------------------------------------------! - npts = cpoly%nsites * n_dist_types - - if (associated(cpoly%loss_fraction)) then - nvar=nvar+1 - call vtable_edio_r(npts,cpoly%loss_fraction,nvar,igr,init,cpoly%siglob_id, & - var_len,var_len_global,max_ptrs,'LOSS_FRACTION :25:hist') - call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') - end if - !------------------------------------------------------------------------------------! - !------------------------------------------------------------------------------------! - - - - - !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! ! This is the 2-D block, with dimensions being nsites and 12 months. Make sure ! @@ -12305,6 +12631,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%avg_monthly_gndwater)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_monthly_gndwater,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_MONTHLY_GNDWATER :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%co2budget_plresp)) then nvar=nvar+1 call vtable_edio_r(npts,csite%co2budget_plresp,nvar,igr,init,csite%paglob_id, & @@ -12454,6 +12787,48 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%par_b)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%par_b,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'PAR_B :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%par_b_beam)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%par_b_beam,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'PAR_B_BEAM :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%par_b_diffuse)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%par_b_diffuse,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'PAR_B_DIFFUSE :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%nir_b)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%nir_b,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'NIR_B :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%nir_b_beam)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%nir_b_beam,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'NIR_B_BEAM :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%nir_b_diffuse)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%nir_b_diffuse,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'NIR_B_DIFFUSE :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%rlong_g)) then nvar=nvar+1 call vtable_edio_r(npts,csite%rlong_g,nvar,igr,init,csite%paglob_id, & @@ -12799,6 +13174,34 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%avg_ustar)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_ustar,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_USTAR_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_tstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_tstar,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_TSTAR_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_qstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_qstar,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_QSTAR_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(csite%avg_cstar)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_cstar,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CSTAR_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%avg_carbon_ac)) then nvar=nvar+1 call vtable_edio_r(npts,csite%avg_carbon_ac,nvar,igr,init,csite%paglob_id, & @@ -12806,6 +13209,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%avg_carbon_st)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_carbon_st,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CARBON_ST_PA :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(csite%dmean_co2_residual)) then nvar=nvar+1 call vtable_edio_r(npts,csite%dmean_co2_residual,nvar,igr,init,csite%paglob_id, & @@ -13065,9 +13475,9 @@ subroutine filltab_sitetype(igr,ipy,isi,init) !------------------------------------------------------------------------------------! npts = csite%npatches * n_dbh - if (associated(csite%co2budget_gpp)) then + if (associated(csite%co2budget_gpp_dbh)) then nvar=nvar+1 - call vtable_edio_r(npts,csite%co2budget_gpp,nvar,igr,init,csite%paglob_id, & + call vtable_edio_r(npts,csite%co2budget_gpp_dbh,nvar,igr,init,csite%paglob_id, & var_len,var_len_global,max_ptrs,'CO2BUDGET_GPP_DBH :36:hist') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -13250,7 +13660,7 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) if (associated(cpatch%krdepth)) then nvar=nvar+1 call vtable_edio_i(npts,cpatch%krdepth,nvar,igr,init,cpatch%coglob_id, & - var_len,var_len_global,max_ptrs,'KRDEPTH :40:hist:anal') + var_len,var_len_global,max_ptrs,'KRDEPTH :40:hist:anal:dail:mont:dcyc:year') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if diff --git a/ED/src/memory/ed_work_vars.f90 b/ED/src/memory/ed_work_vars.f90 index 9a17d0a99..d1f1562e6 100644 --- a/ED/src/memory/ed_work_vars.f90 +++ b/ED/src/memory/ed_work_vars.f90 @@ -11,6 +11,7 @@ module ed_work_vars real , dimension( :,:), pointer :: landfrac real , dimension(:,:,:), pointer :: soilfrac integer, dimension(:,:,:), pointer :: ntext + integer, dimension( :,:), pointer :: nscol integer, dimension( :,:), pointer :: xatm integer, dimension( :,:), pointer :: yatm end type work_vars @@ -23,6 +24,7 @@ module ed_work_vars real , dimension(: ), pointer :: landfrac real , dimension(:,:), pointer :: soilfrac integer, dimension(:,:), pointer :: ntext + integer, dimension(: ), pointer :: nscol integer, dimension(: ), pointer :: xid integer, dimension(: ), pointer :: yid end type work_vecs @@ -65,6 +67,7 @@ subroutine ed_alloc_work(worke,n2,n3,nsite) allocate (worke%landfrac( n2,n3)) allocate (worke%soilfrac(nsite,n2,n3)) allocate (worke%ntext (nsite,n2,n3)) + allocate (worke%nscol ( n2,n3)) !------------------------------------------------------------------------------------! return @@ -95,6 +98,7 @@ subroutine ed_nullify_work(worke) if (associated(worke%landfrac )) nullify (worke%landfrac) if (associated(worke%soilfrac )) nullify (worke%soilfrac) if (associated(worke%ntext )) nullify (worke%ntext ) + if (associated(worke%nscol )) nullify (worke%nscol ) return end subroutine ed_nullify_work @@ -121,6 +125,8 @@ subroutine ed_dealloc_work(worke) if (associated(worke%landfrac )) deallocate (worke%landfrac ) if (associated(worke%soilfrac )) deallocate (worke%soilfrac ) if (associated(worke%ntext )) deallocate (worke%ntext ) + if (associated(worke%nscol )) deallocate (worke%nscol ) + return end subroutine ed_dealloc_work !=======================================================================================! @@ -150,6 +156,7 @@ subroutine ed_alloc_work_vec(workv,npolys,nsite) allocate (workv%landfrac( npolys)) allocate (workv%soilfrac(nsite,npolys)) allocate (workv%ntext (nsite,npolys)) + allocate (workv%nscol ( npolys)) allocate (workv%xid ( npolys)) allocate (workv%yid ( npolys)) !------------------------------------------------------------------------------------! @@ -179,6 +186,7 @@ subroutine ed_nullify_work_vec(workv) if (associated(workv%landfrac)) nullify(workv%landfrac) if (associated(workv%soilfrac)) nullify(workv%soilfrac) if (associated(workv%ntext )) nullify(workv%ntext ) + if (associated(workv%nscol )) nullify(workv%nscol ) if (associated(workv%xid )) nullify(workv%xid ) if (associated(workv%yid )) nullify(workv%yid ) @@ -207,6 +215,7 @@ subroutine ed_dealloc_work_vec(workv) if (associated(workv%landfrac)) deallocate(workv%landfrac) if (associated(workv%soilfrac)) deallocate(workv%soilfrac) if (associated(workv%ntext )) deallocate(workv%ntext ) + if (associated(workv%nscol )) deallocate(workv%nscol ) if (associated(workv%xid )) deallocate(workv%xid ) if (associated(workv%yid )) deallocate(workv%yid ) diff --git a/ED/src/memory/ename_coms.f90 b/ED/src/memory/ename_coms.f90 index c44eb8ab0..37a9d2d17 100644 --- a/ED/src/memory/ename_coms.f90 +++ b/ED/src/memory/ename_coms.f90 @@ -93,6 +93,7 @@ module ename_coms integer :: nzs integer , dimension(maxgrds) :: isoilflg integer :: nslcon + integer :: isoilcol real :: slxclay real :: slxsand integer :: isoilstateinit @@ -129,27 +130,51 @@ module ename_coms !----- Options for model dynamics. --------------------------------------------------! + integer :: ivegt_dynamics integer :: integration_scheme real :: rk4_tolerance integer :: ibranch_thermo integer :: iphysiol - integer :: istoma_scheme integer :: iallom integer :: iphen_scheme integer :: repro_scheme integer :: lapse_scheme integer :: crown_mod - integer :: ican_swrad + integer :: icanrad + real :: ltrans_vis + real :: ltrans_nir + real :: lreflect_vis + real :: lreflect_nir + real :: orient_tree + real :: orient_grass + real :: clump_tree + real :: clump_grass integer :: h2o_plant_lim - real :: vmfact - real :: mfact - real :: kfact - real :: gamfact - real :: d0fact - real :: alphafact + real :: vmfact_c3 + real :: vmfact_c4 + real :: mphoto_trc3 + real :: mphoto_tec3 + real :: mphoto_c4 + real :: bphoto_blc3 + real :: bphoto_nlc3 + real :: bphoto_c4 + real :: kw_grass + real :: kw_tree + real :: gamma_c3 + real :: gamma_c4 + real :: d0_grass + real :: d0_tree + real :: alpha_c3 + real :: alpha_c4 + real :: klowco2in + real :: rrffact + real :: growthresp + real :: lwidth_grass + real :: lwidth_bltree + real :: lwidth_nltree + real :: q10_c3 + real :: q10_c4 real :: thetacrit - real :: lwfact - real :: thioff integer :: quantum_efficiency_T integer :: n_plant_lim integer :: n_decomp_lim @@ -158,7 +183,6 @@ module ename_coms real :: sm_fire integer :: ianth_disturb integer :: icanturb - integer :: i_blyr_condct integer :: isfclyrm integer :: ied_grndvap integer :: ipercol @@ -169,16 +193,14 @@ module ename_coms real :: treefall_disturbance_rate real :: Time2Canopy real :: runoff_time - real :: betapower + real :: ubmin + real :: ugbmin real :: ustmin real :: gamm real :: gamh real :: tprandtl - real :: vh2vr - real :: vh2dh real :: ribmax real :: leaf_maxwhc - real :: ggfact !----- Options for printing polygon vectors/arrays to standard output. --------------! integer :: iprintpolys @@ -319,6 +341,7 @@ subroutine init_ename_vars(enl) enl%nzs = undef_integer enl%isoilflg = (/ (undef_integer,i=1,maxgrds) /) enl%nslcon = undef_integer + enl%isoilcol = undef_integer enl%slxclay = undef_real enl%slxsand = undef_real enl%isoilstateinit = undef_integer @@ -354,27 +377,51 @@ subroutine init_ename_vars(enl) enl%ed_reg_lonmax = (/ (undef_real,i=1,max_ed_regions) /) + enl%ivegt_dynamics = undef_integer enl%integration_scheme = undef_integer enl%rk4_tolerance = undef_real enl%ibranch_thermo = undef_integer enl%iphysiol = undef_integer - enl%istoma_scheme = undef_integer enl%iallom = undef_integer enl%iphen_scheme = undef_integer enl%repro_scheme = undef_integer enl%lapse_scheme = undef_integer enl%crown_mod = undef_integer - enl%ican_swrad = undef_integer + enl%icanrad = undef_integer + enl%ltrans_vis = undef_real + enl%ltrans_nir = undef_real + enl%lreflect_vis = undef_real + enl%lreflect_nir = undef_real + enl%orient_tree = undef_real + enl%orient_grass = undef_real + enl%clump_tree = undef_real + enl%clump_grass = undef_real enl%h2o_plant_lim = undef_integer - enl%vmfact = undef_real - enl%mfact = undef_real - enl%kfact = undef_real - enl%gamfact = undef_real - enl%d0fact = undef_real - enl%alphafact = undef_real + enl%vmfact_c3 = undef_real + enl%vmfact_c4 = undef_real + enl%mphoto_trc3 = undef_real + enl%mphoto_tec3 = undef_real + enl%mphoto_c4 = undef_real + enl%bphoto_blc3 = undef_real + enl%bphoto_nlc3 = undef_real + enl%bphoto_c4 = undef_real + enl%kw_grass = undef_real + enl%kw_tree = undef_real + enl%gamma_c3 = undef_real + enl%gamma_c4 = undef_real + enl%d0_grass = undef_real + enl%d0_tree = undef_real + enl%alpha_c3 = undef_real + enl%alpha_c4 = undef_real + enl%klowco2in = undef_real + enl%rrffact = undef_real + enl%growthresp = undef_real + enl%lwidth_grass = undef_real + enl%lwidth_bltree = undef_real + enl%lwidth_nltree = undef_real + enl%q10_c3 = undef_real + enl%q10_c4 = undef_real enl%thetacrit = undef_real - enl%lwfact = undef_real - enl%thioff = undef_real enl%quantum_efficiency_T = undef_integer enl%n_plant_lim = undef_integer enl%n_decomp_lim = undef_integer @@ -383,7 +430,6 @@ subroutine init_ename_vars(enl) enl%sm_fire = undef_real enl%ianth_disturb = undef_integer enl%icanturb = undef_integer - enl%i_blyr_condct = undef_integer enl%isfclyrm = undef_integer enl%ipercol = undef_integer @@ -395,16 +441,14 @@ subroutine init_ename_vars(enl) enl%treefall_disturbance_rate = undef_real enl%Time2Canopy = undef_real enl%runoff_time = undef_real - enl%betapower = undef_real + enl%ubmin = undef_real + enl%ugbmin = undef_real enl%ustmin = undef_real enl%gamm = undef_real enl%gamh = undef_real enl%tprandtl = undef_real - enl%vh2vr = undef_real - enl%vh2dh = undef_real enl%ribmax = undef_real enl%leaf_maxwhc = undef_real - enl%ggfact = undef_real enl%iprintpolys = undef_integer enl%npvars = undef_integer diff --git a/ED/src/memory/met_driver_coms.f90 b/ED/src/memory/met_driver_coms.f90 index c6f7a6850..ac2292119 100644 --- a/ED/src/memory/met_driver_coms.f90 +++ b/ED/src/memory/met_driver_coms.f90 @@ -153,7 +153,7 @@ module met_driver_coms !---------------------------------------------------------------------------------------! type(met_driv_state) :: lapse - + !---------------------------------------------------------------------------------------! ! The following variables define the lower and upper limits accepted by ED-2. The ! ! actual values can be set in ed_params.f90. ! @@ -180,6 +180,20 @@ module met_driver_coms real :: geoht_max !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! The following variables control whether to print debugging output when inter- ! + ! polating radiation variables. ! + !---------------------------------------------------------------------------------------! + logical :: print_radinterp + character(len=str_len) :: vbdsf_file + character(len=str_len) :: vddsf_file + character(len=str_len) :: nbdsf_file + character(len=str_len) :: nddsf_file + !---------------------------------------------------------------------------------------! + end module met_driver_coms !==========================================================================================! !==========================================================================================! diff --git a/ED/src/memory/pft_coms.f90 b/ED/src/memory/pft_coms.f90 index 90a12f3b9..e5a09d2b2 100644 --- a/ED/src/memory/pft_coms.f90 +++ b/ED/src/memory/pft_coms.f90 @@ -69,6 +69,25 @@ module pft_coms + !=======================================================================================! + !=======================================================================================! + ! The following parameters aren't PFT-dependent, but they are used to determine ! + ! PFT-dependent properties. ! + !---------------------------------------------------------------------------------------! + !----- Carbon-to-biomass ratio of plant tissues. ---------------------------------------! + real :: C2B + !----- Parameters used by the model that predicts SLA based on leaf life span. ---------! + real :: sla_scale + real :: sla_inter + real :: sla_slope + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! !=======================================================================================! ! The following variables are flags that control which PFTs mare used in general, ! @@ -118,7 +137,8 @@ module pft_coms ! Stomata begin to rapidly close once the difference between intercellular and ! ! boundary layer H2O mixing ratios exceed this value. [mol_H2O/mol_air]. ! !---------------------------------------------------------------------------------------! - real, dimension(n_pft) :: D0 + real, dimension(n_pft) :: D0 + !---------------------------------------------------------------------------------------! !----- Temperature [°C] below which leaf metabolic activity begins to rapidly decline. -! real, dimension(n_pft) :: Vm_low_temp @@ -135,7 +155,7 @@ module pft_coms !----- Exponent for Vm in the Arrhenius equation [K]. ----------------------------------! real, dimension(n_pft) :: Vm_hor - !----- Base (Q10 term) for Vm in Collatz equation [K]. ---------------------------------! + !----- Base (Q10 term) for Vm in Collatz equation. -------------------------------------! real, dimension(n_pft) :: Vm_q10 !----- The a term for the Vm decline correction for high temperature, as in Collatz. ---! @@ -159,7 +179,7 @@ module pft_coms !----- Exponent for Rd in the Arrhenius equation [K]. ----------------------------------! real, dimension(n_pft) :: Rd_hor - !----- Base (Q10 term) for respiration in Collatz equation [K]. ------------------------! + !----- Base (Q10 term) for respiration in Collatz equation. ----------------------------! real, dimension(n_pft) :: Rd_q10 !----- Slope of the Ball/Berry stomatal conductance-photosynthesis relationship. -------! @@ -209,10 +229,25 @@ module pft_coms real, dimension(n_pft) :: storage_turnover_rate !---------------------------------------------------------------------------------------! - ! This variable sets the contribution of roots to respiration. Its units is ! - ! umol_CO2/kg_fine_roots/second. ! + ! This variable sets the contribution of roots to respiration at the reference ! + ! temperature of 15C. Its units is ĩmol_CO2/kg_fine_roots/s. ! !---------------------------------------------------------------------------------------! real, dimension(n_pft) :: root_respiration_factor + + !----- Temperature [°C] below which root metabolic activity begins to rapidly decline. -! + real, dimension(n_pft) :: rrf_low_temp + + !----- Temperature [°C] above which root metabolic activity begins to rapidly decline. -! + real, dimension(n_pft) :: rrf_high_temp + + !----- Decay factor for the exponential correction. ------------------------------------! + real, dimension(n_pft) :: rrf_decay_e + + !----- Exponent for Rr in the Arrhenius equation [K]. ----------------------------------! + real, dimension(n_pft) :: rrf_hor + + !----- Base (Q10 term) for respiration in Collatz equation. ----------------------------! + real, dimension(n_pft) :: rrf_q10 !=======================================================================================! !=======================================================================================! @@ -293,11 +328,10 @@ module pft_coms real, dimension(n_pft) :: c2n_leaf !----- Recruit carbon to nitrogen ratio. -----------------------------------------------! real, dimension(n_pft) :: c2n_recruit - !----- Carbon-to-biomass ratio of plant tissues. ---------------------------------------! - real :: C2B !----- Fraction of structural stem that is assumed to be above ground. -----------------! - real :: agf_bs - real :: agf_bsi + real, dimension(n_pft) :: agf_bs + !----- Fraction of above-ground wood biomass that is in the branches and twigs. --------! + real, dimension(n_pft) :: brf_wd !----- Supply coefficient for plant nitrogen uptake [m2/kgC_fine_root/day]. -----------! real :: plant_N_supply_scale !---------------------------------------------------------------------------------------! @@ -325,7 +359,6 @@ module pft_coms !----- Mass ratio between sapwood and leaves [kg_sapwood]/[kg_leaves]. -----------------! real , dimension(n_pft) :: qsw real , dimension(n_pft) :: sapwood_ratio ! AREA ratio - real , dimension(n_pft) :: hgt_ref ! ref height for diam/ht allom (Temperate) !---------------------------------------------------------------------------------------! ! DBH-height allometry intercept (m). Notice that this variable has different ! ! meaning between temperate and tropical PFTs. ! @@ -336,27 +369,39 @@ module pft_coms ! meaning between temperate and tropical PFTs. !! !---------------------------------------------------------------------------------------! real , dimension(n_pft) :: b2Ht + !---------------------------------------------------------------------------------------! + ! Reference height for DBH -> height allometry. They may not be used for tropical ! + ! PFTs but when they are, they have a different meaning from the temperate allometry. ! + !---------------------------------------------------------------------------------------! + real , dimension(n_pft) :: hgt_ref !----- DBH-stem allometry intercept. All PFTs. ----------------------------------------! real , dimension(n_pft) :: b1Bs_small !----- DBH-stem allometry slope (dimensionless). All PFTs. ----------------------------! real , dimension(n_pft) :: b2Bs_small !----- DBH-stem allometry intercept for large DBH cohorts. -----------------------------! - real , dimension(n_pft) :: b1Bs_big + real , dimension(n_pft) :: b1Bs_large !----- DBH-stem allometry slope for large DBH cohorts. ---------------------------------! - real , dimension(n_pft) :: b2Bs_big - !----- Critical Bdead, point in which plants stop growing vertically. ------------------! - real , dimension(n_pft) :: bdead_crit - !----- DBH-leaf allometry intercept (kg leaf biomass / plant * cm^{-b2Bl}). All PFTs --! + real , dimension(n_pft) :: b2Bs_large + !----- DBH-leaf allometry intercept for all cohorts. All PFTs --------------------------! real , dimension(n_pft) :: b1Bl - !----- DBH-leaf allometry slope (dimensionless). All PFTs -----------------------------! + !----- DBH-leaf allometry slope for all cohorts. All PFTs ------------------------------! real , dimension(n_pft) :: b2Bl !----- DBH-crown allometry intercept. All PFTs. ---------------------------------------! real , dimension(n_pft) :: b1Ca !----- DBH-crown allometry slope. All PFTs. -------------------------------------------! real , dimension(n_pft) :: b2Ca - !----- Minimum DBH attainable by this PFT and minimum DBH at maximum height (cm). ------! + !----- DBH-WAI allometry intercept. All PFTs. -----------------------------------------! + real , dimension(n_pft) :: b1WAI + !----- DBH-WAI allometry slope. All PFTs. ---------------------------------------------! + real , dimension(n_pft) :: b2WAI + !----- Minimum DBH attainable by this PFT. ---------------------------------------------! real , dimension(n_pft) :: min_dbh - real , dimension(n_pft) :: max_dbh + !----- Critical DBH for height/bdead, point in which plants stop growing vertically. ---! + real , dimension(n_pft) :: dbh_crit + !----- Minimum Bdead attainable by this PFT. -------------------------------------------! + real , dimension(n_pft) :: min_bdead + !----- Critical Bdead, point in which plants stop growing vertically. ------------------! + real , dimension(n_pft) :: bdead_crit !=======================================================================================! !=======================================================================================! @@ -380,9 +425,6 @@ module pft_coms !---------------------------------------------------------------------------------------! integer, dimension(n_pft) :: phenology - !----- A 0-1 factor indicating degree of clumpiness of leaves and shoots. --------------! - real(kind=8), dimension(n_pft) :: clumping_factor - !----- Leaf width [m], which is used to compute the leaf boundary layer conductance. ---! real, dimension(n_pft) :: leaf_width @@ -439,37 +481,6 @@ module pft_coms - !=======================================================================================! - !=======================================================================================! - ! The following parameters are used in the branching parametrisation (Järvelä 2004). ! - !---------------------------------------------------------------------------------------! - !----- Branching ratio. ----------------------------------------------------------------! - real , dimension(n_pft) :: rbranch - !----- Diameter ratio. -----------------------------------------------------------------! - real , dimension(n_pft) :: rdiamet - !----- Length ratio. -------------------------------------------------------------------! - real , dimension(n_pft) :: rlength - !----- Minimum diameter allowed. -------------------------------------------------------! - real , dimension(n_pft) :: diammin - !----- Number of trunks (usually one). -------------------------------------------------! - real , dimension(n_pft) :: ntrunk - !---------------------------------------------------------------------------------------! - ! The following parameters are used only for effective branch area index, fitting a ! - ! smooth curve for Conijn (1995) numbers. This should be switched by a more realistic ! - ! calculation at some point soon. ! - !---------------------------------------------------------------------------------------! - real , dimension(n_pft) :: conijn_a - real , dimension(n_pft) :: conijn_b - real , dimension(n_pft) :: conijn_c - real , dimension(n_pft) :: conijn_d - !=======================================================================================! - !=======================================================================================! - - - - - - !=======================================================================================! !=======================================================================================! ! Reproduction and recruitment. ! diff --git a/ED/src/memory/phenology_coms.f90 b/ED/src/memory/phenology_coms.f90 index f9803c0ba..3178f5f38 100644 --- a/ED/src/memory/phenology_coms.f90 +++ b/ED/src/memory/phenology_coms.f90 @@ -1,83 +1,265 @@ -Module phenology_coms - use ed_max_dims, only: str_len - implicit none - - ! DO NOT INITIALIZE NON-PARAMETERS IN THEIR MODULES - NOT ALL COMPILERS WILL ACTUALLY INITIALIZE THEM - ! See "initialize_phen_coms" for initial values - - real :: retained_carbon_fraction ! Before plants drop their leaves, they retain this fraction of their leaf carbon and nitrogen and put it into storage. - - real :: theta_crit ! When soil porosity (relative to total soil porosity) drops below, this threshold, drought-deciduous plants drop their leaves. - - real :: elongf_min ! Minimum elongation factor that supports leaves. - - ! leaf offset parameters are from White et al. 1997 Global - ! Biogeochemical Cycles 11(2) 217-234 - real :: dl_tr ! critical daylength in minutes - real :: st_tr1 ! critical soil temp - real :: st_tr2 ! second critical soil temp - - ! Phenology parameters for cold deciduous trees - ! Botta et al. 2000, Global Change Biology, 6, 709--725 - real :: phen_a - real :: phen_b - real :: phen_c - - ! Flag specifying which phenology scheme to run. - ! 0 - predictive scheme with cold-deciduous and drought-deciduous - ! 1 - user prescribed, remote sensing driven - ! 2 - predictive scheme with cold-deciduous and new drought-deciuous - ! 3 - predictive scheme with cold-deciduous, new drought-deciduous and light-controlled - integer :: iphen_scheme - - ! Flag specifying which reproduction scheme to run - ! 0 - no reproduction - ! 1 - original ED1 reproduction - integer :: repro_scheme - - real :: l_fract - - !theta_crit value - real :: thetacrit - - !Flag specifying the first and last spring - integer :: iphenys1,iphenysf,iphenyf1,iphenyff - - character(len=str_len) :: phenpath - - ! Light-controlled - real :: radint - real :: radslp - real :: rad_turnover_int - real :: rad_turnover_slope - - real :: vm_tran - real :: vm_slop - real :: vm_amp - real :: vm_min - - ! Maximum distance to consider the phenology file representative when initialising with - ! prescribed phenology. - real :: max_phenology_dist - - ! Derived type describing prescribed phenology. - type prescribed_phen - - ! number of years for which we have prescribed phenology - integer :: nyears - - ! the years for which we have prescribed phenology - integer, dimension(:), pointer :: years - - ! Two parameters of the springtime logistic function describing leaf flush - real, dimension(:), pointer :: flush_a - real, dimension(:), pointer :: flush_b - - ! Two parameters of the autumn logistic function describing leaf color - real, dimension(:), pointer :: color_a - real, dimension(:), pointer :: color_b - - end type prescribed_phen - - -end Module phenology_coms +!==========================================================================================! +!==========================================================================================! +! This module contains several PFT-indepenendent parameters that control leaf ! +! phenology. The PFT-dependent paramaters are all in pft_coms. ! +! ! +! Kind reminder: DO NOT INITIALIZE NON-PARAMETERS IN THEIR MODULES - not all compilers ! +! will actually initialize them. The subroutine "init_phen_coms" in ! +! ed_params.f90 will assign initial values. ! +!------------------------------------------------------------------------------------------! +module phenology_coms + + use ed_max_dims, only: str_len ! ! intent(in) + + implicit none + + + !=======================================================================================! + !=======================================================================================! + ! The following variables are initialised by the namelist, not by ed_params.f90. ! + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! IPHEN_SCHEME -- It controls the phenology scheme. Even within each scheme, the ! + ! actual phenology will be different depending on the PFT. ! + ! ! + ! -1: grasses - evergreen; ! + ! tropical - evergreen; ! + ! conifers - evergreen; ! + ! hardwoods - cold-deciduous (Botta et al.); ! + ! ! + ! 0: grasses - drought-deciduous (old scheme); ! + ! tropical - drought-deciduous (old scheme); ! + ! conifers - evergreen; ! + ! hardwoods - cold-deciduous; ! + ! ! + ! 1: prescribed phenology ! + ! ! + ! 2: grasses - drought-deciduous (new scheme); ! + ! tropical - drought-deciduous (new scheme); ! + ! conifers - evergreen; ! + ! hardwoods - cold-deciduous; ! + ! ! + ! 3: grasses - drought-deciduous (new scheme); ! + ! tropical - drought-deciduous (light phenology); ! + ! conifers - evergreen; ! + ! hardwoods - cold-deciduous; ! + ! ! + ! Old scheme: plants shed their leaves once instantaneous amount of available water ! + ! becomes less than a critical value. ! + ! New scheme: plants shed their leaves once a 10-day running average of available ! + ! water becomes less than a critical value. ! + !---------------------------------------------------------------------------------------! + integer :: iphen_scheme + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! REPRO_SCHEME -- This controls plant reproduction and dispersal. ! + ! 0. Reproduction off. Useful for very short runs only. ! + ! 1. Original reproduction scheme. Seeds are exchanged between ! + ! patches belonging to the same site, but they can't go outside ! + ! their original site. ! + ! 2. Similar to 1, but seeds are exchanged between patches belonging ! + ! to the same polygon, even if they are in different sites. They ! + ! can't go outside their original polygon, though. This is the ! + ! same as option 1 if there is only one site per polygon. ! + !---------------------------------------------------------------------------------------! + integer :: repro_scheme + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! THETACRIT -- Leaf drought phenology threshold. The sign matters here: ! + ! >= 0. -- This is the relative soil moisture above the wilting point ! + ! below which the drought-deciduous plants will start shedding ! + ! their leaves ! + ! < 0. -- This is the soil potential in MPa below which the drought- ! + ! -deciduous plants will start shedding their leaves. The wilt- ! + ! ing point is by definition -1.5MPa, so make sure that the value ! + ! is above -1.5. ! + !---------------------------------------------------------------------------------------! + real :: thetacrit + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! The following variables control the phenology prescribed from observations: ! + ! ! + ! IPHENYS1 -- First year for spring phenology ! + ! IPHENYSF -- Final year for spring phenology ! + ! IPHENYF1 -- First year for fall/autumn phenology ! + ! IPHENYFF -- Final year for fall/autumn phenology ! + ! PHENPATH -- path and prefix of the prescribed phenology data. ! + ! ! + ! If the years don't cover the entire simulation period, they will be recycled. ! + !---------------------------------------------------------------------------------------! + integer :: iphenys1 + integer :: iphenysf + integer :: iphenyf1 + integer :: iphenyff + character(len=str_len) :: phenpath + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Parameters that control the phenology response to radiation, used only when ! + ! IPHEN_SCHEME = 3. ! + ! ! + ! RADINT -- Intercept ! + ! RADSLP -- Slope. ! + !---------------------------------------------------------------------------------------! + real :: radint + real :: radslp + !---------------------------------------------------------------------------------------! + + + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! + !=======================================================================================! + ! Variables that are to be initialised in init_phen_coms (ed_params.f90). ! + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Before plants drop their leaves, they retain this fraction of their leaf carbon ! + ! and nitrogen and put it into storage. ! + !---------------------------------------------------------------------------------------! + real :: retained_carbon_fraction + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Flag that checks whether to Use soil potential rather than soil moisture to drive ! + ! phenology. ! + !---------------------------------------------------------------------------------------! + logical :: spot_phen + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Minimum elongation factor before plants give up completely and shed all remain- ! + ! ing leaves. ! + !---------------------------------------------------------------------------------------! + real :: elongf_min + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Leaf offset parameters are from: ! + ! White et al. 1997, Global Biogeochemical Cycles 11(2) 217-234 ! + !---------------------------------------------------------------------------------------! + real :: dl_tr + real :: st_tr1 + real :: st_tr2 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Phenology parameters for cold deciduous trees: ! + ! Botta et al. 2000, Global Change Biology, 6, 709--725 ! + !---------------------------------------------------------------------------------------! + real :: phen_a + real :: phen_b + real :: phen_c + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! This variable is the maximum distance between the coordinates of a prescribed ! + ! phenology file and the actual polygon that we will still consider close enough to be ! + ! representative. If the user wants to run with prescribed phenology and the closest ! + ! file is farther away from the polygon than the number below, the simulation will ! + ! stop. ! + !---------------------------------------------------------------------------------------! + real :: max_phenology_dist + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Derived type describing prescribed phenology. ! + !---------------------------------------------------------------------------------------! + type prescribed_phen + !----- Number of years for which prescribed phenology is available. -----------------! + integer :: nyears + + !----- The years for which prescribed phenology is available. -----------------------! + integer, dimension(:), pointer :: years + + !----- Two parameters of the springtime logistic function describing leaf flush. ----! + real, dimension(:), pointer :: flush_a + real, dimension(:), pointer :: flush_b + + !----- Two parameters of the autumn logistic function describing leaf color. --------! + real, dimension(:), pointer :: color_a + real, dimension(:), pointer :: color_b + + end type prescribed_phen + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! These parameters control the specific leaf area as a function of the turnover ! + ! rate ! + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Variables controlling the light phenology as in Kim et al. (20??) ! + !---------------------------------------------------------------------------------------! + !----- Turnover window for running average [days] --------------------------------------! + real :: turnamp_window + !----- Turnover weight, the inverse of the window. -------------------------------------! + real :: turnamp_wgt + !----- Minimum instantaneous turnover rate amplitude [n/d]. ----------------------------! + real :: turnamp_min + !----- Maximum instantaneous turnover rate amplitude [n/d]. ----------------------------! + real :: turnamp_max + !----- Minimum radiation [W/m2], below which the turnover no longer responds. ----------! + real :: radto_min + !----- Maximum radiation [W/m2], above which the turnover no longer responds. ----------! + real :: radto_max + !----- Lifespan window for running average [days]. -------------------------------------! + real :: llspan_window + !----- Lifespan weight, the inverse of the window. -------------------------------------! + real :: llspan_wgt + !----- Minimum instantaneous life span [months]. ---------------------------------------! + real :: llspan_min + !----- Maximum instantaneous life span [months]. ---------------------------------------! + real :: llspan_max + !----- Instantaneous life span in case the turnover rate is 0. -------------------------! + real :: llspan_inf + !----- Vm0 window for running average [days]. ------------------------------------------! + real :: vm0_window + !----- Vm0 weight, the inverse of the window. ------------------------------------------! + real :: vm0_wgt + !----- Parameters that define the instantaneous Vm0 as a function of leaf life span. ---! + real :: vm0_tran + real :: vm0_slope + real :: vm0_amp + real :: vm0_min + !---------------------------------------------------------------------------------------! + +end module phenology_coms +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/memory/physiology_coms.f90 b/ED/src/memory/physiology_coms.f90 index af2f064aa..1edefa929 100644 --- a/ED/src/memory/physiology_coms.f90 +++ b/ED/src/memory/physiology_coms.f90 @@ -54,8 +54,6 @@ module physiology_coms ! 3 -- Same as 2, except that the compensation point ! were found as functions of the Michaelis- ! Mentel constants for CO2 and O2 (like in F80) - !----- This flag controls whether to use the exact or small perturbation solution. -----! - integer :: istoma_scheme !----- This flag controls whether the plants should be limited by nitrogen. ------------! integer :: n_plant_lim !---------------------------------------------------------------------------------------! @@ -68,17 +66,70 @@ module physiology_coms !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! These parameter will decide scaling factors for stomatal slope, Vm0, Kw, and the ! - ! dark respiration constant. ! - !---------------------------------------------------------------------------------------! - real(kind=4) :: vmfact - real(kind=4) :: mfact - real(kind=4) :: kfact - real(kind=4) :: gamfact - real(kind=4) :: d0fact - real(kind=4) :: alphafact - real(kind=4) :: lwfact - real(kind=4) :: thioff + ! The following variables are factors that control photosynthesis and respiration. ! + ! Notice that some of them are relative values whereas others are absolute. ! + ! ! + ! VMFACT_C3 -- Factor multiplying the default Vm0 for C3 plants (1.0 = default). ! + ! VMFACT_C4 -- Factor multiplying the default Vm0 for C4 plants (1.0 = default). ! + ! MPHOTO_TRC3 -- Stomatal slope (M) for tropical C3 plants ! + ! MPHOTO_TEC3 -- Stomatal slope (M) for conifers and temperate C3 plants ! + ! MPHOTO_C4 -- Stomatal slope (M) for C4 plants. ! + ! BPHOTO_BLC3 -- cuticular conductance for broadleaf C3 plants [umol/m2/s] ! + ! BPHOTO_NLC3 -- cuticular conductance for needleleaf C3 plants [umol/m2/s] ! + ! BPHOTO_C4 -- cuticular conductance for C4 plants [umol/m2/s] ! + ! KW_GRASS -- Water conductance for trees, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! KW_TREE -- Water conductance for grasses, in m2/yr/kgC_root. This is used only ! + ! when H2O_PLANT_LIM is not 0. ! + ! GAMMA_C3 -- The dark respiration factor (gamma) for C3 plants. Subtropical ! + ! conifers will be scaled by GAMMA_C3 * 0.028 / 0.02 ! + ! GAMMA_C4 -- The dark respiration factor (gamma) for C4 plants. ! + ! D0_GRASS -- The transpiration control in gsw (D0) for ALL grasses. ! + ! D0_TREE -- The transpiration control in gsw (D0) for ALL trees. ! + ! ALPHA_C3 -- Quantum yield of ALL C3 plants. This is only applied when ! + ! QUANTUM_EFFICIENCY_T = 0. ! + ! ALPHA_C4 -- Quantum yield of C4 plants. This is always applied. ! + ! KLOWCO2IN -- The coefficient that controls the PEP carboxylase limited rate of ! + ! carboxylation for C4 plants. ! + ! RRFFACT -- Factor multiplying the root respiration factor for ALL PFTs. ! + ! (1.0 = default). ! + ! GROWTHRESP -- The actual growth respiration factor (C3/C4 tropical PFTs only). ! + ! (1.0 = default). ! + ! LWIDTH_GRASS -- Leaf width for grasses, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). ! + ! LWIDTH_BLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to broadleaf trees ! + ! only. ! + ! LWIDTH_NLTREE -- Leaf width for trees, in metres. This controls the leaf boundary ! + ! layer conductance (gbh and gbw). This is applied to conifer trees ! + ! only. ! + ! Q10_C3 -- Q10 factor for C3 plants (used only if IPHYSIOL is set to 2 or 3). ! + ! Q10_C4 -- Q10 factor for C4 plants (used only if IPHYSIOL is set to 2 or 3). ! + !---------------------------------------------------------------------------------------! + real(kind=4) :: vmfact_c3 + real(kind=4) :: vmfact_c4 + real(kind=4) :: mphoto_trc3 + real(kind=4) :: mphoto_tec3 + real(kind=4) :: mphoto_c4 + real(kind=4) :: bphoto_blc3 + real(kind=4) :: bphoto_nlc3 + real(kind=4) :: bphoto_c4 + real(kind=4) :: kw_grass + real(kind=4) :: kw_tree + real(kind=4) :: gamma_c3 + real(kind=4) :: gamma_c4 + real(kind=4) :: d0_grass + real(kind=4) :: d0_tree + real(kind=4) :: alpha_c3 + real(kind=4) :: alpha_c4 + real(kind=4) :: klowco2in + real(kind=4) :: rrffact + real(kind=4) :: growthresp + real(kind=4) :: lwidth_grass + real(kind=4) :: lwidth_bltree + real(kind=4) :: lwidth_nltree + real(kind=4) :: q10_c3 + real(kind=4) :: q10_c4 !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/rk4_coms.f90 b/ED/src/memory/rk4_coms.f90 index 8fa21ada3..4cc2c1eef 100644 --- a/ED/src/memory/rk4_coms.f90 +++ b/ED/src/memory/rk4_coms.f90 @@ -169,6 +169,7 @@ module rk4_coms real(kind=8), pointer, dimension(:) :: gsw_closed ! Sto. cond. (cl.) [ kg/mē/s] real(kind=8), pointer, dimension(:) :: rshort_l ! Absorbed SWRad. [ J/mē/s] real(kind=8), pointer, dimension(:) :: rlong_l ! Absorbed LWRad. [ J/mē/s] + !------------------------------------------------------------------------------------! !----- Wood (cohort-level) variables. -----------------------------------------------! @@ -186,6 +187,17 @@ module rk4_coms real(kind=8), pointer, dimension(:) :: wood_gbw ! Bnd.lyr. condct. [ kg/mē/s] real(kind=8), pointer, dimension(:) :: rshort_w ! Absorbed SWRad. [ J/mē/s] real(kind=8), pointer, dimension(:) :: rlong_w ! Absorbed LWRad. [ J/mē/s] + !------------------------------------------------------------------------------------! + + + + !----- Leaf+branchwood (cohort-level) variables. ------------------------------------! + real(kind=8), pointer, dimension(:) :: veg_energy ! Internal energy [ J/mē] + real(kind=8), pointer, dimension(:) :: veg_water ! Sfc. water mass [ kg/mē] + real(kind=8), pointer, dimension(:) :: veg_hcap ! Heat capacity [ J/mē/K] + logical , pointer, dimension(:) :: veg_resolvable ! resolve leaves? [ T|F] + !------------------------------------------------------------------------------------! + !----- General cohort-level properties. ---------------------------------------------! @@ -219,7 +231,6 @@ module rk4_coms !----- Water fluxes -----------------------------------------------------------------! real(kind=8) :: avg_vapor_lc ! Leaf -> canopy air: evap./cond. flux real(kind=8) :: avg_vapor_wc ! Wood -> canopy air: evap./cond. flux - real(kind=8) :: avg_dew_cg ! Canopy -> ground : condensation flux real(kind=8) :: avg_vapor_gc ! Ground -> canopy air: evaporation flux real(kind=8) :: avg_vapor_ac ! Free atm. -> canopy air: vapour flux real(kind=8) :: avg_transp ! Transpiration @@ -241,6 +252,12 @@ module rk4_coms real(kind=8) :: avg_heatstor_veg ! Heat storage in vegetation !----- Carbon flux ------------------------------------------------------------------! real(kind=8) :: avg_carbon_ac ! Free atm. -> canopy air + real(kind=8) :: avg_carbon_st ! Canopy air storage flux + !----- Characteristic gradient scales (stars). --------------------------------------! + real(kind=8) :: avg_ustar ! Friction velocity + real(kind=8) :: avg_tstar ! Temperature + real(kind=8) :: avg_qstar ! Specific humidity + real(kind=8) :: avg_cstar ! CO2 mixing ratio !----- Soil fluxes ------------------------------------------------------------------! real(kind=8),pointer,dimension(:) :: avg_smoist_gg ! Moisture flux between layers real(kind=8),pointer,dimension(:) :: avg_transloss ! Transpired soil moisture sink @@ -256,7 +273,6 @@ module rk4_coms !----- Water fluxes -----------------------------------------------------------------! real(kind=8) :: flx_vapor_lc ! Leaf -> canopy air: evap./cond. flux real(kind=8) :: flx_vapor_wc ! Wood -> canopy air: evap./cond. flux - real(kind=8) :: flx_dew_cg ! Canopy -> ground : condensation flux real(kind=8) :: flx_vapor_gc ! Ground -> canopy air: evaporation flux real(kind=8) :: flx_vapor_ac ! Free atm. -> canopy air: vapour flux real(kind=8) :: flx_transp ! Transpiration @@ -278,6 +294,7 @@ module rk4_coms real(kind=8) :: flx_heatstor_veg ! Heat storage in vegetation !----- Carbon flux ------------------------------------------------------------------! real(kind=8) :: flx_carbon_ac ! Free atm. -> canopy air + real(kind=8) :: flx_carbon_st ! Canopy CO2 storage flux !----- Soil fluxes ------------------------------------------------------------------! real(kind=8),pointer,dimension(:) :: flx_smoist_gg ! Moisture flux between layers real(kind=8),pointer,dimension(:) :: flx_transloss ! Transpired soil moisture sink @@ -334,6 +351,10 @@ module rk4_coms real(kind=8) :: geoht real(kind=8) :: rshort real(kind=8) :: rlong + real(kind=8) :: par_beam + real(kind=8) :: par_diffuse + real(kind=8) :: nir_beam + real(kind=8) :: nir_diffuse real(kind=8) :: lon real(kind=8) :: lat real(kind=8) :: cosz @@ -351,10 +372,10 @@ module rk4_coms real(kind=8), dimension(:), pointer :: psiplusz !----- Hydraulic conductivity [m/s]. ------------------------------------------------! real(kind=8), dimension(:), pointer :: hydcond - !----- Liquid water above wilting point [mģ/mģ]. ------------------------------------! - real(kind=8), dimension(:), pointer :: soil_liq_wilt - !----- Liquid water available for photosynthesis [kg/mē]. ---------------------------! - real(kind=8), dimension(:), pointer :: available_liquid_water + !----- Available water factor at this layer [n/d]. ----------------------------------! + real(kind=8), dimension(:), pointer :: avail_h2o_lyr + !----- Integral of available water factor from top to this layer [n/d]. -------------! + real(kind=8), dimension(:), pointer :: avail_h2o_int !----- Extracted water by transpiration [kg/mē]. ------------------------------------! real(kind=8), dimension(:), pointer :: extracted_water !----- Heat resistance [Kmēs/J]. ----------------------------------------------------! @@ -412,20 +433,49 @@ module rk4_coms !=======================================================================================! ! The following variable will be loaded from the user's namelist. ! !---------------------------------------------------------------------------------------! - integer :: ibranch_thermo ! This flag tells whether we consider the - ! branch actively affecting heat capacity - ! and radiation interception. - ! 0 - no (default); - ! 1 - yes (under development/test); - real :: rk4_tolerance ! The RK4 tolerance (or epsilon). While - ! rk4eps is the actual variable used in - ! Runge-Kutta (a double precision vari- - ! able), rk4tol is the one given at the - ! namelist (a single precision variable). + !---------------------------------------------------------------------------------------! + ! IBRANCH_THERMO -- This determines whether branches should be included in the ! + ! 0. No branches in energy/radiation (ED-2.1 default); ! + ! 1. Branches are accounted in the energy and radiation. Branchwood ! + ! and leaf are treated separately in the canopy radiation scheme, ! + ! but solved as a single pool in the biophysics integration. ! + ! 2. Similar to 1, but branches are treated as separate pools in the ! + ! biophysics (thus doubling the number of prognostic variables). ! + !---------------------------------------------------------------------------------------! + integer :: ibranch_thermo + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! RK4_TOLERANCE -- This is the relative tolerance for Runge-Kutta or Heun's ! + ! integration. Larger numbers will make runs go faster, at the ! + ! expense of being less accurate. Currently the valid range is ! + ! between 1.e-7 and 1.e-1, but recommended values are between 1.e-4 ! + ! and 1.e-2. ! + !---------------------------------------------------------------------------------------! + real :: rk4_tolerance + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! IPERCOL -- This controls percolation and infiltration. ! + ! 0. Default method. Assumes soil conductivity constant and for the ! + ! temporary surface water, it sheds liquid in excess of a 1:9 liquid- ! + ! -to-ice ratio through percolation. Temporary surface water exists ! + ! only if the top soil layer is at saturation. ! + ! 1. Constant soil conductivity, and it uses the percolation model as in ! + ! Anderson (1976) NOAA technical report NWS 19. Temporary surface ! + ! water may exist after a heavy rain event, even if the soil doesn't ! + ! saturate. Recommended value. ! + ! 2. Soil conductivity decreases with depth even for constant soil moisture ! + ! , otherwise it is the same as 1. ! + !---------------------------------------------------------------------------------------! + integer :: ipercol + !---------------------------------------------------------------------------------------! - integer :: ipercol ! This flag controls which percolation - ! scheme we should use !=======================================================================================! !=======================================================================================! @@ -900,12 +950,16 @@ subroutine zero_rk4_patch(y) y%cpwp = 0.d0 y%rasveg = 0.d0 - + + y%avg_ustar = 0.d0 + y%avg_tstar = 0.d0 + y%avg_qstar = 0.d0 + y%avg_cstar = 0.d0 y%avg_carbon_ac = 0.d0 + y%avg_carbon_st = 0.d0 y%avg_vapor_lc = 0.d0 y%avg_vapor_wc = 0.d0 - y%avg_dew_cg = 0.d0 y%avg_vapor_gc = 0.d0 y%avg_wshed_vg = 0.d0 y%avg_intercepted = 0.d0 @@ -928,9 +982,9 @@ subroutine zero_rk4_patch(y) y%avg_drainage_heat = 0.d0 y%flx_carbon_ac = 0.d0 + y%flx_carbon_st = 0.d0 y%flx_vapor_lc = 0.d0 y%flx_vapor_wc = 0.d0 - y%flx_dew_cg = 0.d0 y%flx_vapor_gc = 0.d0 y%flx_wshed_vg = 0.d0 y%flx_intercepted = 0.d0 @@ -1067,6 +1121,10 @@ subroutine allocate_rk4_coh(maxcohort,y) allocate(y%wood_gbw (maxcohort)) allocate(y%rshort_w (maxcohort)) allocate(y%rlong_w (maxcohort)) + allocate(y%veg_energy (maxcohort)) + allocate(y%veg_water (maxcohort)) + allocate(y%veg_hcap (maxcohort)) + allocate(y%veg_resolvable (maxcohort)) allocate(y%nplant (maxcohort)) allocate(y%veg_wind (maxcohort)) allocate(y%lai (maxcohort)) @@ -1145,6 +1203,10 @@ subroutine nullify_rk4_cohort(y) nullify(y%wood_gbw ) nullify(y%rshort_w ) nullify(y%rlong_w ) + nullify(y%veg_energy ) + nullify(y%veg_water ) + nullify(y%veg_hcap ) + nullify(y%veg_resolvable ) nullify(y%nplant ) nullify(y%veg_wind ) nullify(y%lai ) @@ -1221,6 +1283,10 @@ subroutine zero_rk4_cohort(y) if (associated(y%wood_gbw )) y%wood_gbw = 0.d0 if (associated(y%rshort_w )) y%rshort_w = 0.d0 if (associated(y%rlong_w )) y%rlong_w = 0.d0 + if (associated(y%veg_energy )) y%veg_energy = 0.d0 + if (associated(y%veg_water )) y%veg_water = 0.d0 + if (associated(y%veg_hcap )) y%veg_hcap = 0.d0 + if (associated(y%veg_resolvable )) y%veg_resolvable = .false. if (associated(y%nplant )) y%nplant = 0.d0 if (associated(y%veg_wind )) y%veg_wind = 0.d0 if (associated(y%lai )) y%lai = 0.d0 @@ -1297,6 +1363,10 @@ subroutine deallocate_rk4_coh(y) if (associated(y%wood_gbw )) deallocate(y%wood_gbw ) if (associated(y%rshort_w )) deallocate(y%rshort_w ) if (associated(y%rlong_w )) deallocate(y%rlong_w ) + if (associated(y%veg_energy )) deallocate(y%veg_energy ) + if (associated(y%veg_water )) deallocate(y%veg_water ) + if (associated(y%veg_hcap )) deallocate(y%veg_hcap ) + if (associated(y%veg_resolvable )) deallocate(y%veg_resolvable ) if (associated(y%nplant )) deallocate(y%nplant ) if (associated(y%veg_wind )) deallocate(y%veg_wind ) if (associated(y%lai )) deallocate(y%lai ) @@ -1348,7 +1418,6 @@ subroutine reset_rk4_fluxes(y) y%flx_carbon_ac = 0.d0 y%flx_vapor_lc = 0.d0 y%flx_vapor_wc = 0.d0 - y%flx_dew_cg = 0.d0 y%flx_vapor_gc = 0.d0 y%flx_wshed_vg = 0.d0 y%flx_intercepted = 0.d0 @@ -1415,7 +1484,6 @@ subroutine norm_rk4_fluxes(y,hdid) y%flx_carbon_ac = y%flx_carbon_ac * hdidi y%flx_vapor_lc = y%flx_vapor_lc * hdidi y%flx_vapor_wc = y%flx_vapor_wc * hdidi - y%flx_dew_cg = y%flx_dew_cg * hdidi y%flx_vapor_gc = y%flx_vapor_gc * hdidi y%flx_wshed_vg = y%flx_wshed_vg * hdidi y%flx_intercepted = y%flx_intercepted * hdidi @@ -1490,9 +1558,9 @@ subroutine allocate_rk4_aux(mzg,mzs) allocate(rk4aux%hydcond ( 0:mzg) ) allocate(rk4aux%drysoil ( 0:mzg) ) allocate(rk4aux%satsoil ( 0:mzg) ) - allocate(rk4aux%soil_liq_wilt ( mzg) ) - allocate(rk4aux%available_liquid_water ( mzg) ) - allocate(rk4aux%extracted_water ( mzg) ) + allocate(rk4aux%avail_h2o_lyr ( mzg+1) ) + allocate(rk4aux%avail_h2o_int ( mzg+1) ) + allocate(rk4aux%extracted_water ( mzg+1) ) allocate(rk4aux%rfactor ( mzg+mzs) ) allocate(rk4aux%hfluxgsc (mzg+mzs+1) ) allocate(rk4aux%w_flux (mzg+mzs+1) ) @@ -1525,8 +1593,8 @@ subroutine nullify_rk4_aux() nullify(rk4aux%hydcond ) nullify(rk4aux%drysoil ) nullify(rk4aux%satsoil ) - nullify(rk4aux%soil_liq_wilt ) - nullify(rk4aux%available_liquid_water ) + nullify(rk4aux%avail_h2o_lyr ) + nullify(rk4aux%avail_h2o_int ) nullify(rk4aux%extracted_water ) nullify(rk4aux%rfactor ) nullify(rk4aux%hfluxgsc ) @@ -1551,41 +1619,18 @@ end subroutine nullify_rk4_aux subroutine zero_rk4_aux() implicit none - if (associated(rk4aux%psiplusz )) & - rk4aux%psiplusz (:) = 0.d0 - - if (associated(rk4aux%hydcond )) & - rk4aux%hydcond (:) = 0.d0 - - if (associated(rk4aux%drysoil )) & - rk4aux%drysoil (:) = .false. - - if (associated(rk4aux%satsoil )) & - rk4aux%satsoil (:) = .false. - - if (associated(rk4aux%soil_liq_wilt )) & - rk4aux%soil_liq_wilt (:) = 0.d0 - - if (associated(rk4aux%available_liquid_water)) & - rk4aux%available_liquid_water(:) = 0.d0 - - if (associated(rk4aux%extracted_water )) & - rk4aux%extracted_water (:) = 0.d0 - - if (associated(rk4aux%rfactor )) & - rk4aux%rfactor (:) = 0.d0 - - if (associated(rk4aux%hfluxgsc )) & - rk4aux%hfluxgsc (:) = 0.d0 - - if (associated(rk4aux%w_flux )) & - rk4aux%w_flux (:) = 0.d0 - - if (associated(rk4aux%qw_flux )) & - rk4aux%qw_flux (:) = 0.d0 - - if (associated(rk4aux%d_flux )) & - rk4aux%d_flux (:) = 0.d0 + if (associated(rk4aux%psiplusz )) rk4aux%psiplusz (:) = 0.d0 + if (associated(rk4aux%hydcond )) rk4aux%hydcond (:) = 0.d0 + if (associated(rk4aux%drysoil )) rk4aux%drysoil (:) = .false. + if (associated(rk4aux%satsoil )) rk4aux%satsoil (:) = .false. + if (associated(rk4aux%avail_h2o_lyr )) rk4aux%avail_h2o_lyr (:) = 0.d0 + if (associated(rk4aux%avail_h2o_int )) rk4aux%avail_h2o_int (:) = 0.d0 + if (associated(rk4aux%extracted_water )) rk4aux%extracted_water (:) = 0.d0 + if (associated(rk4aux%rfactor )) rk4aux%rfactor (:) = 0.d0 + if (associated(rk4aux%hfluxgsc )) rk4aux%hfluxgsc (:) = 0.d0 + if (associated(rk4aux%w_flux )) rk4aux%w_flux (:) = 0.d0 + if (associated(rk4aux%qw_flux )) rk4aux%qw_flux (:) = 0.d0 + if (associated(rk4aux%d_flux )) rk4aux%d_flux (:) = 0.d0 return end subroutine zero_rk4_aux @@ -1604,41 +1649,18 @@ end subroutine zero_rk4_aux subroutine deallocate_rk4_aux() implicit none - if (associated(rk4aux%psiplusz )) & - deallocate(rk4aux%psiplusz ) - - if (associated(rk4aux%hydcond )) & - deallocate(rk4aux%hydcond ) - - if (associated(rk4aux%drysoil )) & - deallocate(rk4aux%drysoil ) - - if (associated(rk4aux%satsoil )) & - deallocate(rk4aux%satsoil ) - - if (associated(rk4aux%soil_liq_wilt )) & - deallocate(rk4aux%soil_liq_wilt ) - - if (associated(rk4aux%available_liquid_water)) & - deallocate(rk4aux%available_liquid_water) - - if (associated(rk4aux%extracted_water )) & - deallocate(rk4aux%extracted_water ) - - if (associated(rk4aux%rfactor )) & - deallocate(rk4aux%rfactor ) - - if (associated(rk4aux%hfluxgsc )) & - deallocate(rk4aux%hfluxgsc ) - - if (associated(rk4aux%w_flux )) & - deallocate(rk4aux%w_flux ) - - if (associated(rk4aux%qw_flux )) & - deallocate(rk4aux%qw_flux ) - - if (associated(rk4aux%d_flux )) & - deallocate(rk4aux%d_flux ) + if (associated(rk4aux%psiplusz )) deallocate(rk4aux%psiplusz ) + if (associated(rk4aux%hydcond )) deallocate(rk4aux%hydcond ) + if (associated(rk4aux%drysoil )) deallocate(rk4aux%drysoil ) + if (associated(rk4aux%satsoil )) deallocate(rk4aux%satsoil ) + if (associated(rk4aux%avail_h2o_lyr )) deallocate(rk4aux%avail_h2o_lyr ) + if (associated(rk4aux%avail_h2o_int )) deallocate(rk4aux%avail_h2o_int ) + if (associated(rk4aux%extracted_water )) deallocate(rk4aux%extracted_water ) + if (associated(rk4aux%rfactor )) deallocate(rk4aux%rfactor ) + if (associated(rk4aux%hfluxgsc )) deallocate(rk4aux%hfluxgsc ) + if (associated(rk4aux%w_flux )) deallocate(rk4aux%w_flux ) + if (associated(rk4aux%qw_flux )) deallocate(rk4aux%qw_flux ) + if (associated(rk4aux%d_flux )) deallocate(rk4aux%d_flux ) return end subroutine deallocate_rk4_aux diff --git a/ED/src/memory/soil_coms.F90 b/ED/src/memory/soil_coms.F90 index 7f0a259e6..ef7fa3f05 100644 --- a/ED/src/memory/soil_coms.F90 +++ b/ED/src/memory/soil_coms.F90 @@ -16,6 +16,7 @@ module soil_coms , nzs ! ! intent(in) #if defined(COUPLED) use leaf_coms , only : nstyp & ! intent(in) + , nscol & ! intent(in) , nvtyp & ! intent(in) , nvtyp_teb ! ! intent(in) #endif @@ -25,9 +26,11 @@ module soil_coms !----- These variables depend on whether it's a coupled or stand alone model. -----------! #if defined(COUPLED) integer, parameter :: ed_nstyp = nstyp ! total # of soil textural classes + integer, parameter :: ed_nscol = nscol ! total # of soil colour classes integer, parameter :: ed_nvtyp = nvtyp+nvtyp_teb #else integer, parameter :: ed_nstyp = 17 ! total # of soil textural classes + integer, parameter :: ed_nscol = 21 ! total # of soil colour classes integer, parameter :: ed_nvtyp = 21 #endif @@ -37,6 +40,7 @@ module soil_coms integer :: isoilbc ! Bottom layer bnd. cond. integer, dimension(maxgrds) :: isoilflg ! Soil initialization flag. integer :: nslcon ! Default soil texture + integer :: isoilcol ! Default soil texture real :: slxclay ! Clay soil fraction real :: slxsand ! Sand soil fraction real :: zrough ! Default soil roughness. @@ -50,7 +54,6 @@ module soil_coms integer :: isoilstateinit ! Soil state initial cond. integer :: isoildepthflg ! Soil depth initial cond. real :: runoff_time ! Default runoff time scale. - real :: betapower ! Power for gnd evaporation !---------------------------------------------------------------------------------------! @@ -72,14 +75,6 @@ module soil_coms !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! - ! The following variables are assigned in ed_params.f90 based on namelist ! - ! variables. ! - !---------------------------------------------------------------------------------------! - real(kind=8) :: betapower8 ! Power for ground evaporation - !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! Miscellaneous constants. ! @@ -161,6 +156,11 @@ module soil_coms real(kind=4) :: xsilt ! Percentage of silt [ ---] real(kind=4) :: xrobulk ! Bulk density [ ---] real(kind=4) :: slden ! "Dry" soil density (porosity) [ kg/m3] + real(kind=4) :: soilld ! Soil moist. below which drought phen. happens [ m3/m3] + real(kind=4) :: soilfr ! Soil moist. below which fires may happen [ m3/m3] + real(kind=4) :: slpotwp ! Water potential for wilting point [ m] + real(kind=4) :: slpotfc ! Water potential for field capacity [ m] + real(kind=4) :: slpotld ! Water pot. below which drought phen happens [ m] end type soil_class !----- Double precision version --------------------------------------------------------! type soil_class8 @@ -183,11 +183,31 @@ module soil_coms real(kind=8) :: xsilt ! Percentage of silt [ ---] real(kind=8) :: xrobulk ! Bulk density [ ---] real(kind=8) :: slden ! "Dry" soil density (porosity) [ kg/m3] + real(kind=8) :: soilld ! Soil moist. below which drought phen. happens [ m3/m3] + real(kind=8) :: soilfr ! Soil moist. below which fires may happen [ m3/m3] + real(kind=8) :: slpotwp ! Water potential for wilting point [ m] + real(kind=8) :: slpotfc ! Water potential for field capacity [ m] + real(kind=8) :: slpotld ! Water pot. below which drought phen happens [ m] end type soil_class8 !---------------------------------------------------------------------------------------! !----- To be filled in ed_params.f90. --------------------------------------------------! type(soil_class8), dimension(ed_nstyp) :: soil8 type(soil_class) , dimension(ed_nstyp) :: soil + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Define soil colour structure. ! + !---------------------------------------------------------------------------------------! + type soilcol_class + real(kind=4) :: alb_vis_dry + real(kind=4) :: alb_nir_dry + real(kind=4) :: alb_vis_wet + real(kind=4) :: alb_nir_wet + end type soilcol_class + !----- To be filled in ed_params.f90. --------------------------------------------------! + type(soilcol_class), dimension(ed_nscol) :: soilcol + !---------------------------------------------------------------------------------------! ! Look-up tables for vegetation and soil properties: diff --git a/ED/src/mpi/ed_mpass_init.f90 b/ED/src/mpi/ed_mpass_init.f90 index db1fe95b0..824c7af38 100644 --- a/ED/src/mpi/ed_mpass_init.f90 +++ b/ED/src/mpi/ed_mpass_init.f90 @@ -102,6 +102,7 @@ subroutine ed_masterput_nl(par_run) , ffilout & ! intent(in) , ied_init_mode & ! intent(in) , thsums_database & ! intent(in) + , ivegt_dynamics & ! intent(in) , integration_scheme & ! intent(in) , end_time & ! intent(in) , current_time & ! intent(in) @@ -134,17 +135,14 @@ subroutine ed_masterput_nl(par_run) , min_site_area & ! intent(in) , attach_metadata ! ! intent(in) use canopy_air_coms , only : icanturb & ! intent(in) - , i_blyr_condct & ! intent(in) , isfclyrm & ! intent(in) , ied_grndvap & ! intent(in) + , ubmin & ! intent(in) + , ugbmin & ! intent(in) , ustmin & ! intent(in) , gamm & ! intent(in) , gamh & ! intent(in) , tprandtl & ! intent(in) - , vkopr & ! intent(in) - , ggfact & ! intent(in) - , vh2vr & ! intent(in) - , vh2dh & ! intent(in) , ribmax & ! intent(in) , leaf_maxwhc ! ! intent(in) use grid_coms , only : nzg & ! intent(in) @@ -164,6 +162,7 @@ subroutine ed_masterput_nl(par_run) , nstraty ! ! intent(in) use soil_coms , only : isoilflg & ! intent(in) , nslcon & ! intent(in) + , isoilcol & ! intent(in) , slxclay & ! intent(in) , slxsand & ! intent(in) , slz & ! intent(in) @@ -177,7 +176,6 @@ subroutine ed_masterput_nl(par_run) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) , runoff_time & ! intent(in) - , betapower & ! intent(in) , zrough & ! intent(in) , layer_index & ! intent(in) , nlon_lyr & ! intent(in) @@ -207,17 +205,32 @@ subroutine ed_masterput_nl(par_run) , maxpatch & ! intent(in) , maxcohort ! ! intent(in) use physiology_coms , only : iphysiol & ! intent(in) - , istoma_scheme & ! intent(in) , h2o_plant_lim & ! intent(in) , n_plant_lim & ! intent(in) - , vmfact & ! intent(in) - , mfact & ! intent(in) - , kfact & ! intent(in) - , gamfact & ! intent(in) - , d0fact & ! intent(in) - , alphafact & ! intent(in) - , lwfact & ! intent(in) - , thioff & ! intent(in) + , vmfact_c3 & ! intent(in) + , vmfact_c4 & ! intent(in) + , mphoto_trc3 & ! intent(in) + , mphoto_tec3 & ! intent(in) + , mphoto_c4 & ! intent(in) + , bphoto_blc3 & ! intent(in) + , bphoto_nlc3 & ! intent(in) + , bphoto_c4 & ! intent(in) + , kw_grass & ! intent(in) + , kw_tree & ! intent(in) + , gamma_c3 & ! intent(in) + , gamma_c4 & ! intent(in) + , d0_grass & ! intent(in) + , d0_tree & ! intent(in) + , alpha_c3 & ! intent(in) + , alpha_c4 & ! intent(in) + , klowco2in & ! intent(in) + , rrffact & ! intent(in) + , growthresp & ! intent(in) + , lwidth_grass & ! intent(in) + , lwidth_bltree & ! intent(in) + , lwidth_nltree & ! intent(in) + , q10_c3 & ! intent(in) + , q10_c4 & ! intent(in) , quantum_efficiency_T ! ! intent(in) use phenology_coms , only : iphen_scheme & ! intent(in) , iphenys1 & ! intent(in) @@ -244,7 +257,15 @@ subroutine ed_masterput_nl(par_run) , time2canopy ! ! intent(in) use optimiz_coms , only : ioptinpt ! ! intent(in) use canopy_layer_coms , only : crown_mod ! ! intent(in) - use canopy_radiation_coms, only : ican_swrad ! ! intent(in) + use canopy_radiation_coms, only : icanrad & ! intent(in) + , ltrans_vis & ! intent(in) + , ltrans_nir & ! intent(in) + , lreflect_vis & ! intent(in) + , lreflect_nir & ! intent(in) + , orient_tree & ! intent(in) + , orient_grass & ! intent(in) + , clump_tree & ! intent(in) + , clump_grass ! ! intent(in) use rk4_coms , only : rk4_tolerance & ! intent(in) , ibranch_thermo & ! intent(in) , ipercol ! ! intent(in) @@ -321,6 +342,7 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(nzs ,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoilflg,maxgrds,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(nslcon,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(isoilcol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxclay,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxsand,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -370,11 +392,11 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(centlat,maxgrds,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(centlon,maxgrds,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(rk4_tolerance,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ibranch_thermo,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphysiol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(istoma_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iallom,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphen_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(repro_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -383,17 +405,41 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(lapse_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(crown_mod,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ican_swrad,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(icanrad,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_vis,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_nir,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_vis,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_nir,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vmfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(mfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(kfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(gamfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(d0fact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(alphafact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_trc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_tec3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_blc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_nlc3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_tree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(klowco2in,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(rrffact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(growthresp,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_bltree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_nltree,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c3,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c4,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(thetacrit,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(lwfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(thioff,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(quantum_efficiency_T,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_plant_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_decomp_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -406,7 +452,6 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(pft_1st_check,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(icanturb,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(i_blyr_condct,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(isfclyrm,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ied_grndvap,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ipercol,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -414,17 +459,14 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(treefall_disturbance_rate,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(time2canopy,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(runoff_time,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(betapower,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ubmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ugbmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ustmin,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamm,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(tprandtl,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vkopr,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2vr,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2dh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ribmax,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(leaf_maxwhc,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ggfact,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(iprintpolys,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) do n=1,maxpvars @@ -850,8 +892,8 @@ subroutine ed_masterput_poly_dims(par_run,masterworks) end do !----- Getting the message about this node itself. -------------------------------! - gdpy (ntotmachs,ifm) = mpolys(imach) - py_off(ntotmachs,ifm) = moffset(imach) + gdpy (ntotmachs,ifm) = mpolys(ntotmachs) + py_off(ntotmachs,ifm) = moffset(ntotmachs) !---------------------------------------------------------------------------------! ! Free memory for re-allocation in the next grid (or to quit the subroutine). ! @@ -913,8 +955,8 @@ subroutine ed_masterput_worklist_info(par_run) integer :: ipya integer :: ipyz type(work_vecs), dimension(:), allocatable :: sc_work - real , dimension(:), allocatable :: rscratch - integer , dimension(:), allocatable :: iscratch + real , dimension(:), allocatable :: rscratch + integer , dimension(:), allocatable :: iscratch !---------------------------------------------------------------------------------------! @@ -929,7 +971,8 @@ subroutine ed_masterput_worklist_info(par_run) ipyz = offset + npoly !----- Allocate the scratch vectors. ------------------------------------------! - allocate(rscratch(npoly),iscratch(npoly)) + allocate(rscratch(npoly)) + allocate(iscratch(npoly)) !----- Set a unique identifier for these packages. ----------------------------! @@ -956,6 +999,10 @@ subroutine ed_masterput_worklist_info(par_run) call MPI_Send(iscratch,npoly,MPI_INTEGER,machnum(nm),mpiid,MPI_COMM_WORLD,ierr) mpiid = mpiid + 1 + iscratch(1:npoly) = work_v(ifm)%nscol(ipya:ipyz) + call MPI_Send(iscratch,npoly,MPI_INTEGER,machnum(nm),mpiid,MPI_COMM_WORLD,ierr) + mpiid = mpiid + 1 + do itext=1,maxsite iscratch(1:npoly) = work_v(ifm)%ntext(itext,ipya:ipyz) call MPI_Send(iscratch,npoly,MPI_INTEGER,machnum(nm),mpiid,MPI_COMM_WORLD & @@ -969,7 +1016,8 @@ subroutine ed_masterput_worklist_info(par_run) end do !----- Deallocate the scratch arrays, as the polygon sizes may change. --------! - deallocate(rscratch,iscratch) + deallocate(rscratch) + deallocate(iscratch) end do end do @@ -999,12 +1047,14 @@ subroutine ed_masterput_worklist_info(par_run) sc_work(ifm)%landfrac (1:npoly) = work_v(ifm)%landfrac (ipya:ipyz) sc_work(ifm)%soilfrac(1:maxsite,1:npoly) = work_v(ifm)%soilfrac(1:maxsite,ipya:ipyz) sc_work(ifm)%ntext (1:maxsite,1:npoly) = work_v(ifm)%ntext (1:maxsite,ipya:ipyz) + sc_work(ifm)%nscol (1:npoly) = work_v(ifm)%nscol (ipya:ipyz) sc_work(ifm)%xid (1:npoly) = work_v(ifm)%xid (ipya:ipyz) sc_work(ifm)%yid (1:npoly) = work_v(ifm)%yid (ipya:ipyz) call ed_dealloc_work_vec(work_v(ifm)) end do - deallocate(work_e,work_v) + deallocate(work_e) + deallocate(work_v) !---------------------------------------------------------------------------------------! @@ -1014,7 +1064,6 @@ subroutine ed_masterput_worklist_info(par_run) ! serial run. ! !---------------------------------------------------------------------------------------! call ed_mem_alloc(2*par_run) - allocate (work_v(ngrids)) do ifm=1,ngrids @@ -1028,6 +1077,7 @@ subroutine ed_masterput_worklist_info(par_run) work_v(ifm)%landfrac (1:npoly) = sc_work(ifm)%landfrac (1:npoly) work_v(ifm)%soilfrac(1:maxsite,1:npoly) = sc_work(ifm)%soilfrac(1:maxsite,1:npoly) work_v(ifm)%ntext (1:maxsite,1:npoly) = sc_work(ifm)%ntext (1:maxsite,1:npoly) + work_v(ifm)%nscol (1:npoly) = sc_work(ifm)%nscol (1:npoly) work_v(ifm)%xid (1:npoly) = sc_work(ifm)%xid (1:npoly) work_v(ifm)%yid (1:npoly) = sc_work(ifm)%yid (1:npoly) @@ -1132,6 +1182,7 @@ subroutine ed_nodeget_nl , ffilout & ! intent(out) , ied_init_mode & ! intent(out) , thsums_database & ! intent(out) + , ivegt_dynamics & ! intent(out) , integration_scheme & ! intent(out) , end_time & ! intent(out) , current_time & ! intent(out) @@ -1164,17 +1215,14 @@ subroutine ed_nodeget_nl , min_site_area & ! intent(out) , attach_metadata ! ! intent(out) use canopy_air_coms , only : icanturb & ! intent(out) - , i_blyr_condct & ! intent(out) , isfclyrm & ! intent(out) , ied_grndvap & ! intent(out) + , ubmin & ! intent(out) + , ugbmin & ! intent(out) , ustmin & ! intent(out) , gamm & ! intent(out) , gamh & ! intent(out) , tprandtl & ! intent(out) - , vkopr & ! intent(out) - , ggfact & ! intent(out) - , vh2vr & ! intent(out) - , vh2dh & ! intent(out) , ribmax & ! intent(out) , leaf_maxwhc ! ! intent(out) use grid_coms , only : nzg & ! intent(out) @@ -1194,6 +1242,7 @@ subroutine ed_nodeget_nl , nstraty ! ! intent(out) use soil_coms , only : isoilflg & ! intent(out) , nslcon & ! intent(out) + , isoilcol & ! intent(out) , slxclay & ! intent(out) , slxsand & ! intent(out) , slz & ! intent(out) @@ -1207,7 +1256,6 @@ subroutine ed_nodeget_nl , isoildepthflg & ! intent(out) , isoilbc & ! intent(out) , runoff_time & ! intent(out) - , betapower & ! intent(out) , zrough & ! intent(out) , layer_index & ! intent(out) , nlon_lyr & ! intent(out) @@ -1237,17 +1285,32 @@ subroutine ed_nodeget_nl , maxpatch & ! intent(out) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) - , istoma_scheme & ! intent(out) , h2o_plant_lim & ! intent(out) , n_plant_lim & ! intent(out) - , vmfact & ! intent(out) - , mfact & ! intent(out) - , kfact & ! intent(out) - , gamfact & ! intent(out) - , d0fact & ! intent(out) - , alphafact & ! intent(out) - , lwfact & ! intent(out) - , thioff & ! intent(out) + , vmfact_c3 & ! intent(out) + , vmfact_c4 & ! intent(out) + , mphoto_trc3 & ! intent(out) + , mphoto_tec3 & ! intent(out) + , mphoto_c4 & ! intent(out) + , bphoto_blc3 & ! intent(out) + , bphoto_nlc3 & ! intent(out) + , bphoto_c4 & ! intent(out) + , kw_grass & ! intent(out) + , kw_tree & ! intent(out) + , gamma_c3 & ! intent(out) + , gamma_c4 & ! intent(out) + , d0_grass & ! intent(out) + , d0_tree & ! intent(out) + , alpha_c3 & ! intent(out) + , alpha_c4 & ! intent(out) + , klowco2in & ! intent(out) + , rrffact & ! intent(out) + , growthresp & ! intent(out) + , lwidth_grass & ! intent(out) + , lwidth_bltree & ! intent(out) + , lwidth_nltree & ! intent(out) + , q10_c3 & ! intent(out) + , q10_c4 & ! intent(out) , quantum_efficiency_T ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -1274,7 +1337,15 @@ subroutine ed_nodeget_nl , time2canopy ! ! intent(out) use optimiz_coms , only : ioptinpt ! ! intent(out) use canopy_layer_coms , only : crown_mod ! ! intent(out) - use canopy_radiation_coms, only : ican_swrad ! ! intent(out) + use canopy_radiation_coms, only : icanrad & ! intent(out) + , ltrans_vis & ! intent(out) + , ltrans_nir & ! intent(out) + , lreflect_vis & ! intent(out) + , lreflect_nir & ! intent(out) + , orient_tree & ! intent(out) + , orient_grass & ! intent(out) + , clump_tree & ! intent(out) + , clump_grass ! ! intent(out) use rk4_coms , only : rk4_tolerance & ! intent(out) , ibranch_thermo & ! intent(out) , ipercol ! ! intent(out) @@ -1349,6 +1420,7 @@ subroutine ed_nodeget_nl call MPI_Bcast(nzs ,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(isoilflg,maxgrds,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(nslcon,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(isoilcol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxclay,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(slxsand,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -1406,11 +1478,11 @@ subroutine ed_nodeget_nl call MPI_Bcast(centlat,maxgrds,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(centlon,maxgrds,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(rk4_tolerance,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ibranch_thermo,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphysiol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(istoma_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iallom,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iphen_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(repro_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -1419,17 +1491,41 @@ subroutine ed_nodeget_nl call MPI_Bcast(lapse_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(crown_mod,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ican_swrad,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(icanrad,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_vis,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ltrans_nir,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_vis,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lreflect_nir,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(orient_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(clump_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vmfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(mfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(kfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(gamfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(d0fact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(alphafact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(vmfact_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_trc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_tec3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mphoto_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_blc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_nlc3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(bphoto_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(kw_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(gamma_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(d0_tree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(alpha_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(klowco2in,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(rrffact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(growthresp,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_grass,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_bltree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(lwidth_nltree,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c3,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(q10_c4,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(thetacrit,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(lwfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(thioff,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(quantum_efficiency_T,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_plant_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_decomp_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -1442,7 +1538,6 @@ subroutine ed_nodeget_nl call MPI_Bcast(pft_1st_check,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(icanturb,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(i_blyr_condct,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(isfclyrm,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ied_grndvap,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ipercol,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -1450,17 +1545,14 @@ subroutine ed_nodeget_nl call MPI_Bcast(treefall_disturbance_rate,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(time2canopy,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(runoff_time,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(betapower,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ubmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ugbmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ustmin,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamm,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(gamh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(tprandtl,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vkopr,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2vr,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(vh2dh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(ribmax,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(leaf_maxwhc,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) - call MPI_Bcast(ggfact,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(iprintpolys,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) do n=1,maxpvars @@ -1660,41 +1752,44 @@ subroutine ed_nodeget_worklist_info call ed_nullify_work_vec(work_v(ifm)) call ed_alloc_work_vec(work_v(ifm),npolygons,maxsite) - mpiid=maxmach*(ifm-1)*(10+5*maxsite)+mynum + mpiid=1300000 + maxmach*(ifm-1)*(10+5*maxsite)+mynum !------ Grab the information. -------------------------------------------------------! - call MPI_Recv(work_v(ifm)%glon(1:npolygons),npolygons,MPI_REAL,master_num,mpiid & - ,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_v(ifm)%glon,npolygons,MPI_REAL,master_num,mpiid,MPI_COMM_WORLD & + ,status,ierr) mpiid = mpiid + 1 - call MPI_Recv(work_v(ifm)%glat(1:npolygons),npolygons,MPI_REAL,master_num,mpiid & - ,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_v(ifm)%glat,npolygons,MPI_REAL,master_num,mpiid,MPI_COMM_WORLD & + ,status,ierr) mpiid = mpiid + 1 - call MPI_Recv(work_v(ifm)%landfrac(1:npolygons),npolygons,MPI_REAL,master_num,mpiid & + call MPI_Recv(work_v(ifm)%landfrac,npolygons,MPI_REAL,master_num,mpiid & ,MPI_COMM_WORLD,status,ierr) mpiid = mpiid + 1 - call MPI_Recv(work_v(ifm)%xid(1:npolygons),npolygons,MPI_INTEGER,master_num,mpiid & - ,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_v(ifm)%xid,npolygons,MPI_INTEGER,master_num,mpiid,MPI_COMM_WORLD & + ,status,ierr) mpiid = mpiid + 1 - call MPI_Recv(work_v(ifm)%yid(1:npolygons),npolygons,MPI_INTEGER,master_num,mpiid & + call MPI_Recv(work_v(ifm)%yid,npolygons,MPI_INTEGER,master_num,mpiid,MPI_COMM_WORLD & + ,status,ierr) + mpiid = mpiid + 1 + + call MPI_Recv(work_v(ifm)%nscol,npolygons,MPI_INTEGER,master_num,mpiid & ,MPI_COMM_WORLD,status,ierr) mpiid = mpiid + 1 do itext=1,maxsite - call MPI_Recv(work_v(ifm)%ntext(itext,1:npolygons),npolygons,MPI_INTEGER & - ,master_num,mpiid,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_v(ifm)%ntext(itext,:),npolygons,MPI_INTEGER,master_num,mpiid & + ,MPI_COMM_WORLD,status,ierr) mpiid = mpiid + 1 - call MPI_Recv(work_v(ifm)%soilfrac(itext,1:npolygons),npolygons,MPI_REAL & - ,master_num,mpiid,MPI_COMM_WORLD,status,ierr) + call MPI_Recv(work_v(ifm)%soilfrac(itext,:),npolygons,MPI_REAL,master_num,mpiid & + ,MPI_COMM_WORLD,status,ierr) mpiid = mpiid + 1 end do end do - return end subroutine ed_nodeget_worklist_info !==========================================================================================! diff --git a/ED/src/mpi/ed_para_init.F90 b/ED/src/mpi/ed_para_init.F90 index abd29e69c..80b1eeb50 100644 --- a/ED/src/mpi/ed_para_init.F90 +++ b/ED/src/mpi/ed_para_init.F90 @@ -185,7 +185,8 @@ subroutine get_work(ifm,nxp,nyp) use soil_coms , only : veg_database & ! intent(in) , soil_database & ! intent(in) , isoilflg & ! intent(in) - , nslcon ! ! intent(in) + , nslcon & ! intent(in) + , isoilcol ! ! intent(in) use mem_polygons, only : n_poi & ! intent(in) , poi_res & ! intent(in) , grid_res & ! intent(in) @@ -203,6 +204,7 @@ subroutine get_work(ifm,nxp,nyp) real , dimension(:,:), allocatable :: lon_list integer, dimension(:,:), allocatable :: leaf_class_list integer, dimension(:,:), allocatable :: ntext_soil_list + integer, dimension(:,:), allocatable :: ncol_soil_list real , dimension(:,:), allocatable :: ipcent_land real , dimension(:,:), allocatable :: ipcent_soil integer :: datsoil @@ -224,6 +226,7 @@ subroutine get_work(ifm,nxp,nyp) allocate(lon_list ( 3,npoly)) allocate(leaf_class_list(maxsite,npoly)) allocate(ntext_soil_list(maxsite,npoly)) + allocate(ncol_soil_list (maxsite,npoly)) allocate(ipcent_land (maxsite,npoly)) allocate(ipcent_soil (maxsite,npoly)) !---------------------------------------------------------------------------------------! @@ -366,6 +369,14 @@ subroutine get_work(ifm,nxp,nyp) !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! For the time being, soil colour is constant. Only if results look promising we ! + ! will attempt to read a map. ! + !---------------------------------------------------------------------------------------! + ncol_soil_list (:,:) = isoilcol + !---------------------------------------------------------------------------------------! + + !----- Re-map the land cover classes. --------------------------------------------------! ipy = 0 @@ -386,12 +397,15 @@ subroutine get_work(ifm,nxp,nyp) work_e(ifm)%soilfrac(itext,i,j) = ipcent_soil(itext,ipy) work_e(ifm)%ntext (itext,i,j) = ntext_soil_list (itext,ipy) end do + work_e(ifm)%nscol (i,j) = ncol_soil_list(1,ipy) + maxwork = max(maxwork,work_e(ifm)%work(i,j)) else !----- Making this grid point 100% water --------------------------------------! work_e(ifm)%landfrac (i,j) = 0. work_e(ifm)%work (i,j) = epsilon(0.0) + work_e(ifm)%nscol (i,j) = 0 work_e(ifm)%ntext (:,i,j) = 0 work_e(ifm)%soilfrac(:,i,j) = 0. end if @@ -415,6 +429,7 @@ subroutine get_work(ifm,nxp,nyp) deallocate(lon_list ) deallocate(leaf_class_list) deallocate(ntext_soil_list) + deallocate(ncol_soil_list ) deallocate(ipcent_land ) deallocate(ipcent_soil ) !---------------------------------------------------------------------------------------! @@ -491,6 +506,7 @@ subroutine ed_parvec_work(ifm,nxp,nyp) work_v(ifm)%work (poly) = work_e(ifm)%work(i,j) work_v(ifm)%xid (poly) = i work_v(ifm)%yid (poly) = j + work_v(ifm)%nscol (poly) = work_e(ifm)%nscol(i,j) do itext=1,maxsite work_v(ifm)%ntext (itext,poly) = work_e(ifm)%ntext (itext,i,j) diff --git a/ED/src/utils/allometry.f90 b/ED/src/utils/allometry.f90 index 3edb7dd53..436c93dd9 100644 --- a/ED/src/utils/allometry.f90 +++ b/ED/src/utils/allometry.f90 @@ -9,10 +9,11 @@ module allometry !=======================================================================================! real function h2dbh(h,ipft) - use pft_coms, only: is_tropical & ! intent(in) - , b1Ht & ! intent(in), lookup table - , b2Ht & ! intent(in), lookup table - , hgt_ref ! ! intent(in), lookup table + use pft_coms , only : is_tropical & ! intent(in) + , b1Ht & ! intent(in), lookup table + , b2Ht & ! intent(in), lookup table + , hgt_ref ! ! intent(in), lookup table + use ed_misc_coms, only : iallom ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! @@ -20,7 +21,15 @@ real function h2dbh(h,ipft) integer, intent(in) :: ipft !------------------------------------------------------------------------------------! if (is_tropical(ipft)) then - h2dbh = exp((log(h)-b1Ht(ipft))/b2Ht(ipft)) + select case (iallom) + case (0,1) + !----- Default ED-2.1 allometry. ----------------------------------------------! + h2dbh = exp((log(h)-b1Ht(ipft))/b2Ht(ipft)) + case (2) + !----- Poorter et al. (2006) allometry. ---------------------------------------! + h2dbh = ( log(hgt_ref(ipft) / ( hgt_ref(ipft) - h ) ) / b1Ht(ipft) ) & + ** ( 1.0 / b2Ht(ipft) ) + end select else ! Temperate h2dbh = log(1.0-(h-hgt_ref(ipft))/b1Ht(ipft))/b2Ht(ipft) end if @@ -38,20 +47,30 @@ end function h2dbh !=======================================================================================! !=======================================================================================! real function dbh2h(ipft, dbh) - use pft_coms, only: is_tropical & ! intent(in) - , rho & ! intent(in) - , max_dbh & ! intent(in) - , b1Ht & ! intent(in) - , b2Ht & ! intent(in) - , hgt_ref ! ! intent(in) + use pft_coms , only : is_tropical & ! intent(in) + , dbh_crit & ! intent(in) + , b1Ht & ! intent(in) + , b2Ht & ! intent(in) + , hgt_ref ! ! intent(in) + use ed_misc_coms, only : iallom ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! integer , intent(in) :: ipft real , intent(in) :: dbh + !----- Local variables --------------------------------------------------------------! + real :: mdbh !------------------------------------------------------------------------------------! if (is_tropical(ipft)) then - dbh2h = exp (b1Ht(ipft) + b2Ht(ipft) * log(min(dbh,max_dbh(ipft))) ) + mdbh = min(dbh,dbh_crit(ipft)) + select case (iallom) + case (0,1) + !----- Default ED-2.1 allometry. ----------------------------------------------! + dbh2h = exp (b1Ht(ipft) + b2Ht(ipft) * log(mdbh) ) + case (2) + !----- Poorter et al. (2006) allometry. ---------------------------------------! + dbh2h = hgt_ref(ipft) * (1. - exp (-b1Ht(ipft) * mdbh ** b2Ht(ipft) ) ) + end select else !----- Temperate PFT allometry. ------------------------------------------------! dbh2h = hgt_ref(ipft) + b1Ht(ipft) * (1.0 - exp(b2Ht(ipft) * dbh)) end if @@ -73,22 +92,19 @@ real function dbh2bd(dbh,ipft) use pft_coms , only : C2B & ! intent(in) , b1Bs_small & ! intent(in), lookup table , b2Bs_small & ! intent(in), lookup table - , b1Bs_big & ! intent(in), lookup table - , b2Bs_big & ! intent(in), lookup table - , max_dbh ! ! intent(in), lookup table + , b1Bs_large & ! intent(in), lookup table + , b2Bs_large & ! intent(in), lookup table + , dbh_crit ! ! intent(in), lookup table implicit none !----- Arguments --------------------------------------------------------------------! real , intent(in) :: dbh integer, intent(in) :: ipft - !----- Local variables --------------------------------------------------------------! - real :: agb - real :: qd !------------------------------------------------------------------------------------! - if (dbh <= max_dbh(ipft)) then + if (dbh <= dbh_crit(ipft)) then dbh2bd = b1Bs_small(ipft) / C2B * dbh ** b2Bs_small(ipft) else - dbh2bd = b1Bs_big(ipft) / C2B * dbh ** b2Bs_big(ipft) + dbh2bd = b1Bs_large(ipft) / C2B * dbh ** b2Bs_large(ipft) end if return @@ -112,8 +128,8 @@ end function dbh2bd real function bd2dbh(ipft, bdead) use pft_coms , only : b1Bs_small & ! intent(in), lookup table , b2Bs_small & ! intent(in), lookup table - , b1Bs_big & ! intent(in), lookup table - , b2Bs_big & ! intent(in), lookup table + , b1Bs_large & ! intent(in), lookup table + , b2Bs_large & ! intent(in), lookup table , bdead_crit & ! intent(in), lookup table , C2B ! ! intent(in) implicit none @@ -130,7 +146,7 @@ real function bd2dbh(ipft, bdead) if (bdead <= bdead_crit(ipft)) then bd2dbh = (bdead / b1Bs_small(ipft) * C2B)**(1.0/b2Bs_small(ipft)) else - bd2dbh = (bdead / b1Bs_big(ipft) * C2B)**(1.0/b2Bs_big(ipft)) + bd2dbh = (bdead / b1Bs_large(ipft) * C2B)**(1.0/b2Bs_large(ipft)) end if !------------------------------------------------------------------------------------! @@ -146,11 +162,12 @@ end function bd2dbh !=======================================================================================! !=======================================================================================! + ! This function determines the maximum leaf biomass (kgC/plant) real function dbh2bl(dbh,ipft) - use pft_coms , only : max_dbh & ! intent(in), lookup table - , C2B & ! intent(in) - , b1Bl & ! intent(in), lookup table - , b2Bl ! ! intent(in), lookup table + use pft_coms , only : dbh_crit & ! intent(in), lookup table + , C2B & ! intent(in) + , b1Bl & ! intent(in), lookup table + , b2Bl ! ! intent(in), lookup table implicit none !----- Arguments --------------------------------------------------------------------! @@ -158,13 +175,21 @@ real function dbh2bl(dbh,ipft) integer, intent(in) :: ipft !----- Local variables --------------------------------------------------------------! real :: mdbh - real :: agb - real :: qd !------------------------------------------------------------------------------------! - mdbh = min(dbh,max_dbh(ipft)) + !------------------------------------------------------------------------------------! + ! Make sure bleaf won't keep growing once the plant hits the maximum height. ! + !------------------------------------------------------------------------------------! + mdbh = min(dbh,dbh_crit(ipft)) + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find maximum leaf biomass. ! + !------------------------------------------------------------------------------------! dbh2bl = b1Bl(ipft) / C2B * mdbh ** b2Bl(ipft) + !------------------------------------------------------------------------------------! return end function dbh2bl @@ -182,9 +207,8 @@ end function dbh2bl !---------------------------------------------------------------------------------------! real function dbh2ca(dbh,sla,ipft) use ed_misc_coms, only : iallom ! ! intent(in) - use pft_coms , only : max_dbh & ! intent(in) + use pft_coms , only : dbh_crit & ! intent(in) , is_tropical & ! intent(in) - , is_grass & ! intent(in) , b1Ca & ! intent(in) , b2Ca ! ! intent(in) implicit none @@ -199,11 +223,6 @@ real function dbh2ca(dbh,sla,ipft) if (dbh < tiny(1.0)) then loclai = 0.0 dbh2ca = 0.0 - !----- Based on Poorter et al. (2006) -----------------------------------------------! - !elseif(is_tropical(ipft) .or. is_grass(ipft)) then - ! hite = dbh2h(ipft,dbh) - ! dbh2ca = 0.156766*hite**1.888 - !----- Based on Dietze and Clark (2008). --------------------------------------------! else loclai = sla * dbh2bl(dbh,ipft) @@ -214,7 +233,7 @@ real function dbh2ca(dbh,sla,ipft) case default !----- Impose a maximum crown area. -------------------------------------------! - dbh2ca = b1Ca(ipft) * min(dbh,max_dbh(ipft)) ** b2Ca(ipft) + dbh2ca = b1Ca(ipft) * min(dbh,dbh_crit(ipft)) ** b2Ca(ipft) end select end if @@ -282,26 +301,14 @@ integer function dbh2krdepth(hgt,dbh,ipft,lsl) !----- Grasses get a fixed rooting depth of 70 cm. ----------------------------------! select case (iallom) - case (0:2) + case (0) !---------------------------------------------------------------------------------! ! Original ED-2.1 (I don't know the source for this equation, though). ! !---------------------------------------------------------------------------------! volume = dbh2vol(hgt,dbh,ipft) root_depth = b1Rd(ipft) * volume ** b2Rd(ipft) - case (3) - !---------------------------------------------------------------------------------! - ! This equation is based on Kenzo et al (2009), figure 4e, although a ! - ! correction was needed to make root depth a function of DBH rather than basal ! - ! diameter. ! - ! Source: Kenzo, T., and co-authors: 2009. Development of allometric relation- ! - ! ships for accurate estimation of above- and below-ground biomass in ! - ! tropical secondary forests in Sarawak, Malaysia. J. Trop. Ecology, ! - ! 25, 371-386. ! - !---------------------------------------------------------------------------------! - root_depth = b1Rd(ipft) * dbh ** b2Rd(ipft) - - case (4) + case (2) !---------------------------------------------------------------------------------! ! This is just a test allometry, that imposes root depth to be 0.5 m for ! ! plants that are 0.15-m tall, and 5.0 m for plants that are 35-m tall. ! @@ -379,8 +386,8 @@ real function wood_biomass(bdead, bsapwood, pft) real :: absapwood !------------------------------------------------------------------------------------! - bstem = agf_bs * bdead - absapwood = agf_bs * bsapwood + bstem = agf_bs(pft) * bdead + absapwood = agf_bs(pft) * bsapwood wood_biomass = bstem + absapwood return end function wood_biomass @@ -397,7 +404,6 @@ end function wood_biomass ! This subroutine finds the total above ground biomass (wood + leaves) ! !---------------------------------------------------------------------------------------! real function ed_biomass(bdead, balive, bleaf, pft, hite, bstorage, bsapwood) - use pft_coms, only: agf_bs ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! @@ -432,33 +438,19 @@ end function ed_biomass ! constant. The wood area index WAI is found using the model proposed by Järvelä ! ! (2004) to find the specific projected area. ! ! ! - ! Järvelä, J., 2004: Determination of flow resistance caused by non-submerged woody ! - ! vegetation. Intl. J. River Basin Management, 2, 61-70. ! - ! ! - ! There is also a very simplified estimation of branch area index, which is just a ! - ! simple curve adjusted with the information I found in Conijn (1995), which is actual- ! - ! ly for the Sahel... ! - ! ! - ! Conijn, J.G., 1995: RECAFS: a model for resource competition and cycling in agro- ! - ! forestry systems. Rapports Production Soudano-Sahélienne. ! - ! Wageningen, 1995. ! + ! Ahrends, B., C. Penne, O. Panferov, 2010: Impact of target diameter harvesting on ! + ! spatial and temporal pattern of drought risk in forest ecosystems under ! + ! climate change conditions. The Open Geography Journal, 3, 91-102 (they ! + ! didn't develop the allometry, but the original reference is in German...) ! !---------------------------------------------------------------------------------------! subroutine area_indices(nplant,bleaf,bdead,balive,dbh,hite,pft,sla,lai,wpa,wai & ,crown_area,bsapwood) use pft_coms , only : is_tropical & ! intent(in) - , is_grass & ! intent(in) , rho & ! intent(in) , C2B & ! intent(in) - , horiz_branch & ! intent(in) - , rbranch & ! intent(in) - , rdiamet & ! intent(in) - , rlength & ! intent(in) - , diammin & ! intent(in) - , ntrunk & ! intent(in) - , conijn_a & ! intent(in) - , conijn_b & ! intent(in) - , conijn_c & ! intent(in) - , conijn_d ! ! intent(in) + , dbh_crit & ! intent(in) + , b1WAI & ! intent(in) + , b2WAI ! ! intent(in) use consts_coms , only : onethird & ! intent(in) , pi1 ! ! intent(in) use rk4_coms , only : ibranch_thermo ! ! intent(in) @@ -505,73 +497,15 @@ subroutine area_indices(nplant,bleaf,bdead,balive,dbh,hite,pft,sla,lai,wpa,wai !----- Ignore branches and trunk. ------------------------------------------------! wpa = 0. wai = 0. - !------------------------------------------------------------------------------------! - - - case (1) - !---------------------------------------------------------------------------------! - ! Use curve fit based on Conijn (1995) model. Find the total wood biomass ! - ! and the fraction corresponding to branches. ! - !---------------------------------------------------------------------------------! - bwood = wood_biomass(bdead, bsapwood, pft) - if (is_grass(pft)) then - swa = conijn_a(pft) - else - swa = conijn_a(pft) & - + conijn_b(pft) * errorfun(conijn_c(pft)*C2B*bwood + conijn_d(pft)) - end if - wai = nplant * bwood * swa - wpa = wai * dbh2ca(dbh,sla,pft) !---------------------------------------------------------------------------------! - - case (2) - !---------------------------------------------------------------------------------! - ! Use Järvelä (2004) method. ! - !---------------------------------------------------------------------------------! - !----- Now we check the first branching height, that will be the trunk height. ---! - blength = h2crownbh(hite,pft) - !----- Main branch diameter is DBH (in meters) -----------------------------------! - bdiamet = dbh * 0.01 - !----- Minimum branch diameter (in meters) ---------------------------------------! - bdmin = diammin(pft) * 0.01 - !----- Number of main "branches" (trunk), this is usually 1. ---------------------! - nbranch = ntrunk(pft) - - swa = nbranch * blength * bdiamet - !---------------------------------------------------------------------------------! - ! Initialize branch values with trunk. ! - !---------------------------------------------------------------------------------! - branchloop: do - if (bdiamet < bdmin) exit branchloop - !----- Updating branch habits. ------------------------------------------------! - bdiamet = bdiamet / rdiamet(pft) - blength = blength / rlength(pft) - nbranch = nbranch * rbranch(pft) - swa = swa + nbranch * blength * bdiamet - end do branchloop - !----- The wood projected area and the wood area index. --------------------------! - wpa = nplant * swa - wai = horiz_branch(pft) * wpa - case (3) + case (1,2) !---------------------------------------------------------------------------------! - ! Use the equation by: ! - ! Ahrends, B., C. Penne, O. Panferov, 2010: Impact of target diameter ! - ! harvesting on spatial and temporal pattern of drought risk in forest ! - ! ecosystems under climate change conditions. The Open Geography Journal, ! - ! 3, 91-102 (they didn't develop the allometry, but the original ! - ! reference is in German...) ! - !---------------------------------------------------------------------------------! - select case (pft) - case (6:8,17) - !----- Conifers. -------------------------------------------------------------! - wai = nplant * 0.0553 * 0.5 * dbh ** 1.9769 - case default - !----- Broadleaf trees and grasses. ------------------------------------------! - wai = nplant * 0.0192 * 0.5 * dbh ** 2.0947 - end select + ! Solve branches using the equations from Ahrends et al. (2010). ! !---------------------------------------------------------------------------------! + wai = nplant * b1WAI(pft) * min(dbh,dbh_crit(pft)) ** b2WAI(pft) wpa = wai * dbh2ca(dbh,sla,pft) + !---------------------------------------------------------------------------------! end select !------------------------------------------------------------------------------------! diff --git a/ED/src/utils/dateutils.f90 b/ED/src/utils/dateutils.f90 index 5af87c6db..79073e348 100644 --- a/ED/src/utils/dateutils.f90 +++ b/ED/src/utils/dateutils.f90 @@ -342,12 +342,15 @@ end function julday1000 !==========================================================================================! !==========================================================================================! +! This function runs a check on whether the year is leap or not, based on Gregorian ! +! calendar. ! +!------------------------------------------------------------------------------------------! logical function isleap(year) - !This function runs a check on whether the year is leap or not, based - ! on Gregorian calendar + !----- Arguments. ----------------------------------------------------------------------! integer, intent(in) :: year - isleap = (mod(year,400) == 0) .or. & - (mod(year,4) == 0 .and. mod(year,100) /= 0) + !---------------------------------------------------------------------------------------! + + isleap = (mod(year,400) == 0) .or. (mod(year,4) == 0 .and. mod(year,100) /= 0) return end function isleap diff --git a/ED/src/utils/ed_therm_lib.f90 b/ED/src/utils/ed_therm_lib.f90 index 9dbfa753a..387e3fa92 100644 --- a/ED/src/utils/ed_therm_lib.f90 +++ b/ED/src/utils/ed_therm_lib.f90 @@ -51,7 +51,8 @@ subroutine calc_veg_hcap(bleaf,bdead,bsapwood,nplant,pft,leaf_hcap,wood_hcap) , c_ngrn_biom_dry & ! intent(in) , wat_dry_ratio_ngrn & ! intent(in) , delta_c & ! intent(in) - , C2B ! ! intent(in) + , C2B & ! intent(in) + , brf_wd ! ! intent(in) use rk4_coms , only : ibranch_thermo ! ! intent(in) use allometry , only : wood_biomass ! ! function implicit none @@ -81,7 +82,10 @@ subroutine calc_veg_hcap(bleaf,bdead,bsapwood,nplant,pft,leaf_hcap,wood_hcap) !----- Find branch/twig specific heat and biomass. -------------------------------! spheat_wood = (c_ngrn_biom_dry(pft) + wat_dry_ratio_ngrn(pft) * cliq) & / (1. + wat_dry_ratio_ngrn(pft)) + delta_c(pft) - bwood = wood_biomass(bdead, bsapwood,pft) + + !----- Find the total branchwood biomass. ----------------------------------------! + bwood = brf_wd(pft) * wood_biomass(bdead, bsapwood,pft) + end select !----- Find the leaf specific heat. -------------------------------------------------! @@ -300,13 +304,22 @@ end subroutine update_veg_energy_cweh ! the top soil or snow surface and is used for dew formation and snow evaporation. ! ! References: ! ! ! + ! P86 - Passerat de Silans, A., 1986: Transferts de masse et de chaleur dans un sol ! + ! stratifié soumis ā une excitation amtosphérique naturelle. Comparaison: ! + ! Modčles-expérience. Thesis, Institut National Polytechnique de Grenoble. ! + ! ! ! NP89 - Noilhan, J., S. Planton, 1989: A simple parameterization of land surface ! ! processes for meteorological models. Mon. Wea. Rev., 117, 536-549. ! ! ! + ! MN91 - Mahfouf, J. F., J. Noilhan, 1991: Comparative study of various formulations of ! + ! evaporation from bare soil using in situ data. J. Appl. Meteorol., 30, ! + ! 1354-1365. ! + ! ! ! LP92 - Lee, T. J., R. A. Pielke, 1992: Estimating the soil surface specific humidity ! ! J. Appl. Meteorol., 31, 480-484. ! ! ! ! LP93 - Lee, T. J., R. A. Pielke, 1993: CORRIGENDUM, J. Appl. Meteorol., 32, 580. ! + ! ! !---------------------------------------------------------------------------------------! subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp & ,sfcwater_fliq,can_prss,can_shv,ground_shv,ground_ssh & @@ -315,8 +328,7 @@ subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater use canopy_air_coms, only : ied_grndvap & ! intent(in) , ggsoil0 & ! intent(in) , kksoil ! ! intent(in) - use soil_coms , only : soil & ! intent(in) - , betapower ! ! intent(in) + use soil_coms , only : soil ! ! intent(in) use consts_coms , only : pi1 & ! intent(in) , wdns & ! intent(in) , gorh2o & ! intent(in) @@ -369,7 +381,7 @@ subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater ground_ssh = ground_ssh / (1.0 + ground_ssh) !----- Determine alpha. ----------------------------------------------------------! slpotvn = soil(nsoil)%slpots & - * (soil(nsoil)%slmsts / topsoil_water) ** soil(nsoil)%slbs + / (topsoil_water / soil(nsoil)%slmsts) ** soil(nsoil)%slbs lnalpha = gorh2o * slpotvn / ground_temp if (lnalpha > lnexp_min) then alpha = exp(lnalpha) @@ -387,15 +399,9 @@ subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater ! This is necessary to avoid evaporation to be large just slightly above the dry ! ! air soil, which was happening especially for those soil types rich in clay. ! !---------------------------------------------------------------------------------! - if (topsoil_water >= soil(nsoil)%sfldcap) then - beta = 1. - elseif (topsoil_water <= soil(nsoil)%soilwp) then - beta = 0. - else - smterm = (topsoil_water - soil(nsoil)%soilwp) & - / (soil(nsoil)%sfldcap - soil(nsoil)%soilwp) - beta = (.5 * (1. - cos (smterm * pi1))) ** betapower - end if + smterm = min(1.0, max(0.0, (topsoil_water - soil(nsoil)%soilcp) & + / (soil(nsoil)%sfldcap - soil(nsoil)%soilcp) )) + beta = .5 * (1. - cos (smterm * pi1)) !---------------------------------------------------------------------------------! @@ -437,6 +443,14 @@ subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater ground_shv = max(can_shv, ground_ssh * alpha) ggsoil = ggsoil0 * exp(kksoil * smterm) !------------------------------------------------------------------------------! + + case (5) + !------------------------------------------------------------------------------! + ! Combination of NP89 and P86. ! + !------------------------------------------------------------------------------! + ground_shv = max(can_shv, ground_ssh * beta) + ggsoil = ggsoil0 * exp(kksoil * smterm) + !------------------------------------------------------------------------------! end select !---------------------------------------------------------------------------------! @@ -477,31 +491,40 @@ end subroutine ed_grndvap ! the top soil or snow surface and is used for dew formation and snow evaporation. ! ! References: ! ! ! + ! P86 - Passerat de Silans, A., 1986: Transferts de masse et de chaleur dans un sol ! + ! stratifié soumis ā une excitation amtosphérique naturelle. Comparaison: ! + ! Modčles-expérience. Thesis, Institut National Polytechnique de Grenoble. ! + ! ! ! NP89 - Noilhan, J., S. Planton, 1989: A simple parameterization of land surface ! ! processes for meteorological models. Mon. Wea. Rev., 117, 536-549. ! ! ! + ! MN91 - Mahfouf, J. F., J. Noilhan, 1991: Comparative study of various formulations of ! + ! evaporation from bare soil using in situ data. J. Appl. Meteorol., 30, ! + ! 1354-1365. ! + ! ! ! LP92 - Lee, T. J., R. A. Pielke, 1992: Estimating the soil surface specific humidity ! ! J. Appl. Meteorol., 31, 480-484. ! ! ! ! LP93 - Lee, T. J., R. A. Pielke, 1993: CORRIGENDUM, J. Appl. Meteorol., 32, 580. ! + ! ! !---------------------------------------------------------------------------------------! subroutine ed_grndvap8(ksn,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp & ,sfcwater_fliq,can_prss,can_shv,ground_shv,ground_ssh & ,ground_temp,ground_fliq,ggsoil) - use canopy_air_coms, only : ied_grndvap & ! intent(in) - , ggsoil08 & ! intent(in) - , kksoil8 ! ! intent(in) - use soil_coms , only : soil8 & ! intent(in) - , betapower8 ! ! intent(in) - use consts_coms , only : pi18 & ! intent(in) - , wdns8 & ! intent(in) - , gorh2o8 & ! intent(in) - , lnexp_min8 & ! intent(in) - , huge_num8 ! ! intent(in) - use therm_lib8 , only : rslif8 ! ! function - use rk4_coms , only : rk4site ! ! intent(in) - use grid_coms , only : nzg ! ! intent(in) - use ed_max_dims , only : n_pft ! ! intent(in) + use canopy_air_coms, only : ied_grndvap & ! intent(in) + , ggsoil08 & ! intent(in) + , kksoil8 ! ! intent(in) + use soil_coms , only : soil8 ! ! intent(in) + use consts_coms , only : pi18 & ! intent(in) + , wdns8 & ! intent(in) + , gorh2o8 & ! intent(in) + , lnexp_min8 & ! intent(in) + , huge_num8 ! ! intent(in) + use therm_lib8 , only : rslif8 ! ! function + use rk4_coms , only : rk4site ! ! intent(in) + use grid_coms , only : nzg ! ! intent(in) + use ed_max_dims , only : n_pft ! ! intent(in) + use ed_misc_coms , only : current_time ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! integer , intent(in) :: ksn ! # of surface water layers [ ----] @@ -525,17 +548,57 @@ subroutine ed_grndvap8(ksn,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp real(kind=8) :: beta ! beta term (Lee-Pielke,1992) [ ----] real(kind=8) :: lnalpha ! ln(alpha) [ ----] real(kind=8) :: smterm ! soil moisture term [ ----] + !----- Kludge variables. ------------------------------------------------------------! + logical , parameter :: soil_kludge = .false. + logical , save :: first_time = .true. + real(kind=8), dimension(12), save :: topsoil_kludge + real(kind=8) :: use_soil_h2o + integer :: use_ksn !------------------------------------------------------------------------------------! + if (first_time .and. soil_kludge) then + first_time = .false. + + if (abs(rk4site%lon + 60.209) < 0.1 .and. abs(rk4site%lat + 2.609) < 0.1) then + !----- Manaus. ----------------------------------------------------------------! + topsoil_kludge = (/ 0.3944167, 0.4037273, 0.4197778, 0.4275714 & + , 0.4153636, 0.4140000, 0.4046111, 0.3853750 & + , 0.3743333, 0.3610435, 0.3746667, 0.3870000 /) + elseif (abs(rk4site%lon + 61.931) < 0.1 .and. abs(rk4site%lat + 10.083) < 0.1) then + !----- Rebio Jaru. ------------------------------------------------------------! + topsoil_kludge = (/ 0.2218000, 0.2233750, 0.2300000, 0.2141818 & + , 0.1758889, 0.1008750, 0.0867500, 0.1143077 & + , 0.1313636, 0.1208000, 0.1757143, 0.1947000 /) + elseif (abs(rk4site%lon + 62.357) < 0.1 .and. abs(rk4site%lat + 10.762) < 0.1) then + !---- Fazenda Nossa Senhora. --------------------------------------------------! + topsoil_kludge = (/ 0.1814286, 0.1936250, 0.1742222, 0.1783077 & + , 0.1478333, 0.1010000, 0.0618750, 0.0420000 & + , 0.0697500, 0.1412500, 0.1697000, 0.1927273 /) + else + write (unit=*,fmt='(a,1x,es12.5)') ' LON = ',rk4site%lon + write (unit=*,fmt='(a,1x,es12.5)') ' LAT = ',rk4site%lat + call fatal_error('Couldn''t find a good soil moisture climatology!' & + ,'ed_grndvap8','ed_therm_lib.f90') + end if + end if + + !------ Soil type at the top layer. -------------------------------------------------! nsoil = rk4site%ntext_soil(nzg) !------------------------------------------------------------------------------------! + if (soil_kludge) then + use_ksn = 0 + use_soil_h2o = topsoil_kludge(current_time%month) + else + use_ksn = ksn + use_soil_h2o = topsoil_water + end if !------------------------------------------------------------------------------------! ! Decide what are we going to call surface. ! !------------------------------------------------------------------------------------! - select case (ksn) + select case (use_ksn) case (0) !---------------------------------------------------------------------------------! ! Without snowcover or water ponding, ground_shv is the effective specific ! @@ -553,7 +616,7 @@ subroutine ed_grndvap8(ksn,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp ground_ssh = ground_ssh / (1.d0 + ground_ssh) !----- Determine alpha. ----------------------------------------------------------! slpotvn = soil8(nsoil)%slpots & - * (soil8(nsoil)%slmsts / topsoil_water) ** soil8(nsoil)%slbs + / (use_soil_h2o / soil8(nsoil)%slmsts) ** soil8(nsoil)%slbs lnalpha = gorh2o8 * slpotvn / ground_temp if (lnalpha > lnexp_min8) then alpha = exp(lnalpha) @@ -573,15 +636,9 @@ subroutine ed_grndvap8(ksn,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp ! This is necessary to avoid evaporation to be large just slightly above the dry ! ! air soil, which was happening especially for those soil types rich in clay. ! !---------------------------------------------------------------------------------! - if (topsoil_water >= soil8(nsoil)%sfldcap) then - beta = 1.d0 - elseif (topsoil_water <= soil8(nsoil)%soilwp) then - beta = 0.d0 - else - smterm = (topsoil_water - soil8(nsoil)%soilwp) & - / (soil8(nsoil)%sfldcap - soil8(nsoil)%soilwp) - beta = (5.d-1 * (1.d0 - cos (smterm * pi18))) ** betapower8 - end if + smterm = min(1.d0, max(0.d0, (use_soil_h2o - soil8(nsoil)%soilcp) & + / (soil8(nsoil)%sfldcap - soil8(nsoil)%soilcp) )) + beta = 5.d-1 * (1.d0 - cos (smterm * pi18)) !---------------------------------------------------------------------------------! @@ -623,6 +680,14 @@ subroutine ed_grndvap8(ksn,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater_temp ground_shv = max(can_shv, ground_ssh * alpha) ggsoil = ggsoil08 * exp(kksoil8 * smterm) !------------------------------------------------------------------------------! + + case (5) + !------------------------------------------------------------------------------! + ! Combination of NP89 and P86. ! + !------------------------------------------------------------------------------! + ground_shv = max(can_shv, ground_ssh * beta) + ggsoil = ggsoil08 * exp(kksoil8 * smterm) + !------------------------------------------------------------------------------! end select !---------------------------------------------------------------------------------! diff --git a/ED/src/utils/fuse_fiss_utils.f90 b/ED/src/utils/fuse_fiss_utils.f90 index 7ef3a93ea..7556d314e 100644 --- a/ED/src/utils/fuse_fiss_utils.f90 +++ b/ED/src/utils/fuse_fiss_utils.f90 @@ -12,19 +12,25 @@ module fuse_fiss_utils contains !=======================================================================================! !=======================================================================================! - ! This subroutine will sort the cohorts by size (1st = tallest, last = shortest.) ! + ! This subroutine will sort the cohorts by size (1st = tallest, last = shortest.) ! + ! In case there is a tie (for example, when 2 cohorts have reached the maximum possible ! + ! height, then we use DBH for tie breaking, and if they have the exact same DBH, then ! + ! we simply pick the lowest index (as they are exactly the same). This could cause ! + ! some problems when the new grass allometry is implemented, though. ! !---------------------------------------------------------------------------------------! subroutine sort_cohorts(cpatch) use ed_state_vars,only : patchtype ! ! Structure implicit none !----- Arguments --------------------------------------------------------------------! - type(patchtype), target :: cpatch ! Current patch, to have cohorts sorted. + type(patchtype) , target :: cpatch ! Current patch !----- Local variables --------------------------------------------------------------! - type(patchtype), pointer :: temppatch ! Scratch patch structure - integer :: ico ! Counters - integer :: tallco ! Index of tallest cohort - logical :: sorted ! Flag: this patch is already sorted + type(patchtype) , pointer :: temppatch ! Scratch patch structure + integer :: ico ! Counters + integer :: tallco ! Index of tallest cohort + real :: tophgt ! Maximum height considered + logical :: sorted ! Patch is already sorted + logical , dimension(:), allocatable :: attop ! Top cohorts, for tie-break !------------------------------------------------------------------------------------! !----- No need to sort an empty patch or a patch with a single cohort. --------------! @@ -38,7 +44,8 @@ subroutine sort_cohorts(cpatch) !------------------------------------------------------------------------------------! sorted = .true. sortcheck: do ico=1,cpatch%ncohorts-1 - sorted = cpatch%hite(ico) >= cpatch%hite(ico+1) + sorted = cpatch%hite(ico) >= cpatch%dbh(ico+1) .and. & + cpatch%dbh(ico) >= cpatch%dbh(ico+1) if (.not. sorted) exit sortcheck end do sortcheck if (sorted) return @@ -50,20 +57,30 @@ subroutine sort_cohorts(cpatch) nullify(temppatch) allocate(temppatch) call allocate_patchtype(temppatch,cpatch%ncohorts) - + + !----- Allocate the logical flag for tie-breaking. ----------------------------------! + allocate(attop(cpatch%ncohorts)) + ico = 0 !---- Loop until all cohorts were sorted. -------------------------------------------! do while(ico < cpatch%ncohorts) ico = ico + 1 - - !----- Find the tallest cohort. --------------------------------------------------! - tallco = maxloc(cpatch%hite,dim=1) - + + !----- Find the maximum height. --------------------------------------------------! + tophgt = maxval(cpatch%hite) + + !----- Find all cohorts that are at this height. ---------------------------------! + attop = cpatch%hite == tophgt + + !----- Find the fattest cohort at a given height. --------------------------------! + tallco = maxloc(cpatch%dbh,dim=1,mask=attop) + !----- Copy to the scratch structure. --------------------------------------------! call copy_patchtype(cpatch,temppatch,tallco,tallco,ico,ico) - - !----- Put a non-sense height so this will never "win" again. --------------------! + + !----- Put a non-sense DBH so this will never "win" again. -----------------------! cpatch%hite(tallco) = -huge(1.) + cpatch%dbh (tallco) = -huge(1.) end do @@ -72,6 +89,9 @@ subroutine sort_cohorts(cpatch) call deallocate_patchtype(temppatch) deallocate(temppatch) + !----- De-allocate the logical flag. ------------------------------------------------! + deallocate(attop) + return end subroutine sort_cohorts @@ -1297,9 +1317,6 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl cpatch%today_nppdaily(recc)= cpatch%today_nppdaily(recc) & + cpatch%today_nppdaily(donc) - cpatch%today_nppleaf(recc) = cpatch%today_nppleaf(recc) & - + cpatch%today_nppleaf(donc) - cpatch%today_gpp_pot(recc) = cpatch%today_gpp_pot(recc) & + cpatch%today_gpp_pot(donc) @@ -2591,7 +2608,7 @@ subroutine fuse_patches(cgrid,ifm) recloopp: do recp=donp-1,1,-1 recp_found = csite%dist_type(donp) == csite%dist_type(recp) .and. & fuse_table(recp) .and. & - (csite%dist_type(recp) == 1 .or. csite%age(recp) > 2.) + (csite%dist_type(recp) == 1 .or. csite%age(recp) > 3.) if (recp_found) then recpatch => csite%patch(recp) exit recloopp @@ -2911,11 +2928,7 @@ subroutine fuse_patches(cgrid,ifm) ! be a bug. ! !------------------------------------------------------------------------------! if (new_area < 0.99 * old_area .or. & - new_area > 1.01 * old_area .or. & - new_nplant_tot < 0.99 * (old_nplant_tot - elim_nplant_tot) .or. & - new_nplant_tot > 1.01 * (old_nplant_tot - elim_nplant_tot) .or. & - new_lai_tot < 0.99 * (old_lai_tot - elim_lai_tot ) .or. & - new_lai_tot > 1.01 * (old_lai_tot - elim_lai_tot ) ) then + new_area > 1.01 * old_area ) then write (unit=*,fmt='(a,1x,es12.5)') 'OLD_AREA: ',old_area write (unit=*,fmt='(a,1x,es12.5)') 'NEW_AREA: ',new_area write (unit=*,fmt='(a,1x,es12.5)') 'NEW_LAI_TOT: ',new_lai_tot @@ -3177,6 +3190,26 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf + csite%soil_water(iii,donp) * csite%area(donp)) end do + !------------------------------------------------------------------------------------! + ! These variables shouldn't matter because they are reset every day/every month, ! + ! but just in case... ! + !------------------------------------------------------------------------------------! + csite%avg_daily_temp (recp) = newareai & + * ( csite%avg_daily_temp (donp) & + * csite%area (donp) & + + csite%avg_daily_temp (recp) & + * csite%area (recp) ) + + csite%avg_monthly_gndwater (recp) = newareai & + * ( csite%avg_monthly_gndwater (donp) & + * csite%area (donp) & + + csite%avg_monthly_gndwater (recp) & + * csite%area (recp) ) + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! ! This subroutine takes care of filling: ! ! ! @@ -3217,6 +3250,22 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf ! output will have the values. Other variables will probably be scaled here as ! ! well. ! !------------------------------------------------------------------------------------! + csite%avg_ustar (recp) = newareai * & + ( csite%avg_ustar (donp) * csite%area(donp) & + + csite%avg_ustar (recp) * csite%area(recp) ) + + csite%avg_tstar (recp) = newareai * & + ( csite%avg_tstar (donp) * csite%area(donp) & + + csite%avg_tstar (recp) * csite%area(recp) ) + + csite%avg_qstar (recp) = newareai * & + ( csite%avg_qstar (donp) * csite%area(donp) & + + csite%avg_qstar (recp) * csite%area(recp) ) + + csite%avg_cstar (recp) = newareai * & + ( csite%avg_cstar (donp) * csite%area(donp) & + + csite%avg_cstar (recp) * csite%area(recp) ) + csite%avg_rshort_gnd(recp) = newareai * & ( csite%avg_rshort_gnd(donp) * csite%area(donp) & + csite%avg_rshort_gnd(recp) * csite%area(recp) ) @@ -3229,6 +3278,10 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf ( csite%avg_carbon_ac(donp) * csite%area(donp) & + csite%avg_carbon_ac(recp) * csite%area(recp) ) + csite%avg_carbon_st(recp) = newareai * & + ( csite%avg_carbon_st(donp) * csite%area(donp) & + + csite%avg_carbon_st(recp) * csite%area(recp) ) + csite%avg_vapor_lc(recp) = newareai * & ( csite%avg_vapor_lc(donp) * csite%area(donp) & + csite%avg_vapor_lc(recp) * csite%area(recp) ) @@ -3237,10 +3290,6 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf ( csite%avg_vapor_wc(donp) * csite%area(donp) & + csite%avg_vapor_wc(recp) * csite%area(recp) ) - csite%avg_dew_cg(recp) = newareai * & - ( csite%avg_dew_cg(donp) * csite%area(donp) & - + csite%avg_dew_cg(recp) * csite%area(recp) ) - csite%avg_vapor_gc(recp) = newareai * & ( csite%avg_vapor_gc(donp) * csite%area(donp) & + csite%avg_vapor_gc(recp) * csite%area(recp) ) diff --git a/ED/src/utils/invmondays.f90 b/ED/src/utils/invmondays.f90 index f77cd1789..4baeebc43 100644 --- a/ED/src/utils/invmondays.f90 +++ b/ED/src/utils/invmondays.f90 @@ -1,89 +1,163 @@ +!==========================================================================================! +!==========================================================================================! +! Function that determines the inverse of the number of days of the previous month. ! !------------------------------------------------------------------------------------------! -! Function that determines the inverse of the number of days of the previous month. ! -!------------------------------------------------------------------------------------------! +subroutine lastmonthdate(thismonth,lastmonth,maxdaysi) + use ed_misc_coms, only: simtime + implicit none + !----- Arguments. ----------------------------------------------------------------------! + type(simtime) , intent(in) :: thismonth + type(simtime) , intent(out) :: lastmonth + real , intent(out) :: maxdaysi + !----- Local variables. ----------------------------------------------------------------! + integer , dimension(12) :: maxdays + !----- External functions. -------------------------------------------------------------! + logical , external :: isleap + !---------------------------------------------------------------------------------------! + + + !----- Initialise the array assuming it is a regular year. -----------------------------! + maxdays = (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /) + !---------------------------------------------------------------------------------------! + + + !----- Copy the time structure to the previous month, and assign dummy date and time. --! + lastmonth = thismonth + lastmonth%date = 1 + lastmonth%time = 0. + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Shift one month back in time, and check if this would actually be December of the ! + ! previous year. If so, make it December of the previous year. ! + !---------------------------------------------------------------------------------------! + lastmonth%month = lastmonth%month -1 + if (lastmonth%month == 0) then + lastmonth%month = 12 + lastmonth%year = lastmonth%year - 1 + end if + !---------------------------------------------------------------------------------------! + -subroutine lastmonthdate(time,lastmonth,ndaysi) - use ed_misc_coms, only: simtime - implicit none - type(simtime), intent(in) :: time - type(simtime), intent(out) :: lastmonth - real, intent(out) :: ndaysi - integer, dimension(12) :: ndays - logical, external :: isleap - - ndays=(/31,28,31,30,31,30,31,31,30,31,30,31/) - - lastmonth=time - lastmonth%date = 1 - lastmonth%time = 0. - - lastmonth%month = lastmonth%month -1 - if(lastmonth%month == 0)then - lastmonth%month = 12 - lastmonth%year = lastmonth%year - 1 - endif -!----- Changing the number of days in February for leap years -----------------------------! - if(isleap(lastmonth%year)) ndays(2)=29 - - ndaysi=1.0/real(ndays(lastmonth%month)) - return + + !---------------------------------------------------------------------------------------! + ! Change the number of days in February if the previous month falls in a ! + ! leap year. ! + !---------------------------------------------------------------------------------------! + if (isleap(lastmonth%year)) maxdays(2)=29 + !---------------------------------------------------------------------------------------! + + maxdaysi=1.0/real(maxdays(lastmonth%month)) + return end subroutine lastmonthdate -!------------------------------------------------------------------------------------------! +!==========================================================================================! +!==========================================================================================! -!------------------------------------------------------------------------------------------! -! Function that determines the which day was yesterday. ! + + + +!==========================================================================================! +!==========================================================================================! +! Function that determines the which day was the day before. ! !------------------------------------------------------------------------------------------! subroutine yesterday(inyear,inmonth,inday,outyear,outmonth,outday) - implicit none - integer, intent(in) :: inyear,inmonth,inday - integer, intent(out) :: outyear,outmonth,outday - - integer, dimension(12) :: ndays - logical, external :: isleap - - ndays=(/31,28,31,30,31,30,31,31,30,31,30,31/) - - outday=inday - 1 - - if(outday == 0)then - outmonth = inmonth - 1 - - if(outmonth == 0)then - outyear = inyear - 1 - outmonth = 12 - else - outyear = inyear - end if - - if(isleap(outyear)) ndays(2)=29 - outday =ndays(outmonth) - else - outmonth = inmonth - outyear = inyear - end if - - return + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: inyear + integer , intent(in) :: inmonth + integer , intent(in) :: inday + integer , intent(out) :: outyear + integer , intent(out) :: outmonth + integer , intent(out) :: outday + !----- Local variables. ----------------------------------------------------------------! + integer, dimension(12) :: maxdays + !----- External functions. -------------------------------------------------------------! + logical , external :: isleap + !---------------------------------------------------------------------------------------! + + + !----- Initialise the array assuming it is a regular year. -----------------------------! + maxdays = (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /) + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Shift day by one day. In case it becomes zero, it means that it should be the ! + ! last day of the previous month. ! + !---------------------------------------------------------------------------------------! + outday = inday - 1 + if (outday == 0) then + !------------------------------------------------------------------------------------! + ! Shift month by one month. In case it becomes zero, it means that it should be ! + ! December of the previous year. ! + !------------------------------------------------------------------------------------! + outmonth = inmonth - 1 + if (outmonth == 0) then + outyear = inyear - 1 + outmonth = 12 + else + outyear = inyear + end if + + !----- Fix the number of days in case the previous day falls in a leap year. --------! + if (isleap(outyear)) maxdays(2)=29 + outday = maxdays(outmonth) + !------------------------------------------------------------------------------------! + else + !------------------------------------------------------------------------------------! + ! Middle of the month, copy the month and year for current time. ! + !------------------------------------------------------------------------------------! + outmonth = inmonth + outyear = inyear + !------------------------------------------------------------------------------------! + end if + + return end subroutine yesterday -!------------------------------------------------------------------------------------------! +!==========================================================================================! +!==========================================================================================! -!------------------------------------------------------------------------------------------! -! Function the number of days of a certain month ! + + + +!==========================================================================================! +!==========================================================================================! +! This function founds the number of days of a certain month and year. ! !------------------------------------------------------------------------------------------! integer function num_days(month,year) implicit none - integer, intent(in) :: month, year - logical, external :: isleap - integer, dimension(12) :: maxdays - - !----- Temporary array with # of days --------------------------------------------------! - maxdays=(/31,28,31,30,31,30,31,31,30,31,30,31/) + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: month + integer , intent(in) :: year + !----- Local variables. ----------------------------------------------------------------! + integer, dimension(12) :: maxdays + !----- External functions. -------------------------------------------------------------! + logical , external :: isleap + !---------------------------------------------------------------------------------------! + + + + !----- Initialise the array assuming it is a regular year. -----------------------------! + maxdays = (/ 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31 /) + !---------------------------------------------------------------------------------------! + + + + !----- Correct the number of days in February in case this is a leap year. -------------! if (isleap(year)) maxdays(2) = 29 - + !---------------------------------------------------------------------------------------! + + !------ Find the number of days of this month. -----------------------------------------! num_days = maxdays(month) + !---------------------------------------------------------------------------------------! + return end function num_days -!------------------------------------------------------------------------------------------! +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/utils/numutils.f90 b/ED/src/utils/numutils.f90 index fe15e492e..40e18b0f1 100644 --- a/ED/src/utils/numutils.f90 +++ b/ED/src/utils/numutils.f90 @@ -1842,28 +1842,32 @@ end function check_real !==========================================================================================! ! This subroutine will solve the linear system AA . X = Y for given AA and Y, using ! ! the Gaussian elimination method with partial pivoting and back-substitution. ! +! This subroutine is based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press. ! !------------------------------------------------------------------------------------------! subroutine lisys_solver(nsiz,AA,Y,X,sing) implicit none !----- Arguments. ----------------------------------------------------------------------! - integer , intent(in) :: nsiz ! matrix and vector size - real , dimension(nsiz,nsiz), intent(in) :: AA ! matrix - real , dimension(nsiz) , intent(in) :: Y ! right-hand side vector - real , dimension(nsiz) , intent(out) :: X ! unknown vector - logical , intent(out) :: sing ! The matrix was singular [T|F] + integer , intent(in) :: nsiz ! matrix and vector size + real(kind=4), dimension(nsiz,nsiz), intent(in) :: AA ! matrix + real(kind=4), dimension(nsiz) , intent(in) :: Y ! right-hand side vector + real(kind=4), dimension(nsiz) , intent(out) :: X ! unknown vector + logical , intent(out) :: sing ! The matrix is singular [T|F] !----- Local variables. ----------------------------------------------------------------! - real , dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. - real , dimension(nsiz) :: Z ! Copy of Y, for scaling - real , dimension(nsiz) :: dumvec ! Dummy vector, for row swapping - real :: pivot ! The pivot - real :: multip ! Multiplier - integer :: r ! Row index - integer :: b ! Row below index - integer :: c ! Column index - integer :: p ! Pivot index - real :: dumsca ! Dummy scalar, for row swapping + real(kind=4), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. + real(kind=4), dimension(nsiz) :: Z ! Copy of Y, for scaling + real(kind=4), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) + real(kind=4) :: pivot ! The pivot + real(kind=4) :: multip ! Multiplier + integer :: r ! Row index + integer :: b ! Row below index + integer :: c ! Column index + integer :: p ! Pivot index + real(kind=4) :: dumsca ! Dummy scalar (row swapping) !----- Local parameters. ---------------------------------------------------------------! - real , parameter :: tinyoff=1.e-20 + real(kind=4) , parameter :: tinyoff=1.e-20 !---------------------------------------------------------------------------------------! !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! @@ -1945,6 +1949,120 @@ end subroutine lisys_solver + + +!==========================================================================================! +!==========================================================================================! +! This subroutine is the double precision version of the linear system solver above. ! +! It will solve the linear system AA . X = Y for given AA and Y, using the Gaussian ! +! elimination method with partial pivoting and back-substitution. This subroutine is ! +! based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press. ! +!------------------------------------------------------------------------------------------! +subroutine lisys_solver8(nsiz,AA,Y,X,sing) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: nsiz ! matrix and vector size + real(kind=8), dimension(nsiz,nsiz), intent(in) :: AA ! matrix + real(kind=8), dimension(nsiz) , intent(in) :: Y ! right-hand side vector + real(kind=8), dimension(nsiz) , intent(out) :: X ! unknown vector + logical , intent(out) :: sing ! The matrix was singular [T|F] + !----- Local variables. ----------------------------------------------------------------! + real(kind=8), dimension(nsiz,nsiz) :: EE ! Copy of AA, for elimination. + real(kind=8), dimension(nsiz) :: Z ! Copy of Y, for scaling + real(kind=8), dimension(nsiz) :: dumvec ! Dummy vector (row swapping) + real(kind=8) :: pivot ! The pivot + real(kind=8) :: multip ! Multiplier + integer :: r ! Row index + integer :: b ! Row below index + integer :: c ! Column index + integer :: p ! Pivot index + real(kind=8) :: dumsca ! Dummy scalar (row swapping) + !----- Local parameters. ---------------------------------------------------------------! + real(kind=8) , parameter :: tinyoff=1.d-20 + !---------------------------------------------------------------------------------------! + + !----- First thing, we copy AA to EE and Y to Z. ---------------------------------------! + EE(:,:) = AA(:,:) + Z (:) = Y (:) + dumvec = 0.d0 + dumsca = 0.d0 + !---------------------------------------------------------------------------------------! + ! We initialise X with a huge, non-sense value, which will become the answer when ! + ! the matrix is singular. ! + !---------------------------------------------------------------------------------------! + X (:) = -huge(1.d0) + !----- We first assume that everything will be fine. -----------------------------------! + sing = .false. + + !---------------------------------------------------------------------------------------! + ! 1. Main elimination loop, done row by row. ! + !---------------------------------------------------------------------------------------! + elimloop: do r = 1, nsiz-1 + !------ 1a. Finding the largest element, which will become our pivot ----------------! + p = (r-1) + maxloc(abs(EE(r:nsiz,r)),dim=1) + + pivot = maxval(abs(EE(r:nsiz,r))) + !------------------------------------------------------------------------------------! + ! 1b. Check the pivot and make sure it is a good one. If not, then this matrix is ! + ! singular or almost singular, and we cannot solve it, so we switch the flag and ! + ! return. ! + !------------------------------------------------------------------------------------! + if (pivot < tinyoff) then + sing = .true. + return + end if + + !----- 1c. If the best pivot is not the current row, we must swap them. -------------! + if (p /= r) then + dumvec(r:nsiz) = EE(r,r:nsiz) + dumsca = Z(r) + EE(r,r:nsiz) = EE(p,r:nsiz) + Z(r) = Z(p) + EE(p,r:nsiz) = dumvec(r:nsiz) + Z(p) = dumsca + end if + + !------------------------------------------------------------------------------------! + ! 1d. Eliminate rows below, everything to the left of the (,r) column will become ! + ! zero (we won't compute that, but they will be.). ! + !------------------------------------------------------------------------------------! + belowloop: do b=r+1,nsiz + multip = EE(b,r)/EE(r,r) + EE(b,r:nsiz) = EE(b,r:nsiz) - multip * EE(r,r:nsiz) + Z(b) = Z(b) - multip * Z(r) + end do belowloop + end do elimloop + + !---------------------------------------------------------------------------------------! + ! 2. We may be unlucky and discover that the matrix is singular at the last line, so we ! + ! check the last pivot too. ! + !---------------------------------------------------------------------------------------! + if (abs(EE(nsiz,nsiz)) < tinyoff) then + sing = .true. + return + end if + + !---------------------------------------------------------------------------------------! + ! 3. We now perform the back-substitution, to find the solution. ! + !---------------------------------------------------------------------------------------! + X(nsiz) = Z(nsiz) / EE(nsiz,nsiz) + backsubloop: do r=nsiz-1,1,-1 + b = r+1 + X(r) = (Z(r) - sum(EE(r,b:nsiz)*x(b:nsiz))) / EE(r,r) + end do backsubloop + + return +end subroutine lisys_solver8 +!==========================================================================================! +!==========================================================================================! + + + + + !==========================================================================================! !==========================================================================================! ! This function checks whether a number is finite or not. This test will return true ! @@ -2011,3 +2129,117 @@ subroutine diagon(nsiz,mat,vec) end subroutine diagon !==========================================================================================! !==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! EIFUN8 -- This function computes the exponential integral function, defined by ! +! ! +! x_ ! +! | exp(t) ! +! Ei(x) = | -------- dt ! +! _| t ! +! 0 ! +! ! +! This function is based on: ! +! ! +! Press, W. H., S. A. Teukolsky, W. T. Vetterling, B. P. Flannery: 1992. Numerical recipes ! +! in Fortran 77. Cambridge University Press, section 6.3 p. 215-219. ! +! ! +! with the difference that we also solve for negative numbers. Zero cannot be solved, so ! +! if this happens, or if the sought number would lead to infinity, we stop the model. ! +!------------------------------------------------------------------------------------------! +real(kind=8) function eifun8(x) + use consts_coms, only : euler_gam8 & ! intent(in) + , lnexp_min8 & ! intent(in) + , lnexp_max8 & ! intent(in) + , tiny_num8 ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + real(kind=8), intent(in) :: x + !----- Local variables. ----------------------------------------------------------------! + real(kind=8) :: sum + real(kind=8) :: term + real(kind=8) :: fact + real(kind=8) :: prev + real(kind=8) :: diter + integer :: iter + !----- Local constants. ----------------------------------------------------------------! + real(kind=8), parameter :: powerlim = 1.5d+01 + real(kind=8), parameter :: converge = 1.0d-7 + integer , parameter :: maxiter = 100 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Check what to do depending on the value of x. ! + !---------------------------------------------------------------------------------------! + if (x == 0.d0) then + !------------------------------------------------------------------------------------! + ! Zero. This is a singularity and the user should never call it in this case. ! + ! That's sad, but we ought to quit this run and tell the user why the run crashed. ! + !------------------------------------------------------------------------------------! + call fatal_error('Exponential integral cannot be solved for x = 0.' & + ,'eifun8','numutils.f90') + elseif (x >= lnexp_max8) then + !----- Huge value, crash because this is iminent over-flow. -------------------------! + write(unit=*,fmt='(a,1x,es12.5)') 'Attempted X = ',x + write(unit=*,fmt='(a,1x,es12.5)') 'Maximum acceptable X =',lnexp_max8 + call fatal_error('Exponential integral cannot be solved for x = 0.' & + ,'eifun8','numutils.f90') + elseif (abs(x) <= lnexp_min8) then + !----- Huge negative number, the result can be rounded to zero. ---------------------! + eifun8 = 0.d0 + elseif (abs(x) <= tiny_num8) then + !----- The number is too close to zero, bypass iterative methods. -------------------! + eifun8 = euler_gam8 + log(abs(x)) + elseif (abs(x) <= powerlim) then + !------------------------------------------------------------------------------------! + ! Input x is small, so we use the power method. ! + !------------------------------------------------------------------------------------! + fact = 1.d0 + sum = 0.d0 + powerloop: do iter=1,maxiter + diter = dble(iter) + fact = fact * x / diter + term = fact / diter + sum = sum + term + !----- If the term is tiny, we have reached convergence, quit the loop. ----------! + if (abs(term) < converge * abs(sum)) exit powerloop + end do powerloop + eifun8 = euler_gam8 + log(abs(x)) + sum + else + !------------------------------------------------------------------------------------! + ! Input x is large, so we use the asymptotic approximation. ! + !------------------------------------------------------------------------------------! + sum = 0.d0 + term = 1.d0 + asymploop: do iter=1,maxiter + diter = dble(iter) + prev = term + term = term * diter / x + if (abs(term) < converge) then + !----- The term is tiny, we have reached convergence, quit the loop. ----------! + exit asymploop + elseif (abs(term) >= abs(prev)) then + !------------------------------------------------------------------------------! + ! Series is diverging, we are probably reaching round-off errors, we better ! + ! stop now. ! + !------------------------------------------------------------------------------! + sum = sum - prev + exit asymploop + else + sum = sum + term + end if + end do asymploop + eifun8 = exp(x) * (1.d0 + sum) / x + end if + + return +end function eifun8 +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/utils/radiate_utils.f90 b/ED/src/utils/radiate_utils.f90 index c879663da..9218e7073 100644 --- a/ED/src/utils/radiate_utils.f90 +++ b/ED/src/utils/radiate_utils.f90 @@ -307,7 +307,7 @@ subroutine short_bdown_weissnorman(rshort_full,atm_prss,cosz,par_beam,par_diff,n !------------------------------------------------------------------------------------! ! Find the actual total for PAR and NIR, using equations 7 and 8. ! !------------------------------------------------------------------------------------! - ratio = min(1.2, rshort_full / (par_full_pot + nir_full_pot)) + ratio = rshort_full / (par_full_pot + nir_full_pot) par_full = ratio * par_full_pot nir_full = ratio * nir_full_pot !------------------------------------------------------------------------------------! @@ -348,3 +348,302 @@ subroutine short_bdown_weissnorman(rshort_full,atm_prss,cosz,par_beam,par_diff,n end subroutine short_bdown_weissnorman !==========================================================================================! !==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This subroutine updates the 10-day running average of radiation, which is used for ! +! phenology. ! +!------------------------------------------------------------------------------------------! +subroutine update_rad_avg(cgrid) + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype ! ! structure + use ed_misc_coms , only : radfrq ! ! intent(in) + use consts_coms , only : day_sec ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + type(edtype) , target :: cgrid + !----- Local variables. ----------------------------------------------------------------! + type(polygontype), pointer :: cpoly + type(sitetype) , pointer :: csite + integer :: ipy + integer :: isi + real :: tfact + !----- Local constants. ----------------------------------------------------------------! + real , parameter :: tendays_sec = 10.*day_sec + !---------------------------------------------------------------------------------------! + + tfact = radfrq/tendays_sec + + + + polyloop: do ipy = 1,cgrid%npolygons + cpoly => cgrid%polygon(ipy) + siteloop: do isi = 1,cpoly%nsites + cpoly%rad_avg(isi) = cpoly%rad_avg(isi) * (1.0 - tfact) & + + cpoly%met(isi)%rshort * tfact + end do siteloop + end do polyloop + + return +end subroutine update_rad_avg +!==========================================================================================! +!==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This sub-routine prints the radiation information if the user wants detailed output ! +!------------------------------------------------------------------------------------------! +subroutine dump_radinfo(cgrid,ipy,mprev,mnext,prevmet_timea,nextmet_timea,met_frq & + ,wprev,wnext,secz_prev,secz_next,fperp_prev,fperp_next,night_prev & + ,night_next,variable) + use ed_state_vars , only : edtype ! ! structure + use ed_max_dims , only : str_len ! ! intent(in) + use ed_misc_coms , only : simtime & ! intent(in) + , current_time ! ! intent(in) + use met_driver_coms , only : nbdsf_file & ! intent(in) + , nddsf_file & ! intent(in) + , vbdsf_file & ! intent(in) + , vddsf_file ! ! intent(in) + use canopy_radiation_coms, only : cosz_min ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + type(edtype) , target :: cgrid + integer , intent(in) :: ipy + type(simtime) , intent(in) :: prevmet_timea + type(simtime) , intent(in) :: nextmet_timea + integer , intent(in) :: mprev + integer , intent(in) :: mnext + real , intent(in) :: met_frq + real , intent(in) :: wprev + real , intent(in) :: wnext + real , intent(in) :: secz_prev + real , intent(in) :: secz_next + real , intent(in) :: fperp_prev + real , intent(in) :: fperp_next + logical , intent(in) :: night_prev + logical , intent(in) :: night_next + character(len=5) , intent(in) :: variable + !----- Local variables. ----------------------------------------------------------------! + character(len=str_len) :: thisfile + character(len=22) :: when_prev + character(len=22) :: when_next + character(len=22) :: when_now + real :: flux_prev + real :: flux_next + real :: flux_now + real :: fperp_now + logical :: night_now + logical :: itsthere + !----- Local constants. ----------------------------------------------------------------! + character(len=18) , parameter :: fmth = '(3(a,3x),15(a,1x))' + character(len=35) , parameter :: fmtd = '(3(a,3x),3(11x,l1,1x),12(f12.3,1x))' + character(len=29) , parameter :: fmtt = '(2(i2.2,a),i4.4,1x,3(i2.2,a))' + !----- Locally saved variables, to delete and re-create scratch files. -----------------! + logical , save :: first_nbdsf = .true. + logical , save :: first_nddsf = .true. + logical , save :: first_vbdsf = .true. + logical , save :: first_vddsf = .true. + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! This copies the information to some common variables. ! + !---------------------------------------------------------------------------------------! + select case (variable) + case ('nbdsf') + + flux_prev = cgrid%metinput(ipy)%nbdsf(mprev) + flux_next = cgrid%metinput(ipy)%nbdsf(mnext) + flux_now = cgrid%met(ipy)%nir_beam + thisfile = nbdsf_file + + if (first_nbdsf) then + + !---------------------------------------------------------------------------------! + ! Check whether there was a file in there. In case there was, delete and ! + ! create a new header. ! + !---------------------------------------------------------------------------------! + inquire (file=trim(thisfile),exist=itsthere) + if (itsthere) then + open (unit=87,file=trim(thisfile),status='old',action='write') + close(unit=87,status='delete') + end if + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Make the header. ! + !---------------------------------------------------------------------------------! + open (unit=87,file=trim(thisfile),status='new',action='write') + write (unit=87,fmt=fmth) ' WHEN_PREV',' WHEN_NOW' & + ,' WHEN_NEXT',' NIGHT_PREV',' NIGHT_NOW' & + ,' NIGHT_NEXT',' MET_FRQ',' WPREV' & + ,' WNEXT',' FLUX_PREV',' SECZ_PREV' & + ,' FPERP_PREV',' FLUX_NEXT',' SECZ_NEXT' & + ,' FPERP_NEXT',' FLUX_NOW',' COSZ_NOW' & + ,' FPERP_NOW' + close (unit=87,status='keep') + !---------------------------------------------------------------------------------! + + first_nbdsf = .false. + end if + + case ('nddsf') + + flux_prev = cgrid%metinput(ipy)%nddsf(mprev) + flux_next = cgrid%metinput(ipy)%nddsf(mnext) + flux_now = cgrid%met(ipy)%nir_diffuse + thisfile = nddsf_file + + if (first_nddsf) then + + !---------------------------------------------------------------------------------! + ! Check whether there was a file in there. In case there was, delete and ! + ! create a new header. ! + !---------------------------------------------------------------------------------! + inquire (file=trim(thisfile),exist=itsthere) + if (itsthere) then + open (unit=87,file=trim(thisfile),status='old',action='write') + close(unit=87,status='delete') + end if + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Make the header. ! + !---------------------------------------------------------------------------------! + open (unit=87,file=trim(thisfile),status='new',action='write') + write (unit=87,fmt=fmth) ' WHEN_PREV',' WHEN_NOW' & + ,' WHEN_NEXT',' NIGHT_PREV',' NIGHT_NOW' & + ,' NIGHT_NEXT',' MET_FRQ',' WPREV' & + ,' WNEXT',' FLUX_PREV',' SECZ_PREV' & + ,' FPERP_PREV',' FLUX_NEXT',' SECZ_NEXT' & + ,' FPERP_NEXT',' FLUX_NOW',' COSZ_NOW' & + ,' FPERP_NOW' + close (unit=87,status='keep') + !---------------------------------------------------------------------------------! + + first_nddsf = .false. + end if + case ('vbdsf') + + flux_prev = cgrid%metinput(ipy)%vbdsf(mprev) + flux_next = cgrid%metinput(ipy)%vbdsf(mnext) + flux_now = cgrid%met(ipy)%par_beam + thisfile = vbdsf_file + + if (first_vbdsf) then + + !---------------------------------------------------------------------------------! + ! Check whether there was a file in there. In case there was, delete and ! + ! create a new header. ! + !---------------------------------------------------------------------------------! + inquire (file=trim(thisfile),exist=itsthere) + if (itsthere) then + open (unit=87,file=trim(thisfile),status='old',action='write') + close(unit=87,status='delete') + end if + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Make the header. ! + !---------------------------------------------------------------------------------! + open (unit=87,file=trim(thisfile),status='new',action='write') + write (unit=87,fmt=fmth) ' WHEN_PREV',' WHEN_NOW' & + ,' WHEN_NEXT',' NIGHT_PREV',' NIGHT_NOW' & + ,' NIGHT_NEXT',' MET_FRQ',' WPREV' & + ,' WNEXT',' FLUX_PREV',' SECZ_PREV' & + ,' FPERP_PREV',' FLUX_NEXT',' SECZ_NEXT' & + ,' FPERP_NEXT',' FLUX_NOW',' COSZ_NOW' & + ,' FPERP_NOW' + close (unit=87,status='keep') + !---------------------------------------------------------------------------------! + + first_vbdsf = .false. + end if + + case ('vddsf') + + flux_prev = cgrid%metinput(ipy)%vddsf(mprev) + flux_next = cgrid%metinput(ipy)%vddsf(mnext) + flux_now = cgrid%met(ipy)%par_diffuse + thisfile = vddsf_file + + if (first_vddsf) then + + !---------------------------------------------------------------------------------! + ! Check whether there was a file in there. In case there was, delete and ! + ! create a new header. ! + !---------------------------------------------------------------------------------! + inquire (file=trim(thisfile),exist=itsthere) + if (itsthere) then + open (unit=87,file=trim(thisfile),status='old',action='write') + close(unit=87,status='delete') + end if + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Make the header. ! + !---------------------------------------------------------------------------------! + open (unit=87,file=trim(thisfile),status='new',action='write') + write (unit=87,fmt=fmth) ' WHEN_PREV',' WHEN_NOW' & + ,' WHEN_NEXT',' NIGHT_PREV',' NIGHT_NOW' & + ,' NIGHT_NEXT',' MET_FRQ',' WPREV' & + ,' WNEXT',' FLUX_PREV',' SECZ_PREV' & + ,' FPERP_PREV',' FLUX_NEXT',' SECZ_NEXT' & + ,' FPERP_NEXT',' FLUX_NOW',' COSZ_NOW' & + ,' FPERP_NOW' + close (unit=87,status='keep') + !---------------------------------------------------------------------------------! + + first_vddsf = .false. + end if + end select + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! Find some common variables. ! + !---------------------------------------------------------------------------------------! + write (when_prev,fmt=fmtt) prevmet_timea%month,'/',prevmet_timea%date,'/' & + ,prevmet_timea%year,prevmet_timea%hour,'.',prevmet_timea%min & + ,'.',prevmet_timea%sec,'UTC' + write (when_now ,fmt=fmtt) current_time%month,'/',current_time%date,'/' & + ,current_time%year,current_time%hour,'.',current_time%min,'.' & + ,current_time%sec,'UTC' + write (when_next,fmt=fmtt) nextmet_timea%month,'/',nextmet_timea%date,'/' & + ,nextmet_timea%year,nextmet_timea%hour,'.',nextmet_timea%min & + ,'.',nextmet_timea%sec,'UTC' + fperp_now = fperp_prev * wprev + fperp_next * wnext + night_now = cgrid%cosz(ipy) <= cosz_min + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Write the information on the file. ! + !---------------------------------------------------------------------------------------! + open(unit=87,file=trim(thisfile),status='old',action='write',position='append') + write(unit=87,fmt=fmtd) when_prev,when_now,when_next,night_prev,night_now,night_next & + ,met_frq,wprev,wnext,flux_prev,secz_prev,fperp_prev,flux_next & + ,secz_next,fperp_next,flux_now,cgrid%cosz(ipy),fperp_now + close(unit=87,status='keep') + !---------------------------------------------------------------------------------------! + return +end subroutine dump_radinfo +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/utils/stable_cohorts.f90 b/ED/src/utils/stable_cohorts.f90 index a8b101f22..8cf94baf2 100644 --- a/ED/src/utils/stable_cohorts.f90 +++ b/ED/src/utils/stable_cohorts.f90 @@ -107,8 +107,8 @@ subroutine is_resolvable(csite,ipa,ico,green_leaf_factor) ! set to zero when branch thermodynamics is turned off, so this will always be ! ! false in this case. ! !---------------------------------------------------------------------------------------! - leaf_enough = cpatch%lai(ico) > lai_min(ipft) - wood_enough = cpatch%wai(ico) > lai_min(ipft) + leaf_enough = cpatch%lai(ico) > lai_min(ipft) .and. cpatch%leaf_hcap(ico) > 0.0 + wood_enough = cpatch%wai(ico) > lai_min(ipft) .and. cpatch%wood_hcap(ico) > 0.0 !---------------------------------------------------------------------------------------! diff --git a/ED/src/utils/update_derived_props.f90 b/ED/src/utils/update_derived_props.f90 index e54c19be5..5c380023d 100644 --- a/ED/src/utils/update_derived_props.f90 +++ b/ED/src/utils/update_derived_props.f90 @@ -583,52 +583,6 @@ end subroutine read_soil_moist_temp -!==========================================================================================! -!==========================================================================================! -! This subroutine updates the 10-day running average of radiation, which is used for ! -! phenology. ! -!------------------------------------------------------------------------------------------! -subroutine update_rad_avg(cgrid) - use ed_state_vars , only : edtype & ! structure - , polygontype & ! structure - , sitetype ! ! structure - use ed_misc_coms , only : radfrq ! ! intent(in) - use consts_coms , only : day_sec ! ! intent(in) - implicit none - !----- Arguments. ----------------------------------------------------------------------! - type(edtype) , target :: cgrid - !----- Local variables. ----------------------------------------------------------------! - type(polygontype), pointer :: cpoly - type(sitetype) , pointer :: csite - integer :: ipy - integer :: isi - real :: tfact - !----- Local constants. ----------------------------------------------------------------! - real , parameter :: tendays_sec = 10.*day_sec - !---------------------------------------------------------------------------------------! - - tfact = radfrq/tendays_sec - - - - polyloop: do ipy = 1,cgrid%npolygons - cpoly => cgrid%polygon(ipy) - siteloop: do isi = 1,cpoly%nsites - cpoly%rad_avg(isi) = cpoly%rad_avg(isi) * (1.0 - tfact) & - + cpoly%met(isi)%rshort * tfact - end do siteloop - end do polyloop - - return -end subroutine update_rad_avg -!==========================================================================================! -!==========================================================================================! - - - - - - !==========================================================================================! !==========================================================================================! ! This subroutine will convert the integrated number of time steps in steps/day, then ! diff --git a/Ramspost/build/bin/2ndcomp.sh b/Ramspost/build/bin/2ndcomp.sh index bf1b23423..d010dbc1d 100755 --- a/Ramspost/build/bin/2ndcomp.sh +++ b/Ramspost/build/bin/2ndcomp.sh @@ -24,6 +24,7 @@ rm -fv rnamel.o rnamel.mod rm -fv rnumr.o rnumr.mod rm -fv rpost_coms.o rpost_coms.mod rm -fv rpost_dims.o rpost_dims.mod +rm -fv rpost_filelist.o rpost_filelist.mod rm -fv rpost_misc.o rpost_misc.mod rm -fv rsys.o rsys.mod rm -fv rutil.o rutil.mod diff --git a/Ramspost/build/bin/dependency.mk b/Ramspost/build/bin/dependency.mk index f434a8774..347971ac9 100644 --- a/Ramspost/build/bin/dependency.mk +++ b/Ramspost/build/bin/dependency.mk @@ -1,7 +1,8 @@ # DO NOT DELETE THIS LINE - used by make depend -rcio.o: leaf_coms.mod micro_coms.mod rconstants.mod rpost_coms.mod somevars.mod -rcio.o: therm_lib.mod -rpost_main.o: brams_data.mod misc_coms.mod rpost_coms.mod rpost_dims.mod +rcio.o: leaf_coms.mod micro_coms.mod rconstants.mod rpost_coms.mod +rcio.o: rpost_dims.mod somevars.mod therm_lib.mod +rpost_main.o: brams_data.mod leaf_coms.mod misc_coms.mod rpost_coms.mod +rpost_main.o: rpost_dims.mod rpost_misc.o: misc_coms.mod rpost_dims.mod variables.o: an_header.mod brams_data.mod leaf_coms.mod micro_coms.mod variables.o: misc_coms.mod rconstants.mod rpost_coms.mod rpost_dims.mod @@ -21,15 +22,17 @@ rnamel.o: misc_coms.mod therm_lib.o: rconstants.mod tmpname.o: /n/Moorcroft_Lab/Users/mlongo/EDBRAMS/Ramspost/src/include/utils_sub_names.h tmpname.o: -vformat_brams3.3.o: misc_coms.mod +vformat_brams3.3.o: misc_coms.mod rpost_dims.mod brams_data.o: rpost_dims.mod micro_coms.o: rpost_dims.mod misc_coms.o: rpost_dims.mod rpost_coms.o: rpost_dims.mod soil_coms.o: rpost_dims.mod +charutils.o: rpost_dims.mod dateutils.o: rconstants.mod numutils.o: rconstants.mod therm_lib.mod polarst.o: rconstants.mod +rpost_filelist.o: rpost_dims.mod utils_c.o: /n/Moorcroft_Lab/Users/mlongo/EDBRAMS/Ramspost/src/include/utils_sub_names.h utils_c.o: an_header.mod: an_header.o diff --git a/Ramspost/build/bin/objects.mk b/Ramspost/build/bin/objects.mk index 2634f3060..09fd89c06 100644 --- a/Ramspost/build/bin/objects.mk +++ b/Ramspost/build/bin/objects.mk @@ -34,6 +34,7 @@ OBJECTS = \ rnumr.o \ rpost_coms.o \ rpost_dims.o \ + rpost_filelist.o \ rpost_misc.o \ rsys.o \ rutil.o \ diff --git a/Ramspost/build/bin/rules.mk b/Ramspost/build/bin/rules.mk index 5d7649ed3..ef99f239f 100644 --- a/Ramspost/build/bin/rules.mk +++ b/Ramspost/build/bin/rules.mk @@ -123,6 +123,11 @@ rpost_dims.o: $(RPOST_MEMORY)/rpost_dims.f90 $(F90_COMMAND) $(level,vapour_on,cloud_on,bulk_on use micro_coms use rpost_coms - use leaf_coms , only : ustmin, gamm, gamh, tprandtl, vkopr, ribmax, min_patch_area - use rconstants, only : vonk + use leaf_coms , only : ubmin & ! intent(inout) + , ugbmin & ! intent(inout) + , ustmin & ! intent(inout) + , gamm & ! intent(inout) + , gamh & ! intent(inout) + , tprandtl & ! intent(inout) + , ribmax & ! intent(inout) + , min_patch_area & ! intent(inout) + , sfclyr_init_params ! ! subroutine + use rconstants, only : vonk ! ! intent(inout) CHARACTER*(*) IO,CFILE ! This routine reads or writes the history and analysis file common blocks. @@ -147,13 +155,14 @@ SUBROUTINE COMMIO (CFILE,IO,IUN) ie=cio_i_sca(iun,irw,'isfcl',isfcl,1) ie=cio_i_sca(iun,irw,'istar',istar,1) + ie=cio_f_sca(iun,irw,'ubmin',ubmin,1) + ie=cio_f_sca(iun,irw,'ugbmin',ugbmin,1) ie=cio_f_sca(iun,irw,'ustmin',ustmin,1) ie=cio_f_sca(iun,irw,'min_patch_area',min_patch_area,1) ie=cio_f_sca(iun,irw,'gamm',gamm,1) ie=cio_f_sca(iun,irw,'gamh',gamh,1) ie=cio_f_sca(iun,irw,'tprandtl',tprandtl,1) ie=cio_f_sca(iun,irw,'ribmax',ribmax,1) - vkopr = vonk / tprandtl ie=cio_i_sca(iun,irw,'ico2',ico2,1) ie=cio_f (iun,irw,'co2con',co2con,max_nnzp) @@ -274,6 +283,10 @@ SUBROUTINE COMMIO (CFILE,IO,IUN) end do end do + + !---- Initialise surface layer parameters for the CLM-like similarity theory model. + call sfclyr_init_params(istar) + return end SUBROUTINE COMMIO @@ -281,8 +294,10 @@ end SUBROUTINE COMMIO !--------------------------------------------------------- subroutine cio_pos_file(iun,cstr,ierr) - character*(*) cstr - character*128 line,csearch + use rpost_dims, only : str_len + character(len=*) :: cstr + character(len=str_len) :: line + character(len=str_len) :: csearch ! print*,'cio_pos:',iun,cstr iend=0 @@ -317,9 +332,10 @@ end subroutine cio_pos_file !--------------------------------------------------------- integer function cio_i(iun,irw,cstr,ia,n) + use rpost_dims, only : str_len integer ia(*) character*(*) cstr - character*256 string + character(len=str_len) :: string if (irw.eq.1) then call cio_pos_file (iun,cstr,cio_i) @@ -349,9 +365,10 @@ end function cio_i !--------------------------------------------------------- integer function cio_f(iun,irw,cstr,ia,n) + use rpost_dims, only : str_len real ia(*) character*(*) cstr - character*256 string + character(len=str_len) :: string if (irw.eq.1) then call cio_pos_file (iun,cstr,cio_f) @@ -373,9 +390,10 @@ end function cio_f !--------------------------------------------------------- integer function cio_f8(iun,irw,cstr,ia,n) + use rpost_dims, only : str_len real*8 ia(*) character*(*) cstr - character*256 string + character(len=str_len) :: string if (irw.eq.1) then call cio_pos_file (iun,cstr,cio_f8) @@ -397,9 +415,10 @@ end function cio_f8 !--------------------------------------------------------- integer function cio_c(iun,irw,cstr,ia,n) + use rpost_dims, only : str_len character*(*) ia(*) character*(*) cstr - character*256 string + character(len=str_len) :: string if (irw.eq.1) then call cio_pos_file (iun,cstr,cio_c) @@ -422,11 +441,12 @@ end function cio_c !--------------------------------------------------------- !MLO - The next functions aren't really necessary, it's just to avoid ifort with -get-interfaces to screw up... integer function cio_i_sca(iun,irw,cstr,ia,n) +use rpost_dims, only : str_len implicit none integer :: iun,irw,n integer ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -460,11 +480,12 @@ end function cio_i_sca !--------------------------------------------------------- integer function cio_f_sca(iun,irw,cstr,ia,n) +use rpost_dims, only : str_len implicit none integer :: iun,irw,n real ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -498,11 +519,12 @@ end function cio_f_sca !--------------------------------------------------------- integer function cio_f8_sca(iun,irw,cstr,ia,n) +use rpost_dims, only : str_len implicit none integer :: iun,irw,n real(kind=8) :: ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then @@ -536,11 +558,12 @@ end function cio_f8_sca !--------------------------------------------------------- integer function cio_c_sca(iun,irw,cstr,ia,n) +use rpost_dims, only : str_len implicit none integer :: iun,irw,n character(len=*) :: ia character(len=*) :: cstr -character(len=256) :: string +character(len=str_len) :: string integer :: nn,i if (n /= 1) then diff --git a/Ramspost/src/driver/rpost_main.f90 b/Ramspost/src/driver/rpost_main.f90 index 6e86719ce..5e5f503a9 100644 --- a/Ramspost/src/driver/rpost_main.f90 +++ b/Ramspost/src/driver/rpost_main.f90 @@ -14,19 +14,26 @@ program ramspost ! ----------------------- use rpost_coms - use rpost_dims, only : fnm_len & ! intent(in) - , str_len ! ! intent(in) + use rpost_dims, only : str_len ! ! intent(in) use brams_data - character(len=fnm_len), dimension(maxfiles) :: fln + use leaf_coms , only : sfclyr_init_params ! ! sub-routine + character(len=str_len), dimension(maxfiles) :: fln character(len=str_len) :: inp - character(len=fnm_len) :: fprefix - character(len=fnm_len) :: gprefix - character(len=fnm_len) :: cfln - character*40 vpln(200),cdum1 - character*10 vp(200),vpun(200),cdum2,proj,anl2gra - character*1 cgrid - character*2 ccgrid,patchnumber,cldnumber - character*3 cmo(12) + character(len=str_len) :: fprefix + character(len=str_len) :: gprefix + character(len=str_len) :: cfln + character(len=40), dimension(200) :: vpln + character(len=40) :: cdum1 + character(len=20), dimension(200) :: vp + character(len=20), dimension(200) :: vpun + character(len=20) :: cdum2 + character(len=20) :: proj + character(len=20) :: anl2gra + character(len=1) :: cgrid + character(len=2) :: ccgrid + character(len=2) :: patchnumber + character(len=2) :: cldnumber + character(len=3), dimension(12) :: cmo character*15 chdate,chstep,xchstep integer nvp,nfiles,nzvp(200),nrec,ipresslev,iplevs(nplmax) integer inplevs,zlevmax(maxgrds),ndim(200),iproj,ianl2gra,icld @@ -59,7 +66,7 @@ program ramspost dimension dep_zlev(nzpmax,maxgrds),iep_nx(maxgrds), & iep_ny(maxgrds),iep_nz(maxgrds),dep_glat(2,maxgrds), dep_glon(2,maxgrds) - character*600 wfln(maxfiles) + character(len=str_len), dimension(maxfiles) :: wfln ! ----------------------------- ! - INITIALIZING ROUTINES - @@ -687,65 +694,6 @@ subroutine ep_setdate(iyear1,imonth1,idate1,strtim,itrec) return end subroutine ep_setdate -!*************************************************************** -! New version that just uses ls and the /tmp directory - -subroutine RAMS_filelist(fnames,file_prefix,nfile) - character fnames(*)*(*),file_prefix*(*) - character file*600,command*600 - - ! This version uses nfile as flag for whether to stop if no files exist. - ! If nfile.ge.0, then stop - - iflag=nfile - - nfile = 0 - print *, ' ' - print *, 'RAMS file analysis: Checking directory - ',file_prefix - - iprelen=index(file_prefix,' ') - if(iprelen.eq.0) iprelen=len(file_prefix) - - command= & - '/bin/ls -1 '//file_prefix(1:iprelen)//' >./.RAMS_filelist' - call system(command) - command= 'chmod 777 ./.RAMS_filelist' - call system(command) - - ! Open the directory list and read through the files - iun=98 - open(unit=iun,file='./.RAMS_filelist',status='old',err=15) - rewind iun - - do nf=1,1000000 - read(iun,'(a128)',end=30,err=30) file - fnames(nf) = file - enddo - -30 continue - - close(iun) - command= '/bin/rm -f ./.RAMS_filelist' - call system(command) - - nfile=nf-1 - - if (nfile .eq. 0) then - print *, 'No RAMS files for prefix:',file_prefix - if(iflag.ge.0) stop './.RAMS_filelist-no_files' - endif - - return - -15 print *, 'RAMS_filelist: Error opening ./.RAMS_filelist' - stop './.RAMS_filelist-/tmp file error : run again' - return - -100 continue - - return -end subroutine RAMS_filelist - !***************************************************************************** ! -------------------------------------------------------- diff --git a/Ramspost/src/driver/rpost_misc.f90 b/Ramspost/src/driver/rpost_misc.f90 index 4e12b8420..b0ea335fb 100644 --- a/Ramspost/src/driver/rpost_misc.f90 +++ b/Ramspost/src/driver/rpost_misc.f90 @@ -48,95 +48,103 @@ subroutine Ctransvar(n1,n2,n3,a,topo,nzlev,izlev,zt,ztop) return end -!------------------------------------------------------------------- - Subroutine define_lim(ng,nxg,nyg,rlat1,dlat,rlon1,dlon, & - lati,latf,loni,lonf,nxa,nxb,nya,nyb,proj,& - nx,ny,rlat,rlon) - use rpost_dims - use misc_coms, only : glong, glatg - Dimension rlat(nx,ny),rlon(nx,ny) - real lati,latf,loni,lonf - character*(*) proj -! dimension nnxa(nYpmax),nnxb(nYpmax), & -! nnya(nXpmax),nnyb(nXpmax) - - - do i=1,nxg - if(loni.le.glong(i)) go to 100 -! print*,' i lon=',i,glong(i),loni - enddo - 100 continue - nxa=max(i,1) - do j=1,nyg - if(lati.le.glatg(j)) go to 101 -! print*,' j lat=',j,glatg(j),lati - enddo - 101 continue - nya=max(j,1) - - nlon=abs(int(((lonf-loni))/dlon))+1 - nlat=abs(int(((latf-lati))/dlat))+1 - nxb=min(nxa+nlon,nxg) - nyb=min(nya+nlat,nyg) - rlon1=glong(nxa) - rlat1=glatg(nya) -!----------19-07-2001 - - if(proj.ne.'YES'.AND.proj.ne.'yes') then - x=0 - xx=0 - do j=nya,nyb - x=x+rlon(nxa,j) - xx=xx+ (rlon(nxb,j)-rlon(nxa,j))/(nxb-nxa) - enddo - rlon1= x/(nyb-nya+1) - dlon =xx/(nyb-nya+1) +!==========================================================================================! +!==========================================================================================! +subroutine define_lim(ng,nxg,nyg,rlat1,dlat,rlon1,dlon,lati,latf,loni,lonf,nxa,nxb,nya,nyb & + ,proj,nx,ny,rlat,rlon) + + use rpost_dims + use misc_coms, only : glong, glatg + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: nx + integer , intent(in) :: ny + integer , intent(in) :: nxg + integer , intent(in) :: nyg + integer , intent(in) :: ng + real, dimension(nx,ny), intent(in) :: rlat + real, dimension(nx,ny), intent(in) :: rlon + real , intent(in) :: lati + real , intent(in) :: latf + real , intent(in) :: loni + real , intent(in) :: lonf + character(len=*) , intent(in) :: proj + integer , intent(out) :: nxa + integer , intent(out) :: nxb + integer , intent(out) :: nya + integer , intent(out) :: nyb + real , intent(out) :: rlat1 + real , intent(inout) :: dlat + real , intent(out) :: rlon1 + real , intent(inout) :: dlon + !----- Local variables. ----------------------------------------------------------------! + integer :: i + integer :: j + integer :: n + integer :: nlon + integer :: nlat + real :: x + real :: xx + !---------------------------------------------------------------------------------------! - x=0 - xx=0 - do n=nxa,nxb - x=x+rlat(n,nya) - xx=xx+ (rlat(n,nyb)-rlat(n,nya))/(nyb-nya) - enddo - rlat1= x/(nxb-nxa+1) - dlat =xx/(nxb-nxa+1) - - endif - - -!------------18-07-2001 -! if(proj.ne.'YES'.AND.proj.ne.'yes') then -! call define_grid2(loni,lonf,lati,latf,nxg,nyg,& -! rlat,rlon,nxa,nxb,nya,nyb) -! print*,nxa,nxb,nya,nyb - -! x=0. -! xx=0. -! do j=nya,nyb -! x=x+rlon(nxa,j) -!!certo >> x=x+rlon(nxa(j),j) -! xx=xx+ (rlon(nxb,j)-rlon(nxa,j))/(nx-1) -!!certo>>> xx=xx+ (rlon(nxb(j),j)-rlon(nxa(j),j))/(nx-1) -! enddo -! dep_glon1= x/ny -! dep_glon2=xx/ny -! -! -!>>>>>>>> aqui nxa e nxb dependem de j (nxa(j), nxb(j) -! nya == nya(i) -! nyb == nyb(i) -! consertar na rotina define_grid2 -! colocar dimension nxa(nYpmax) ...nxb(NYPMAX) -! nya(nXmax) -!----------------------------- - - -! print*,nxa,nya,nxb,nyb,nlon,nlat,rlon1,rlat1 - return - end + !----- Find the number of grid points. -------------------------------------------------! + xloop: do i=1,nxg + if (loni <= glong(i)) exit xloop + end do xloop + nxa = max(i,1) + + yloop: do j=1,nyg + if (lati <= glatg(j)) exit yloop + end do yloop + nya = max(j,1) + + + nlon = abs( floor( (lonf-loni) / dlon ) ) + 1 + nlat = abs( floor( (latf-lati) / dlat ) ) + 1 + + nxb = min(nxa+nlon,nxg) + nyb = min(nya+nlat,nyg) + rlon1 = glong(nxa) + rlat1 = glatg(nya) + + if (proj /= 'YES' .and. proj /= 'yes') then + x = 0. + xx = 0. + do j=nya,nyb + x = x + rlon(nxa,j) + xx = xx + (rlon(nxb,j)-rlon(nxa,j)) / (nxb-nxa) + end do + rlon1 = x / (nyb-nya+1) + dlon = xx / (nyb-nya+1) + + x = 0. + xx = 0. + do n=nxa,nxb + x = x + rlat(n,nya) + xx = xx + (rlat(n,nyb)-rlat(n,nya)) / (nyb-nya) + end do + rlat1 = x / (nxb-nxa+1) + dlat = xx / (nxb-nxa+1) + end if + + write (unit=*,fmt='(a,1x,es12.5)') ' LONI = ',loni + write (unit=*,fmt='(a,1x,es12.5)') ' LONF = ',lonf + write (unit=*,fmt='(a,1x,i6)' ) ' NLON = ',nlon + write (unit=*,fmt='(a,1x,es12.5)') ' RLON1 = ',rlon1 + write (unit=*,fmt='(a,1x,es12.5)') ' DLON = ',dlon + write (unit=*,fmt='(a,1x,es12.5)') ' LATI = ',lati + write (unit=*,fmt='(a,1x,es12.5)') ' LATF = ',latf + write (unit=*,fmt='(a,1x,i6)' ) ' NLAT = ',nlat + write (unit=*,fmt='(a,1x,es12.5)') ' RLAT1 = ',rlat1 + write (unit=*,fmt='(a,1x,es12.5)') ' DLAT = ',dlat + + return +end subroutine define_lim +!==========================================================================================! +!==========================================================================================! !---------------------------------------------------------------- subroutine define_grid2(nx,ny,loni,lonf,lati,latf,nxg,nyg,& rlat,rlon,nxa,nxb,nya,nyb) diff --git a/Ramspost/src/driver/variables.f90 b/Ramspost/src/driver/variables.f90 index de0651d6d..c11aa639e 100644 --- a/Ramspost/src/driver/variables.f90 +++ b/Ramspost/src/driver/variables.f90 @@ -15,7 +15,7 @@ subroutine RAMS_anal_init(nfile,fnames,file_prefix,dep_zlev,iep_nx,iep_ny,iep_nz implicit none !----- Arguments. ----------------------------------------------------------------------! integer , intent(out) :: nfile - character(len=fnm_len), dimension(maxfiles) , intent(in) :: fnames + character(len=str_len), dimension(maxfiles) , intent(in) :: fnames real , dimension(nzpmax,maxgrds), intent(inout) :: dep_zlev integer , intent(inout) :: iep_np integer , intent(inout) :: iep_nc @@ -25,8 +25,8 @@ subroutine RAMS_anal_init(nfile,fnames,file_prefix,dep_zlev,iep_nx,iep_ny,iep_nz integer , dimension( maxgrds), intent(inout) :: iep_ny integer , dimension( maxgrds), intent(inout) :: iep_nz !----- Internal variables. -------------------------------------------------------------! - character(len=fnm_len) :: file_prefix - character(len=fnm_len) :: fpref + character(len=str_len) :: file_prefix + character(len=str_len) :: fpref integer , dimension(13) :: mondays integer :: maxmem integer :: nc @@ -282,7 +282,7 @@ end subroutine RAMS_get_time_step integer function RAMS_getvar(stringg,itype,ngrd,a,b,flnm) use an_header - use rpost_dims, only : fnm_len ! ! intent(inout) + use rpost_dims, only : str_len ! ! intent(inout) use misc_coms , only : ifound ! ! intent(inout) implicit none @@ -294,7 +294,7 @@ integer function RAMS_getvar(stringg,itype,ngrd,a,b,flnm) integer , intent(out) :: itype integer , intent(in) :: ngrd !----- Local variables. ----------------------------------------------------------------! - character(len=fnm_len) :: flng + character(len=str_len) :: flng character(len=120) :: errmsg character(len=20) :: string integer :: lenf @@ -312,8 +312,8 @@ integer function RAMS_getvar(stringg,itype,ngrd,a,b,flnm) ! the variable name. ! !---------------------------------------------------------------------------------------! select case (flnm(lenf-18:lenf-18)) - case ('M','B') - string = trim(stringg)//'M' + !case ('M','B') + ! string = trim(stringg)//'M' case default string = trim(stringg) end select @@ -1476,7 +1476,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar case('liqpcp') cdname='purely liquid precip' end select - cdunits='kg/mē' + cdunits='kg/m2' case ('accpp') ivar_type=2 @@ -1540,7 +1540,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar select case (trim(cvar)) case ('totpcp','precip') - cdunits='kg/mē' + cdunits='kg/m2' case ('precip_in','totpcp_in') call RAMS_comp_mults(nx,ny,nz,a,.03937) cdunits='in liq' @@ -1558,7 +1558,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar if(ierr == 0) call RAMS_comp_accum(nx,ny,1,a,scr%c) cdname='purely ice precip' - cdunits='kg/mē' + cdunits='kg/m2' call RAMS_comp_noneg(nx,ny,1,a) case ('mixpcp') @@ -1570,7 +1570,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar if(ierr == 0) call RAMS_comp_accum(nx,ny,1,a,scr%c) cdname='mixed (ice/liq) precip' - cdunits='kg/mē' + cdunits='kg/m2' call RAMS_comp_noneg(nx,ny,1,a) case ('pcprr') @@ -1792,7 +1792,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Conv. upward flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('cfxdn_deep') ivar_type=3 @@ -1800,7 +1800,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_nopos(nx,ny,nz,a) cdname='Conv. downward flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('cfxup_shal') ivar_type=3 @@ -1808,7 +1808,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Conv. upward flux - shallow' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('efxup_deep') ivar_type=3 @@ -1816,7 +1816,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Updraft entrainment flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('efxdn_deep') ivar_type=3 @@ -1824,7 +1824,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Downdraft entrainment flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('efxup_shal') ivar_type=3 @@ -1832,7 +1832,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Updraft entrainment flux - shallow' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dfxup_deep') ivar_type=3 @@ -1840,7 +1840,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Updraft detrainment flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dfxdn_deep') ivar_type=3 @@ -1848,7 +1848,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Downdraft detrainment flux - deep' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dfxup_shal') ivar_type=3 @@ -1856,7 +1856,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Updraft detrainment flux - shallow' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('cfxup') ivar_type=6 @@ -1865,7 +1865,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_noneg(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Convective upward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('cfxdn') ivar_type=6 @@ -1874,7 +1874,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_nopos(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Convective downward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dfxup') ivar_type=6 @@ -1883,7 +1883,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_noneg(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Detrainment upward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dfxdn') ivar_type=6 @@ -1892,7 +1892,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_noneg(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Detrainment upward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('efxup') ivar_type=6 @@ -1901,7 +1901,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_noneg(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Entrainment upward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('efxdn') ivar_type=6 @@ -1910,7 +1910,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar call RAMS_comp_noneg(nx,ny,nz*ncld,a) call get_cumulus(nx,ny,nz,ncld,a,a6) cdname='Entrainment upward flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' ! Extra turbulence parameters @@ -1920,7 +1920,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr_getvar = ierr_getvar + ierr ! call RAMS_comp_noneg(nx,ny,nz,a) cdname='Mean turbulent kinetic energy' - cdunits='mē/sē' + cdunits='m2/s2' case ('ltscale') ivar_type=3 @@ -2209,18 +2209,18 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname='topo' cdunits='m' - case ('lat') + case ('lon','longitude') ivar_type=2 - ierr= RAMS_getvar('GLAT',idim_type,ngrd,a,b,flnm) + ierr= RAMS_getvar('GLON',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr - cdname='latitude' + cdname='longitude' cdunits='deg' - case ('lon') + case ('lat','latitude') ivar_type=2 - ierr= RAMS_getvar('GLON',idim_type,ngrd,a,b,flnm) + ierr= RAMS_getvar('GLAT',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr - cdname='longitude' + cdname='latitude' cdunits='deg' case ('mynum') @@ -3300,6 +3300,56 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname='canopy equiv. pot. temperature' cdunits='K' + case ('rshort_gnd','rshort_gnd_ps') + + irecind = 1 + select case (trim(cvar)) + case ('rshort_gnd_ps') + irecsize = nnxp(ngrd) * nnyp(ngrd) * npat + ierr = RAMS_getvar('PATCH_AREA',idim_type,ngrd & + ,a(irecind),b,flnm) + irecind = irecind + irecsize + end select + ierr = RAMS_getvar('RSHORT_GND',idim_type,ngrd & + ,a(irecind),b,flnm) + ierr_getvar = ierr_getvar + ierr + + select case (trim(cvar)) + case ('rshort_gnd') + ivar_type = 7 + case ('rshort_gnd_ps') + ivar_type = 2 + call RAMS_comp_patchsum(nnxp(ngrd),nnyp(ngrd),1,npat,a) + end select + + cdname='Ground shortwave radiation' + cdunits='W/m2' + + case ('rlong_gnd','rlong_gnd_ps') + + irecind = 1 + select case (trim(cvar)) + case ('rlong_gnd_ps') + irecsize = nnxp(ngrd) * nnyp(ngrd) * npat + ierr = RAMS_getvar('PATCH_AREA',idim_type,ngrd & + ,a(irecind),b,flnm) + irecind = irecind + irecsize + end select + ierr = RAMS_getvar('RLONG_GND',idim_type,ngrd & + ,a(irecind),b,flnm) + ierr_getvar = ierr_getvar + ierr + + select case (trim(cvar)) + case ('rlong_gnd') + ivar_type = 7 + case ('rlong_gnd_ps') + ivar_type = 2 + call RAMS_comp_patchsum(nnxp(ngrd),nnyp(ngrd),1,npat,a) + end select + + cdname='Ground longwave radiation' + cdunits='W/m2' + case ('snow_depth_p','snow_depth_ps') irecind = 1 @@ -4026,28 +4076,28 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar ierr= RAMS_getvar('UPMF',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr cdname='updraft mass flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dnmf') ivar_type=9 ierr= RAMS_getvar('DNMF',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr cdname='downdraft mass flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('upmx') ivar_type=9 ierr= RAMS_getvar('UPMX',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr cdname='potential updraft mass flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('dnmx') ivar_type=9 ierr= RAMS_getvar('DNMX',idim_type,ngrd,a,b,flnm) ierr_getvar = ierr_getvar + ierr cdname='potential downdraft mass flux' - cdunits='kg/mē/s' + cdunits='kg/m2/s' case ('wdndraft') ivar_type=9 diff --git a/Ramspost/src/lib/comp_lib.f90 b/Ramspost/src/lib/comp_lib.f90 index 35f1c9ed3..2bbe705f5 100644 --- a/Ramspost/src/lib/comp_lib.f90 +++ b/Ramspost/src/lib/comp_lib.f90 @@ -2032,9 +2032,13 @@ subroutine cldfraction(n1,n2,n3,frac,pi,rh) ! ! ! 1. Based on L79; ! ! 2. Based on: OD95, but with some terms computed as in L79 and B71 to avoid singular- ! -! ities. ! +! ities (now using the iterative method to find zeta). ! ! 3. Based on BH91, using an iterative method to find zeta, and using the modified ! ! equation for stable layers. ! +! 4. Based on CLM04, with special functions for very stable and very stable case, even ! +! though we use a different functional form for very unstable case for momentum. ! +! This is ensure that phi_m decreases monotonically as zeta becomes more negative. ! +! We use a power law of order of -1/6 instead. ! ! ! ! References: ! ! B71. BUSINGER, J.A, et. al; Flux-Profile relationships in the atmospheric surface ! @@ -2045,6 +2049,9 @@ subroutine cldfraction(n1,n2,n3,frac,pi,rh) ! atmospheric models. J. Appl. Meteor., 30, 327-341, 1991. ! ! OD95. ONCLEY, S.P.; DUDHIA, J.; Evaluation of surface fluxes from MM5 using observa- ! ! tions. Mon. Wea. Rev., 123, 3344-3357, 1995. ! +! CLM04. OLESON, K. W., et al.; Technical description of the community land model (CLM) ! +! NCAR Technical Note NCAR/TN-461+STR, Boulder, CO, May 2004. ! +! ! !------------------------------------------------------------------------------------------! subroutine RAMS_reduced_prop(nx,ny,nz,np,ng,which,topt,theta_atm,rvap_atm,co2_atm,uspd_atm & ,theta_can,rvap_can,co2_can,prss_can,zout,rough,rib,zeta,parea & @@ -2280,70 +2287,22 @@ subroutine RAMS_reduced_prop(nx,ny,nz,np,ng,which,topt,theta_atm,rvap_atm,co2_at ured = max(0., ustar(x,y,p) * lnzooz0m / (vonk * sqrt(fmo))) multh = tprandtl * ustar(x,y,p) * lnzooz0m / (vonk * ured * fho) - case (2,4) + case default !---------------------------------------------------------------------------! ! 2. Here we use the model proposed by OD95, the standard for MM5, but with ! - ! some terms that were computed in B71 (namely, the "0" terms). which ! - ! prevent singularities. Since we use OD95 to estimate zeta, which ! - ! avoids the computation of the Obukhov length L , we can't compute ! - ! zeta0 by its definition(z0/L). However we know zeta, so zeta0 can be ! - ! written as z0/z * zeta. ! - ! ! - ! 4. We use the model proposed by BH91, but we find zeta using the ! - ! approximation given by OD95. ! - !---------------------------------------------------------------------------! - if (is_ed2) then - - !----- We now compute the stability correction functions. ---------------! - if (stable) then - !----- Stable case. --------------------------------------------------! - zeta(x,y,p) = rib(x,y,p) * lnzroz0m / (1.1 - 5.0 * rib(x,y,p)) - else - !----- Unstable case. ------------------------------------------------! - zeta(x,y,p) = rib(x,y,p) * lnzroz0m - end if - end if - - zetaom = (zout + rough(x,y,p)) * zeta(x,y,p) / zref - zetaoh = zetaom - zeta0m = rough(x,y,p) * zeta(x,y,p) / zref - zeta0h = zeta0m - !---------------------------------------------------------------------------! - - - !----- Re-compute the stars if this is an ED-2 run. ------------------------! - if (is_ed2) then - ustar(x,y,p) = max (ustmin, vonk * uref & - / (lnzroz0m - psim(zeta(x,y,p),stable,myistar) & - + psim(zeta0m,stable,myistar) )) - - !----- Finding the coefficient to scale the other stars. ----------------! - c3 = vonk / (tprandtl * (lnzroz0m - psih(zeta(x,y,p),stable,myistar) & - + psih(zeta0m,stable,myistar) )) - !----- Computing the other scales. --------------------------------------! - rstar(x,y,p) = c3 * (rvap_atm (x,y,2) - rvap_can (x,y,p) ) - tstar(x,y,p) = c3 * (theta_atm(x,y,2) - theta_can(x,y,p) ) - cstar(x,y,p) = c3 * (co2_atm (x,y,2) - co2_can (x,y,p) ) - end if - !---------------------------------------------------------------------------! - - - ured = ustar(x,y,p) * ( lnzooz0m - psim(zetaom,stable,myistar) & - + psim(zeta0m,stable,myistar) ) / vonk - multh = tprandtl * ( lnzooz0m - psih(zetaoh,stable,myistar) & - + psih(zeta0h,stable,myistar) ) / vonk - - case (3,5) - !---------------------------------------------------------------------------! + ! some terms that were computed in B71 (namely, the "0" terms), which ! + ! prevent singularities. ! + ! However we know zeta, so zeta0 can be written as z0/z * zeta. ! ! 3. Here we use the model proposed by BH91, which is almost the same as ! - ! the OD95 method, with the two following (important) differences. ! - ! a. Zeta (z/L) is actually found using the iterative method. ! - ! b. Stable functions are computed in a more generic way. BH91 claim ! - ! that the oft-used approximation (-beta*zeta) can cause poor ! - ! ventilation of the stable layer, leading to decoupling between the ! - ! atmosphere and the canopy air space and excessive cooling. ! - ! 5. Similar as 3, but we compute the stable functions the same way as ! - ! OD95. ! + ! the OD95 method, except that the stable functions are computed in a ! + ! more generic way. BH91 claim that the oft-used approximation ! + ! (-beta*zeta) can cause poor ventilation of the stable layer, leading ! + ! to decoupling between the atmosphere and the canopy air space and ! + ! excessive cooling. ! + ! 4. Here we use a similar approach as in CLM04, excepth that the momentum ! + ! flux gradient function for the unstable case for momentum is switched ! + ! by a power of -1/6 (kind of the square of the heat one). This is to ! + ! guarantee that the psi function doesn't have local maxima/minima. ! !---------------------------------------------------------------------------! if (is_ed2) then !----- Make sure that the bulk Richardson number is not above ribmax. ---! diff --git a/Ramspost/src/lib/leaf_coms.f90 b/Ramspost/src/lib/leaf_coms.f90 index dbe610836..b0cf35156 100644 --- a/Ramspost/src/lib/leaf_coms.f90 +++ b/Ramspost/src/lib/leaf_coms.f90 @@ -18,37 +18,34 @@ !------------------------------------------------------------------------------------------! module leaf_coms use rconstants, only: grav & ! intent(in) + , vonk & ! intent(in) , twothirds ! ! intent(in) !----- Values that are read in rcio. ---------------------------------------------------! + real :: ubmin ! Minimum velocity [ m/s] + real :: ugbmin ! Minimum leaf-level velocity [ m/s] real :: ustmin ! Minimum ustar [ m/s] real :: gamm ! Gamma used by Businger et al. (1971) - momentum. real :: gamh ! Gamma used by Businger et al. (1971) - heat. real :: tprandtl ! Turbulent Prandtl number. - real :: vkopr ! von Karman / turbulent Prandtl real :: ribmax ! Maximum bulk Richardson number real :: min_patch_area ! Minimum patch area to consider. !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! - ! Speed-related minimum values we will consider. ! - !---------------------------------------------------------------------------------------! - real, parameter :: ubmin = 0.65 ! Minimum velocity [ m/s] - !---------------------------------------------------------------------------------------! - !---------------------------------------------------------------------------------------! ! Constants for surface layer models. ! !---------------------------------------------------------------------------------------! + real, parameter :: vh2vr = 0.13 ! Vegetation roughness:vegetation hgt ratio + real, parameter :: vh2dh = 0.63 ! Displacement height:vegetation hgt ratio !----- Louis (1979) model. -------------------------------------------------------------! real, parameter :: bl79 = 5.0 ! b prime parameter real, parameter :: csm = 7.5 ! C* for momentum (eqn. 20, not co2 char. scale) real, parameter :: csh = 5.0 ! C* for heat (eqn.20, not co2 char. scale) real, parameter :: dl79 = 5.0 ! ??? !----- Oncley and Dudhia (1995) model. -------------------------------------------------! - real, parameter :: bbeta = 5.0 ! Beta used by Businger et al. (1971) + real, parameter :: beta_s = 5.0 ! Beta used by Businger et al. (1971) !----- Beljaars and Holtslag (1991) model. ---------------------------------------------! real, parameter :: abh91 = -1.00 ! -a from equation (28) and (32) real, parameter :: bbh91 = -twothirds ! -b from equation (28) and (32) @@ -63,6 +60,22 @@ module leaf_coms real, parameter :: atetf = ate * fbh91 ! a * e * f real, parameter :: z0moz0h = 1.0 ! z0(M)/z0(h) real, parameter :: z0hoz0m = 1. / z0moz0h ! z0(M)/z0(h) + !----- Modified CLM (2004) model. These will be initialised later. -------------------! + real :: beta_vs ! Beta for the very stable case (CLM eq. 5.30) + real :: chim ! CLM coefficient for very unstable case (momentum) + real :: chih ! CLM coefficient for very unstable case (heat) + real :: zetac_um ! critical zeta below which it becomes very unstable (momentum) + real :: zetac_uh ! critical zeta below which it becomes very unstable (heat) + real :: zetac_sm ! critical zeta above which it becomes very stable (momentum) + real :: zetac_sh ! critical zeta above which it becomes very stable (heat) + real :: zetac_umi ! 1. / zetac_umi + real :: zetac_uhi ! 1. / zetac_uhi + real :: zetac_smi ! 1. / zetac_smi + real :: zetac_shi ! 1. / zetac_shi + real :: zetac_umi16 ! 1/(-zetac_umi)^(1/6) + real :: zetac_uhi13 ! 1/(-zetac_umi)^(1/6) + real :: psimc_um ! psim evaluation at zetac_um + real :: psihc_uh ! psih evaluation at zetac_uh !---------------------------------------------------------------------------------------! contains @@ -74,12 +87,62 @@ module leaf_coms + !=======================================================================================! + !=======================================================================================! + ! This sub-routine initialises several parameters for the surface layer model. ! + !---------------------------------------------------------------------------------------! + subroutine sfclyr_init_params(istar) + use rconstants, only : onesixth ! ! intent(in) + implicit none + !----- Arguments. -------------------------------------------------------------------! + integer, intent(in) :: istar + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt + !------------------------------------------------------------------------------------! + + !----- Similar to CLM (2004), but with different phi_m for very unstable case. ------! + zetac_um = -1.5 + zetac_uh = -0.5 + zetac_sm = 1.0 + zetac_sh = zetac_sm + !----- Define chim and chih so the functions are continuous. ------------------------! + chim = (-zetac_um) ** onesixth / sqrt(sqrt(1.0 - gamm * zetac_um)) + chih = cbrt(-zetac_uh) / sqrt(1.0 - gamh * zetac_uh) + beta_vs = 1.0 - (1.0 - beta_s) * zetac_sm + !----- Define derived values to speed up the code a little. -------------------------! + zetac_umi = 1.0 / zetac_um + zetac_uhi = 1.0 / zetac_uh + zetac_smi = 1.0 / zetac_sm + zetac_shi = 1.0 / zetac_sh + zetac_umi16 = 1.0 / (- zetac_um) ** onesixth + zetac_uhi13 = 1.0 / cbrt(-zetac_uh) + + !------------------------------------------------------------------------------------! + ! Initialise these values with dummies, it will be updated after we define the ! + ! functions. ! + !------------------------------------------------------------------------------------! + psimc_um = 0. + psimc_um = psim(zetac_um,.false.,istar) + psihc_uh = 0. + psihc_uh = psih(zetac_uh,.false.,istar) + !------------------------------------------------------------------------------------! + + return + end subroutine sfclyr_init_params + !=======================================================================================! + !=======================================================================================! + + + + + !=======================================================================================! !=======================================================================================! ! This function computes the stability correction function for momentum. ! !---------------------------------------------------------------------------------------! real function psim(zeta,stable,istar) - use rconstants, only : halfpi + use rconstants, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -87,20 +150,47 @@ real function psim(zeta,stable,istar) integer, intent(in) :: istar ! Which surface layer closure I should use !----- Local variables. -------------------------------------------------------------! real :: xx + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psim = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! - psim = abh91 * zeta + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) & + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psim = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! + psim = abh91 * zeta & + + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) & + bcod + case (4) !----- CLM (2004) (including neglected terms). --------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + psim = (1.0 - beta_vs) * log(zeta * zetac_smi) & + + (1.0 - beta_s ) * zetac_sm - zeta + else + !----- Normal stable case. -------------------------------------------------! + psim = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) - 2.0*atan(xx) + halfpi + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psim = log(zeta * zetac_umi) & + + 6.0 * chim * ((- zeta) ** (-onesixth) - zetac_umi16) & + + psimc_um + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + psim = log(0.125 * (1.0+xx) * (1.0+xx) * (1.0 + xx*xx)) & + - 2.0*atan(xx) + halfpi + end if + end select end if + return end function psim !=======================================================================================! @@ -117,6 +207,8 @@ end function psim ! and carbon dioxide too.) ! !---------------------------------------------------------------------------------------! real function psih(zeta,stable,istar) + use rconstants, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -124,21 +216,45 @@ real function psih(zeta,stable,istar) integer, intent(in) :: istar ! Which surface layer closure I should use !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! - if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - psih = - bbeta * zeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + psih = - beta_s * zeta + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! psih = 1.0 - (1.0 + ate * zeta)**fbh91 & + bbh91 * (zeta - cod) * exp(max(-38.,-dbh91 * zeta)) + bcod + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + psih = (1.0 - beta_vs) * log(zeta * zetac_shi) & + + (1.0 - beta_s ) * zetac_sh - zeta + else + !----- Normal stable case. -------------------------------------------------! + psih = - beta_s * zeta + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - psih = log(0.25 * (1.0+yy) * (1.0+yy)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + psih = log(zeta * zetac_uhi) & + + 3.0 * chih * (1./cbrt(-zeta) - zetac_uhi13) & + + psihc_uh + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + psih = log(0.25 * (1.0+yy) * (1.0+yy)) + end if + end select end if + return end function psih !=======================================================================================! !=======================================================================================! @@ -154,6 +270,8 @@ end function psih ! momentum with respect to zeta. ! !---------------------------------------------------------------------------------------! real function dpsimdzeta(zeta,stable,istar) + use rconstants, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -165,16 +283,35 @@ real function dpsimdzeta(zeta,stable,istar) if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsimdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsimdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsimdzeta = abh91 + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sm) then + !----- Very stable case. ---------------------------------------------------! + dpsimdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsimdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - xx = sqrt(sqrt(1.0 - gamm * zeta)) - dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsimdzeta = (1.0 - chim * (-zeta)**onesixth) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + xx = sqrt(sqrt(1.0 - gamm * zeta)) + dpsimdzeta = - gamm / (xx * (1.0+xx) * (1.0 + xx*xx)) + end if + end select end if return @@ -193,6 +330,8 @@ end function dpsimdzeta ! heat/moisture/CO2 with respect to zeta. ! !---------------------------------------------------------------------------------------! real function dpsihdzeta(zeta,stable,istar) + use rconstants, only : halfpi & ! intent(in) + , onesixth ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! real , intent(in) :: zeta ! z/L, z is the height, and L the Obukhov length [ ---] @@ -200,21 +339,41 @@ real function dpsihdzeta(zeta,stable,istar) integer, intent(in) :: istar ! Which surface layer closure I should use !----- Local variables. -------------------------------------------------------------! real :: yy + !----- External functions. ----------------------------------------------------------! + real , external :: cbrt !------------------------------------------------------------------------------------! - if (stable) then select case (istar) - case (2,5) !----- Oncley and Dudhia (1995). --------------------------------------! - dpsihdzeta = - bbeta - case (3,4) !----- Beljaars and Holtslag (1991). ----------------------------------! + case (2) !----- Oncley and Dudhia (1995). ----------------------------------------! + dpsihdzeta = - beta_s + case (3) !----- Beljaars and Holtslag (1991). ------------------------------------! dpsihdzeta = - atetf * (1.0 + ate * zeta)**fm1 & + bbh91 * (1.0 - dbh91 * zeta + cbh91) & * exp(max(-38.,-dbh91 * zeta)) + case (4) !----- CLM (2004). ------------------------------------------------------! + if (zeta > zetac_sh) then + !----- Very stable case. ---------------------------------------------------! + dpsihdzeta = (1.0 - beta_vs) / zeta - 1.0 + else + !----- Normal stable case. -------------------------------------------------! + dpsihdzeta = - beta_s + end if end select else - !----- Unstable case, both papers use the same expression. -----------------------! - yy = sqrt(1.0 - gamh * zeta) - dpsihdzeta = -gamh / (yy * (1.0 + yy)) + select case (istar) + case (2,3) !----- Oncley and Dudhia (1995) and Beljaars and Holtslag (1991). -----! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + case (4) !----- CLM (2004) (including neglected terms). ------------------------! + if (zeta < zetac_um) then + !----- Very unstable case. -------------------------------------------------! + dpsihdzeta = (1.0 + chih / cbrt(zeta)) / zeta + else + !----- Normal unstable case. -----------------------------------------------! + yy = sqrt(1.0 - gamh * zeta) + dpsihdzeta = -gamh / (yy * (1.0 + yy)) + end if + end select end if return @@ -253,6 +412,7 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable,istar) logical, intent(in) :: stable ! Flag... This surface layer is stable [ T|F] integer, intent(in) :: istar ! Which surface layer closure I should use !----- Local variables. -------------------------------------------------------------! + real :: ribuse ! Richardson number to use [ ---] real :: fm ! lnzoz0m - psim(zeta) + psim(zeta0m) [ ---] real :: fh ! lnzoz0h - psih(zeta) + psih(zeta0h) [ ---] real :: dfmdzeta ! d(fm)/d(zeta) [ ---] @@ -278,22 +438,56 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable,istar) logical :: zside ! Flag... I'm on the z-side. [ T|F] !------------------------------------------------------------------------------------! + + + !----- Define some values that won't change during the iterative method. ------------! + z0moz = 1. / zoz0m + z0hoz = 1. / zoz0h + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! First thing, check whether this is a stable case and we are running methods 2 ! + ! or 4. In these methods, there is a singularity that must be avoided. ! !------------------------------------------------------------------------------------! - ! First thing: if the bulk Richardson number is zero or almost zero, then we ! - ! rather just assign z/L to be the one given by Oncley and Dudhia (1995). This ! - ! saves time and also avoids the risk of having zeta with the opposite sign. ! + select case (istar) + case (2,4) + ribuse = min(rib, (1.0 - toler) * tprandtl / (beta_s * (1.0 - min(z0moz,z0hoz)))) + + !---------------------------------------------------------------------------------! + ! Stable case, using Oncley and Dudhia, we can solve it analytically. ! + !---------------------------------------------------------------------------------! + if (stable .and. istar == 2) then + zoobukhov = ribuse * min(lnzoz0m,lnzoz0h) & + / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) *ribuse) + return + end if + !---------------------------------------------------------------------------------! + case default + ribuse = rib + end select !------------------------------------------------------------------------------------! - zetasmall = vkopr * rib * min(lnzoz0m,lnzoz0h) - if (rib <= 0. .and. zetasmall > - z0moz0h * toler) then - zoobukhov = vkopr * rib * lnzoz0m + + + + !------------------------------------------------------------------------------------! + ! If the bulk Richardson number is zero or almost zero, then we rather just ! + ! assign z/L to be the one similar to Oncley and Dudhia (1995). This saves time and ! + ! also avoids the risk of having zeta with the opposite sign. ! + !------------------------------------------------------------------------------------! + zetasmall = ribuse * min(lnzoz0m,lnzoz0h) + if (ribuse <= 0. .and. zetasmall > - z0moz0h * toler) then + zoobukhov = zetasmall / tprandtl return - elseif (rib > 0. .and. zetasmall < z0moz0h * toler) then - zoobukhov = zetasmall / (1.1 - 5.0 * rib) + elseif (ribuse > 0. .and. zetasmall < z0moz0h * toler) then + zoobukhov = zetasmall / (tprandtl - beta_s * (1.0 - min(z0moz,z0hoz)) * ribuse) return else zetamin = toler zetamax = -toler end if + !------------------------------------------------------------------------------------! !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.20. ! !------------------------------------------------------------------------------------! - zetaa = vkopr * rib * lnzoz0m + zetaa = ribuse * lnzoz0m / tprandtl !----- Finding the function and its derivative. -------------------------------------! zeta0m = zetaa * z0moz @@ -323,9 +512,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable,istar) fh = lnzoz0h - psih(zetaa,stable,istar) + psih(zeta0h,stable,istar) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable,istar)-dpsimdzeta(zetaa,stable,istar) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable,istar)-dpsihdzeta(zetaa,stable,istar) - funa = vkopr * rib * fm * fm / fh - zetaa - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + funa = ribuse * fm * fm / (tprandtl * fh) - zetaa + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !----- Copying just in case it fails at the first iteration. ------------------------! zetaz = zetaa @@ -373,9 +562,9 @@ real function zoobukhov(rib,zref,rough,zoz0m,lnzoz0m,zoz0h,lnzoz0h,stable,istar) fh = lnzoz0h - psih(zetaz,stable,istar) + psih(zeta0h,stable,istar) dfmdzeta = z0moz * dpsimdzeta(zeta0m,stable,istar)-dpsimdzeta(zetaz,stable,istar) dfhdzeta = z0hoz * dpsihdzeta(zeta0h,stable,istar)-dpsihdzeta(zetaz,stable,istar) - fun = vkopr * rib * fm * fm / fh - zetaz - deriv = vkopr * rib * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & - / (fh * fh) - 1. + fun = ribuse * fm * fm / (tprandtl * fh) - zetaz + deriv = ribuse * (2. * fm * dfmdzeta * fh - fm * fm * dfhdzeta) & + / (tprandtl * fh * fh) - 1. !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>