diff --git a/.bzrignore b/.bzrignore index e6f72a2a6..05902bfef 100644 --- a/.bzrignore +++ b/.bzrignore @@ -7351,3 +7351,4812 @@ ED/dbgbuild/bin/zero_ed_yearly_vars_mod.mod Ramspost/build/bin/rout_coms.mod BRAMS/gnubuild BRAMS/i11build +ED/dbgbuild/bin/ed_bigleaf_init.f90 +ED/dbgbuild/bin/ed_bigleaf_init_mod.f90 +ED/dbgbuild/bin/ed_bigleaf_init_mod.mod +ED/dbgbuild/bin/check_rescale_mod.f90 +ED/dbgbuild/bin/check_rescale_mod.mod +ED/dbgbuild/bin/read_ed21_polyclone_mod.f90 +ED/dbgbuild/bin/read_ed21_polyclone_mod.mod +BRAMS/build/edbrams-new +BRAMS/i10dbg/bin/adap_bldg_mod.f90 +BRAMS/i10dbg/bin/adap_init.f90 +BRAMS/i10dbg/bin/advected_mod.f90 +BRAMS/i10dbg/bin/alt_dia_mod.f90 +BRAMS/i10dbg/bin/altera_dia.f90 +BRAMS/i10dbg/bin/an_header.f90 +BRAMS/i10dbg/bin/aobj.f90 +BRAMS/i10dbg/bin/apply_drydep_mod.f90 +BRAMS/i10dbg/bin/asgen.f90 +BRAMS/i10dbg/bin/asti2.f90 +BRAMS/i10dbg/bin/asti.f90 +BRAMS/i10dbg/bin/astp.f90 +BRAMS/i10dbg/bin/avarf.f90 +BRAMS/i10dbg/bin/bn_parm_mod.f90 +BRAMS/i10dbg/bin/bn_pass_mod.f90 +BRAMS/i10dbg/bin/bn_qual_mod.f90 +BRAMS/i10dbg/bin/catt_start.f90 +BRAMS/i10dbg/bin/char_strip_var_mod.f90 +BRAMS/i10dbg/bin/charutils.f90 +BRAMS/i10dbg/bin/cond_file_inv_mod.f90 +BRAMS/i10dbg/bin/cond_read.f90 +BRAMS/i10dbg/bin/cond_read_mod.f90 +BRAMS/i10dbg/bin/cond_update.f90 +BRAMS/i10dbg/bin/cond_update_mod.f90 +BRAMS/i10dbg/bin/conv_coms.f90 +BRAMS/i10dbg/bin/coriolis.f90 +BRAMS/i10dbg/bin/corlos_mod.f90 +BRAMS/i10dbg/bin/corlsu_mod.f90 +BRAMS/i10dbg/bin/corlsv_mod.f90 +BRAMS/i10dbg/bin/ctrlvols_mod.f90 +BRAMS/i10dbg/bin/cu_file_inv_mod.f90 +BRAMS/i10dbg/bin/cuparth_mod.f90 +BRAMS/i10dbg/bin/cuparth_shal_mod.f90 +BRAMS/i10dbg/bin/cup_dd_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_dd_edt_mod.f90 +BRAMS/i10dbg/bin/cup_dd_he_mod.f90 +BRAMS/i10dbg/bin/cup_dd_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_dd_nms_mod.f90 +BRAMS/i10dbg/bin/cup_dellabot_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.f90 +BRAMS/i10dbg/bin/cup_direction2_mod.f90 +BRAMS/i10dbg/bin/cup_dn.f90 +BRAMS/i10dbg/bin/cup_enss_mod.f90 +BRAMS/i10dbg/bin/cup_enss_shal_mod.f90 +BRAMS/i10dbg/bin/cup_env_clev_mod.f90 +BRAMS/i10dbg/bin/cup_env.f90 +BRAMS/i10dbg/bin/cup_env_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_grell2.f90 +BRAMS/i10dbg/bin/cup_grell2_shcu.f90 +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.f90 +BRAMS/i10dbg/bin/cup_kbcon_mod.f90 +BRAMS/i10dbg/bin/cup_ktop_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_up_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_up.f90 +BRAMS/i10dbg/bin/cup_up_he_mod.f90 +BRAMS/i10dbg/bin/cup_up_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_up_nms_mod.f90 +BRAMS/i10dbg/bin/cu_read.f90 +BRAMS/i10dbg/bin/cu_read_mod.f90 +BRAMS/i10dbg/bin/cu_update_mod.f90 +BRAMS/i10dbg/bin/cyclic_mod.f90 +BRAMS/i10dbg/bin/date_2_seconds_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs2_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs_mod.f90 +BRAMS/i10dbg/bin/date_add_to_big_mod.f90 +BRAMS/i10dbg/bin/date_add_to_mod.f90 +BRAMS/i10dbg/bin/date_make_big_mod.f90 +BRAMS/i10dbg/bin/date_secs_ymdt_mod.f90 +BRAMS/i10dbg/bin/date_unmake_big_mod.f90 +BRAMS/i10dbg/bin/dateutils.f90 +BRAMS/i10dbg/bin/dealloc_all_mod.f90 +BRAMS/i10dbg/bin/dealloc.f90 +BRAMS/i10dbg/bin/deblank_mod.f90 +BRAMS/i10dbg/bin/define_pbl_height_mod.f90 +BRAMS/i10dbg/bin/detab_mod.f90 +BRAMS/i10dbg/bin/diffsclr_brams31_mod.f90 +BRAMS/i10dbg/bin/diffsclr.f90 +BRAMS/i10dbg/bin/diffuse_brams31_mod.f90 +BRAMS/i10dbg/bin/diffuse.f90 +BRAMS/i10dbg/bin/domain_decomp.f90 +BRAMS/i10dbg/bin/drydep_driver_mod.f90 +BRAMS/i10dbg/bin/dry_dep.f90 +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.f90 +BRAMS/i10dbg/bin/dry_dep_mod.f90 +BRAMS/i10dbg/bin/dry_dep_particles_mod.f90 +BRAMS/i10dbg/bin/emission_source_map.f90 +BRAMS/i10dbg/bin/extra.f90 +BRAMS/i10dbg/bin/fcorio_mod.f90 +BRAMS/i10dbg/bin/findln_mod.f90 +BRAMS/i10dbg/bin/get_press_mod.f90 +BRAMS/i10dbg/bin/get_zi_mod.f90 +BRAMS/i10dbg/bin/grell_coms.f90 +BRAMS/i10dbg/bin/grid_dims.f90 +BRAMS/i10dbg/bin/grid_struct.f90 +BRAMS/i10dbg/bin/ifirstchar_mod.f90 +BRAMS/i10dbg/bin/input_rawi_mod.f90 +BRAMS/i10dbg/bin/input_sfc_mod.f90 +BRAMS/i10dbg/bin/io_params.f90 +BRAMS/i10dbg/bin/isan_coms.f90 +BRAMS/i10dbg/bin/isan_driver_mod.f90 +BRAMS/i10dbg/bin/isleap_mod.f90 +BRAMS/i10dbg/bin/isnsig_mod.f90 +BRAMS/i10dbg/bin/isnstage_mod.f90 +BRAMS/i10dbg/bin/julday1000_mod.f90 +BRAMS/i10dbg/bin/julday_mod.f90 +BRAMS/i10dbg/bin/ke_coms.f90 +BRAMS/i10dbg/bin/lastchar_mod.f90 +BRAMS/i10dbg/bin/lastslash_mod.f90 +BRAMS/i10dbg/bin/leaf_coms.f90 +BRAMS/i10dbg/bin/lpuvw_init_mod.f90 +BRAMS/i10dbg/bin/lsl_particles_mod.f90 +BRAMS/i10dbg/bin/makevarf_mod.f90 +BRAMS/i10dbg/bin/maximi_mod.f90 +BRAMS/i10dbg/bin/mem_aerad.f90 +BRAMS/i10dbg/bin/mem_all.f90 +BRAMS/i10dbg/bin/mem_basic.f90 +BRAMS/i10dbg/bin/mem_cuparm.f90 +BRAMS/i10dbg/bin/mem_emiss.f90 +BRAMS/i10dbg/bin/mem_ensemble.f90 +BRAMS/i10dbg/bin/mem_gaspart.f90 +BRAMS/i10dbg/bin/mem_globaer.f90 +BRAMS/i10dbg/bin/mem_globrad.f90 +BRAMS/i10dbg/bin/mem_grell_param2.f90 +BRAMS/i10dbg/bin/mem_grid_dim_defs.f90 +BRAMS/i10dbg/bin/mem_grid.f90 +BRAMS/i10dbg/bin/mem_leaf.f90 +BRAMS/i10dbg/bin/mem_mass.f90 +BRAMS/i10dbg/bin/mem_micro.f90 +BRAMS/i10dbg/bin/mem_mnt_advec.f90 +BRAMS/i10dbg/bin/mem_nestb.f90 +BRAMS/i10dbg/bin/mem_oda.f90 +BRAMS/i10dbg/bin/mem_opt_scratch.f90 +BRAMS/i10dbg/bin/mem_radiate.f90 +BRAMS/i10dbg/bin/mem_scalar.f90 +BRAMS/i10dbg/bin/mem_scratch1_brams.f90 +BRAMS/i10dbg/bin/mem_scratch1_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch.f90 +BRAMS/i10dbg/bin/mem_scratch_grell.f90 +BRAMS/i10dbg/bin/mem_teb_common.f90 +BRAMS/i10dbg/bin/mem_teb.f90 +BRAMS/i10dbg/bin/mem_tend.f90 +BRAMS/i10dbg/bin/mem_turb.f90 +BRAMS/i10dbg/bin/mem_varinit.f90 +BRAMS/i10dbg/bin/micphys.f90 +BRAMS/i10dbg/bin/minimi_mod.f90 +BRAMS/i10dbg/bin/nc_get_press_mod.f90 +BRAMS/i10dbg/bin/nc_pressure_stage_mod.f90 +BRAMS/i10dbg/bin/nc_prfill_mod.f90 +BRAMS/i10dbg/bin/node_mod.f90 +BRAMS/i10dbg/bin/nud_cond_accum_mod.f90 +BRAMS/i10dbg/bin/obanl_mod.f90 +BRAMS/i10dbg/bin/obj_anal_mod.f90 +BRAMS/i10dbg/bin/opspec4_mod.f90 +BRAMS/i10dbg/bin/parse_mod.f90 +BRAMS/i10dbg/bin/prebarn_mod.f90 +BRAMS/i10dbg/bin/press_miss_mod.f90 +BRAMS/i10dbg/bin/pressure_stage_mod.f90 +BRAMS/i10dbg/bin/prfill_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_t_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_z_mod.f90 +BRAMS/i10dbg/bin/pr_interp_mod.f90 +BRAMS/i10dbg/bin/pr_miss_fill_mod.f90 +BRAMS/i10dbg/bin/rams_dintsort_mod.f90 +BRAMS/i10dbg/bin/rams_fltsort_mod.f90 +BRAMS/i10dbg/bin/rams_intsort_mod.f90 +BRAMS/i10dbg/bin/rams_sort_dint3_mod.f90 +BRAMS/i10dbg/bin/rams_unique_dint_mod.f90 +BRAMS/i10dbg/bin/rconstants.f90 +BRAMS/i10dbg/bin/ref_sounding.f90 +BRAMS/i10dbg/bin/sedim_particles_mod.f90 +BRAMS/i10dbg/bin/setgv_mod.f90 +BRAMS/i10dbg/bin/sfcproc_mod.f90 +BRAMS/i10dbg/bin/sfcqual_mod.f90 +BRAMS/i10dbg/bin/sndproc_mod.f90 +BRAMS/i10dbg/bin/soundtopo_mod.f90 +BRAMS/i10dbg/bin/stainterp_mod.f90 +BRAMS/i10dbg/bin/staprt_mod.f90 +BRAMS/i10dbg/bin/strmfun_mod.f90 +BRAMS/i10dbg/bin/teb_spm_start.f90 +BRAMS/i10dbg/bin/therm_lib.f90 +BRAMS/i10dbg/bin/tokenize1_mod.f90 +BRAMS/i10dbg/bin/tokenize_mod.f90 +BRAMS/i10dbg/bin/tokfind_mod.f90 +BRAMS/i10dbg/bin/tolower_mod.f90 +BRAMS/i10dbg/bin/varfile_nstfeed_mod.f90 +BRAMS/i10dbg/bin/var_tables.f90 +BRAMS/i10dbg/bin/varuv_mod.f90 +BRAMS/i10dbg/bin/visurf_mod.f90 +BRAMS/i10dbg/bin/vshyd_mod.f90 +BRAMS/i10dbg/bin/abort_run_mod.mod +BRAMS/i10dbg/bin/adap_bldg_mod.mod +BRAMS/i10dbg/bin/advected_mod.mod +BRAMS/i10dbg/bin/alt_dia_mod.mod +BRAMS/i10dbg/bin/an_header.mod +BRAMS/i10dbg/bin/apply_drydep_mod.mod +BRAMS/i10dbg/bin/bn_parm_mod.mod +BRAMS/i10dbg/bin/bn_pass_mod.mod +BRAMS/i10dbg/bin/bn_qual_mod.mod +BRAMS/i10dbg/bin/brams_fail_whale_mod.mod +BRAMS/i10dbg/bin/catt_start.mod +BRAMS/i10dbg/bin/char_strip_var_mod.mod +BRAMS/i10dbg/bin/comp_avgu_mod.mod +BRAMS/i10dbg/bin/comp_avgv_mod.mod +BRAMS/i10dbg/bin/comp_press_mod.mod +BRAMS/i10dbg/bin/comp_rhfrac_mod.mod +BRAMS/i10dbg/bin/cond_file_inv_mod.mod +BRAMS/i10dbg/bin/cond_read_mod.mod +BRAMS/i10dbg/bin/cond_update_mod.mod +BRAMS/i10dbg/bin/consts_coms.mod +BRAMS/i10dbg/bin/conv_coms.mod +BRAMS/i10dbg/bin/corlos_mod.mod +BRAMS/i10dbg/bin/corlsu_mod.mod +BRAMS/i10dbg/bin/corlsv_mod.mod +BRAMS/i10dbg/bin/ctrlvols_mod.mod +BRAMS/i10dbg/bin/cu_file_inv_mod.mod +BRAMS/i10dbg/bin/cuparth_mod.mod +BRAMS/i10dbg/bin/cuparth_shal_mod.mod +BRAMS/i10dbg/bin/cup_dd_aa0_mod.mod +BRAMS/i10dbg/bin/cup_dd_edt_mod.mod +BRAMS/i10dbg/bin/cup_dd_he_mod.mod +BRAMS/i10dbg/bin/cup_dd_moisture_mod.mod +BRAMS/i10dbg/bin/cup_dd_nms_mod.mod +BRAMS/i10dbg/bin/cup_dellabot_mod.mod +BRAMS/i10dbg/bin/cup_dellas_mod.mod +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.mod +BRAMS/i10dbg/bin/cup_direction2_mod.mod +BRAMS/i10dbg/bin/cup_enss_mod.mod +BRAMS/i10dbg/bin/cup_enss_shal_mod.mod +BRAMS/i10dbg/bin/cup_env_clev_mod.mod +BRAMS/i10dbg/bin/cup_env_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_mod.mod +BRAMS/i10dbg/bin/cup_ktop_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_up_aa0_mod.mod +BRAMS/i10dbg/bin/cup_up_he_mod.mod +BRAMS/i10dbg/bin/cup_up_moisture_mod.mod +BRAMS/i10dbg/bin/cup_up_nms_mod.mod +BRAMS/i10dbg/bin/cu_read_mod.mod +BRAMS/i10dbg/bin/cu_update_mod.mod +BRAMS/i10dbg/bin/cyclic_mod.mod +BRAMS/i10dbg/bin/date_2_seconds_mod.mod +BRAMS/i10dbg/bin/date_abs_secs2_mod.mod +BRAMS/i10dbg/bin/date_abs_secs_mod.mod +BRAMS/i10dbg/bin/date_add_to_big_mod.mod +BRAMS/i10dbg/bin/date_add_to_mod.mod +BRAMS/i10dbg/bin/date_make_big_mod.mod +BRAMS/i10dbg/bin/date_secs_ymdt_mod.mod +BRAMS/i10dbg/bin/date_unmake_big_mod.mod +BRAMS/i10dbg/bin/dealloc_all_mod.mod +BRAMS/i10dbg/bin/deblank_mod.mod +BRAMS/i10dbg/bin/define_pbl_height_mod.mod +BRAMS/i10dbg/bin/detab_mod.mod +BRAMS/i10dbg/bin/diffsclr_brams31_mod.mod +BRAMS/i10dbg/bin/diffuse_brams31_mod.mod +BRAMS/i10dbg/bin/domain_decomp.mod +BRAMS/i10dbg/bin/drydep_driver_mod.mod +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.mod +BRAMS/i10dbg/bin/dry_dep_mod.mod +BRAMS/i10dbg/bin/dry_dep_particles_mod.mod +BRAMS/i10dbg/bin/emission_source_map.mod +BRAMS/i10dbg/bin/extras.mod +BRAMS/i10dbg/bin/fcorio_mod.mod +BRAMS/i10dbg/bin/findln_mod.mod +BRAMS/i10dbg/bin/first_rams_mod.mod +BRAMS/i10dbg/bin/fmint4_isan_mod.mod +BRAMS/i10dbg/bin/get_press_mod.mod +BRAMS/i10dbg/bin/get_zi_mod.mod +BRAMS/i10dbg/bin/grell_coms.mod +BRAMS/i10dbg/bin/grid_dims.mod +BRAMS/i10dbg/bin/grid_struct.mod +BRAMS/i10dbg/bin/ifirstchar_mod.mod +BRAMS/i10dbg/bin/input_rawi_mod.mod +BRAMS/i10dbg/bin/input_sfc_mod.mod +BRAMS/i10dbg/bin/io_params.mod +BRAMS/i10dbg/bin/isan_comp_dn0_mod.mod +BRAMS/i10dbg/bin/isan_coms.mod +BRAMS/i10dbg/bin/isan_driver_mod.mod +BRAMS/i10dbg/bin/isan_file_inv_mod.mod +BRAMS/i10dbg/bin/isleap_mod.mod +BRAMS/i10dbg/bin/isnsig_mod.mod +BRAMS/i10dbg/bin/isnstage_mod.mod +BRAMS/i10dbg/bin/julday1000_mod.mod +BRAMS/i10dbg/bin/julday_mod.mod +BRAMS/i10dbg/bin/ke_coms.mod +BRAMS/i10dbg/bin/lastchar_mod.mod +BRAMS/i10dbg/bin/lastslash_mod.mod +BRAMS/i10dbg/bin/latset_tracer_mod.mod +BRAMS/i10dbg/bin/leaf_coms.mod +BRAMS/i10dbg/bin/lpuvw_init_mod.mod +BRAMS/i10dbg/bin/lsl_particles_mod.mod +BRAMS/i10dbg/bin/makevarf_mod.mod +BRAMS/i10dbg/bin/maximi_mod.mod +BRAMS/i10dbg/bin/mem_aerad.mod +BRAMS/i10dbg/bin/mem_all.mod +BRAMS/i10dbg/bin/mem_basic.mod +BRAMS/i10dbg/bin/mem_cuparm.mod +BRAMS/i10dbg/bin/mem_emiss.mod +BRAMS/i10dbg/bin/mem_ensemble.mod +BRAMS/i10dbg/bin/mem_gaspart.mod +BRAMS/i10dbg/bin/mem_globaer.mod +BRAMS/i10dbg/bin/mem_globrad.mod +BRAMS/i10dbg/bin/mem_grell_param.mod +BRAMS/i10dbg/bin/mem_grid_dim_defs.mod +BRAMS/i10dbg/bin/mem_grid.mod +BRAMS/i10dbg/bin/mem_leaf.mod +BRAMS/i10dbg/bin/mem_mass.mod +BRAMS/i10dbg/bin/mem_micro.mod +BRAMS/i10dbg/bin/mem_mnt_advec.mod +BRAMS/i10dbg/bin/mem_nestb.mod +BRAMS/i10dbg/bin/mem_oda.mod +BRAMS/i10dbg/bin/mem_opt.mod +BRAMS/i10dbg/bin/mem_radiate.mod +BRAMS/i10dbg/bin/mem_scalar.mod +BRAMS/i10dbg/bin/mem_scratch1_grell.mod +BRAMS/i10dbg/bin/mem_scratch1.mod +BRAMS/i10dbg/bin/mem_scratch2_grell.mod +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch3_grell.mod +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch_grell.mod +BRAMS/i10dbg/bin/mem_scratch.mod +BRAMS/i10dbg/bin/mem_teb_common.mod +BRAMS/i10dbg/bin/mem_teb.mod +BRAMS/i10dbg/bin/mem_tend.mod +BRAMS/i10dbg/bin/mem_turb.mod +BRAMS/i10dbg/bin/mem_varinit.mod +BRAMS/i10dbg/bin/micphys.mod +BRAMS/i10dbg/bin/minimi_mod.mod +BRAMS/i10dbg/bin/nc_get_press_mod.mod +BRAMS/i10dbg/bin/nc_pressure_stage_mod.mod +BRAMS/i10dbg/bin/nc_prfill_mod.mod +BRAMS/i10dbg/bin/node_mod.mod +BRAMS/i10dbg/bin/nud_cond_accum_mod.mod +BRAMS/i10dbg/bin/obanl_mod.mod +BRAMS/i10dbg/bin/obj_anal_mod.mod +BRAMS/i10dbg/bin/opspec4_mod.mod +BRAMS/i10dbg/bin/opspec_mess_mod.mod +BRAMS/i10dbg/bin/parse_mod.mod +BRAMS/i10dbg/bin/prebarn_mod.mod +BRAMS/i10dbg/bin/press_miss_mod.mod +BRAMS/i10dbg/bin/pressure_stage_mod.mod +BRAMS/i10dbg/bin/prfill_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_t_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_z_mod.mod +BRAMS/i10dbg/bin/pr_interp_mod.mod +BRAMS/i10dbg/bin/pr_miss_fill_mod.mod +BRAMS/i10dbg/bin/rams_dintsort_mod.mod +BRAMS/i10dbg/bin/rams_filelist_mod.mod +BRAMS/i10dbg/bin/rams_fltsort_mod.mod +BRAMS/i10dbg/bin/rams_intsort_mod.mod +BRAMS/i10dbg/bin/rams_sort_dint3_mod.mod +BRAMS/i10dbg/bin/rams_unique_dint_mod.mod +BRAMS/i10dbg/bin/rconstants.mod +BRAMS/i10dbg/bin/ref_sounding.mod +BRAMS/i10dbg/bin/sedim_particles_mod.mod +BRAMS/i10dbg/bin/setgv_mod.mod +BRAMS/i10dbg/bin/sfcproc_mod.mod +BRAMS/i10dbg/bin/sfcqual_mod.mod +BRAMS/i10dbg/bin/sndproc_mod.mod +BRAMS/i10dbg/bin/soundtopo_mod.mod +BRAMS/i10dbg/bin/stainterp_mod.mod +BRAMS/i10dbg/bin/staprt_mod.mod +BRAMS/i10dbg/bin/strmfun_mod.mod +BRAMS/i10dbg/bin/teb_spm_start.mod +BRAMS/i10dbg/bin/therm_lib.mod +BRAMS/i10dbg/bin/tokenize1_mod.mod +BRAMS/i10dbg/bin/tokenize_mod.mod +BRAMS/i10dbg/bin/tokfind_mod.mod +BRAMS/i10dbg/bin/tolower_mod.mod +BRAMS/i10dbg/bin/varfile_nstfeed_mod.mod +BRAMS/i10dbg/bin/var_tables.mod +BRAMS/i10dbg/bin/varuv_mod.mod +BRAMS/i10dbg/bin/visurf_mod.mod +BRAMS/i10dbg/bin/vshyd_mod.mod +BRAMS/i10dbg/bin/abort_run_mod.f90 +BRAMS/i10dbg/bin/adap_bldg_mod.f90 +BRAMS/i10dbg/bin/adap_init.f90 +BRAMS/i10dbg/bin/advected_mod.f90 +BRAMS/i10dbg/bin/alt_dia_mod.f90 +BRAMS/i10dbg/bin/altera_dia.f90 +BRAMS/i10dbg/bin/an_header.f90 +BRAMS/i10dbg/bin/aobj.f90 +BRAMS/i10dbg/bin/apply_drydep_mod.f90 +BRAMS/i10dbg/bin/asgen.f90 +BRAMS/i10dbg/bin/asti2.f90 +BRAMS/i10dbg/bin/asti.f90 +BRAMS/i10dbg/bin/astp.f90 +BRAMS/i10dbg/bin/avarf.f90 +BRAMS/i10dbg/bin/bn_parm_mod.f90 +BRAMS/i10dbg/bin/bn_pass_mod.f90 +BRAMS/i10dbg/bin/bn_qual_mod.f90 +BRAMS/i10dbg/bin/brams_fail_whale_mod.f90 +BRAMS/i10dbg/bin/catt_start.f90 +BRAMS/i10dbg/bin/char_strip_var_mod.f90 +BRAMS/i10dbg/bin/charutils.f90 +BRAMS/i10dbg/bin/comp_avgu_mod.f90 +BRAMS/i10dbg/bin/comp_avgv_mod.f90 +BRAMS/i10dbg/bin/comp_press_mod.f90 +BRAMS/i10dbg/bin/comp_rhfrac_mod.f90 +BRAMS/i10dbg/bin/cond_file_inv_mod.f90 +BRAMS/i10dbg/bin/cond_read.f90 +BRAMS/i10dbg/bin/cond_read_mod.f90 +BRAMS/i10dbg/bin/cond_update.f90 +BRAMS/i10dbg/bin/cond_update_mod.f90 +BRAMS/i10dbg/bin/conv_coms.f90 +BRAMS/i10dbg/bin/convert_to_misture_ratio_teb_mod.f90 +BRAMS/i10dbg/bin/coriolis.f90 +BRAMS/i10dbg/bin/corlos_mod.f90 +BRAMS/i10dbg/bin/corlsu_mod.f90 +BRAMS/i10dbg/bin/corlsv_mod.f90 +BRAMS/i10dbg/bin/ctrlvols_mod.f90 +BRAMS/i10dbg/bin/cu_file_inv_mod.f90 +BRAMS/i10dbg/bin/cuparth_mod.f90 +BRAMS/i10dbg/bin/cuparth_shal_mod.f90 +BRAMS/i10dbg/bin/cup_dd_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_dd_edt_mod.f90 +BRAMS/i10dbg/bin/cup_dd_he_mod.f90 +BRAMS/i10dbg/bin/cup_dd_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_dd_nms_mod.f90 +BRAMS/i10dbg/bin/cup_dellabot_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.f90 +BRAMS/i10dbg/bin/cup_direction2_mod.f90 +BRAMS/i10dbg/bin/cup_dn.f90 +BRAMS/i10dbg/bin/cup_enss_mod.f90 +BRAMS/i10dbg/bin/cup_enss_shal_mod.f90 +BRAMS/i10dbg/bin/cup_env_clev_mod.f90 +BRAMS/i10dbg/bin/cup_env.f90 +BRAMS/i10dbg/bin/cup_env_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_grell2.f90 +BRAMS/i10dbg/bin/cup_grell2_shcu.f90 +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.f90 +BRAMS/i10dbg/bin/cup_kbcon_mod.f90 +BRAMS/i10dbg/bin/cup_ktop_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_up_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_up.f90 +BRAMS/i10dbg/bin/cup_up_he_mod.f90 +BRAMS/i10dbg/bin/cup_up_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_up_nms_mod.f90 +BRAMS/i10dbg/bin/cu_read.f90 +BRAMS/i10dbg/bin/cu_read_mod.f90 +BRAMS/i10dbg/bin/cu_update_mod.f90 +BRAMS/i10dbg/bin/cyclic_mod.f90 +BRAMS/i10dbg/bin/date_2_seconds_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs2_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs_mod.f90 +BRAMS/i10dbg/bin/date_add_to_big_mod.f90 +BRAMS/i10dbg/bin/date_add_to_mod.f90 +BRAMS/i10dbg/bin/date_make_big_mod.f90 +BRAMS/i10dbg/bin/date_secs_ymdt_mod.f90 +BRAMS/i10dbg/bin/date_unmake_big_mod.f90 +BRAMS/i10dbg/bin/dateutils.f90 +BRAMS/i10dbg/bin/dealloc_all_mod.f90 +BRAMS/i10dbg/bin/dealloc.f90 +BRAMS/i10dbg/bin/deblank_mod.f90 +BRAMS/i10dbg/bin/define_pbl_height_mod.f90 +BRAMS/i10dbg/bin/detab_mod.f90 +BRAMS/i10dbg/bin/diffsclr_brams31_mod.f90 +BRAMS/i10dbg/bin/diffsclr.f90 +BRAMS/i10dbg/bin/diffuse_brams31_mod.f90 +BRAMS/i10dbg/bin/diffuse.f90 +BRAMS/i10dbg/bin/domain_decomp.f90 +BRAMS/i10dbg/bin/drydep_driver_mod.f90 +BRAMS/i10dbg/bin/dry_dep.f90 +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.f90 +BRAMS/i10dbg/bin/dry_dep_mod.f90 +BRAMS/i10dbg/bin/dry_dep_particles_mod.f90 +BRAMS/i10dbg/bin/dum1_zero_mod.f90 +BRAMS/i10dbg/bin/emfactor_mod.f90 +BRAMS/i10dbg/bin/emissao_mod.f90 +BRAMS/i10dbg/bin/emission_source_map.f90 +BRAMS/i10dbg/bin/error_mess.f90 +BRAMS/i10dbg/bin/extra.f90 +BRAMS/i10dbg/bin/fcorio_mod.f90 +BRAMS/i10dbg/bin/file_inv.f90 +BRAMS/i10dbg/bin/findln_mod.f90 +BRAMS/i10dbg/bin/first_rams.f90 +BRAMS/i10dbg/bin/first_rams_mod.f90 +BRAMS/i10dbg/bin/fmint4_isan_mod.f90 +BRAMS/i10dbg/bin/gaspart.f90 +BRAMS/i10dbg/bin/get_press_mod.f90 +BRAMS/i10dbg/bin/get_zi_mod.f90 +BRAMS/i10dbg/bin/grell_coms.f90 +BRAMS/i10dbg/bin/grid_dims.f90 +BRAMS/i10dbg/bin/grid_struct.f90 +BRAMS/i10dbg/bin/hist_pol_read_mod.f90 +BRAMS/i10dbg/bin/ifirstchar_mod.f90 +BRAMS/i10dbg/bin/init_conc1_mod.f90 +BRAMS/i10dbg/bin/init_conc2_mod.f90 +BRAMS/i10dbg/bin/init_conc_prev_mod.f90 +BRAMS/i10dbg/bin/input_rawi_mod.f90 +BRAMS/i10dbg/bin/input_sfc_mod.f90 +BRAMS/i10dbg/bin/io_params.f90 +BRAMS/i10dbg/bin/isan_comp_dn0_mod.f90 +BRAMS/i10dbg/bin/isan_coms.f90 +BRAMS/i10dbg/bin/isan_driver_mod.f90 +BRAMS/i10dbg/bin/isan_file_inv_mod.f90 +BRAMS/i10dbg/bin/isleap_mod.f90 +BRAMS/i10dbg/bin/isnsig_mod.f90 +BRAMS/i10dbg/bin/isnstage_mod.f90 +BRAMS/i10dbg/bin/julday1000_mod.f90 +BRAMS/i10dbg/bin/julday_mod.f90 +BRAMS/i10dbg/bin/ke_coms.f90 +BRAMS/i10dbg/bin/lastchar_mod.f90 +BRAMS/i10dbg/bin/lastslash_mod.f90 +BRAMS/i10dbg/bin/latset_tracer_mod.f90 +BRAMS/i10dbg/bin/leaf_coms.f90 +BRAMS/i10dbg/bin/le_fontes_mod.f90 +BRAMS/i10dbg/bin/lpuvw_init_mod.f90 +BRAMS/i10dbg/bin/lsl_particles_mod.f90 +BRAMS/i10dbg/bin/makevarf_mod.f90 +BRAMS/i10dbg/bin/maximi_mod.f90 +BRAMS/i10dbg/bin/mem_aerad.f90 +BRAMS/i10dbg/bin/mem_all.f90 +BRAMS/i10dbg/bin/mem_basic.f90 +BRAMS/i10dbg/bin/mem_cuparm.f90 +BRAMS/i10dbg/bin/mem_emiss.f90 +BRAMS/i10dbg/bin/mem_ensemble.f90 +BRAMS/i10dbg/bin/mem_gaspart.f90 +BRAMS/i10dbg/bin/mem_globaer.f90 +BRAMS/i10dbg/bin/mem_globrad.f90 +BRAMS/i10dbg/bin/mem_grell_param2.f90 +BRAMS/i10dbg/bin/mem_grid_dim_defs.f90 +BRAMS/i10dbg/bin/mem_grid.f90 +BRAMS/i10dbg/bin/mem_leaf.f90 +BRAMS/i10dbg/bin/mem_mass.f90 +BRAMS/i10dbg/bin/mem_micro.f90 +BRAMS/i10dbg/bin/mem_mnt_advec.f90 +BRAMS/i10dbg/bin/mem_nestb.f90 +BRAMS/i10dbg/bin/mem_oda.f90 +BRAMS/i10dbg/bin/mem_opt_scratch.f90 +BRAMS/i10dbg/bin/mem_radiate.f90 +BRAMS/i10dbg/bin/mem_scalar.f90 +BRAMS/i10dbg/bin/mem_scratch1_brams.f90 +BRAMS/i10dbg/bin/mem_scratch1_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch.f90 +BRAMS/i10dbg/bin/mem_scratch_grell.f90 +BRAMS/i10dbg/bin/mem_teb_common.f90 +BRAMS/i10dbg/bin/mem_teb.f90 +BRAMS/i10dbg/bin/mem_teb_vars_const.f90 +BRAMS/i10dbg/bin/mem_tend.f90 +BRAMS/i10dbg/bin/mem_turb.f90 +BRAMS/i10dbg/bin/mem_varinit.f90 +BRAMS/i10dbg/bin/micphys.f90 +BRAMS/i10dbg/bin/minimi_mod.f90 +BRAMS/i10dbg/bin/nc_get_press_mod.f90 +BRAMS/i10dbg/bin/nc_pressure_stage_mod.f90 +BRAMS/i10dbg/bin/nc_prfill_mod.f90 +BRAMS/i10dbg/bin/node_mod.f90 +BRAMS/i10dbg/bin/nud_cond_accum_mod.f90 +BRAMS/i10dbg/bin/obanl_mod.f90 +BRAMS/i10dbg/bin/obj_anal_mod.f90 +BRAMS/i10dbg/bin/opspec4_mod.f90 +BRAMS/i10dbg/bin/opspec_mess_mod.f90 +BRAMS/i10dbg/bin/parse_mod.f90 +BRAMS/i10dbg/bin/prebarn_mod.f90 +BRAMS/i10dbg/bin/press_miss_mod.f90 +BRAMS/i10dbg/bin/pressure_stage_mod.f90 +BRAMS/i10dbg/bin/prfill_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_t_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_z_mod.f90 +BRAMS/i10dbg/bin/pr_interp_mod.f90 +BRAMS/i10dbg/bin/pr_miss_fill_mod.f90 +BRAMS/i10dbg/bin/rams_dintsort_mod.f90 +BRAMS/i10dbg/bin/rams_filelist_mod.f90 +BRAMS/i10dbg/bin/rams_fltsort_mod.f90 +BRAMS/i10dbg/bin/rams_intsort_mod.f90 +BRAMS/i10dbg/bin/rams_sort_dint3_mod.f90 +BRAMS/i10dbg/bin/rams_unique_dint_mod.f90 +BRAMS/i10dbg/bin/rconstants.f90 +BRAMS/i10dbg/bin/read_sources_teb_mod.f90 +BRAMS/i10dbg/bin/ref_sounding.f90 +BRAMS/i10dbg/bin/reorganize_sources_teb_mod.f90 +BRAMS/i10dbg/bin/sedim_particles_mod.f90 +BRAMS/i10dbg/bin/setgv_mod.f90 +BRAMS/i10dbg/bin/sfcproc_mod.f90 +BRAMS/i10dbg/bin/sfcqual_mod.f90 +BRAMS/i10dbg/bin/sndproc_mod.f90 +BRAMS/i10dbg/bin/soundtopo_mod.f90 +BRAMS/i10dbg/bin/sources_teb_mod.f90 +BRAMS/i10dbg/bin/stainterp_mod.f90 +BRAMS/i10dbg/bin/staprt_mod.f90 +BRAMS/i10dbg/bin/strmfun_mod.f90 +BRAMS/i10dbg/bin/teb_spm_start.f90 +BRAMS/i10dbg/bin/tendgas_mod.f90 +BRAMS/i10dbg/bin/therm_lib.f90 +BRAMS/i10dbg/bin/tokenize1_mod.f90 +BRAMS/i10dbg/bin/tokenize_mod.f90 +BRAMS/i10dbg/bin/tokfind_mod.f90 +BRAMS/i10dbg/bin/tolower_mod.f90 +BRAMS/i10dbg/bin/varfile_nstfeed_mod.f90 +BRAMS/i10dbg/bin/var_tables.f90 +BRAMS/i10dbg/bin/varuv_mod.f90 +BRAMS/i10dbg/bin/visurf_mod.f90 +BRAMS/i10dbg/bin/vshyd_mod.f90 +BRAMS/i10dbg/bin/abort_run_mod.mod +BRAMS/i10dbg/bin/adap_bldg_mod.mod +BRAMS/i10dbg/bin/advected_mod.mod +BRAMS/i10dbg/bin/alt_dia_mod.mod +BRAMS/i10dbg/bin/an_header.mod +BRAMS/i10dbg/bin/apply_drydep_mod.mod +BRAMS/i10dbg/bin/bn_parm_mod.mod +BRAMS/i10dbg/bin/bn_pass_mod.mod +BRAMS/i10dbg/bin/bn_qual_mod.mod +BRAMS/i10dbg/bin/brams_fail_whale_mod.mod +BRAMS/i10dbg/bin/catt_start.mod +BRAMS/i10dbg/bin/char_strip_var_mod.mod +BRAMS/i10dbg/bin/comp_avgu_mod.mod +BRAMS/i10dbg/bin/comp_avgv_mod.mod +BRAMS/i10dbg/bin/comp_press_mod.mod +BRAMS/i10dbg/bin/comp_rhfrac_mod.mod +BRAMS/i10dbg/bin/cond_file_inv_mod.mod +BRAMS/i10dbg/bin/cond_read_mod.mod +BRAMS/i10dbg/bin/cond_update_mod.mod +BRAMS/i10dbg/bin/consts_coms.mod +BRAMS/i10dbg/bin/conv_coms.mod +BRAMS/i10dbg/bin/convert_to_misture_ratio_teb_mod.mod +BRAMS/i10dbg/bin/corlos_mod.mod +BRAMS/i10dbg/bin/corlsu_mod.mod +BRAMS/i10dbg/bin/corlsv_mod.mod +BRAMS/i10dbg/bin/ctrlvols_mod.mod +BRAMS/i10dbg/bin/cu_file_inv_mod.mod +BRAMS/i10dbg/bin/cuparth_mod.mod +BRAMS/i10dbg/bin/cuparth_shal_mod.mod +BRAMS/i10dbg/bin/cup_dd_aa0_mod.mod +BRAMS/i10dbg/bin/cup_dd_edt_mod.mod +BRAMS/i10dbg/bin/cup_dd_he_mod.mod +BRAMS/i10dbg/bin/cup_dd_moisture_mod.mod +BRAMS/i10dbg/bin/cup_dd_nms_mod.mod +BRAMS/i10dbg/bin/cup_dellabot_mod.mod +BRAMS/i10dbg/bin/cup_dellas_mod.mod +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.mod +BRAMS/i10dbg/bin/cup_direction2_mod.mod +BRAMS/i10dbg/bin/cup_enss_mod.mod +BRAMS/i10dbg/bin/cup_enss_shal_mod.mod +BRAMS/i10dbg/bin/cup_env_clev_mod.mod +BRAMS/i10dbg/bin/cup_env_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_mod.mod +BRAMS/i10dbg/bin/cup_ktop_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_up_aa0_mod.mod +BRAMS/i10dbg/bin/cup_up_he_mod.mod +BRAMS/i10dbg/bin/cup_up_moisture_mod.mod +BRAMS/i10dbg/bin/cup_up_nms_mod.mod +BRAMS/i10dbg/bin/cu_read_mod.mod +BRAMS/i10dbg/bin/cu_update_mod.mod +BRAMS/i10dbg/bin/cyclic_mod.mod +BRAMS/i10dbg/bin/date_2_seconds_mod.mod +BRAMS/i10dbg/bin/date_abs_secs2_mod.mod +BRAMS/i10dbg/bin/date_abs_secs_mod.mod +BRAMS/i10dbg/bin/date_add_to_big_mod.mod +BRAMS/i10dbg/bin/date_add_to_mod.mod +BRAMS/i10dbg/bin/date_make_big_mod.mod +BRAMS/i10dbg/bin/date_secs_ymdt_mod.mod +BRAMS/i10dbg/bin/date_unmake_big_mod.mod +BRAMS/i10dbg/bin/dealloc_all_mod.mod +BRAMS/i10dbg/bin/deblank_mod.mod +BRAMS/i10dbg/bin/define_pbl_height_mod.mod +BRAMS/i10dbg/bin/detab_mod.mod +BRAMS/i10dbg/bin/diffsclr_brams31_mod.mod +BRAMS/i10dbg/bin/diffuse_brams31_mod.mod +BRAMS/i10dbg/bin/dist_gc_mod.mod +BRAMS/i10dbg/bin/domain_decomp.mod +BRAMS/i10dbg/bin/drydep_driver_mod.mod +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.mod +BRAMS/i10dbg/bin/dry_dep_mod.mod +BRAMS/i10dbg/bin/dry_dep_particles_mod.mod +BRAMS/i10dbg/bin/dtedint_mod.mod +BRAMS/i10dbg/bin/dted_mod.mod +BRAMS/i10dbg/bin/dum1_zero_mod.mod +BRAMS/i10dbg/bin/emfactor_mod.mod +BRAMS/i10dbg/bin/emissao_mod.mod +BRAMS/i10dbg/bin/emission_source_map.mod +BRAMS/i10dbg/bin/extras.mod +BRAMS/i10dbg/bin/fcorio_mod.mod +BRAMS/i10dbg/bin/findln_mod.mod +BRAMS/i10dbg/bin/first_rams_mod.mod +BRAMS/i10dbg/bin/fmint4_isan_mod.mod +BRAMS/i10dbg/bin/geodat_mod.mod +BRAMS/i10dbg/bin/get_press_mod.mod +BRAMS/i10dbg/bin/get_zi_mod.mod +BRAMS/i10dbg/bin/grell_cldwork_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_coms.mod +BRAMS/i10dbg/bin/grell_cupar_driver_mod.mod +BRAMS/i10dbg/bin/grell_cupar_initial_mod.mod +BRAMS/i10dbg/bin/grell_cupar_static_driver_mod.mod +BRAMS/i10dbg/bin/grell_draft_area_mod.mod +BRAMS/i10dbg/bin/grell_feedback_driver_mod.mod +BRAMS/i10dbg/bin/grell_find_downdraft_origin_mod.mod +BRAMS/i10dbg/bin/grell_massflx_stats_mod.mod +BRAMS/i10dbg/bin/grell_most_thermo_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_nms_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_sanity_check_mod.mod +BRAMS/i10dbg/bin/grell_sanity_thil2tqall_mod.mod +BRAMS/i10dbg/bin/grell_theiv_downdraft_mod.mod +BRAMS/i10dbg/bin/grid_dims.mod +BRAMS/i10dbg/bin/grid_struct.mod +BRAMS/i10dbg/bin/hist_pol_read_mod.mod +BRAMS/i10dbg/bin/ifirstchar_mod.mod +BRAMS/i10dbg/bin/init_conc1_mod.mod +BRAMS/i10dbg/bin/init_conc2_mod.mod +BRAMS/i10dbg/bin/init_conc_prev_mod.mod +BRAMS/i10dbg/bin/initial_grid_grell_mod.mod +BRAMS/i10dbg/bin/initial_tend_grell_mod.mod +BRAMS/i10dbg/bin/initial_thermo_grell_mod.mod +BRAMS/i10dbg/bin/initial_winds_grell_mod.mod +BRAMS/i10dbg/bin/input_rawi_mod.mod +BRAMS/i10dbg/bin/input_sfc_mod.mod +BRAMS/i10dbg/bin/io_params.mod +BRAMS/i10dbg/bin/isan_comp_dn0_mod.mod +BRAMS/i10dbg/bin/isan_coms.mod +BRAMS/i10dbg/bin/isan_driver_mod.mod +BRAMS/i10dbg/bin/isan_file_inv_mod.mod +BRAMS/i10dbg/bin/isleap_mod.mod +BRAMS/i10dbg/bin/isnsig_mod.mod +BRAMS/i10dbg/bin/isnstage_mod.mod +BRAMS/i10dbg/bin/julday1000_mod.mod +BRAMS/i10dbg/bin/julday_mod.mod +BRAMS/i10dbg/bin/ke_coms.mod +BRAMS/i10dbg/bin/lastchar_mod.mod +BRAMS/i10dbg/bin/lastslash_mod.mod +BRAMS/i10dbg/bin/latset_tracer_mod.mod +BRAMS/i10dbg/bin/leaf_coms.mod +BRAMS/i10dbg/bin/le_fontes_mod.mod +BRAMS/i10dbg/bin/lpuvw_init_mod.mod +BRAMS/i10dbg/bin/lsl_particles_mod.mod +BRAMS/i10dbg/bin/makevarf_mod.mod +BRAMS/i10dbg/bin/maximi_mod.mod +BRAMS/i10dbg/bin/mem_aerad.mod +BRAMS/i10dbg/bin/mem_all.mod +BRAMS/i10dbg/bin/mem_basic.mod +BRAMS/i10dbg/bin/mem_cuparm.mod +BRAMS/i10dbg/bin/mem_emiss.mod +BRAMS/i10dbg/bin/mem_ensemble.mod +BRAMS/i10dbg/bin/mem_gaspart.mod +BRAMS/i10dbg/bin/mem_globaer.mod +BRAMS/i10dbg/bin/mem_globrad.mod +BRAMS/i10dbg/bin/mem_grell_param.mod +BRAMS/i10dbg/bin/mem_grid_dim_defs.mod +BRAMS/i10dbg/bin/mem_grid.mod +BRAMS/i10dbg/bin/mem_leaf.mod +BRAMS/i10dbg/bin/mem_mass.mod +BRAMS/i10dbg/bin/mem_micro.mod +BRAMS/i10dbg/bin/mem_mnt_advec.mod +BRAMS/i10dbg/bin/mem_nestb.mod +BRAMS/i10dbg/bin/mem_oda.mod +BRAMS/i10dbg/bin/mem_opt.mod +BRAMS/i10dbg/bin/mem_radiate.mod +BRAMS/i10dbg/bin/mem_scalar.mod +BRAMS/i10dbg/bin/mem_scratch1_grell.mod +BRAMS/i10dbg/bin/mem_scratch1.mod +BRAMS/i10dbg/bin/mem_scratch2_grell.mod +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch3_grell.mod +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch_grell.mod +BRAMS/i10dbg/bin/mem_scratch.mod +BRAMS/i10dbg/bin/mem_teb_common.mod +BRAMS/i10dbg/bin/mem_teb.mod +BRAMS/i10dbg/bin/mem_tend.mod +BRAMS/i10dbg/bin/mem_turb.mod +BRAMS/i10dbg/bin/mem_varinit.mod +BRAMS/i10dbg/bin/micphys.mod +BRAMS/i10dbg/bin/minimi_mod.mod +BRAMS/i10dbg/bin/nc_get_press_mod.mod +BRAMS/i10dbg/bin/nc_pressure_stage_mod.mod +BRAMS/i10dbg/bin/nc_prfill_mod.mod +BRAMS/i10dbg/bin/node_mod.mod +BRAMS/i10dbg/bin/nud_cond_accum_mod.mod +BRAMS/i10dbg/bin/obanl_mod.mod +BRAMS/i10dbg/bin/obj_anal_mod.mod +BRAMS/i10dbg/bin/opspec4_mod.mod +BRAMS/i10dbg/bin/opspec_mess_mod.mod +BRAMS/i10dbg/bin/parse_mod.mod +BRAMS/i10dbg/bin/prebarn_mod.mod +BRAMS/i10dbg/bin/press_miss_mod.mod +BRAMS/i10dbg/bin/pressure_stage_mod.mod +BRAMS/i10dbg/bin/prfill_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_t_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_z_mod.mod +BRAMS/i10dbg/bin/pr_interp_mod.mod +BRAMS/i10dbg/bin/pr_miss_fill_mod.mod +BRAMS/i10dbg/bin/rams_dintsort_mod.mod +BRAMS/i10dbg/bin/rams_filelist_mod.mod +BRAMS/i10dbg/bin/rams_fltsort_mod.mod +BRAMS/i10dbg/bin/rams_getvar_mod.mod +BRAMS/i10dbg/bin/rams_intsort_mod.mod +BRAMS/i10dbg/bin/rams_sort_dint3_mod.mod +BRAMS/i10dbg/bin/rams_unique_dint_mod.mod +BRAMS/i10dbg/bin/rconstants.mod +BRAMS/i10dbg/bin/read_sources_teb_mod.mod +BRAMS/i10dbg/bin/ref_sounding.mod +BRAMS/i10dbg/bin/reorganize_sources_teb_mod.mod +BRAMS/i10dbg/bin/sedim_particles_mod.mod +BRAMS/i10dbg/bin/setgv_mod.mod +BRAMS/i10dbg/bin/sfcopqr_mod.mod +BRAMS/i10dbg/bin/sfcproc_mod.mod +BRAMS/i10dbg/bin/sfcqual_mod.mod +BRAMS/i10dbg/bin/sndproc_mod.mod +BRAMS/i10dbg/bin/soundtopo_mod.mod +BRAMS/i10dbg/bin/sources_teb_mod.mod +BRAMS/i10dbg/bin/stainterp_mod.mod +BRAMS/i10dbg/bin/staprt_mod.mod +BRAMS/i10dbg/bin/strmfun_mod.mod +BRAMS/i10dbg/bin/teb_spm_start.mod +BRAMS/i10dbg/bin/teb_vars_const.mod +BRAMS/i10dbg/bin/tendgas_mod.mod +BRAMS/i10dbg/bin/therm_lib.mod +BRAMS/i10dbg/bin/tokenize1_mod.mod +BRAMS/i10dbg/bin/tokenize_mod.mod +BRAMS/i10dbg/bin/tokfind_mod.mod +BRAMS/i10dbg/bin/tolower_mod.mod +BRAMS/i10dbg/bin/topoq_mod.mod +BRAMS/i10dbg/bin/varfile_nstfeed_mod.mod +BRAMS/i10dbg/bin/var_tables.mod +BRAMS/i10dbg/bin/varuv_mod.mod +BRAMS/i10dbg/bin/visurf_mod.mod +BRAMS/i10dbg/bin/vshyd_mod.mod +BRAMS/i10dbg/bin/zoq_mod.mod +BRAMS/i10dbg/bin/a3e0_mod.f90 +BRAMS/i10dbg/bin/a3e1_mod.f90 +BRAMS/i10dbg/bin/a3e2_mod.f90 +BRAMS/i10dbg/bin/abort_run_mod.f90 +BRAMS/i10dbg/bin/acctimes_mod.f90 +BRAMS/i10dbg/bin/accum_mod.f90 +BRAMS/i10dbg/bin/acnst_mod.f90 +BRAMS/i10dbg/bin/acoust_adap_mod.f90 +BRAMS/i10dbg/bin/acoustic_new_mod.f90 +BRAMS/i10dbg/bin/acoust_new_mod.f90 +BRAMS/i10dbg/bin/adap_bldg_mod.f90 +BRAMS/i10dbg/bin/adap_init.f90 +BRAMS/i10dbg/bin/adivb_mod.f90 +BRAMS/i10dbg/bin/adj1_mod.f90 +BRAMS/i10dbg/bin/adjust_sfcw_properties_mod.f90 +BRAMS/i10dbg/bin/adjust_topsoil_properties_mod.f90 +BRAMS/i10dbg/bin/adjust_veg_properties_mod.f90 +BRAMS/i10dbg/bin/advectc_mod.f90 +BRAMS/i10dbg/bin/advected_mod.f90 +BRAMS/i10dbg/bin/advect_sca_mod.f90 +BRAMS/i10dbg/bin/advect_theta_mod.f90 +BRAMS/i10dbg/bin/advect_vec_mod.f90 +BRAMS/i10dbg/bin/advtndc_adap_mod.f90 +BRAMS/i10dbg/bin/advtndc_mod.f90 +BRAMS/i10dbg/bin/advtndc_plumerise_mod.f90 +BRAMS/i10dbg/bin/ae0_mod.f90 +BRAMS/i10dbg/bin/ae1m1_mod.f90 +BRAMS/i10dbg/bin/ae1_mod.f90 +BRAMS/i10dbg/bin/ae1p1_mod.f90 +BRAMS/i10dbg/bin/ae1p1p1_mod.f90 +BRAMS/i10dbg/bin/ae1t0_mod.f90 +BRAMS/i10dbg/bin/ae1t0p1_mod.f90 +BRAMS/i10dbg/bin/ae1t1_mod.f90 +BRAMS/i10dbg/bin/ae1t1p1_mod.f90 +BRAMS/i10dbg/bin/ae1tn1_mod.f90 +BRAMS/i10dbg/bin/ae2_mod.f90 +BRAMS/i10dbg/bin/ae3m3d0_mod.f90 +BRAMS/i10dbg/bin/ae3m3_mod.f90 +BRAMS/i10dbg/bin/ae3_mod.f90 +BRAMS/i10dbg/bin/ae3p3_mod.f90 +BRAMS/i10dbg/bin/ae3t0p3_mod.f90 +BRAMS/i10dbg/bin/ae3t3_mod.f90 +BRAMS/i10dbg/bin/ae3t3p3_mod.f90 +BRAMS/i10dbg/bin/aen1_mod.f90 +BRAMS/i10dbg/bin/aen3t0p3_mod.f90 +BRAMS/i10dbg/bin/akscal_init_mod.f90 +BRAMS/i10dbg/bin/alebl_mod.f90 +BRAMS/i10dbg/bin/alloc_edcp_driver_mod.f90 +BRAMS/i10dbg/bin/allometry.f90 +BRAMS/i10dbg/bin/alt_dia_mod.f90 +BRAMS/i10dbg/bin/altera_dia.f90 +BRAMS/i10dbg/bin/aminmax_mod.f90 +BRAMS/i10dbg/bin/angle_of_incid_mod.f90 +BRAMS/i10dbg/bin/an_header.f90 +BRAMS/i10dbg/bin/anlavg_mod.f90 +BRAMS/i10dbg/bin/anlhdf_mod.f90 +BRAMS/i10dbg/bin/anlwrt_mod.f90 +BRAMS/i10dbg/bin/aobj.f90 +BRAMS/i10dbg/bin/aone_mod.f90 +BRAMS/i10dbg/bin/api_prlatlon_mod.f90 +BRAMS/i10dbg/bin/apply_cloud_forcing_mod.f90 +BRAMS/i10dbg/bin/apply_drydep_mod.f90 +BRAMS/i10dbg/bin/apply_forestry_mod.f90 +BRAMS/i10dbg/bin/arinam_mod.f90 +BRAMS/i10dbg/bin/array2xcol_mod.f90 +BRAMS/i10dbg/bin/array2ycol_mod.f90 +BRAMS/i10dbg/bin/array2zcol_mod.f90 +BRAMS/i10dbg/bin/arrsnd_mod.f90 +BRAMS/i10dbg/bin/arscam_mod.f90 +BRAMS/i10dbg/bin/asgen.f90 +BRAMS/i10dbg/bin/assign_prescribed_phen_mod.f90 +BRAMS/i10dbg/bin/asti2.f90 +BRAMS/i10dbg/bin/asti.f90 +BRAMS/i10dbg/bin/astp.f90 +BRAMS/i10dbg/bin/atimb_mod.f90 +BRAMS/i10dbg/bin/atob_log_mod.f90 +BRAMS/i10dbg/bin/atob_mod.f90 +BRAMS/i10dbg/bin/auto_accret_mod.f90 +BRAMS/i10dbg/bin/avarf.f90 +BRAMS/i10dbg/bin/average_mod.f90 +BRAMS/i10dbg/bin/average_utils.f90 +BRAMS/i10dbg/bin/avg_ed_daily_output_pool_mod.f90 +BRAMS/i10dbg/bin/avgvel_mod.f90 +BRAMS/i10dbg/bin/avint_mod.f90 +BRAMS/i10dbg/bin/awtcmp_mod.f90 +BRAMS/i10dbg/bin/azero_mod.f90 +BRAMS/i10dbg/bin/banbks_mod.f90 +BRAMS/i10dbg/bin/bandec_mod.f90 +BRAMS/i10dbg/bin/bdf2_solver.f90 +BRAMS/i10dbg/bin/bdf2_solver_mod.f90 +BRAMS/i10dbg/bin/binom_mod.f90 +BRAMS/i10dbg/bin/bld_e_budget_mod.f90 +BRAMS/i10dbg/bin/bn_parm_mod.f90 +BRAMS/i10dbg/bin/bn_pass_mod.f90 +BRAMS/i10dbg/bin/bn_qual_mod.f90 +BRAMS/i10dbg/bin/botset_adap_mod.f90 +BRAMS/i10dbg/bin/botset_mod.f90 +BRAMS/i10dbg/bin/boyanc_mod.f90 +BRAMS/i10dbg/bin/brams_fail_whale_mod.f90 +BRAMS/i10dbg/bin/bruvais_mod.f90 +BRAMS/i10dbg/bin/bubble_mod.f90 +BRAMS/i10dbg/bin/budget_utils.f90 +BRAMS/i10dbg/bin/buoyancy_acc_mod.f90 +BRAMS/i10dbg/bin/buoyancy_mod.f90 +BRAMS/i10dbg/bin/buoyancy_plumerise_mod.f90 +BRAMS/i10dbg/bin/c34constants.f90 +BRAMS/i10dbg/bin/calc_flow_routing_mod.f90 +BRAMS/i10dbg/bin/calchydrosubsurface_mod.f90 +BRAMS/i10dbg/bin/calchydrosurface_mod.f90 +BRAMS/i10dbg/bin/calc_met_lapse_mod.f90 +BRAMS/i10dbg/bin/calcwatertable_mod.f90 +BRAMS/i10dbg/bin/canopy_air_coms.f90 +BRAMS/i10dbg/bin/canopy_derivs_two_mod.f90 +BRAMS/i10dbg/bin/canopy_photosynthesis_mod.f90 +BRAMS/i10dbg/bin/canopy_radiation_coms.f90 +BRAMS/i10dbg/bin/canopy_struct_dynamics.f90 +BRAMS/i10dbg/bin/catt_start.f90 +BRAMS/i10dbg/bin/cbrt8_mod.f90 +BRAMS/i10dbg/bin/cbrt_mod.f90 +BRAMS/i10dbg/bin/cdf2normal_mod.f90 +BRAMS/i10dbg/bin/cdf_mod.f90 +BRAMS/i10dbg/bin/cfact_mod.f90 +BRAMS/i10dbg/bin/cfll_mod.f90 +BRAMS/i10dbg/bin/cfl_mod.f90 +BRAMS/i10dbg/bin/cfux_mod.f90 +BRAMS/i10dbg/bin/cfuy_mod.f90 +BRAMS/i10dbg/bin/char_strip_var_mod.f90 +BRAMS/i10dbg/bin/charutils.f90 +BRAMS/i10dbg/bin/check_real_mod.f90 +BRAMS/i10dbg/bin/check_rescale_mod.f90 +BRAMS/i10dbg/bin/chemistry_mod.f90 +BRAMS/i10dbg/bin/chkcyc_mod.f90 +BRAMS/i10dbg/bin/cio_c_mod.f90 +BRAMS/i10dbg/bin/cio_c_sca_mod.f90 +BRAMS/i10dbg/bin/cio_f8_mod.f90 +BRAMS/i10dbg/bin/cio_f8_sca_mod.f90 +BRAMS/i10dbg/bin/cio_f_mod.f90 +BRAMS/i10dbg/bin/cio_f_sca_mod.f90 +BRAMS/i10dbg/bin/cio_i_mod.f90 +BRAMS/i10dbg/bin/cio_i_sca_mod.f90 +BRAMS/i10dbg/bin/cio_pos_file_mod.f90 +BRAMS/i10dbg/bin/cldnuc_mod.f90 +BRAMS/i10dbg/bin/clgen_mod.f90 +BRAMS/i10dbg/bin/cloud_opt_mod.f90 +BRAMS/i10dbg/bin/cloudprep_rad_mod.f90 +BRAMS/i10dbg/bin/cloud_sketch_mod.f90 +BRAMS/i10dbg/bin/clsgks_mod.f90 +BRAMS/i10dbg/bin/cl_top_mod.f90 +BRAMS/i10dbg/bin/coarse2fine_driver_mod.f90 +BRAMS/i10dbg/bin/coarse2fine_mod.f90 +BRAMS/i10dbg/bin/coefz_adap_mod.f90 +BRAMS/i10dbg/bin/coefz_mod.f90 +BRAMS/i10dbg/bin/cofnest_mod.f90 +BRAMS/i10dbg/bin/col1_mod.f90 +BRAMS/i10dbg/bin/col2_mod.f90 +BRAMS/i10dbg/bin/col3344_mod.f90 +BRAMS/i10dbg/bin/col3443_mod.f90 +BRAMS/i10dbg/bin/col3_mod.f90 +BRAMS/i10dbg/bin/cols_mod.f90 +BRAMS/i10dbg/bin/colxfers_mod.f90 +BRAMS/i10dbg/bin/commio_mod.f90 +BRAMS/i10dbg/bin/comm_time_mod.f90 +BRAMS/i10dbg/bin/comm_time_new_mod.f90 +BRAMS/i10dbg/bin/comp_avgu_mod.f90 +BRAMS/i10dbg/bin/comp_avgv_mod.f90 +BRAMS/i10dbg/bin/comp_press_mod.f90 +BRAMS/i10dbg/bin/comp_rhfrac_mod.f90 +BRAMS/i10dbg/bin/compute_budget_mod.f90 +BRAMS/i10dbg/bin/compute_c_and_n_storage_mod.f90 +BRAMS/i10dbg/bin/compute_co2_storage_mod.f90 +BRAMS/i10dbg/bin/compute_energy_storage_mod.f90 +BRAMS/i10dbg/bin/compute_mass_flux_mod.f90 +BRAMS/i10dbg/bin/compute_netrad_mod.f90 +BRAMS/i10dbg/bin/compute_water_storage_mod.f90 +BRAMS/i10dbg/bin/cond_file_inv_mod.f90 +BRAMS/i10dbg/bin/cond_read.f90 +BRAMS/i10dbg/bin/cond_read_mod.f90 +BRAMS/i10dbg/bin/cond_update.f90 +BRAMS/i10dbg/bin/cond_update_mod.f90 +BRAMS/i10dbg/bin/conpar_mod.f90 +BRAMS/i10dbg/bin/conrec_mod.f90 +BRAMS/i10dbg/bin/contnuc_mod.f90 +BRAMS/i10dbg/bin/conv_coms.f90 +BRAMS/i10dbg/bin/convert_mod.f90 +BRAMS/i10dbg/bin/convert_to_misture_ratio_teb_mod.f90 +BRAMS/i10dbg/bin/conv_ppm_rm_mod.f90 +BRAMS/i10dbg/bin/copy_atm2lsm_mod.f90 +BRAMS/i10dbg/bin/copy_avgvars_to_leaf_mod.f90 +BRAMS/i10dbg/bin/copyback_mod.f90 +BRAMS/i10dbg/bin/copy_bdf2_prev_mod.f90 +BRAMS/i10dbg/bin/copy_fb_patch_mod.f90 +BRAMS/i10dbg/bin/copy_fluxes_future_2_past_mod.f90 +BRAMS/i10dbg/bin/copy_fluxes_lsm2atm_mod.f90 +BRAMS/i10dbg/bin/copy_in_bramsmpi_mod.f90 +BRAMS/i10dbg/bin/copy_in_bramsnl_mod.f90 +BRAMS/i10dbg/bin/copy_initp2prev_mod.f90 +BRAMS/i10dbg/bin/copy_lake_brams_mod.f90 +BRAMS/i10dbg/bin/copy_lake_init_mod.f90 +BRAMS/i10dbg/bin/copy_met_2_lake_mod.f90 +BRAMS/i10dbg/bin/copy_met_2_rk4site_mod.f90 +BRAMS/i10dbg/bin/copy_patch_init_carbon_mod.f90 +BRAMS/i10dbg/bin/copy_patch_init_mod.f90 +BRAMS/i10dbg/bin/copy_path_from_grid_1_mod.f90 +BRAMS/i10dbg/bin/copy_prev2patch_mod.f90 +BRAMS/i10dbg/bin/copy_rk4_patch_mod.f90 +BRAMS/i10dbg/bin/coriolis.f90 +BRAMS/i10dbg/bin/corlos_mod.f90 +BRAMS/i10dbg/bin/corlsu_mod.f90 +BRAMS/i10dbg/bin/corlsv_mod.f90 +BRAMS/i10dbg/bin/count_pft_xml_config_mod.f90 +BRAMS/i10dbg/bin/cp2mod_mod.f90 +BRAMS/i10dbg/bin/cpclam_mod.f90 +BRAMS/i10dbg/bin/cpcldr_mod.f90 +BRAMS/i10dbg/bin/cpcnrc_mod.f90 +BRAMS/i10dbg/bin/cpezct_mod.f90 +BRAMS/i10dbg/bin/cpgeti_mod.f90 +BRAMS/i10dbg/bin/cpgetr_mod.f90 +BRAMS/i10dbg/bin/cplbdr_mod.f90 +BRAMS/i10dbg/bin/cppkcl_mod.f90 +BRAMS/i10dbg/bin/cprect_mod.f90 +BRAMS/i10dbg/bin/cpsetc_mod.f90 +BRAMS/i10dbg/bin/cpseti_mod.f90 +BRAMS/i10dbg/bin/cpsetr_mod.f90 +BRAMS/i10dbg/bin/cputime_mod.f90 +BRAMS/i10dbg/bin/create_ed10_ed20_fname_mod.f90 +BRAMS/i10dbg/bin/csband_mod.f90 +BRAMS/i10dbg/bin/cscalei_mod.f90 +BRAMS/i10dbg/bin/cscale_mod.f90 +BRAMS/i10dbg/bin/ctrlvols_mod.f90 +BRAMS/i10dbg/bin/cu_environ_mod.f90 +BRAMS/i10dbg/bin/cu_file_inv_mod.f90 +BRAMS/i10dbg/bin/cu_inv_tend_mod.f90 +BRAMS/i10dbg/bin/cumsum_mod.f90 +BRAMS/i10dbg/bin/cumulus_time_mod.f90 +BRAMS/i10dbg/bin/cuparth_mod.f90 +BRAMS/i10dbg/bin/cuparth_shal_mod.f90 +BRAMS/i10dbg/bin/cup_dd_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_dd_edt_mod.f90 +BRAMS/i10dbg/bin/cup_dd_he_mod.f90 +BRAMS/i10dbg/bin/cup_dd_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_dd_nms_mod.f90 +BRAMS/i10dbg/bin/cup_dellabot_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_mod.f90 +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.f90 +BRAMS/i10dbg/bin/cup_direction2_mod.f90 +BRAMS/i10dbg/bin/cup_dn.f90 +BRAMS/i10dbg/bin/cup_enss_mod.f90 +BRAMS/i10dbg/bin/cup_enss_shal_mod.f90 +BRAMS/i10dbg/bin/cup_env_clev_mod.f90 +BRAMS/i10dbg/bin/cup_env.f90 +BRAMS/i10dbg/bin/cup_env_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.f90 +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_grell2.f90 +BRAMS/i10dbg/bin/cup_grell2_shcu.f90 +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.f90 +BRAMS/i10dbg/bin/cup_kbcon_mod.f90 +BRAMS/i10dbg/bin/cup_ktop_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_mod.f90 +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.f90 +BRAMS/i10dbg/bin/cup_up_aa0_mod.f90 +BRAMS/i10dbg/bin/cup_up.f90 +BRAMS/i10dbg/bin/cup_up_he_mod.f90 +BRAMS/i10dbg/bin/cup_up_moisture_mod.f90 +BRAMS/i10dbg/bin/cup_up_nms_mod.f90 +BRAMS/i10dbg/bin/cu_read.f90 +BRAMS/i10dbg/bin/cu_read_mod.f90 +BRAMS/i10dbg/bin/curved_mod.f90 +BRAMS/i10dbg/bin/curve_mod.f90 +BRAMS/i10dbg/bin/cu_update_mod.f90 +BRAMS/i10dbg/bin/cvmgm_mod.f90 +BRAMS/i10dbg/bin/cvmgn_mod.f90 +BRAMS/i10dbg/bin/cvmgp_mod.f90 +BRAMS/i10dbg/bin/cvmgz_mod.f90 +BRAMS/i10dbg/bin/cyclic_mod.f90 +BRAMS/i10dbg/bin/cyclic_set_mod.f90 +BRAMS/i10dbg/bin/damp_grav_wave_mod.f90 +BRAMS/i10dbg/bin/dashdb_mod.f90 +BRAMS/i10dbg/bin/dashdc_mod.f90 +BRAMS/i10dbg/bin/datassim_mod.f90 +BRAMS/i10dbg/bin/date_2_seconds_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs2_mod.f90 +BRAMS/i10dbg/bin/date_abs_secs_mod.f90 +BRAMS/i10dbg/bin/date_add_to_big_mod.f90 +BRAMS/i10dbg/bin/date_add_to_mod.f90 +BRAMS/i10dbg/bin/date_make_big_mod.f90 +BRAMS/i10dbg/bin/date_secs_ymdt_mod.f90 +BRAMS/i10dbg/bin/date_unmake_big_mod.f90 +BRAMS/i10dbg/bin/dateutils.f90 +BRAMS/i10dbg/bin/dble2sngl_mod.f90 +BRAMS/i10dbg/bin/dcvmgm_mod.f90 +BRAMS/i10dbg/bin/dcvmgp_mod.f90 +BRAMS/i10dbg/bin/dcw_swap16_mod.f90 +BRAMS/i10dbg/bin/dcw_swap32_mod.f90 +BRAMS/i10dbg/bin/dcw_swap64_mod.f90 +BRAMS/i10dbg/bin/ddens_dt_effect_mod.f90 +BRAMS/i10dbg/bin/dealloc_all_mod.f90 +BRAMS/i10dbg/bin/dealloc.f90 +BRAMS/i10dbg/bin/deblank_mod.f90 +BRAMS/i10dbg/bin/decomp_coms.f90 +BRAMS/i10dbg/bin/decomp_plot_mod.f90 +BRAMS/i10dbg/bin/define_pbl_height_mod.f90 +BRAMS/i10dbg/bin/detab_mod.f90 +BRAMS/i10dbg/bin/detailed_coms.f90 +BRAMS/i10dbg/bin/diagon_mod.f90 +BRAMS/i10dbg/bin/diffprep_mod.f90 +BRAMS/i10dbg/bin/diffsclr_adap_mod.f90 +BRAMS/i10dbg/bin/diffsclr_brams31_mod.f90 +BRAMS/i10dbg/bin/diffsclr.f90 +BRAMS/i10dbg/bin/diffsclr_mod.f90 +BRAMS/i10dbg/bin/diffuse_brams31_mod.f90 +BRAMS/i10dbg/bin/diffuse.f90 +BRAMS/i10dbg/bin/diffuse_mod.f90 +BRAMS/i10dbg/bin/diffvel_adap_mod.f90 +BRAMS/i10dbg/bin/diffvel_mod.f90 +BRAMS/i10dbg/bin/dist_gc_mod.f90 +BRAMS/i10dbg/bin/disturbance.f90 +BRAMS/i10dbg/bin/disturb_coms.f90 +BRAMS/i10dbg/bin/divcart_mod.f90 +BRAMS/i10dbg/bin/divstar_mod.f90 +BRAMS/i10dbg/bin/dmax2_mod.f90 +BRAMS/i10dbg/bin/dmin2_mod.f90 +BRAMS/i10dbg/bin/dnswt2_mod.f90 +BRAMS/i10dbg/bin/domain_decomp.f90 +BRAMS/i10dbg/bin/dpstable_mod.f90 +BRAMS/i10dbg/bin/drwstr_mod.f90 +BRAMS/i10dbg/bin/drydep_driver_mod.f90 +BRAMS/i10dbg/bin/dry_dep.f90 +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.f90 +BRAMS/i10dbg/bin/dry_dep_mod.f90 +BRAMS/i10dbg/bin/dry_dep_particles_mod.f90 +BRAMS/i10dbg/bin/drythrm_mod.f90 +BRAMS/i10dbg/bin/dssum_mod.f90 +BRAMS/i10dbg/bin/dtedint_mod.f90 +BRAMS/i10dbg/bin/dted_mod.f90 +BRAMS/i10dbg/bin/dum1_zero_mod.f90 +BRAMS/i10dbg/bin/dump_domain_decomposition_mod.f90 +BRAMS/i10dbg/bin/dump_dtset_mod.f90 +BRAMS/i10dbg/bin/dump_modsched_mod.f90 +BRAMS/i10dbg/bin/dump_radinfo_mod.f90 +BRAMS/i10dbg/bin/dumset_mod.f90 +BRAMS/i10dbg/bin/each_call_mod.f90 +BRAMS/i10dbg/bin/each_column_mod.f90 +BRAMS/i10dbg/bin/ed1_fileinfo_mod.f90 +BRAMS/i10dbg/bin/ed21_fileinfo_mod.f90 +BRAMS/i10dbg/bin/ed_bigleaf_init.f90 +BRAMS/i10dbg/bin/ed_bigleaf_init_mod.f90 +BRAMS/i10dbg/bin/ed_coup_driver_mod.f90 +BRAMS/i10dbg/bin/ed_coup_model_mod.f90 +BRAMS/i10dbg/bin/edcp_driver.f90 +BRAMS/i10dbg/bin/edcp_get_work_mod.f90 +BRAMS/i10dbg/bin/edcp_init.f90 +BRAMS/i10dbg/bin/edcp_lake_driver.f90 +BRAMS/i10dbg/bin/edcp_lake_misc.f90 +BRAMS/i10dbg/bin/edcp_lake_stepper.f90 +BRAMS/i10dbg/bin/edcp_load_namelist.f90 +BRAMS/i10dbg/bin/edcp_met.f90 +BRAMS/i10dbg/bin/edcp_met_init.f90 +BRAMS/i10dbg/bin/edcp_model.f90 +BRAMS/i10dbg/bin/edcp_mpiutils.f90 +BRAMS/i10dbg/bin/edcp_nodebounds_self_mod.f90 +BRAMS/i10dbg/bin/edcp_para_init.f90 +BRAMS/i10dbg/bin/edcp_parvec_work_mod.f90 +BRAMS/i10dbg/bin/ed_datp_datq_mod.f90 +BRAMS/i10dbg/bin/ed_datp_datsoil_mod.f90 +BRAMS/i10dbg/bin/ed_filelist_mod.f90 +BRAMS/i10dbg/bin/ed_grid.f90 +BRAMS/i10dbg/bin/ed_gridset_mod.f90 +BRAMS/i10dbg/bin/ed_init_atm_mod.f90 +BRAMS/i10dbg/bin/ed_init.f90 +BRAMS/i10dbg/bin/ed_init_radiation_mod.f90 +BRAMS/i10dbg/bin/edio.f90 +BRAMS/i10dbg/bin/ed_ll_xy_mod.f90 +BRAMS/i10dbg/bin/ed_mem_grid_dim_defs.f90 +BRAMS/i10dbg/bin/ed_misc_coms.f90 +BRAMS/i10dbg/bin/ed_nbg_init.f90 +BRAMS/i10dbg/bin/ed_newgrid_mod.f90 +BRAMS/i10dbg/bin/ed_node_coms.f90 +BRAMS/i10dbg/bin/ed_opspec_grid_mod.f90 +BRAMS/i10dbg/bin/ed_opspec_misc_mod.f90 +BRAMS/i10dbg/bin/ed_opspec_par_mod.f90 +BRAMS/i10dbg/bin/ed_opspec_times_mod.f90 +BRAMS/i10dbg/bin/ed_output_mod.f90 +BRAMS/i10dbg/bin/ed_para_coms.f90 +BRAMS/i10dbg/bin/ed_params.f90 +BRAMS/i10dbg/bin/ed_polarst_mod.f90 +BRAMS/i10dbg/bin/ed_print.f90 +BRAMS/i10dbg/bin/ed_read_ed10_20_history.f90 +BRAMS/i10dbg/bin/ed_state_vars.f90 +BRAMS/i10dbg/bin/ed_therm_lib.f90 +BRAMS/i10dbg/bin/ed_timestep_mod.f90 +BRAMS/i10dbg/bin/ed_type_init.f90 +BRAMS/i10dbg/bin/ed_var_tables.f90 +BRAMS/i10dbg/bin/ed_work_vars.f90 +BRAMS/i10dbg/bin/ed_xml_config.f90 +BRAMS/i10dbg/bin/ed_xy_ll_mod.f90 +BRAMS/i10dbg/bin/ed_zen_mod.f90 +BRAMS/i10dbg/bin/effxy_mod.f90 +BRAMS/i10dbg/bin/eifun8_mod.f90 +BRAMS/i10dbg/bin/eintp_mod.f90 +BRAMS/i10dbg/bin/elgs_mod.f90 +BRAMS/i10dbg/bin/emfactor_mod.f90 +BRAMS/i10dbg/bin/emissao_mod.f90 +BRAMS/i10dbg/bin/emission_source_map.f90 +BRAMS/i10dbg/bin/ename_coms.f90 +BRAMS/i10dbg/bin/encd_mod.f90 +BRAMS/i10dbg/bin/endian_mod.f90 +BRAMS/i10dbg/bin/enemb_mod.f90 +BRAMS/i10dbg/bin/eng_params_mod.f90 +BRAMS/i10dbg/bin/entrainment_mod.f90 +BRAMS/i10dbg/bin/errorfun_mod.f90 +BRAMS/i10dbg/bin/error_mess.f90 +BRAMS/i10dbg/bin/esat_l_mod.f90 +BRAMS/i10dbg/bin/esat_pr_mod.f90 +BRAMS/i10dbg/bin/euler_driver.f90 +BRAMS/i10dbg/bin/euler_integ_mod.f90 +BRAMS/i10dbg/bin/euler_timestep_mod.f90 +BRAMS/i10dbg/bin/evaporate_mod.f90 +BRAMS/i10dbg/bin/event_fertilize_mod.f90 +BRAMS/i10dbg/bin/event_fire_mod.f90 +BRAMS/i10dbg/bin/event_harvest_mod.f90 +BRAMS/i10dbg/bin/event_irrigate_mod.f90 +BRAMS/i10dbg/bin/event_planting_mod.f90 +BRAMS/i10dbg/bin/events.f90 +BRAMS/i10dbg/bin/event_till_mod.f90 +BRAMS/i10dbg/bin/ex_adv_buff_mod.f90 +BRAMS/i10dbg/bin/exadvlf_mod.f90 +BRAMS/i10dbg/bin/excondiv_mod.f90 +BRAMS/i10dbg/bin/ex_cyc_buff_mod.f90 +BRAMS/i10dbg/bin/exevolve_mod.f90 +BRAMS/i10dbg/bin/ex_full_buff_mod.f90 +BRAMS/i10dbg/bin/exhtend_ad_mod.f90 +BRAMS/i10dbg/bin/exhtend_st_mod.f90 +BRAMS/i10dbg/bin/ex_lbc_buff_mod.f90 +BRAMS/i10dbg/bin/expected_mod.f90 +BRAMS/i10dbg/bin/expmsq_mod.f90 +BRAMS/i10dbg/bin/ex_st_buff_mod.f90 +BRAMS/i10dbg/bin/exthvadv_mod.f90 +BRAMS/i10dbg/bin/extra.f90 +BRAMS/i10dbg/bin/ezcntr_mod.f90 +BRAMS/i10dbg/bin/fail_whale_mod.f90 +BRAMS/i10dbg/bin/fallpart_mod.f90 +BRAMS/i10dbg/bin/fa_preptc_adap_mod.f90 +BRAMS/i10dbg/bin/fa_preptc_mod.f90 +BRAMS/i10dbg/bin/farq_leuning.f90 +BRAMS/i10dbg/bin/fatal_error.f90 +BRAMS/i10dbg/bin/fatal_error_mod.f90 +BRAMS/i10dbg/bin/fa_xc_adap_mod.f90 +BRAMS/i10dbg/bin/fa_xc_mod.f90 +BRAMS/i10dbg/bin/fa_yc_adap_mod.f90 +BRAMS/i10dbg/bin/fa_yc_mod.f90 +BRAMS/i10dbg/bin/fa_zc_adap_mod.f90 +BRAMS/i10dbg/bin/fa_zc_mod.f90 +BRAMS/i10dbg/bin/fa_zc_plumerise_mod.f90 +BRAMS/i10dbg/bin/fb_dy_step_trunc_mod.f90 +BRAMS/i10dbg/bin/fb_sanity_check_mod.f90 +BRAMS/i10dbg/bin/fcorio_mod.f90 +BRAMS/i10dbg/bin/fdback_mod.f90 +BRAMS/i10dbg/bin/fdbackp_mod.f90 +BRAMS/i10dbg/bin/file_inv.f90 +BRAMS/i10dbg/bin/filesize4_mod.f90 +BRAMS/i10dbg/bin/fill_cyc_mod.f90 +BRAMS/i10dbg/bin/fill_datp_mod.f90 +BRAMS/i10dbg/bin/fill_dn0uv_mod.f90 +BRAMS/i10dbg/bin/fill_history_grid_mod.f90 +BRAMS/i10dbg/bin/fill_history_patch_mod.f90 +BRAMS/i10dbg/bin/fill_history_polygon_mod.f90 +BRAMS/i10dbg/bin/fill_history_site_mod.f90 +BRAMS/i10dbg/bin/fillscr_mod.f90 +BRAMS/i10dbg/bin/fill_site_precip_mod.f90 +BRAMS/i10dbg/bin/fill_thermovars_mod.f90 +BRAMS/i10dbg/bin/fill_thvlast_mod.f90 +BRAMS/i10dbg/bin/fill_toptuvm_mod.f90 +BRAMS/i10dbg/bin/fillvar_l_mod.f90 +BRAMS/i10dbg/bin/fillvar_mod.f90 +BRAMS/i10dbg/bin/find_actual_densities_mod.f90 +BRAMS/i10dbg/bin/find_avg_winds_mod.f90 +BRAMS/i10dbg/bin/find_closing_comment_mod.f90 +BRAMS/i10dbg/bin/find_frqsum_mod.f90 +BRAMS/i10dbg/bin/findgood_mod.f90 +BRAMS/i10dbg/bin/findgrid_mod.f90 +BRAMS/i10dbg/bin/findln_mod.f90 +BRAMS/i10dbg/bin/find_rank_mod.f90 +BRAMS/i10dbg/bin/findtime_mod.f90 +BRAMS/i10dbg/bin/find_walcek_densities_mod.f90 +BRAMS/i10dbg/bin/fire.f90 +BRAMS/i10dbg/bin/fire_frequency_mod.f90 +BRAMS/i10dbg/bin/first_rams.f90 +BRAMS/i10dbg/bin/first_rams_mod.f90 +BRAMS/i10dbg/bin/flag_stable_cohorts_mod.f90 +BRAMS/i10dbg/bin/fldinit_mod.f90 +BRAMS/i10dbg/bin/flds3d_adap_mod.f90 +BRAMS/i10dbg/bin/flds3d_mod.f90 +BRAMS/i10dbg/bin/flxlw_mod.f90 +BRAMS/i10dbg/bin/flxsw_mod.f90 +BRAMS/i10dbg/bin/fmdn0_isan_mod.f90 +BRAMS/i10dbg/bin/fmdn0_mod.f90 +BRAMS/i10dbg/bin/fmint2d_mod.f90 +BRAMS/i10dbg/bin/fmint3_mod.f90 +BRAMS/i10dbg/bin/fmint4_isan_mod.f90 +BRAMS/i10dbg/bin/fmint4_mod.f90 +BRAMS/i10dbg/bin/fmint5_mod.f90 +BRAMS/i10dbg/bin/fmpmove_mod.f90 +BRAMS/i10dbg/bin/fmpmoves_mod.f90 +BRAMS/i10dbg/bin/fmrefs1d_isan_mod.f90 +BRAMS/i10dbg/bin/fmrefs1d_mod.f90 +BRAMS/i10dbg/bin/fmrefs3d_isan_mod.f90 +BRAMS/i10dbg/bin/fmrefs3d_mod.f90 +BRAMS/i10dbg/bin/forestry.f90 +BRAMS/i10dbg/bin/frame_mod.f90 +BRAMS/i10dbg/bin/frstpt_mod.f90 +BRAMS/i10dbg/bin/fuse_fiss_utils.f90 +BRAMS/i10dbg/bin/fusion_fission_coms.f90 +BRAMS/i10dbg/bin/fuso_check_mod.f90 +BRAMS/i10dbg/bin/fusoinit_mod.f90 +BRAMS/i10dbg/bin/fusonest_mod.f90 +BRAMS/i10dbg/bin/fuso_read_mod.f90 +BRAMS/i10dbg/bin/fuso_write_mod.f90 +BRAMS/i10dbg/bin/gacwk_mod.f90 +BRAMS/i10dbg/bin/gammln_mod.f90 +BRAMS/i10dbg/bin/gam_mod.f90 +BRAMS/i10dbg/bin/gammp_mod.f90 +BRAMS/i10dbg/bin/gammq_mod.f90 +BRAMS/i10dbg/bin/gaspart.f90 +BRAMS/i10dbg/bin/gcf_mod.f90 +BRAMS/i10dbg/bin/gclks_mod.f90 +BRAMS/i10dbg/bin/gclrwk_mod.f90 +BRAMS/i10dbg/bin/gclwk_mod.f90 +BRAMS/i10dbg/bin/gdawk_mod.f90 +BRAMS/i10dbg/bin/gdtost2_mod.f90 +BRAMS/i10dbg/bin/gdtost_mod.f90 +BRAMS/i10dbg/bin/geodat.f90 +BRAMS/i10dbg/bin/geodat_mod.f90 +BRAMS/i10dbg/bin/geonest_file_mod.f90 +BRAMS/i10dbg/bin/geonest_nofile_mod.f90 +BRAMS/i10dbg/bin/gessdc_mod.f90 +BRAMS/i10dbg/bin/gesspn_mod.f90 +BRAMS/i10dbg/bin/getconfigint_mod.f90 +BRAMS/i10dbg/bin/getconfigreal_mod.f90 +BRAMS/i10dbg/bin/getconfigstring_mod.f90 +BRAMS/i10dbg/bin/get_convflx_mod.f90 +BRAMS/i10dbg/bin/get_dn01d_mod.f90 +BRAMS/i10dbg/bin/getdrag_mod.f90 +BRAMS/i10dbg/bin/get_env_condition_mod.f90 +BRAMS/i10dbg/bin/get_errmax_mod.f90 +BRAMS/i10dbg/bin/get_file_indices_mod.f90 +BRAMS/i10dbg/bin/get_fire_properties_mod.f90 +BRAMS/i10dbg/bin/geth5dims_mod.f90 +BRAMS/i10dbg/bin/getict_mod.f90 +BRAMS/i10dbg/bin/get_obs_value_mod.f90 +BRAMS/i10dbg/bin/get_press_mod.f90 +BRAMS/i10dbg/bin/get_sc_dn_mod.f90 +BRAMS/i10dbg/bin/get_sc_up_mod.f90 +BRAMS/i10dbg/bin/get_sc_up_wet_mod.f90 +BRAMS/i10dbg/bin/get_se_mod.f90 +BRAMS/i10dbg/bin/getset_mod.f90 +BRAMS/i10dbg/bin/get_stcum_detrain_mod.f90 +BRAMS/i10dbg/bin/get_stcum_mod.f90 +BRAMS/i10dbg/bin/get_triinds_mod.f90 +BRAMS/i10dbg/bin/get_upaobs_value_mod.f90 +BRAMS/i10dbg/bin/getusv_mod.f90 +BRAMS/i10dbg/bin/getvar.f90 +BRAMS/i10dbg/bin/get_wet_deposited_mass_mod.f90 +BRAMS/i10dbg/bin/get_yscal_mod.f90 +BRAMS/i10dbg/bin/get_zi_mod.f90 +BRAMS/i10dbg/bin/gfa_mod.f90 +BRAMS/i10dbg/bin/gflas1_mod.f90 +BRAMS/i10dbg/bin/gflas2_mod.f90 +BRAMS/i10dbg/bin/gflas3_mod.f90 +BRAMS/i10dbg/bin/glaciate_mod.f90 +BRAMS/i10dbg/bin/gopks_mod.f90 +BRAMS/i10dbg/bin/gopwk_mod.f90 +BRAMS/i10dbg/bin/gpl_mod.f90 +BRAMS/i10dbg/bin/gpm_mod.f90 +BRAMS/i10dbg/bin/gqasf_mod.f90 +BRAMS/i10dbg/bin/gqcntn_mod.f90 +BRAMS/i10dbg/bin/gqcr_mod.f90 +BRAMS/i10dbg/bin/gqnt_mod.f90 +BRAMS/i10dbg/bin/gqplci_mod.f90 +BRAMS/i10dbg/bin/gqtxci_mod.f90 +BRAMS/i10dbg/bin/grad_mod.f90 +BRAMS/i10dbg/bin/gradxt_mod.f90 +BRAMS/i10dbg/bin/gradxu_mod.f90 +BRAMS/i10dbg/bin/gradyt_mod.f90 +BRAMS/i10dbg/bin/gradyv_mod.f90 +BRAMS/i10dbg/bin/gradzt_mod.f90 +BRAMS/i10dbg/bin/gradzw_mod.f90 +BRAMS/i10dbg/bin/grdspc_mod.f90 +BRAMS/i10dbg/bin/great_circle.f90 +BRAMS/i10dbg/bin/grell_arakschu_solver_mod.f90 +BRAMS/i10dbg/bin/grell_buoy_below_lfc_mod.f90 +BRAMS/i10dbg/bin/grell_cldwork_downdraft_mod.f90 +BRAMS/i10dbg/bin/grell_cldwork_updraft_mod.f90 +BRAMS/i10dbg/bin/grell_coms.f90 +BRAMS/i10dbg/bin/grell_cupar_area_scaler_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_aux.f90 +BRAMS/i10dbg/bin/grell_cupar_downdraft.f90 +BRAMS/i10dbg/bin/grell_cupar_driver.f90 +BRAMS/i10dbg/bin/grell_cupar_driver_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_dynamic.f90 +BRAMS/i10dbg/bin/grell_cupar_dynamic_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_ensemble.f90 +BRAMS/i10dbg/bin/grell_cupar_environment.f90 +BRAMS/i10dbg/bin/grell_cupar_feedback.f90 +BRAMS/i10dbg/bin/grell_cupar_feedback_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_initial_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_output_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_static_driver_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_static.f90 +BRAMS/i10dbg/bin/grell_cupar_static_mod.f90 +BRAMS/i10dbg/bin/grell_cupar_updraft.f90 +BRAMS/i10dbg/bin/grell_dellabot_ensemble_mod.f90 +BRAMS/i10dbg/bin/grell_dellas_ensemble_mod.f90 +BRAMS/i10dbg/bin/grell_draft_area_mod.f90 +BRAMS/i10dbg/bin/grell_dyncontrol_ensemble_mod.f90 +BRAMS/i10dbg/bin/grell_efficiency_ensemble_mod.f90 +BRAMS/i10dbg/bin/grell_extras_catt.f90 +BRAMS/i10dbg/bin/grell_feedback_driver_mod.f90 +BRAMS/i10dbg/bin/grell_find_cloud_lfc_mod.f90 +BRAMS/i10dbg/bin/grell_find_downdraft_origin_mod.f90 +BRAMS/i10dbg/bin/grell_find_pbl_height_mod.f90 +BRAMS/i10dbg/bin/grell_grell_solver_mod.f90 +BRAMS/i10dbg/bin/grell_inre_solver_mod.f90 +BRAMS/i10dbg/bin/grell_massflx_stats_mod.f90 +BRAMS/i10dbg/bin/grell_most_thermo_downdraft_mod.f90 +BRAMS/i10dbg/bin/grell_most_thermo_updraft_mod.f90 +BRAMS/i10dbg/bin/grell_nms_downdraft_mod.f90 +BRAMS/i10dbg/bin/grell_nms_updraft_mod.f90 +BRAMS/i10dbg/bin/grell_sanity_check_mod.f90 +BRAMS/i10dbg/bin/grell_sanity_thil2tqall_mod.f90 +BRAMS/i10dbg/bin/grell_theiv_downdraft_mod.f90 +BRAMS/i10dbg/bin/grell_theiv_updraft_mod.f90 +BRAMS/i10dbg/bin/grell_thermo_cldlev_mod.f90 +BRAMS/i10dbg/bin/grell_updraft_origin_mod.f90 +BRAMS/i10dbg/bin/grid_coms.f90 +BRAMS/i10dbg/bin/grid_dims.f90 +BRAMS/i10dbg/bin/gridinit_mod.f90 +BRAMS/i10dbg/bin/gridloc_prt_mod.f90 +BRAMS/i10dbg/bin/gridset.f90 +BRAMS/i10dbg/bin/gridset_mod.f90 +BRAMS/i10dbg/bin/grid_setup_mod.f90 +BRAMS/i10dbg/bin/grid_struct.f90 +BRAMS/i10dbg/bin/growth_balive.f90 +BRAMS/i10dbg/bin/gsasf_mod.f90 +BRAMS/i10dbg/bin/gsclip_mod.f90 +BRAMS/i10dbg/bin/gscr_mod.f90 +BRAMS/i10dbg/bin/gselnt_mod.f90 +BRAMS/i10dbg/bin/gser_mod.f90 +BRAMS/i10dbg/bin/gsetmarkercolourind_mod.f90 +BRAMS/i10dbg/bin/gsfaci_mod.f90 +BRAMS/i10dbg/bin/gsfais_mod.f90 +BRAMS/i10dbg/bin/gslwsc_mod.f90 +BRAMS/i10dbg/bin/gsmk_mod.f90 +BRAMS/i10dbg/bin/gsmksc_mod.f90 +BRAMS/i10dbg/bin/gsplci_mod.f90 +BRAMS/i10dbg/bin/gspmci_mod.f90 +BRAMS/i10dbg/bin/gstxci_mod.f90 +BRAMS/i10dbg/bin/h5_output_mod.f90 +BRAMS/i10dbg/bin/hadvance_mod.f90 +BRAMS/i10dbg/bin/hadvance_plumerise_mod.f90 +BRAMS/i10dbg/bin/harr_coms.f90 +BRAMS/i10dbg/bin/harr_lwrad_mod.f90 +BRAMS/i10dbg/bin/harr_raddriv.f90 +BRAMS/i10dbg/bin/harr_raddriv_mod.f90 +BRAMS/i10dbg/bin/harr_radinit1_mod.f90 +BRAMS/i10dbg/bin/harr_radinit.f90 +BRAMS/i10dbg/bin/harr_radinit_mod.f90 +BRAMS/i10dbg/bin/harr_swrad_mod.f90 +BRAMS/i10dbg/bin/harv_immat_patches_mod.f90 +BRAMS/i10dbg/bin/harv_mat_patches_mod.f90 +BRAMS/i10dbg/bin/haznuc_mod.f90 +BRAMS/i10dbg/bin/hdf_getslab_d_mod.f90 +BRAMS/i10dbg/bin/hdf_getslab_i_mod.f90 +BRAMS/i10dbg/bin/hdf_getslab_r_mod.f90 +BRAMS/i10dbg/bin/heav_mod.f90 +BRAMS/i10dbg/bin/hemi2.f90 +BRAMS/i10dbg/bin/hemintrp_cof_mod.f90 +BRAMS/i10dbg/bin/hemintrp_mod.f90 +BRAMS/i10dbg/bin/hemintrp_table_mod.f90 +BRAMS/i10dbg/bin/hemintt_mod.f90 +BRAMS/i10dbg/bin/hemintuv_mod.f90 +BRAMS/i10dbg/bin/het_resp_weight_mod.f90 +BRAMS/i10dbg/bin/heun_driver.f90 +BRAMS/i10dbg/bin/heun_integ_mod.f90 +BRAMS/i10dbg/bin/heun_stepper_mod.f90 +BRAMS/i10dbg/bin/heun_timestep_mod.f90 +BRAMS/i10dbg/bin/hg_xy_mod.f90 +BRAMS/i10dbg/bin/hg_z_mod.f90 +BRAMS/i10dbg/bin/hi_avgu_mod.f90 +BRAMS/i10dbg/bin/hi_avgv_mod.f90 +BRAMS/i10dbg/bin/hi_avgw_mod.f90 +BRAMS/i10dbg/bin/hifromx_mod.f90 +BRAMS/i10dbg/bin/hi_interp_mod.f90 +BRAMS/i10dbg/bin/hintrp_cc_mod.f90 +BRAMS/i10dbg/bin/history_start_mod.f90 +BRAMS/i10dbg/bin/hist_pol_read_mod.f90 +BRAMS/i10dbg/bin/hist_read_mod.f90 +BRAMS/i10dbg/bin/hiswrt_mod.f90 +BRAMS/i10dbg/bin/hlsrgb_mod.f90 +BRAMS/i10dbg/bin/homfrzcl_mod.f90 +BRAMS/i10dbg/bin/how_to_read_a_file_mod.f90 +BRAMS/i10dbg/bin/hsvrgb_mod.f90 +BRAMS/i10dbg/bin/htint2_mod.f90 +BRAMS/i10dbg/bin/htintcp_mod.f90 +BRAMS/i10dbg/bin/htint_index_mod.f90 +BRAMS/i10dbg/bin/htint_inter_mod.f90 +BRAMS/i10dbg/bin/htint_mod.f90 +BRAMS/i10dbg/bin/htint-opt.f90 +BRAMS/i10dbg/bin/hybrid_driver.f90 +BRAMS/i10dbg/bin/hybrid_integ_mod.f90 +BRAMS/i10dbg/bin/hybrid_timestep_mod.f90 +BRAMS/i10dbg/bin/hydrol_mod.f90 +BRAMS/i10dbg/bin/hydrology_coms.f90 +BRAMS/i10dbg/bin/hydrology_constants.f90 +BRAMS/i10dbg/bin/hydro_mod.f90 +BRAMS/i10dbg/bin/i1mach_mod.f90 +BRAMS/i10dbg/bin/ibias_mod.f90 +BRAMS/i10dbg/bin/ibindec_mod.f90 +BRAMS/i10dbg/bin/icenuc_mod.f90 +BRAMS/i10dbg/bin/ifirstchar_mod.f90 +BRAMS/i10dbg/bin/inc_fwd_patch_mod.f90 +BRAMS/i10dbg/bin/include_shal_effect_mod.f90 +BRAMS/i10dbg/bin/inc_rk4_patch_mod.f90 +BRAMS/i10dbg/bin/init_can_air_params_mod.f90 +BRAMS/i10dbg/bin/init_can_lyr_params_mod.f90 +BRAMS/i10dbg/bin/init_can_rad_params_mod.f90 +BRAMS/i10dbg/bin/init_cohorts_by_layers_mod.f90 +BRAMS/i10dbg/bin/init_conc1_mod.f90 +BRAMS/i10dbg/bin/init_conc2_mod.f90 +BRAMS/i10dbg/bin/init_conc_prev_mod.f90 +BRAMS/i10dbg/bin/init_decomp_params_mod.f90 +BRAMS/i10dbg/bin/init_disturb_params_mod.f90 +BRAMS/i10dbg/bin/init_ed_cohort_vars_mod.f90 +BRAMS/i10dbg/bin/init_ed_misc_coms_mod.f90 +BRAMS/i10dbg/bin/init_ed_patch_vars_mod.f90 +BRAMS/i10dbg/bin/init_ed_poly_vars_mod.f90 +BRAMS/i10dbg/bin/init_ed_site_vars_mod.f90 +BRAMS/i10dbg/bin/init_ff_coms_mod.f90 +BRAMS/i10dbg/bin/init_fields_mod.f90 +BRAMS/i10dbg/bin/init_full_history_restart_mod.f90 +BRAMS/i10dbg/bin/initg_mod.f90 +BRAMS/i10dbg/bin/ini_tg_profile_mod.f90 +BRAMS/i10dbg/bin/init_grid_spacing_mod.f90 +BRAMS/i10dbg/bin/inithh_mod.f90 +BRAMS/i10dbg/bin/inithis.f90 +BRAMS/i10dbg/bin/inithis_mod.f90 +BRAMS/i10dbg/bin/init_hydro_coms_mod.f90 +BRAMS/i10dbg/bin/inithydrology_mod.f90 +BRAMS/i10dbg/bin/init_hydro_sites.f90 +BRAMS/i10dbg/bin/inithydrosubsurface_mod.f90 +BRAMS/i10dbg/bin/initial_grid_grell_mod.f90 +BRAMS/i10dbg/bin/initialize_ed2leaf_mod.f90 +BRAMS/i10dbg/bin/initialize_rk4patches_mod.f90 +BRAMS/i10dbg/bin/initial_mod.f90 +BRAMS/i10dbg/bin/initial_tend_grell_mod.f90 +BRAMS/i10dbg/bin/initial_thermo_grell_mod.f90 +BRAMS/i10dbg/bin/initial_winds_grell_mod.f90 +BRAMS/i10dbg/bin/init_lapse_params_mod.f90 +BRAMS/i10dbg/bin/initlz_mod.f90 +BRAMS/i10dbg/bin/init_master_work_mod.f90 +BRAMS/i10dbg/bin/init_met_params_mod.f90 +BRAMS/i10dbg/bin/init_nbg_cohorts_mod.f90 +BRAMS/i10dbg/bin/init_node_work_mod.f90 +BRAMS/i10dbg/bin/init_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_alloc_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_derived_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_leaf_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_mort_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_nitro_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_photo_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_repro_params_mod.f90 +BRAMS/i10dbg/bin/init_pft_resp_params_mod.f90 +BRAMS/i10dbg/bin/init_phen_coms_mod.f90 +BRAMS/i10dbg/bin/init_physiology_params_mod.f90 +BRAMS/i10dbg/bin/initqin_mod.f90 +BRAMS/i10dbg/bin/init_rk4_params_mod.f90 +BRAMS/i10dbg/bin/init_soil_coms_mod.f90 +BRAMS/i10dbg/bin/input_rawi_mod.f90 +BRAMS/i10dbg/bin/input_sfc_mod.f90 +BRAMS/i10dbg/bin/integ_liq_ice_mod.f90 +BRAMS/i10dbg/bin/integrate_ed_daily_output_flux_mod.f90 +BRAMS/i10dbg/bin/integrate_ed_daily_output_state_mod.f90 +BRAMS/i10dbg/bin/integrate_ed_monthly_output_vars_mod.f90 +BRAMS/i10dbg/bin/integrate_lake_mod.f90 +BRAMS/i10dbg/bin/integrate_patch_euler_mod.f90 +BRAMS/i10dbg/bin/integrate_patch_heun_mod.f90 +BRAMS/i10dbg/bin/interp_lib.f90 +BRAMS/i10dbg/bin/int_met_avg_mod.f90 +BRAMS/i10dbg/bin/intrp_mod.f90 +BRAMS/i10dbg/bin/intrrap_mod.f90 +BRAMS/i10dbg/bin/inventory_mat_forests_mod.f90 +BRAMS/i10dbg/bin/invmondays.f90 +BRAMS/i10dbg/bin/io_params.f90 +BRAMS/i10dbg/bin/ipaths_cyc_alloc_mod.f90 +BRAMS/i10dbg/bin/iprim_mod.f90 +BRAMS/i10dbg/bin/iran_recsize_mod.f90 +BRAMS/i10dbg/bin/isan_comp_dn0_mod.f90 +BRAMS/i10dbg/bin/isan_coms.f90 +BRAMS/i10dbg/bin/isan_driver_mod.f90 +BRAMS/i10dbg/bin/isan_file_inv_mod.f90 +BRAMS/i10dbg/bin/isan_io.f90 +BRAMS/i10dbg/bin/isenio_mod.f90 +BRAMS/i10dbg/bin/is_finite8_mod.f90 +BRAMS/i10dbg/bin/is_finite_mod.f90 +BRAMS/i10dbg/bin/ishift_mod.f90 +BRAMS/i10dbg/bin/isleap_mod.f90 +BRAMS/i10dbg/bin/ismax_mod.f90 +BRAMS/i10dbg/bin/ismin_mod.f90 +BRAMS/i10dbg/bin/isnsig_mod.f90 +BRAMS/i10dbg/bin/isnstage_mod.f90 +BRAMS/i10dbg/bin/is_resolvable_mod.f90 +BRAMS/i10dbg/bin/ivalugp_mod.f90 +BRAMS/i10dbg/bin/izero_mod.f90 +BRAMS/i10dbg/bin/jnmbinit_mod.f90 +BRAMS/i10dbg/bin/julday1000_mod.f90 +BRAMS/i10dbg/bin/julday_mod.f90 +BRAMS/i10dbg/bin/ke_coms.f90 +BRAMS/i10dbg/bin/klbnd_mod.f90 +BRAMS/i10dbg/bin/krig_mod.f90 +BRAMS/i10dbg/bin/kuocp_mod.f90 +BRAMS/i10dbg/bin/kuo_cupar_driver.f90 +BRAMS/i10dbg/bin/kuo_cupar_driver_mod.f90 +BRAMS/i10dbg/bin/lake_coms.f90 +BRAMS/i10dbg/bin/lake_derived_thbounds_mod.f90 +BRAMS/i10dbg/bin/lake_derivs_mod.f90 +BRAMS/i10dbg/bin/lake_diagnostics_mod.f90 +BRAMS/i10dbg/bin/lake_heun_mod.f90 +BRAMS/i10dbg/bin/lake_rk4_mod.f90 +BRAMS/i10dbg/bin/lake_sanity_check_mod.f90 +BRAMS/i10dbg/bin/lambcon_ps_mod.f90 +BRAMS/i10dbg/bin/landuse_init.f90 +BRAMS/i10dbg/bin/landuse_init_mod.f90 +BRAMS/i10dbg/bin/landuse_opqr_mod.f90 +BRAMS/i10dbg/bin/lapse.f90 +BRAMS/i10dbg/bin/large_error_mod.f90 +BRAMS/i10dbg/bin/lastchar_mod.f90 +BRAMS/i10dbg/bin/lastmonthdate_mod.f90 +BRAMS/i10dbg/bin/lastslash_mod.f90 +BRAMS/i10dbg/bin/latbnd_mod.f90 +BRAMS/i10dbg/bin/latlon_ps_mod.f90 +BRAMS/i10dbg/bin/latnormv_mod.f90 +BRAMS/i10dbg/bin/latset_mod.f90 +BRAMS/i10dbg/bin/latset_tracer_mod.f90 +BRAMS/i10dbg/bin/lblbar_mod.f90 +BRAMS/i10dbg/bin/lbound_mod.f90 +BRAMS/i10dbg/bin/lbseti_mod.f90 +BRAMS/i10dbg/bin/lc2ll_mod.f90 +BRAMS/i10dbg/bin/lc_ll_mod.f90 +BRAMS/i10dbg/bin/leaf0_mod.f90 +BRAMS/i10dbg/bin/leaf2ed_soil_moist_energy_mod.f90 +BRAMS/i10dbg/bin/leaf3_adjust_sfcw_mod.f90 +BRAMS/i10dbg/bin/leaf3_aerodynamic_conductances_mod.f90 +BRAMS/i10dbg/bin/leaf3_atmo1d_mod.f90 +BRAMS/i10dbg/bin/leaf3_bc.f90 +BRAMS/i10dbg/bin/leaf3_bcond_mod.f90 +BRAMS/i10dbg/bin/leaf3_can_diag_mod.f90 +BRAMS/i10dbg/bin/leaf3_can.f90 +BRAMS/i10dbg/bin/leaf3_canopy_mod.f90 +BRAMS/i10dbg/bin/leaf3_clone_mod.f90 +BRAMS/i10dbg/bin/leaf3.f90 +BRAMS/i10dbg/bin/leaf3_grndvap_mod.f90 +BRAMS/i10dbg/bin/leaf3_hyd.f90 +BRAMS/i10dbg/bin/leaf3_init.f90 +BRAMS/i10dbg/bin/leaf3init_overwrite_mod.f90 +BRAMS/i10dbg/bin/leaf3_ocean_diag_mod.f90 +BRAMS/i10dbg/bin/leaf3_ocean.f90 +BRAMS/i10dbg/bin/leaf3_ocean_mod.f90 +BRAMS/i10dbg/bin/leaf3_prognostic_mod.f90 +BRAMS/i10dbg/bin/leaf3_reduced_wind_mod.f90 +BRAMS/i10dbg/bin/leaf3_roughness_mod.f90 +BRAMS/i10dbg/bin/leaf3_sfclmcv_mod.f90 +BRAMS/i10dbg/bin/leaf3_sfcrad_mod.f90 +BRAMS/i10dbg/bin/leaf3_sflux_w_mod.f90 +BRAMS/i10dbg/bin/leaf3_soilsfcw_diag_mod.f90 +BRAMS/i10dbg/bin/leaf3_solve_veg_mod.f90 +BRAMS/i10dbg/bin/leaf3_stars_mod.f90 +BRAMS/i10dbg/bin/leaf3_step_startup_mod.f90 +BRAMS/i10dbg/bin/leaf3_teb.f90 +BRAMS/i10dbg/bin/leaf3_teb_interface_mod.f90 +BRAMS/i10dbg/bin/leaf3_timestep_mod.f90 +BRAMS/i10dbg/bin/leaf3_tw.f90 +BRAMS/i10dbg/bin/leaf3_tw_mod.f90 +BRAMS/i10dbg/bin/leaf3_utils.f90 +BRAMS/i10dbg/bin/leaf3_veg_diag_mod.f90 +BRAMS/i10dbg/bin/leaf_coms.f90 +BRAMS/i10dbg/bin/leaf_database.f90 +BRAMS/i10dbg/bin/leaf_database_mod.f90 +BRAMS/i10dbg/bin/leaf_datp_datq_mod.f90 +BRAMS/i10dbg/bin/leaf_datp_datsoil_mod.f90 +BRAMS/i10dbg/bin/leaf_derivs_mod.f90 +BRAMS/i10dbg/bin/leaftw_derivs_mod.f90 +BRAMS/i10dbg/bin/le_fontes_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__closeall_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__closefile_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_error_getline_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__existid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_existid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__existpid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90.f90_pp.f90 +BRAMS/i10dbg/bin/libxml2f90__findinchara_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__flush_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__get_fileunit_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_getline_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_getsafec8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_getsafei4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_getsafel4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_getsafer8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__getunit_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_addid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_addid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_add_list_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_add_list_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_addpid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_addpid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_addpureid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_closetag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_closetag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_down_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_edit_id_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_edit_id_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_edit_pid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_edit_pid_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_exist_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getc8__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getc8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getc8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getch_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getch_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getch_scal_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_geti4__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_geti4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_geti4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getl4__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getl4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getl4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpc8__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpc8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpch_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpi4__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpi4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpl4__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpl4_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpr8__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpr8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpsize_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpstring__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getpstring_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getr8__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getr8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getr8_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getsize_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getsize_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getstring__mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_getstring_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_getstring_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_initlist_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_inittag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_opentag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_opentag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_report_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_report_rec_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_ll_report_rec_wrap_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_selectlist_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_selecttag_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__ll_up_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__openfile_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_parse_file_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_parse_find_char_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__readin_file_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_readin_file_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__readin_nfil_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__set_casesensitive_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__set_default_ll_id_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__setformat_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__set_paw_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__set_rmcomma_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__set_rmquotes_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__settransform_exm_mod.f90 +BRAMS/i10dbg/bin/libxml2f90__setwrite_exm_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_tostringa_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_tostring_mod.f90 +BRAMS/i10dbg/bin/libxml2f90_transform_paw_mod.f90 +BRAMS/i10dbg/bin/lined_mod.f90 +BRAMS/i10dbg/bin/line_mod.f90 +BRAMS/i10dbg/bin/lisys_solver8_mod.f90 +BRAMS/i10dbg/bin/lisys_solver_mod.f90 +BRAMS/i10dbg/bin/lite_varset_mod.f90 +BRAMS/i10dbg/bin/ll2lc_mod.f90 +BRAMS/i10dbg/bin/ll_lc_mod.f90 +BRAMS/i10dbg/bin/ll_rotate_lc_mod.f90 +BRAMS/i10dbg/bin/ll_xy_mod.f90 +BRAMS/i10dbg/bin/load_ecosystem_state_mod.f90 +BRAMS/i10dbg/bin/load_ed_ecosystem_params_mod.f90 +BRAMS/i10dbg/bin/local_proc.f90 +BRAMS/i10dbg/bin/lpuvw_init_mod.f90 +BRAMS/i10dbg/bin/lsl_particles_mod.f90 +BRAMS/i10dbg/bin/lsm_hyd.f90 +BRAMS/i10dbg/bin/lubksb_dble_mod.f90 +BRAMS/i10dbg/bin/ludcmp_dble_mod.f90 +BRAMS/i10dbg/bin/lw_multiple_scatter_mod.f90 +BRAMS/i10dbg/bin/lwradc_mod.f90 +BRAMS/i10dbg/bin/lwradp_mod.f90 +BRAMS/i10dbg/bin/lw_twostream_mod.f90 +BRAMS/i10dbg/bin/make_autotab_mod.f90 +BRAMS/i10dbg/bin/makefnam_mod.f90 +BRAMS/i10dbg/bin/makeplume_mod.f90 +BRAMS/i10dbg/bin/make_sfcfiles_mod.f90 +BRAMS/i10dbg/bin/makevarf_mod.f90 +BRAMS/i10dbg/bin/mapaci_mod.f90 +BRAMS/i10dbg/bin/mapbla_mod.f90 +BRAMS/i10dbg/bin/mapdrw_mod.f90 +BRAMS/i10dbg/bin/mapint_mod.f90 +BRAMS/i10dbg/bin/mapiqa_mod.f90 +BRAMS/i10dbg/bin/mapiq_mod.f90 +BRAMS/i10dbg/bin/mapita_mod.f90 +BRAMS/i10dbg/bin/mapit_mod.f90 +BRAMS/i10dbg/bin/mappos_mod.f90 +BRAMS/i10dbg/bin/map_proj.f90 +BRAMS/i10dbg/bin/maproj_mod.f90 +BRAMS/i10dbg/bin/maprs_mod.f90 +BRAMS/i10dbg/bin/mapset_mod.f90 +BRAMS/i10dbg/bin/mapstc_mod.f90 +BRAMS/i10dbg/bin/mapsti_mod.f90 +BRAMS/i10dbg/bin/maptra_mod.f90 +BRAMS/i10dbg/bin/maptri_mod.f90 +BRAMS/i10dbg/bin/maptrn_mod.f90 +BRAMS/i10dbg/bin/master_ed_init_mod.f90 +BRAMS/i10dbg/bin/master_getall_mod.f90 +BRAMS/i10dbg/bin/master_getanl_mod.f90 +BRAMS/i10dbg/bin/master_getcflcpu_mod.f90 +BRAMS/i10dbg/bin/master_putcflmax_mod.f90 +BRAMS/i10dbg/bin/masterput_cofnest_mod.f90 +BRAMS/i10dbg/bin/master_putdtsched_mod.f90 +BRAMS/i10dbg/bin/master_putdxt_mod.f90 +BRAMS/i10dbg/bin/masterput_ednl_mod.f90 +BRAMS/i10dbg/bin/masterput_grid_dimens_mod.f90 +BRAMS/i10dbg/bin/masterput_gridinit_mod.f90 +BRAMS/i10dbg/bin/masterput_gridset_mod.f90 +BRAMS/i10dbg/bin/masterput_micphys_mod.f90 +BRAMS/i10dbg/bin/masterput_misc_mod.f90 +BRAMS/i10dbg/bin/masterput_nl_mod.f90 +BRAMS/i10dbg/bin/masterput_oda_mod.f90 +BRAMS/i10dbg/bin/masterput_processid_mod.f90 +BRAMS/i10dbg/bin/master_sendinit_mod.f90 +BRAMS/i10dbg/bin/mat_forest_harv_rates_mod.f90 +BRAMS/i10dbg/bin/maximi_mod.f90 +BRAMS/i10dbg/bin/mcphys_main_mod.f90 +BRAMS/i10dbg/bin/mean_daysecz_mod.f90 +BRAMS/i10dbg/bin/melt_mod.f90 +BRAMS/i10dbg/bin/mem_aerad.f90 +BRAMS/i10dbg/bin/mem_all.f90 +BRAMS/i10dbg/bin/mem_basic.f90 +BRAMS/i10dbg/bin/mem_carma.f90 +BRAMS/i10dbg/bin/mem_cuparm.f90 +BRAMS/i10dbg/bin/mem_edcp.f90 +BRAMS/i10dbg/bin/mem_emiss.f90 +BRAMS/i10dbg/bin/mem_ensemble.f90 +BRAMS/i10dbg/bin/mem_gaspart.f90 +BRAMS/i10dbg/bin/mem_globaer.f90 +BRAMS/i10dbg/bin/mem_globrad.f90 +BRAMS/i10dbg/bin/mem_grell_param2.f90 +BRAMS/i10dbg/bin/mem_grid_dim_defs.f90 +BRAMS/i10dbg/bin/mem_grid.f90 +BRAMS/i10dbg/bin/mem_harr.f90 +BRAMS/i10dbg/bin/mem_leaf.f90 +BRAMS/i10dbg/bin/mem_mass.f90 +BRAMS/i10dbg/bin/mem_mclat.f90 +BRAMS/i10dbg/bin/mem_micro.f90 +BRAMS/i10dbg/bin/mem_mksfc.f90 +BRAMS/i10dbg/bin/mem_mnt_advec.f90 +BRAMS/i10dbg/bin/mem_nestb.f90 +BRAMS/i10dbg/bin/mem_oda.f90 +BRAMS/i10dbg/bin/mem_opt_scratch.f90 +BRAMS/i10dbg/bin/mem_polygons.f90 +BRAMS/i10dbg/bin/mem_radiate.f90 +BRAMS/i10dbg/bin/mem_scalar.f90 +BRAMS/i10dbg/bin/mem_scratch1_brams.f90 +BRAMS/i10dbg/bin/mem_scratch1_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell.f90 +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell.f90 +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.f90 +BRAMS/i10dbg/bin/mem_scratch.f90 +BRAMS/i10dbg/bin/mem_scratch_grell.f90 +BRAMS/i10dbg/bin/mem_soil_moisture.f90 +BRAMS/i10dbg/bin/mem_tconv.f90 +BRAMS/i10dbg/bin/mem_teb_common.f90 +BRAMS/i10dbg/bin/mem_teb.f90 +BRAMS/i10dbg/bin/mem_teb_vars_const.f90 +BRAMS/i10dbg/bin/mem_tend.f90 +BRAMS/i10dbg/bin/mem_turb.f90 +BRAMS/i10dbg/bin/mem_turb_scalar.f90 +BRAMS/i10dbg/bin/mem_varinit.f90 +BRAMS/i10dbg/bin/met_driver_coms.f90 +BRAMS/i10dbg/bin/met_sanity_check_mod.f90 +BRAMS/i10dbg/bin/mic_coll.f90 +BRAMS/i10dbg/bin/mic_driv.f90 +BRAMS/i10dbg/bin/mic_gamma.f90 +BRAMS/i10dbg/bin/mic_init.f90 +BRAMS/i10dbg/bin/micinit_mod.f90 +BRAMS/i10dbg/bin/mic_misc.f90 +BRAMS/i10dbg/bin/mic_nuc.f90 +BRAMS/i10dbg/bin/micphys.f90 +BRAMS/i10dbg/bin/micro_1st_mod.f90 +BRAMS/i10dbg/bin/micro_coms.f90 +BRAMS/i10dbg/bin/micro_data_mod.f90 +BRAMS/i10dbg/bin/micro_driver_mod.f90 +BRAMS/i10dbg/bin/micro_master_mod.f90 +BRAMS/i10dbg/bin/mic_tabs.f90 +BRAMS/i10dbg/bin/mic_vap.f90 +BRAMS/i10dbg/bin/migs_mod.f90 +BRAMS/i10dbg/bin/minimi_mod.f90 +BRAMS/i10dbg/bin/minmax_mod.f90 +BRAMS/i10dbg/bin/minvap_1d_adj_mod.f90 +BRAMS/i10dbg/bin/mk_adv_buff_mod.f90 +BRAMS/i10dbg/bin/mkcoltb_mod.f90 +BRAMS/i10dbg/bin/mk_cyc_buff_mod.f90 +BRAMS/i10dbg/bin/mk_full_buff_mod.f90 +BRAMS/i10dbg/bin/mk_lbc_buff_mod.f90 +BRAMS/i10dbg/bin/mknest_buff_mod.f90 +BRAMS/i10dbg/bin/mksedim_tab_mod.f90 +BRAMS/i10dbg/bin/mksfc_driver.f90 +BRAMS/i10dbg/bin/mksfc_fuso.f90 +BRAMS/i10dbg/bin/mksfc_ndvi.f90 +BRAMS/i10dbg/bin/mksfc_sfc.f90 +BRAMS/i10dbg/bin/mksfc_sst.f90 +BRAMS/i10dbg/bin/mksfc_top.f90 +BRAMS/i10dbg/bin/mk_st_buff_mod.f90 +BRAMS/i10dbg/bin/mnt_advec_aux.f90 +BRAMS/i10dbg/bin/mnt_advec_main.f90 +BRAMS/i10dbg/bin/mod_advect_kit.f90 +BRAMS/i10dbg/bin/model.f90 +BRAMS/i10dbg/bin/model_mod.f90 +BRAMS/i10dbg/bin/mod_GhostBlock.f90 +BRAMS/i10dbg/bin/mod_GhostBlockPartition.f90 +BRAMS/i10dbg/bin/mod_ozone.f90 +BRAMS/i10dbg/bin/modsched.f90 +BRAMS/i10dbg/bin/modsched_mod.f90 +BRAMS/i10dbg/bin/monotonic_advec_mod.f90 +BRAMS/i10dbg/bin/mortality.f90 +BRAMS/i10dbg/bin/movenest_mod.f90 +BRAMS/i10dbg/bin/mpass_advec.f90 +BRAMS/i10dbg/bin/mpass_cyclic.f90 +BRAMS/i10dbg/bin/mpass_dtl.f90 +BRAMS/i10dbg/bin/mpass_feed.f90 +BRAMS/i10dbg/bin/mpass_full.f90 +BRAMS/i10dbg/bin/mpass_init.f90 +BRAMS/i10dbg/bin/mpass_lbc.f90 +BRAMS/i10dbg/bin/mpass_nest.f90 +BRAMS/i10dbg/bin/mpass_oda.f90 +BRAMS/i10dbg/bin/mpass_st.f90 +BRAMS/i10dbg/bin/mpilbc_driver_mod.f90 +BRAMS/i10dbg/bin/mprove_mod.f90 +BRAMS/i10dbg/bin/mpsetc_mod.f90 +BRAMS/i10dbg/bin/multiple_scatter.f90 +BRAMS/i10dbg/bin/mxdefm_mod.f90 +BRAMS/i10dbg/bin/mxdefm_tracer_mod.f90 +BRAMS/i10dbg/bin/mxtked_mod.f90 +BRAMS/i10dbg/bin/nakanishi_mod.f90 +BRAMS/i10dbg/bin/nameout_mod.f90 +BRAMS/i10dbg/bin/ncarg_dummies_mod.f90 +BRAMS/i10dbg/bin/ncarg_dummy.f90 +BRAMS/i10dbg/bin/nc_get_press_mod.f90 +BRAMS/i10dbg/bin/nc_pressure_stage_mod.f90 +BRAMS/i10dbg/bin/nc_prfill_mod.f90 +BRAMS/i10dbg/bin/ndvi_check_header_mod.f90 +BRAMS/i10dbg/bin/ndvi_file_inv_mod.f90 +BRAMS/i10dbg/bin/ndviinit_mod.f90 +BRAMS/i10dbg/bin/ndviinit_user_mod.f90 +BRAMS/i10dbg/bin/ndvinest_mod.f90 +BRAMS/i10dbg/bin/ndvi_read_dataheader_mod.f90 +BRAMS/i10dbg/bin/ndvi_read.f90 +BRAMS/i10dbg/bin/ndvi_read_mod.f90 +BRAMS/i10dbg/bin/ndvi_update_mod.f90 +BRAMS/i10dbg/bin/ndvi_write_mod.f90 +BRAMS/i10dbg/bin/near_bare_ground_big_leaf_init_mod.f90 +BRAMS/i10dbg/bin/near_bare_ground_init_mod.f90 +BRAMS/i10dbg/bin/nearest_neighbour_sm_mod.f90 +BRAMS/i10dbg/bin/negadj1_mod.f90 +BRAMS/i10dbg/bin/nest_feed.f90 +BRAMS/i10dbg/bin/nest_filldens.f90 +BRAMS/i10dbg/bin/nest_geosst.f90 +BRAMS/i10dbg/bin/nest_init_aux.f90 +BRAMS/i10dbg/bin/nest_interpolated_topo_mod.f90 +BRAMS/i10dbg/bin/nest_intrp.f90 +BRAMS/i10dbg/bin/nest_move.f90 +BRAMS/i10dbg/bin/newgrid_mod.f90 +BRAMS/i10dbg/bin/new_patch_sfc_props_mod.f90 +BRAMS/i10dbg/bin/newtemp_mod.f90 +BRAMS/i10dbg/bin/niceinc6_mod.f90 +BRAMS/i10dbg/bin/niceinc_mod.f90 +BRAMS/i10dbg/bin/node_cycinit_mod.f90 +BRAMS/i10dbg/bin/node_decomp_mod.f90 +BRAMS/i10dbg/bin/node_ed_init_mod.f90 +BRAMS/i10dbg/bin/node_getadv_mod.f90 +BRAMS/i10dbg/bin/node_getcflmax_mod.f90 +BRAMS/i10dbg/bin/nodeget_cofnest_mod.f90 +BRAMS/i10dbg/bin/node_getcyclic_mod.f90 +BRAMS/i10dbg/bin/node_getdtsched_mod.f90 +BRAMS/i10dbg/bin/node_getdxt_mod.f90 +BRAMS/i10dbg/bin/nodeget_ednl_mod.f90 +BRAMS/i10dbg/bin/node_getfeed_mod.f90 +BRAMS/i10dbg/bin/nodeget_grid_dimens_mod.f90 +BRAMS/i10dbg/bin/nodeget_gridinit_mod.f90 +BRAMS/i10dbg/bin/nodeget_gridset_mod.f90 +BRAMS/i10dbg/bin/node_getinit_mod.f90 +BRAMS/i10dbg/bin/node_getlbc_mod.f90 +BRAMS/i10dbg/bin/nodeget_micphys_mod.f90 +BRAMS/i10dbg/bin/nodeget_misc_mod.f90 +BRAMS/i10dbg/bin/node_getnbc_mod.f90 +BRAMS/i10dbg/bin/nodeget_nl_mod.f90 +BRAMS/i10dbg/bin/nodeget_oda_mod.f90 +BRAMS/i10dbg/bin/nodeget_processid_mod.f90 +BRAMS/i10dbg/bin/node_getst_mod.f90 +BRAMS/i10dbg/bin/node_index_mod.f90 +BRAMS/i10dbg/bin/node_mod.f90 +BRAMS/i10dbg/bin/node_putcflcpu_mod.f90 +BRAMS/i10dbg/bin/node_sendadv_mod.f90 +BRAMS/i10dbg/bin/node_sendall_mod.f90 +BRAMS/i10dbg/bin/node_sendanl_mod.f90 +BRAMS/i10dbg/bin/node_sendcyclic_mod.f90 +BRAMS/i10dbg/bin/node_sendfeed_mod.f90 +BRAMS/i10dbg/bin/node_sendlbc_mod.f90 +BRAMS/i10dbg/bin/node_sendnbc_mod.f90 +BRAMS/i10dbg/bin/node_sendst_mod.f90 +BRAMS/i10dbg/bin/normal_accfluxes_mod.f90 +BRAMS/i10dbg/bin/normalize_averaged_vars_mod.f90 +BRAMS/i10dbg/bin/normalize_ed_dailynpp_vars_mod.f90 +BRAMS/i10dbg/bin/normalize_ed_daily_output_vars_mod.f90 +BRAMS/i10dbg/bin/normalize_ed_daily_vars_mod.f90 +BRAMS/i10dbg/bin/normalize_ed_monthly_output_vars_mod.f90 +BRAMS/i10dbg/bin/norm_harv_patch_mod.f90 +BRAMS/i10dbg/bin/nstbdriv_mod.f90 +BRAMS/i10dbg/bin/nstb_mod.f90 +BRAMS/i10dbg/bin/nstbtnd_mod.f90 +BRAMS/i10dbg/bin/nstfeed_mod.f90 +BRAMS/i10dbg/bin/nud_analysis.f90 +BRAMS/i10dbg/bin/nud_cond_accum_mod.f90 +BRAMS/i10dbg/bin/nud_file_inv_mod.f90 +BRAMS/i10dbg/bin/nudge_cond_mod.f90 +BRAMS/i10dbg/bin/nudge_mod.f90 +BRAMS/i10dbg/bin/nud_read.f90 +BRAMS/i10dbg/bin/nud_read_mod.f90 +BRAMS/i10dbg/bin/nud_update.f90 +BRAMS/i10dbg/bin/nud_update_mod.f90 +BRAMS/i10dbg/bin/num_days_mod.f90 +BRAMS/i10dbg/bin/numutils.f90 +BRAMS/i10dbg/bin/obanl_mod.f90 +BRAMS/i10dbg/bin/obj_anal_mod.f90 +BRAMS/i10dbg/bin/obs_input.f90 +BRAMS/i10dbg/bin/obs_isen_mod.f90 +BRAMS/i10dbg/bin/obs_sigz_mod.f90 +BRAMS/i10dbg/bin/oda_file_inv_mod.f90 +BRAMS/i10dbg/bin/oda_krig.f90 +BRAMS/i10dbg/bin/oda_nudge.f90 +BRAMS/i10dbg/bin/oda_nudge_init_mod.f90 +BRAMS/i10dbg/bin/oda_nudge_mod.f90 +BRAMS/i10dbg/bin/oda_obs_alloc_mod.f90 +BRAMS/i10dbg/bin/oda_proc_obs.f90 +BRAMS/i10dbg/bin/oda_proc_obs_mod.f90 +BRAMS/i10dbg/bin/oda_read.f90 +BRAMS/i10dbg/bin/oda_read_mod.f90 +BRAMS/i10dbg/bin/oda_sta_count.f90 +BRAMS/i10dbg/bin/oda_sta_count_mod.f90 +BRAMS/i10dbg/bin/oda_sta_input.f90 +BRAMS/i10dbg/bin/oda_sta_input_mod.f90 +BRAMS/i10dbg/bin/oda_tendency_mod.f90 +BRAMS/i10dbg/bin/odeint_mod.f90 +BRAMS/i10dbg/bin/old_grell_cupar_driver.f90 +BRAMS/i10dbg/bin/old_grell_cupar_driver_mod.f90 +BRAMS/i10dbg/bin/old_prep_convflx_to_mass_mod.f90 +BRAMS/i10dbg/bin/onenode_mod.f90 +BRAMS/i10dbg/bin/operts_mod.f90 +BRAMS/i10dbg/bin/opngks_mod.f90 +BRAMS/i10dbg/bin/opspec1_mod.f90 +BRAMS/i10dbg/bin/opspec2_mod.f90 +BRAMS/i10dbg/bin/opspec3_mod.f90 +BRAMS/i10dbg/bin/opspec4_mod.f90 +BRAMS/i10dbg/bin/opspec.f90 +BRAMS/i10dbg/bin/opspec_fatal_mod.f90 +BRAMS/i10dbg/bin/opspec_mess_mod.f90 +BRAMS/i10dbg/bin/optimiz_coms.f90 +BRAMS/i10dbg/bin/optlib_mod.f90 +BRAMS/i10dbg/bin/overwrite_with_xml_config_mod.f90 +BRAMS/i10dbg/bin/ozone.f90 +BRAMS/i10dbg/bin/ozone_mod.f90 +BRAMS/i10dbg/bin/para_init.f90 +BRAMS/i10dbg/bin/paral.f90 +BRAMS/i10dbg/bin/par_bintp_mod.f90 +BRAMS/i10dbg/bin/par_decomp_bounds_mod.f90 +BRAMS/i10dbg/bin/par_decomp.f90 +BRAMS/i10dbg/bin/par_decomp_input_mod.f90 +BRAMS/i10dbg/bin/par_decomp_mod.f90 +BRAMS/i10dbg/bin/par_est_time_mod.f90 +BRAMS/i10dbg/bin/par_model_mod.f90 +BRAMS/i10dbg/bin/par_node_paths_mod.f90 +BRAMS/i10dbg/bin/parsefnam_mod.f90 +BRAMS/i10dbg/bin/parse_mod.f90 +BRAMS/i10dbg/bin/patch_array_size_mod.f90 +BRAMS/i10dbg/bin/patch_interp_driver_mod.f90 +BRAMS/i10dbg/bin/patch_interp_mod.f90 +BRAMS/i10dbg/bin/patch_land_average_mod.f90 +BRAMS/i10dbg/bin/patch_land_copy2_mod.f90 +BRAMS/i10dbg/bin/patch_land_unaverage_mod.f90 +BRAMS/i10dbg/bin/patch_latlon_mod.f90 +BRAMS/i10dbg/bin/patch_minsize_mod.f90 +BRAMS/i10dbg/bin/path_lengths_mod.f90 +BRAMS/i10dbg/bin/pc03_mod.f90 +BRAMS/i10dbg/bin/pcgeti_mod.f90 +BRAMS/i10dbg/bin/pcgetr_mod.f90 +BRAMS/i10dbg/bin/pcseti_mod.f90 +BRAMS/i10dbg/bin/perim_mod.f90 +BRAMS/i10dbg/bin/pft_coms.f90 +BRAMS/i10dbg/bin/phenology_aux.f90 +BRAMS/i10dbg/bin/phenology_coms.f90 +BRAMS/i10dbg/bin/phenology_driver_eq_0_mod.f90 +BRAMS/i10dbg/bin/phenology_driver_mod.f90 +BRAMS/i10dbg/bin/phenology_driv.f90 +BRAMS/i10dbg/bin/phenology_startup.f90 +BRAMS/i10dbg/bin/phenology_thresholds_mod.f90 +BRAMS/i10dbg/bin/photosyn_driv.f90 +BRAMS/i10dbg/bin/physiology_coms.f90 +BRAMS/i10dbg/bin/plant_structural_allocation_mod.f90 +BRAMS/i10dbg/bin/plchhq_mod.f90 +BRAMS/i10dbg/bin/plchlq_mod.f90 +BRAMS/i10dbg/bin/plchmq_mod.f90 +BRAMS/i10dbg/bin/plin_mod.f90 +BRAMS/i10dbg/bin/plkavg_mod.f90 +BRAMS/i10dbg/bin/plotif_mod.f90 +BRAMS/i10dbg/bin/plotit_mod.f90 +BRAMS/i10dbg/bin/plumerise_driver_mod.f90 +BRAMS/i10dbg/bin/plumerise_mod.f90 +BRAMS/i10dbg/bin/plumerise_vector.f90 +BRAMS/i10dbg/bin/point_mod.f90 +BRAMS/i10dbg/bin/points_mod.f90 +BRAMS/i10dbg/bin/polarst.f90 +BRAMS/i10dbg/bin/polarst_mod.f90 +BRAMS/i10dbg/bin/posidef_mod.f90 +BRAMS/i10dbg/bin/prdctp1_adap_mod.f90 +BRAMS/i10dbg/bin/prdctp1_new_mod.f90 +BRAMS/i10dbg/bin/prdctp2_adap_mod.f90 +BRAMS/i10dbg/bin/prdctp2_mod.f90 +BRAMS/i10dbg/bin/prdctu_adap_mod.f90 +BRAMS/i10dbg/bin/prdctu_mod.f90 +BRAMS/i10dbg/bin/prdctv_adap_mod.f90 +BRAMS/i10dbg/bin/prdctv_mod.f90 +BRAMS/i10dbg/bin/prdctw1_adap_mod.f90 +BRAMS/i10dbg/bin/prdctw1_mod.f90 +BRAMS/i10dbg/bin/prdctw2_adap_mod.f90 +BRAMS/i10dbg/bin/prdctw2_mod.f90 +BRAMS/i10dbg/bin/prdctw3_adap_mod.f90 +BRAMS/i10dbg/bin/prdctw3_mod.f90 +BRAMS/i10dbg/bin/prebarn_mod.f90 +BRAMS/i10dbg/bin/predict_mod.f90 +BRAMS/i10dbg/bin/predtr_mod.f90 +BRAMS/i10dbg/bin/prep_advflx_to_mass_mod.f90 +BRAMS/i10dbg/bin/prepare_timeavg_driver_mod.f90 +BRAMS/i10dbg/bin/prepare_timeavg_to_mass_mod.f90 +BRAMS/i10dbg/bin/prep_convflx_to_mass_mod.f90 +BRAMS/i10dbg/bin/prep_lnthetv_mod.f90 +BRAMS/i10dbg/bin/prep_lnthvtend_mod.f90 +BRAMS/i10dbg/bin/prep_timeave_mod.f90 +BRAMS/i10dbg/bin/prescribed_event_mod.f90 +BRAMS/i10dbg/bin/press_miss_mod.f90 +BRAMS/i10dbg/bin/pressure_stage_mod.f90 +BRAMS/i10dbg/bin/prfill_mod.f90 +BRAMS/i10dbg/bin/prgintrp_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_t_mod.f90 +BRAMS/i10dbg/bin/pr_hystatic_z_mod.f90 +BRAMS/i10dbg/bin/print_c_and_n_budgets_mod.f90 +BRAMS/i10dbg/bin/print_csiteipa_mod.f90 +BRAMS/i10dbg/bin/pr_interp_mod.f90 +BRAMS/i10dbg/bin/print_errmax_mod.f90 +BRAMS/i10dbg/bin/print_field_node_mod.f90 +BRAMS/i10dbg/bin/print_fields_mod.f90 +BRAMS/i10dbg/bin/print_lake_errmax_mod.f90 +BRAMS/i10dbg/bin/print_lakesite_mod.f90 +BRAMS/i10dbg/bin/print_longwave_mod.f90 +BRAMS/i10dbg/bin/print_photo_details_mod.f90 +BRAMS/i10dbg/bin/print_rk4patch_mod.f90 +BRAMS/i10dbg/bin/print_rk4_state_mod.f90 +BRAMS/i10dbg/bin/print_soil_info_mod.f90 +BRAMS/i10dbg/bin/pr_miss_fill_mod.f90 +BRAMS/i10dbg/bin/prt2d_mod.f90 +BRAMS/i10dbg/bin/prtlev_mod.f90 +BRAMS/i10dbg/bin/prtopt_mod.f90 +BRAMS/i10dbg/bin/prtout_mod.f90 +BRAMS/i10dbg/bin/psfill_mod.f90 +BRAMS/i10dbg/bin/ps_ps_mod.f90 +BRAMS/i10dbg/bin/ps_ps_rot_mod.f90 +BRAMS/i10dbg/bin/psxfer_mod.f90 +BRAMS/i10dbg/bin/putconfigint_mod.f90 +BRAMS/i10dbg/bin/putconfigreal8_mod.f90 +BRAMS/i10dbg/bin/putconfigreal_mod.f90 +BRAMS/i10dbg/bin/putconfigstring_mod.f90 +BRAMS/i10dbg/bin/pwritx_mod.f90 +BRAMS/i10dbg/bin/q8qst4_mod.f90 +BRAMS/i10dbg/bin/raco_adap.f90 +BRAMS/i10dbg/bin/raco.f90 +BRAMS/i10dbg/bin/rad_carma.f90 +BRAMS/i10dbg/bin/rad_ccmp.f90 +BRAMS/i10dbg/bin/radcomp_mod.f90 +BRAMS/i10dbg/bin/rad_copy2scratch_mod.f90 +BRAMS/i10dbg/bin/rad_driv.f90 +BRAMS/i10dbg/bin/radiate_driver.f90 +BRAMS/i10dbg/bin/radiate_driver_mod.f90 +BRAMS/i10dbg/bin/radiate_mod.f90 +BRAMS/i10dbg/bin/radiate_utils.f90 +BRAMS/i10dbg/bin/rad_mclat.f90 +BRAMS/i10dbg/bin/rad_mclat_mod.f90 +BRAMS/i10dbg/bin/rad_stable.f90 +BRAMS/i10dbg/bin/radvc_adap.f90 +BRAMS/i10dbg/bin/radvc.f90 +BRAMS/i10dbg/bin/radvc_mnt_driver_mod.f90 +BRAMS/i10dbg/bin/radvc_new.f90 +BRAMS/i10dbg/bin/ralph_vars_mod.f90 +BRAMS/i10dbg/bin/ramran_mod.f90 +BRAMS/i10dbg/bin/rams2_mm_mod.f90 +BRAMS/i10dbg/bin/rams_aprep_hkh_mod.f90 +BRAMS/i10dbg/bin/rams_aprep_p_mod.f90 +BRAMS/i10dbg/bin/rams_aprep_vkh_mod.f90 +BRAMS/i10dbg/bin/rams_dintsort_mod.f90 +BRAMS/i10dbg/bin/rams_filelist_mod.f90 +BRAMS/i10dbg/bin/rams_fltsort_mod.f90 +BRAMS/i10dbg/bin/rams_f_open_mod.f90 +BRAMS/i10dbg/bin/rams_getvar_mod.f90 +BRAMS/i10dbg/bin/rams_grad_mod.f90 +BRAMS/i10dbg/bin/rams_grid.f90 +BRAMS/i10dbg/bin/rams_intsort_mod.f90 +BRAMS/i10dbg/bin/rams_master.f90 +BRAMS/i10dbg/bin/rams_master_mod.f90 +BRAMS/i10dbg/bin/rams_mem_alloc.f90 +BRAMS/i10dbg/bin/rams_mem_alloc_mod.f90 +BRAMS/i10dbg/bin/rams_mm_mod.f90 +BRAMS/i10dbg/bin/rams_node_mod.f90 +BRAMS/i10dbg/bin/rams_output_mod.f90 +BRAMS/i10dbg/bin/rams_read_header.f90 +BRAMS/i10dbg/bin/rams_read_header_mod.f90 +BRAMS/i10dbg/bin/rams_sort_dint3_mod.f90 +BRAMS/i10dbg/bin/rams_unique_dint_mod.f90 +BRAMS/i10dbg/bin/rank_down_mod.f90 +BRAMS/i10dbg/bin/rank_up_mod.f90 +BRAMS/i10dbg/bin/ranlavg.f90 +BRAMS/i10dbg/bin/rayf_adap_mod.f90 +BRAMS/i10dbg/bin/rayf_mod.f90 +BRAMS/i10dbg/bin/rayft_mod.f90 +BRAMS/i10dbg/bin/rayleigh_mod.f90 +BRAMS/i10dbg/bin/rbnd_adap.f90 +BRAMS/i10dbg/bin/rbnd.f90 +BRAMS/i10dbg/bin/rcio.f90 +BRAMS/i10dbg/bin/rconstants.f90 +BRAMS/i10dbg/bin/rconv_driver.f90 +BRAMS/i10dbg/bin/rconv_driver_mod.f90 +BRAMS/i10dbg/bin/rdint.f90 +BRAMS/i10dbg/bin/read_ed10_ed20_history_file_mod.f90 +BRAMS/i10dbg/bin/read_ed21_history_file_mod.f90 +BRAMS/i10dbg/bin/read_ed21_history_unstruct_mod.f90 +BRAMS/i10dbg/bin/read_ed21_polyclone_mod.f90 +BRAMS/i10dbg/bin/read_ednl_mod.f90 +BRAMS/i10dbg/bin/read_ed_xml_config_mod.f90 +BRAMS/i10dbg/bin/read_events_xml_mod.f90 +BRAMS/i10dbg/bin/read_hdf_mod.f90 +BRAMS/i10dbg/bin/read_header_mod.f90 +BRAMS/i10dbg/bin/read_nl_mod.f90 +BRAMS/i10dbg/bin/read_plantation_fractions_mod.f90 +BRAMS/i10dbg/bin/read_ralph.f90 +BRAMS/i10dbg/bin/read_site_file_mod.f90 +BRAMS/i10dbg/bin/read_soil_depth_mod.f90 +BRAMS/i10dbg/bin/read_soil_moist_temp_mod.f90 +BRAMS/i10dbg/bin/read_sources_teb_mod.f90 +BRAMS/i10dbg/bin/rearrange_mod.f90 +BRAMS/i10dbg/bin/recycle.f90 +BRAMS/i10dbg/bin/recycle_mod.f90 +BRAMS/i10dbg/bin/refs1d_mod.f90 +BRAMS/i10dbg/bin/refs3d_mod.f90 +BRAMS/i10dbg/bin/ref_sounding.f90 +BRAMS/i10dbg/bin/refstate.f90 +BRAMS/i10dbg/bin/relms_mod.f90 +BRAMS/i10dbg/bin/reord_mod.f90 +BRAMS/i10dbg/bin/reorganize_sources_teb_mod.f90 +BRAMS/i10dbg/bin/reproduction_eq_0_mod.f90 +BRAMS/i10dbg/bin/reproduction.f90 +BRAMS/i10dbg/bin/reproduction_mod.f90 +BRAMS/i10dbg/bin/reset_averaged_vars_mod.f90 +BRAMS/i10dbg/bin/reset_mod.f90 +BRAMS/i10dbg/bin/resp_f_decomp_mod.f90 +BRAMS/i10dbg/bin/resp_rh_mod.f90 +BRAMS/i10dbg/bin/rexev.f90 +BRAMS/i10dbg/bin/rgbhls_mod.f90 +BRAMS/i10dbg/bin/rgrad.f90 +BRAMS/i10dbg/bin/rhhi.f90 +BRAMS/i10dbg/bin/rinit.f90 +BRAMS/i10dbg/bin/rio.f90 +BRAMS/i10dbg/bin/rk4_coms.f90 +BRAMS/i10dbg/bin/rk4_integ_utils.f90 +BRAMS/i10dbg/bin/rk4_misc.f90 +BRAMS/i10dbg/bin/rmass.f90 +BRAMS/i10dbg/bin/rname.f90 +BRAMS/i10dbg/bin/rnest_par.f90 +BRAMS/i10dbg/bin/rnode.f90 +BRAMS/i10dbg/bin/road_wall_layer_e_budget_mod.f90 +BRAMS/i10dbg/bin/roof_layer_e_budget_mod.f90 +BRAMS/i10dbg/bin/root_resp_norm_mod.f90 +BRAMS/i10dbg/bin/rotate_winds_mod.f90 +BRAMS/i10dbg/bin/rotate_winds_obs_mod.f90 +BRAMS/i10dbg/bin/rowcolmn_mod.f90 +BRAMS/i10dbg/bin/rpara.f90 +BRAMS/i10dbg/bin/rprnt.f90 +BRAMS/i10dbg/bin/rr_sfc_obs_mod.f90 +BRAMS/i10dbg/bin/rr_sfc_ver_mod.f90 +BRAMS/i10dbg/bin/rr_upa_obs_mod.f90 +BRAMS/i10dbg/bin/rr_upa_ver_mod.f90 +BRAMS/i10dbg/bin/rtgintrp_isan_mod.f90 +BRAMS/i10dbg/bin/rtgintrp_mod.f90 +BRAMS/i10dbg/bin/rthrm.f90 +BRAMS/i10dbg/bin/rtimh.f90 +BRAMS/i10dbg/bin/rtimi.f90 +BRAMS/i10dbg/bin/ruser.f90 +BRAMS/i10dbg/bin/satadjst_mod.f90 +BRAMS/i10dbg/bin/scale_ed_radiation_mod.f90 +BRAMS/i10dbg/bin/scl_advectc_plumerise_mod.f90 +BRAMS/i10dbg/bin/scl_misc_mod.f90 +BRAMS/i10dbg/bin/sedim_mod.f90 +BRAMS/i10dbg/bin/sedim_particles_mod.f90 +BRAMS/i10dbg/bin/seed_dispersal_mod.f90 +BRAMS/i10dbg/bin/selective_gaussian_2body_mod.f90 +BRAMS/i10dbg/bin/seter_mod.f90 +BRAMS/i10dbg/bin/set_flam_vert_mod.f90 +BRAMS/i10dbg/bin/set_grid_mod.f90 +BRAMS/i10dbg/bin/setgv_mod.f90 +BRAMS/i10dbg/bin/setlapseparms_mod.f90 +BRAMS/i10dbg/bin/set_mod.f90 +BRAMS/i10dbg/bin/set_polygon_coordinates_edcp_mod.f90 +BRAMS/i10dbg/bin/set_polygon_coordinates_mod.f90 +BRAMS/i10dbg/bin/set_site_defprops_mod.f90 +BRAMS/i10dbg/bin/setusv_mod.f90 +BRAMS/i10dbg/bin/sfc_check_mod.f90 +BRAMS/i10dbg/bin/sfc_data_convert_mod.f90 +BRAMS/i10dbg/bin/sfcdata_ed_mod.f90 +BRAMS/i10dbg/bin/sfcdata_mod.f90 +BRAMS/i10dbg/bin/sfc_fields_adap_mod.f90 +BRAMS/i10dbg/bin/sfc_fields_mod.f90 +BRAMS/i10dbg/bin/sfcinit_file_mod.f90 +BRAMS/i10dbg/bin/sfcinit_file_user_mod.f90 +BRAMS/i10dbg/bin/sfcinit_hstart_mod.f90 +BRAMS/i10dbg/bin/sfcinit_nofile_mod.f90 +BRAMS/i10dbg/bin/sfcinit_nofile_user_mod.f90 +BRAMS/i10dbg/bin/sfc_obs_convert_mod.f90 +BRAMS/i10dbg/bin/sfcopqr_mod.f90 +BRAMS/i10dbg/bin/sfc_pcp_mod.f90 +BRAMS/i10dbg/bin/sfcproc_mod.f90 +BRAMS/i10dbg/bin/sfcprt_mod.f90 +BRAMS/i10dbg/bin/sfcqual_mod.f90 +BRAMS/i10dbg/bin/sfcrad_ed_mod.f90 +BRAMS/i10dbg/bin/sfc_read_mod.f90 +BRAMS/i10dbg/bin/sfc_write_mod.f90 +BRAMS/i10dbg/bin/sflush_mod.f90 +BRAMS/i10dbg/bin/sfseti_mod.f90 +BRAMS/i10dbg/bin/sfsgfa_mod.f90 +BRAMS/i10dbg/bin/sh2mod_mod.f90 +BRAMS/i10dbg/bin/shcu_env_mod.f90 +BRAMS/i10dbg/bin/shcupar_mod.f90 +BRAMS/i10dbg/bin/shcu_vars_const.f90 +BRAMS/i10dbg/bin/short2diff_sib_mod.f90 +BRAMS/i10dbg/bin/short_bdown_weissnorman_mod.f90 +BRAMS/i10dbg/bin/shradc_mod.f90 +BRAMS/i10dbg/bin/shradp_mod.f90 +BRAMS/i10dbg/bin/sh_rates_mod.f90 +BRAMS/i10dbg/bin/sigzio_mod.f90 +BRAMS/i10dbg/bin/simple_lake_model_mod.f90 +BRAMS/i10dbg/bin/sndproc_mod.f90 +BRAMS/i10dbg/bin/sngloff_mod.f90 +BRAMS/i10dbg/bin/snowinit_mod.f90 +BRAMS/i10dbg/bin/soil_depth_fill_mod.f90 +BRAMS/i10dbg/bin/soil_idx2water_mod.f90 +BRAMS/i10dbg/bin/soil_moisture_init.f90 +BRAMS/i10dbg/bin/soil_moisture_init_mod.f90 +BRAMS/i10dbg/bin/soil_respiration.f90 +BRAMS/i10dbg/bin/soil_respiration_mod.f90 +BRAMS/i10dbg/bin/solar_radiation_breakdown_mod.f90 +BRAMS/i10dbg/bin/sort3_mod.f90 +BRAMS/i10dbg/bin/sort_down_mod.f90 +BRAMS/i10dbg/bin/sort_up_mod.f90 +BRAMS/i10dbg/bin/soundtopo_mod.f90 +BRAMS/i10dbg/bin/sources_teb_mod.f90 +BRAMS/i10dbg/bin/souza_cupar_driver.f90 +BRAMS/i10dbg/bin/souza_cupar_driver_mod.f90 +BRAMS/i10dbg/bin/spatial_averages_mod.f90 +BRAMS/i10dbg/bin/spline1_mod.f90 +BRAMS/i10dbg/bin/spline2_mod.f90 +BRAMS/i10dbg/bin/sst_check_header_mod.f90 +BRAMS/i10dbg/bin/sst_file_inv_mod.f90 +BRAMS/i10dbg/bin/sstinit_mod.f90 +BRAMS/i10dbg/bin/sstinit_user_mod.f90 +BRAMS/i10dbg/bin/sstnest_mod.f90 +BRAMS/i10dbg/bin/sst_read_dataheader_mod.f90 +BRAMS/i10dbg/bin/sst_read.f90 +BRAMS/i10dbg/bin/sst_read_mod.f90 +BRAMS/i10dbg/bin/sst_read_new_mod.f90 +BRAMS/i10dbg/bin/sst_update_mod.f90 +BRAMS/i10dbg/bin/sst_write_mod.f90 +BRAMS/i10dbg/bin/ssum_mod.f90 +BRAMS/i10dbg/bin/stable_cohorts.f90 +BRAMS/i10dbg/bin/stable_mod.f90 +BRAMS/i10dbg/bin/stainterp_mod.f90 +BRAMS/i10dbg/bin/staprt_mod.f90 +BRAMS/i10dbg/bin/stline_mod.f90 +BRAMS/i10dbg/bin/storage_theta_mod.f90 +BRAMS/i10dbg/bin/strain_adap_mod.f90 +BRAMS/i10dbg/bin/strain_mod.f90 +BRAMS/i10dbg/bin/strmfun_mod.f90 +BRAMS/i10dbg/bin/strmln_mod.f90 +BRAMS/i10dbg/bin/structural_growth_eq_0_mod.f90 +BRAMS/i10dbg/bin/structural_growth.f90 +BRAMS/i10dbg/bin/structural_growth_mod.f90 +BRAMS/i10dbg/bin/sublimate_mod.f90 +BRAMS/i10dbg/bin/sumn_mod.f90 +BRAMS/i10dbg/bin/sum_plant_cfluxes_mod.f90 +BRAMS/i10dbg/bin/sunavg_mod.f90 +BRAMS/i10dbg/bin/surface_aero_cond_mod.f90 +BRAMS/i10dbg/bin/surface_cd_mod.f90 +BRAMS/i10dbg/bin/surface_ri_mod.f90 +BRAMS/i10dbg/bin/swap32_mod.f90 +BRAMS/i10dbg/bin/sw_multiple_scatter_mod.f90 +BRAMS/i10dbg/bin/sw_twostream_clump_mod.f90 +BRAMS/i10dbg/bin/sxy_mod.f90 +BRAMS/i10dbg/bin/tabhab_mod.f90 +BRAMS/i10dbg/bin/tabmelt_mod.f90 +BRAMS/i10dbg/bin/tebc_init_mod.f90 +BRAMS/i10dbg/bin/teb_init_mod.f90 +BRAMS/i10dbg/bin/teb_spm_start.f90 +BRAMS/i10dbg/bin/tend0_mod.f90 +BRAMS/i10dbg/bin/tend0_plumerise_mod.f90 +BRAMS/i10dbg/bin/tend_accum_mod.f90 +BRAMS/i10dbg/bin/tendgas_mod.f90 +BRAMS/i10dbg/bin/test_mod.f90 +BRAMS/i10dbg/bin/therm_lib8.f90 +BRAMS/i10dbg/bin/therm_lib.f90 +BRAMS/i10dbg/bin/thermo_boundary_driver_mod.f90 +BRAMS/i10dbg/bin/thermo_mod.f90 +BRAMS/i10dbg/bin/timestep_mod.f90 +BRAMS/i10dbg/bin/timing_mod.f90 +BRAMS/i10dbg/bin/tkeeps_mod.f90 +BRAMS/i10dbg/bin/tkeinit_mod.f90 +BRAMS/i10dbg/bin/tkemy_mod.f90 +BRAMS/i10dbg/bin/tkenn.f90 +BRAMS/i10dbg/bin/tkescl_mod.f90 +BRAMS/i10dbg/bin/tokenize1_mod.f90 +BRAMS/i10dbg/bin/tokenize_mod.f90 +BRAMS/i10dbg/bin/tokfind_mod.f90 +BRAMS/i10dbg/bin/tolower_mod.f90 +BRAMS/i10dbg/bin/top_check_mod.f90 +BRAMS/i10dbg/bin/topobnd_mod.f90 +BRAMS/i10dbg/bin/topoq_mod.f90 +BRAMS/i10dbg/bin/toposmooth_mod.f90 +BRAMS/i10dbg/bin/top_read_mod.f90 +BRAMS/i10dbg/bin/topset_mod.f90 +BRAMS/i10dbg/bin/toptinit_mod.f90 +BRAMS/i10dbg/bin/toptinit_user_mod.f90 +BRAMS/i10dbg/bin/toptnest_mod.f90 +BRAMS/i10dbg/bin/toptsmth_mod.f90 +BRAMS/i10dbg/bin/top_write_mod.f90 +BRAMS/i10dbg/bin/trans_conv_mflx_mod.f90 +BRAMS/i10dbg/bin/transfer_ed2leaf_mod.f90 +BRAMS/i10dbg/bin/transfm_mod.f90 +BRAMS/i10dbg/bin/tricheck_mod.f90 +BRAMS/i10dbg/bin/trid2_mod.f90 +BRAMS/i10dbg/bin/tridiff1_adap_mod.f90 +BRAMS/i10dbg/bin/tridiff1_mod.f90 +BRAMS/i10dbg/bin/tridiff2_mod.f90 +BRAMS/i10dbg/bin/tridiff2orig_mod.f90 +BRAMS/i10dbg/bin/trid_mod.f90 +BRAMS/i10dbg/bin/tri_intp_cofs_mod.f90 +BRAMS/i10dbg/bin/trncl1_mod.f90 +BRAMS/i10dbg/bin/trncl2_mod.f90 +BRAMS/i10dbg/bin/trsets_mod.f90 +BRAMS/i10dbg/bin/trtend_mod.f90 +BRAMS/i10dbg/bin/trueps60_ps_mod.f90 +BRAMS/i10dbg/bin/trueps60_ps_rot_mod.f90 +BRAMS/i10dbg/bin/trueps60_uevetouv_mod.f90 +BRAMS/i10dbg/bin/trueps60_uvtoueve_mod.f90 +BRAMS/i10dbg/bin/truhor_mod.f90 +BRAMS/i10dbg/bin/truhor_opt_mod.f90 +BRAMS/i10dbg/bin/turb_coms.f90 +BRAMS/i10dbg/bin/turb_derivs.f90 +BRAMS/i10dbg/bin/turb_diff_adap.f90 +BRAMS/i10dbg/bin/turb_diff.f90 +BRAMS/i10dbg/bin/turb_k_adap.f90 +BRAMS/i10dbg/bin/turb_ke.f90 +BRAMS/i10dbg/bin/turb_k.f90 +BRAMS/i10dbg/bin/twostream_rad.f90 +BRAMS/i10dbg/bin/uevetouv_mod.f90 +BRAMS/i10dbg/bin/ugetarg_mod.f90 +BRAMS/i10dbg/bin/unarrange_mod.f90 +BRAMS/i10dbg/bin/unfdbackp_fixed_mod.f90 +BRAMS/i10dbg/bin/unfdbackp_mod.f90 +BRAMS/i10dbg/bin/unfpack1_mod.f90 +BRAMS/i10dbg/bin/unfpack_mod.f90 +BRAMS/i10dbg/bin/unmkbuff_mod.f90 +BRAMS/i10dbg/bin/upa_get_profile_mod.f90 +BRAMS/i10dbg/bin/upa_interp_mod.f90 +BRAMS/i10dbg/bin/update_budget_mod.f90 +BRAMS/i10dbg/bin/update_c_and_n_pools_mod.f90 +BRAMS/i10dbg/bin/update_derived_cohort_props_mod.f90 +BRAMS/i10dbg/bin/update_derived_props.f90 +BRAMS/i10dbg/bin/update_derived_props_mod.f90 +BRAMS/i10dbg/bin/update_diagnostic_vars_mod.f90 +BRAMS/i10dbg/bin/update_ed_yearly_vars_mod.f90 +BRAMS/i10dbg/bin/updatehydroparms_mod.f90 +BRAMS/i10dbg/bin/update_model_time_dm_mod.f90 +BRAMS/i10dbg/bin/update_mod.f90 +BRAMS/i10dbg/bin/update_patch_derived_props_mod.f90 +BRAMS/i10dbg/bin/update_patch_thermo_props_mod.f90 +BRAMS/i10dbg/bin/update_phenology_eq_0_mod.f90 +BRAMS/i10dbg/bin/update_phenology_mod.f90 +BRAMS/i10dbg/bin/update_plumerise_mod.f90 +BRAMS/i10dbg/bin/update_polygon_derived_props_mod.f90 +BRAMS/i10dbg/bin/update_psibar_mod.f90 +BRAMS/i10dbg/bin/update_rad_avg_mod.f90 +BRAMS/i10dbg/bin/update_site_derived_props_mod.f90 +BRAMS/i10dbg/bin/update_thermo_mod.f90 +BRAMS/i10dbg/bin/update_vital_rates_mod.f90 +BRAMS/i10dbg/bin/updatewatertableadd_mod.f90 +BRAMS/i10dbg/bin/updatewatertablebaseflow_mod.f90 +BRAMS/i10dbg/bin/updatewatertablesubtract_mod.f90 +BRAMS/i10dbg/bin/update_workload_mod.f90 +BRAMS/i10dbg/bin/urban_canopy.f90 +BRAMS/i10dbg/bin/urban_canopy_mod.f90 +BRAMS/i10dbg/bin/urban_drag_mod.f90 +BRAMS/i10dbg/bin/urban.f90 +BRAMS/i10dbg/bin/urban_hydro_mod.f90 +BRAMS/i10dbg/bin/urban_lw_coef_mod.f90 +BRAMS/i10dbg/bin/urban_mod.f90 +BRAMS/i10dbg/bin/urban_solar_abs_mod.f90 +BRAMS/i10dbg/bin/urb_drag_init_mod.f90 +BRAMS/i10dbg/bin/urb_tend_mod.f90 +BRAMS/i10dbg/bin/utils_f.f90 +BRAMS/i10dbg/bin/uvlc_uvll_mod.f90 +BRAMS/i10dbg/bin/uvll_uvlc_mod.f90 +BRAMS/i10dbg/bin/uvtoueve_mod.f90 +BRAMS/i10dbg/bin/uwc_mod.f90 +BRAMS/i10dbg/bin/uwcomp_mod.f90 +BRAMS/i10dbg/bin/valugp_mod.f90 +BRAMS/i10dbg/bin/vapdiff_mod.f90 +BRAMS/i10dbg/bin/vapflux_mod.f90 +BRAMS/i10dbg/bin/vapthrm_mod.f90 +BRAMS/i10dbg/bin/varf_adap_mod.f90 +BRAMS/i10dbg/bin/varf_file_inv_mod.f90 +BRAMS/i10dbg/bin/varfile_nstfeed_mod.f90 +BRAMS/i10dbg/bin/varfile_refstate_mod.f90 +BRAMS/i10dbg/bin/varf_read.f90 +BRAMS/i10dbg/bin/varf_read_mod.f90 +BRAMS/i10dbg/bin/varf_update.f90 +BRAMS/i10dbg/bin/varf_update_mod.f90 +BRAMS/i10dbg/bin/varref_mod.f90 +BRAMS/i10dbg/bin/var_tables.f90 +BRAMS/i10dbg/bin/varutils.f90 +BRAMS/i10dbg/bin/varuv_mod.f90 +BRAMS/i10dbg/bin/varweight_mod.f90 +BRAMS/i10dbg/bin/vcirec_mod.f90 +BRAMS/i10dbg/bin/vcorec_mod.f90 +BRAMS/i10dbg/bin/vctran_mod.f90 +BRAMS/i10dbg/bin/vector_mod.f90 +BRAMS/i10dbg/bin/vegetation_dynamics_eq_0_mod.f90 +BRAMS/i10dbg/bin/vegetation_dynamics.f90 +BRAMS/i10dbg/bin/vegetation_dynamics_mod.f90 +BRAMS/i10dbg/bin/vegndvi_mod.f90 +BRAMS/i10dbg/bin/vel_advectc_adap_mod.f90 +BRAMS/i10dbg/bin/vel_advectc_mod.f90 +BRAMS/i10dbg/bin/vel_advectc_plumerise_mod.f90 +BRAMS/i10dbg/bin/velvct_mod.f90 +BRAMS/i10dbg/bin/vertmap2_mod.f90 +BRAMS/i10dbg/bin/vfinit_mod.f90 +BRAMS/i10dbg/bin/vfintrpf_mod.f90 +BRAMS/i10dbg/bin/vfirec_mod.f90 +BRAMS/i10dbg/bin/vforec_mod.f90 +BRAMS/i10dbg/bin/vformat.f90 +BRAMS/i10dbg/bin/viirec_mod.f90 +BRAMS/i10dbg/bin/v_interps.f90 +BRAMS/i10dbg/bin/viorec_mod.f90 +BRAMS/i10dbg/bin/visc_w_mod.f90 +BRAMS/i10dbg/bin/visurf_mod.f90 +BRAMS/i10dbg/bin/vmissr_mod.f90 +BRAMS/i10dbg/bin/vmissw_mod.f90 +BRAMS/i10dbg/bin/vpsets_mod.f90 +BRAMS/i10dbg/bin/vshyd_mod.f90 +BRAMS/i10dbg/bin/vtab_fill.f90 +BRAMS/i10dbg/bin/vtables2_mod.f90 +BRAMS/i10dbg/bin/vtables_scalar_mod.f90 +BRAMS/i10dbg/bin/vtables_scalar_new_mod.f90 +BRAMS/i10dbg/bin/vterpp_i_mod.f90 +BRAMS/i10dbg/bin/vterpp_s_mod.f90 +BRAMS/i10dbg/bin/vwrti_mod.f90 +BRAMS/i10dbg/bin/vwrt_mod.f90 +BRAMS/i10dbg/bin/w3fb06_mod.f90 +BRAMS/i10dbg/bin/w3fb07_mod.f90 +BRAMS/i10dbg/bin/walltime_mod.f90 +BRAMS/i10dbg/bin/warning_mod.f90 +BRAMS/i10dbg/bin/waterbal_mod.f90 +BRAMS/i10dbg/bin/wetthrm3_mod.f90 +BRAMS/i10dbg/bin/winddf_mod.f90 +BRAMS/i10dbg/bin/winduv_mod.f90 +BRAMS/i10dbg/bin/writebin_mod.f90 +BRAMS/i10dbg/bin/write_ed_xml_config_mod.f90 +BRAMS/i10dbg/bin/writehydro_mod.f90 +BRAMS/i10dbg/bin/w_shallow_mod.f90 +BRAMS/i10dbg/bin/wtstr_mod.f90 +BRAMS/i10dbg/bin/x02_mod.f90 +BRAMS/i10dbg/bin/xcol2array_mod.f90 +BRAMS/i10dbg/bin/xj_mod.f90 +BRAMS/i10dbg/bin/xy_ij_mod.f90 +BRAMS/i10dbg/bin/xy_ll_mod.f90 +BRAMS/i10dbg/bin/ycol2array_mod.f90 +BRAMS/i10dbg/bin/yesterday_mod.f90 +BRAMS/i10dbg/bin/zcol2array_mod.f90 +BRAMS/i10dbg/bin/ze_dims_mod.f90 +BRAMS/i10dbg/bin/zen_mod.f90 +BRAMS/i10dbg/bin/zeragas_mod.f90 +BRAMS/i10dbg/bin/zero_ed_daily_output_vars_mod.f90 +BRAMS/i10dbg/bin/zero_ed_daily_vars_mod.f90 +BRAMS/i10dbg/bin/zero_ed_monthly_output_vars_mod.f90 +BRAMS/i10dbg/bin/zero_ed_yearly_vars_mod.f90 +BRAMS/i10dbg/bin/zeroout_mod.f90 +BRAMS/i10dbg/bin/zoq_mod.f90 +BRAMS/i10dbg/bin/a3e0_mod.mod +BRAMS/i10dbg/bin/a3e1_mod.mod +BRAMS/i10dbg/bin/a3e2_mod.mod +BRAMS/i10dbg/bin/abort_run_mod.mod +BRAMS/i10dbg/bin/acctimes_mod.mod +BRAMS/i10dbg/bin/accum_mod.mod +BRAMS/i10dbg/bin/acnst_mod.mod +BRAMS/i10dbg/bin/acoust_adap_mod.mod +BRAMS/i10dbg/bin/acoustic_new_mod.mod +BRAMS/i10dbg/bin/acoust_new_mod.mod +BRAMS/i10dbg/bin/adap_bldg_mod.mod +BRAMS/i10dbg/bin/adivb_mod.mod +BRAMS/i10dbg/bin/adj1_mod.mod +BRAMS/i10dbg/bin/adjust_sfcw_properties_mod.mod +BRAMS/i10dbg/bin/adjust_topsoil_properties_mod.mod +BRAMS/i10dbg/bin/adjust_veg_properties_mod.mod +BRAMS/i10dbg/bin/advectc_mod.mod +BRAMS/i10dbg/bin/advected_mod.mod +BRAMS/i10dbg/bin/advect_kit.mod +BRAMS/i10dbg/bin/advect_sca_mod.mod +BRAMS/i10dbg/bin/advect_theta_mod.mod +BRAMS/i10dbg/bin/advect_vec_mod.mod +BRAMS/i10dbg/bin/advtndc_adap_mod.mod +BRAMS/i10dbg/bin/advtndc_mod.mod +BRAMS/i10dbg/bin/advtndc_plumerise_mod.mod +BRAMS/i10dbg/bin/ae0_mod.mod +BRAMS/i10dbg/bin/ae1m1_mod.mod +BRAMS/i10dbg/bin/ae1_mod.mod +BRAMS/i10dbg/bin/ae1p1_mod.mod +BRAMS/i10dbg/bin/ae1p1p1_mod.mod +BRAMS/i10dbg/bin/ae1t0_mod.mod +BRAMS/i10dbg/bin/ae1t0p1_mod.mod +BRAMS/i10dbg/bin/ae1t1_mod.mod +BRAMS/i10dbg/bin/ae1t1p1_mod.mod +BRAMS/i10dbg/bin/ae1tn1_mod.mod +BRAMS/i10dbg/bin/ae2_mod.mod +BRAMS/i10dbg/bin/ae3m3d0_mod.mod +BRAMS/i10dbg/bin/ae3m3_mod.mod +BRAMS/i10dbg/bin/ae3_mod.mod +BRAMS/i10dbg/bin/ae3p3_mod.mod +BRAMS/i10dbg/bin/ae3t0p3_mod.mod +BRAMS/i10dbg/bin/ae3t3_mod.mod +BRAMS/i10dbg/bin/ae3t3p3_mod.mod +BRAMS/i10dbg/bin/aen1_mod.mod +BRAMS/i10dbg/bin/aen3t0p3_mod.mod +BRAMS/i10dbg/bin/akscal_init_mod.mod +BRAMS/i10dbg/bin/alebl_mod.mod +BRAMS/i10dbg/bin/alloc_edcp_driver_mod.mod +BRAMS/i10dbg/bin/allometry.mod +BRAMS/i10dbg/bin/alt_dia_mod.mod +BRAMS/i10dbg/bin/aminmax_mod.mod +BRAMS/i10dbg/bin/angle_of_incid_mod.mod +BRAMS/i10dbg/bin/an_header.mod +BRAMS/i10dbg/bin/anlavg_mod.mod +BRAMS/i10dbg/bin/anlhdf_mod.mod +BRAMS/i10dbg/bin/anlwrt_mod.mod +BRAMS/i10dbg/bin/aone_mod.mod +BRAMS/i10dbg/bin/api_prlatlon_mod.mod +BRAMS/i10dbg/bin/apply_cloud_forcing_mod.mod +BRAMS/i10dbg/bin/apply_drydep_mod.mod +BRAMS/i10dbg/bin/apply_forestry_mod.mod +BRAMS/i10dbg/bin/arinam_mod.mod +BRAMS/i10dbg/bin/array2xcol_mod.mod +BRAMS/i10dbg/bin/array2ycol_mod.mod +BRAMS/i10dbg/bin/array2zcol_mod.mod +BRAMS/i10dbg/bin/arrsnd_mod.mod +BRAMS/i10dbg/bin/arscam_mod.mod +BRAMS/i10dbg/bin/assign_prescribed_phen_mod.mod +BRAMS/i10dbg/bin/atimb_mod.mod +BRAMS/i10dbg/bin/atob_log_mod.mod +BRAMS/i10dbg/bin/atob_mod.mod +BRAMS/i10dbg/bin/auto_accret_mod.mod +BRAMS/i10dbg/bin/average_mod.mod +BRAMS/i10dbg/bin/avg_ed_daily_output_pool_mod.mod +BRAMS/i10dbg/bin/avgvel_mod.mod +BRAMS/i10dbg/bin/avint_mod.mod +BRAMS/i10dbg/bin/awtcmp_mod.mod +BRAMS/i10dbg/bin/azero_mod.mod +BRAMS/i10dbg/bin/banbks_mod.mod +BRAMS/i10dbg/bin/bandec_mod.mod +BRAMS/i10dbg/bin/bdf2_solver_mod.mod +BRAMS/i10dbg/bin/binom_mod.mod +BRAMS/i10dbg/bin/bld_e_budget_mod.mod +BRAMS/i10dbg/bin/bn_parm_mod.mod +BRAMS/i10dbg/bin/bn_pass_mod.mod +BRAMS/i10dbg/bin/bn_qual_mod.mod +BRAMS/i10dbg/bin/botset_adap_mod.mod +BRAMS/i10dbg/bin/botset_mod.mod +BRAMS/i10dbg/bin/boyanc_mod.mod +BRAMS/i10dbg/bin/brams_fail_whale_mod.mod +BRAMS/i10dbg/bin/bruvais_mod.mod +BRAMS/i10dbg/bin/bubble_mod.mod +BRAMS/i10dbg/bin/buoyancy_acc_mod.mod +BRAMS/i10dbg/bin/buoyancy_mod.mod +BRAMS/i10dbg/bin/buoyancy_plumerise_mod.mod +BRAMS/i10dbg/bin/c34constants.mod +BRAMS/i10dbg/bin/calc_flow_routing_mod.mod +BRAMS/i10dbg/bin/calchydrosubsurface_mod.mod +BRAMS/i10dbg/bin/calchydrosurface_mod.mod +BRAMS/i10dbg/bin/calc_met_lapse_mod.mod +BRAMS/i10dbg/bin/calcwatertable_mod.mod +BRAMS/i10dbg/bin/canopy_air_coms.mod +BRAMS/i10dbg/bin/canopy_derivs_two_mod.mod +BRAMS/i10dbg/bin/canopy_layer_coms.mod +BRAMS/i10dbg/bin/canopy_photosynthesis_mod.mod +BRAMS/i10dbg/bin/canopy_radiation_coms.mod +BRAMS/i10dbg/bin/canopy_struct_dynamics.mod +BRAMS/i10dbg/bin/catt_start.mod +BRAMS/i10dbg/bin/cbrt8_mod.mod +BRAMS/i10dbg/bin/cbrt_mod.mod +BRAMS/i10dbg/bin/cdf2normal_mod.mod +BRAMS/i10dbg/bin/cdf_mod.mod +BRAMS/i10dbg/bin/cfact_mod.mod +BRAMS/i10dbg/bin/cfll_mod.mod +BRAMS/i10dbg/bin/cfl_mod.mod +BRAMS/i10dbg/bin/cfux_mod.mod +BRAMS/i10dbg/bin/cfuy_mod.mod +BRAMS/i10dbg/bin/char_strip_var_mod.mod +BRAMS/i10dbg/bin/check_real_mod.mod +BRAMS/i10dbg/bin/check_rescale_mod.mod +BRAMS/i10dbg/bin/chemistry_mod.mod +BRAMS/i10dbg/bin/chkcyc_mod.mod +BRAMS/i10dbg/bin/cio_c_mod.mod +BRAMS/i10dbg/bin/cio_c_sca_mod.mod +BRAMS/i10dbg/bin/cio_f8_mod.mod +BRAMS/i10dbg/bin/cio_f8_sca_mod.mod +BRAMS/i10dbg/bin/cio_f_mod.mod +BRAMS/i10dbg/bin/cio_f_sca_mod.mod +BRAMS/i10dbg/bin/cio_i_mod.mod +BRAMS/i10dbg/bin/cio_i_sca_mod.mod +BRAMS/i10dbg/bin/cio_pos_file_mod.mod +BRAMS/i10dbg/bin/cldnuc_mod.mod +BRAMS/i10dbg/bin/clgen_mod.mod +BRAMS/i10dbg/bin/cloud_opt_mod.mod +BRAMS/i10dbg/bin/cloudprep_rad_mod.mod +BRAMS/i10dbg/bin/cloud_sketch_mod.mod +BRAMS/i10dbg/bin/clsgks_mod.mod +BRAMS/i10dbg/bin/cl_top_mod.mod +BRAMS/i10dbg/bin/coarse2fine_driver_mod.mod +BRAMS/i10dbg/bin/coarse2fine_mod.mod +BRAMS/i10dbg/bin/coefz_adap_mod.mod +BRAMS/i10dbg/bin/coefz_mod.mod +BRAMS/i10dbg/bin/cofnest_mod.mod +BRAMS/i10dbg/bin/col1_mod.mod +BRAMS/i10dbg/bin/col2_mod.mod +BRAMS/i10dbg/bin/col3344_mod.mod +BRAMS/i10dbg/bin/col3443_mod.mod +BRAMS/i10dbg/bin/col3_mod.mod +BRAMS/i10dbg/bin/cols_mod.mod +BRAMS/i10dbg/bin/colxfers_mod.mod +BRAMS/i10dbg/bin/commio_mod.mod +BRAMS/i10dbg/bin/comm_time_mod.mod +BRAMS/i10dbg/bin/comm_time_new_mod.mod +BRAMS/i10dbg/bin/comp_avgu_mod.mod +BRAMS/i10dbg/bin/comp_avgv_mod.mod +BRAMS/i10dbg/bin/comp_press_mod.mod +BRAMS/i10dbg/bin/comp_rhfrac_mod.mod +BRAMS/i10dbg/bin/compute_budget_mod.mod +BRAMS/i10dbg/bin/compute_c_and_n_storage_mod.mod +BRAMS/i10dbg/bin/compute_co2_storage_mod.mod +BRAMS/i10dbg/bin/compute_energy_storage_mod.mod +BRAMS/i10dbg/bin/compute_mass_flux_mod.mod +BRAMS/i10dbg/bin/compute_netrad_mod.mod +BRAMS/i10dbg/bin/compute_water_storage_mod.mod +BRAMS/i10dbg/bin/cond_file_inv_mod.mod +BRAMS/i10dbg/bin/cond_read_mod.mod +BRAMS/i10dbg/bin/cond_update_mod.mod +BRAMS/i10dbg/bin/conpar_mod.mod +BRAMS/i10dbg/bin/conrec_mod.mod +BRAMS/i10dbg/bin/consts_coms.mod +BRAMS/i10dbg/bin/contnuc_mod.mod +BRAMS/i10dbg/bin/conv_coms.mod +BRAMS/i10dbg/bin/convert_mod.mod +BRAMS/i10dbg/bin/convert_to_misture_ratio_teb_mod.mod +BRAMS/i10dbg/bin/conv_ppm_rm_mod.mod +BRAMS/i10dbg/bin/copy_atm2lsm_mod.mod +BRAMS/i10dbg/bin/copy_avgvars_to_leaf_mod.mod +BRAMS/i10dbg/bin/copyback_mod.mod +BRAMS/i10dbg/bin/copy_bdf2_prev_mod.mod +BRAMS/i10dbg/bin/copy_fb_patch_mod.mod +BRAMS/i10dbg/bin/copy_fluxes_future_2_past_mod.mod +BRAMS/i10dbg/bin/copy_fluxes_lsm2atm_mod.mod +BRAMS/i10dbg/bin/copy_in_bramsmpi_mod.mod +BRAMS/i10dbg/bin/copy_in_bramsnl_mod.mod +BRAMS/i10dbg/bin/copy_initp2prev_mod.mod +BRAMS/i10dbg/bin/copy_lake_brams_mod.mod +BRAMS/i10dbg/bin/copy_lake_init_mod.mod +BRAMS/i10dbg/bin/copy_met_2_lake_mod.mod +BRAMS/i10dbg/bin/copy_met_2_rk4site_mod.mod +BRAMS/i10dbg/bin/copy_patch_init_carbon_mod.mod +BRAMS/i10dbg/bin/copy_patch_init_mod.mod +BRAMS/i10dbg/bin/copy_path_from_grid_1_mod.mod +BRAMS/i10dbg/bin/copy_prev2patch_mod.mod +BRAMS/i10dbg/bin/copy_rk4_patch_mod.mod +BRAMS/i10dbg/bin/corlos_mod.mod +BRAMS/i10dbg/bin/corlsu_mod.mod +BRAMS/i10dbg/bin/corlsv_mod.mod +BRAMS/i10dbg/bin/count_pft_xml_config_mod.mod +BRAMS/i10dbg/bin/cp2mod_mod.mod +BRAMS/i10dbg/bin/cpclam_mod.mod +BRAMS/i10dbg/bin/cpcldr_mod.mod +BRAMS/i10dbg/bin/cpcnrc_mod.mod +BRAMS/i10dbg/bin/cpezct_mod.mod +BRAMS/i10dbg/bin/cpgeti_mod.mod +BRAMS/i10dbg/bin/cpgetr_mod.mod +BRAMS/i10dbg/bin/cplbdr_mod.mod +BRAMS/i10dbg/bin/cppkcl_mod.mod +BRAMS/i10dbg/bin/cprect_mod.mod +BRAMS/i10dbg/bin/cpsetc_mod.mod +BRAMS/i10dbg/bin/cpseti_mod.mod +BRAMS/i10dbg/bin/cpsetr_mod.mod +BRAMS/i10dbg/bin/cputime_mod.mod +BRAMS/i10dbg/bin/create_ed10_ed20_fname_mod.mod +BRAMS/i10dbg/bin/csband_mod.mod +BRAMS/i10dbg/bin/cscalei_mod.mod +BRAMS/i10dbg/bin/cscale_mod.mod +BRAMS/i10dbg/bin/ctrlvols_mod.mod +BRAMS/i10dbg/bin/cu_environ_mod.mod +BRAMS/i10dbg/bin/cu_file_inv_mod.mod +BRAMS/i10dbg/bin/cu_inv_tend_mod.mod +BRAMS/i10dbg/bin/cumsum_mod.mod +BRAMS/i10dbg/bin/cumulus_time_mod.mod +BRAMS/i10dbg/bin/cuparth_mod.mod +BRAMS/i10dbg/bin/cuparth_shal_mod.mod +BRAMS/i10dbg/bin/cup_dd_aa0_mod.mod +BRAMS/i10dbg/bin/cup_dd_edt_mod.mod +BRAMS/i10dbg/bin/cup_dd_he_mod.mod +BRAMS/i10dbg/bin/cup_dd_moisture_mod.mod +BRAMS/i10dbg/bin/cup_dd_nms_mod.mod +BRAMS/i10dbg/bin/cup_dellabot_mod.mod +BRAMS/i10dbg/bin/cup_dellas_mod.mod +BRAMS/i10dbg/bin/cup_dellas_shallow_mod.mod +BRAMS/i10dbg/bin/cup_direction2_mod.mod +BRAMS/i10dbg/bin/cup_enss_mod.mod +BRAMS/i10dbg/bin/cup_enss_shal_mod.mod +BRAMS/i10dbg/bin/cup_env_clev_mod.mod +BRAMS/i10dbg/bin/cup_env_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_16_mod.mod +BRAMS/i10dbg/bin/cup_forcing_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_cin_mod.mod +BRAMS/i10dbg/bin/cup_kbcon_mod.mod +BRAMS/i10dbg/bin/cup_ktop_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_mod.mod +BRAMS/i10dbg/bin/cup_output_ens_shal_mod.mod +BRAMS/i10dbg/bin/cup_up_aa0_mod.mod +BRAMS/i10dbg/bin/cup_up_he_mod.mod +BRAMS/i10dbg/bin/cup_up_moisture_mod.mod +BRAMS/i10dbg/bin/cup_up_nms_mod.mod +BRAMS/i10dbg/bin/cu_read_mod.mod +BRAMS/i10dbg/bin/curved_mod.mod +BRAMS/i10dbg/bin/curve_mod.mod +BRAMS/i10dbg/bin/cu_update_mod.mod +BRAMS/i10dbg/bin/cvmgm_mod.mod +BRAMS/i10dbg/bin/cvmgn_mod.mod +BRAMS/i10dbg/bin/cvmgp_mod.mod +BRAMS/i10dbg/bin/cvmgz_mod.mod +BRAMS/i10dbg/bin/cyclic_mod.mod +BRAMS/i10dbg/bin/cyclic_set_mod.mod +BRAMS/i10dbg/bin/damp_grav_wave_mod.mod +BRAMS/i10dbg/bin/dashdb_mod.mod +BRAMS/i10dbg/bin/dashdc_mod.mod +BRAMS/i10dbg/bin/datassim_mod.mod +BRAMS/i10dbg/bin/date_2_seconds_mod.mod +BRAMS/i10dbg/bin/date_abs_secs2_mod.mod +BRAMS/i10dbg/bin/date_abs_secs_mod.mod +BRAMS/i10dbg/bin/date_add_to_big_mod.mod +BRAMS/i10dbg/bin/date_add_to_mod.mod +BRAMS/i10dbg/bin/date_make_big_mod.mod +BRAMS/i10dbg/bin/date_secs_ymdt_mod.mod +BRAMS/i10dbg/bin/date_unmake_big_mod.mod +BRAMS/i10dbg/bin/dble2sngl_mod.mod +BRAMS/i10dbg/bin/dcvmgm_mod.mod +BRAMS/i10dbg/bin/dcvmgp_mod.mod +BRAMS/i10dbg/bin/dcw_swap16_mod.mod +BRAMS/i10dbg/bin/dcw_swap32_mod.mod +BRAMS/i10dbg/bin/dcw_swap64_mod.mod +BRAMS/i10dbg/bin/ddens_dt_effect_mod.mod +BRAMS/i10dbg/bin/dealloc_all_mod.mod +BRAMS/i10dbg/bin/deblank_mod.mod +BRAMS/i10dbg/bin/decomp_coms.mod +BRAMS/i10dbg/bin/decomp_plot_mod.mod +BRAMS/i10dbg/bin/define_pbl_height_mod.mod +BRAMS/i10dbg/bin/detab_mod.mod +BRAMS/i10dbg/bin/detailed_coms.mod +BRAMS/i10dbg/bin/diagon_mod.mod +BRAMS/i10dbg/bin/diffprep_mod.mod +BRAMS/i10dbg/bin/diffsclr_adap_mod.mod +BRAMS/i10dbg/bin/diffsclr_brams31_mod.mod +BRAMS/i10dbg/bin/diffsclr_mod.mod +BRAMS/i10dbg/bin/diffuse_brams31_mod.mod +BRAMS/i10dbg/bin/diffuse_mod.mod +BRAMS/i10dbg/bin/diffvel_adap_mod.mod +BRAMS/i10dbg/bin/diffvel_mod.mod +BRAMS/i10dbg/bin/dist_gc_mod.mod +BRAMS/i10dbg/bin/disturbance_utils.mod +BRAMS/i10dbg/bin/disturb_coms.mod +BRAMS/i10dbg/bin/divcart_mod.mod +BRAMS/i10dbg/bin/divstar_mod.mod +BRAMS/i10dbg/bin/dmax2_mod.mod +BRAMS/i10dbg/bin/dmin2_mod.mod +BRAMS/i10dbg/bin/dnswt2_mod.mod +BRAMS/i10dbg/bin/domain_decomp.mod +BRAMS/i10dbg/bin/dpstable_mod.mod +BRAMS/i10dbg/bin/drwstr_mod.mod +BRAMS/i10dbg/bin/drydep_driver_mod.mod +BRAMS/i10dbg/bin/dry_dep_gaseous_mod.mod +BRAMS/i10dbg/bin/dry_dep_mod.mod +BRAMS/i10dbg/bin/dry_dep_particles_mod.mod +BRAMS/i10dbg/bin/drythrm_mod.mod +BRAMS/i10dbg/bin/dssum_mod.mod +BRAMS/i10dbg/bin/dtedint_mod.mod +BRAMS/i10dbg/bin/dted_mod.mod +BRAMS/i10dbg/bin/dtset.mod +BRAMS/i10dbg/bin/dum1_zero_mod.mod +BRAMS/i10dbg/bin/dump_domain_decomposition_mod.mod +BRAMS/i10dbg/bin/dump_dtset_mod.mod +BRAMS/i10dbg/bin/dump_modsched_mod.mod +BRAMS/i10dbg/bin/dump_radinfo_mod.mod +BRAMS/i10dbg/bin/dumset_mod.mod +BRAMS/i10dbg/bin/each_call_mod.mod +BRAMS/i10dbg/bin/each_column_mod.mod +BRAMS/i10dbg/bin/ed1_fileinfo_mod.mod +BRAMS/i10dbg/bin/ed21_fileinfo_mod.mod +BRAMS/i10dbg/bin/ed_bigleaf_init_mod.mod +BRAMS/i10dbg/bin/ed_coup_driver_mod.mod +BRAMS/i10dbg/bin/ed_coup_model_mod.mod +BRAMS/i10dbg/bin/edcp_get_work_mod.mod +BRAMS/i10dbg/bin/edcp_nodebounds_self_mod.mod +BRAMS/i10dbg/bin/edcp_parvec_work_mod.mod +BRAMS/i10dbg/bin/ed_datp_datq_mod.mod +BRAMS/i10dbg/bin/ed_datp_datsoil_mod.mod +BRAMS/i10dbg/bin/ed_filelist_mod.mod +BRAMS/i10dbg/bin/ed_gridset_mod.mod +BRAMS/i10dbg/bin/ed_init_atm_mod.mod +BRAMS/i10dbg/bin/ed_init_radiation_mod.mod +BRAMS/i10dbg/bin/ed_ll_xy_mod.mod +BRAMS/i10dbg/bin/ed_max_dims.mod +BRAMS/i10dbg/bin/ed_mem_grid_dim_defs.mod +BRAMS/i10dbg/bin/ed_misc_coms.mod +BRAMS/i10dbg/bin/ed_newgrid_mod.mod +BRAMS/i10dbg/bin/ed_node_coms.mod +BRAMS/i10dbg/bin/ed_opspec_grid_mod.mod +BRAMS/i10dbg/bin/ed_opspec_misc_mod.mod +BRAMS/i10dbg/bin/ed_opspec_par_mod.mod +BRAMS/i10dbg/bin/ed_opspec_times_mod.mod +BRAMS/i10dbg/bin/ed_output_mod.mod +BRAMS/i10dbg/bin/ed_para_coms.mod +BRAMS/i10dbg/bin/ed_polarst_mod.mod +BRAMS/i10dbg/bin/ed_state_vars.mod +BRAMS/i10dbg/bin/ed_therm_lib.mod +BRAMS/i10dbg/bin/ed_timestep_mod.mod +BRAMS/i10dbg/bin/ed_var_tables.mod +BRAMS/i10dbg/bin/ed_work_vars.mod +BRAMS/i10dbg/bin/ed_xy_ll_mod.mod +BRAMS/i10dbg/bin/ed_zen_mod.mod +BRAMS/i10dbg/bin/effxy_mod.mod +BRAMS/i10dbg/bin/eifun8_mod.mod +BRAMS/i10dbg/bin/eintp_mod.mod +BRAMS/i10dbg/bin/elgs_mod.mod +BRAMS/i10dbg/bin/emfactor_mod.mod +BRAMS/i10dbg/bin/emissao_mod.mod +BRAMS/i10dbg/bin/emission_source_map.mod +BRAMS/i10dbg/bin/ename_coms.mod +BRAMS/i10dbg/bin/encd_mod.mod +BRAMS/i10dbg/bin/endian_mod.mod +BRAMS/i10dbg/bin/enemb_mod.mod +BRAMS/i10dbg/bin/eng_params_mod.mod +BRAMS/i10dbg/bin/entrainment_mod.mod +BRAMS/i10dbg/bin/errorfun_mod.mod +BRAMS/i10dbg/bin/esat_l_mod.mod +BRAMS/i10dbg/bin/esat_pr_mod.mod +BRAMS/i10dbg/bin/euler_integ_mod.mod +BRAMS/i10dbg/bin/euler_timestep_mod.mod +BRAMS/i10dbg/bin/evaporate_mod.mod +BRAMS/i10dbg/bin/event_fertilize_mod.mod +BRAMS/i10dbg/bin/event_fire_mod.mod +BRAMS/i10dbg/bin/event_harvest_mod.mod +BRAMS/i10dbg/bin/event_irrigate_mod.mod +BRAMS/i10dbg/bin/event_planting_mod.mod +BRAMS/i10dbg/bin/event_till_mod.mod +BRAMS/i10dbg/bin/ex_adv_buff_mod.mod +BRAMS/i10dbg/bin/exadvlf_mod.mod +BRAMS/i10dbg/bin/excondiv_mod.mod +BRAMS/i10dbg/bin/ex_cyc_buff_mod.mod +BRAMS/i10dbg/bin/exevolve_mod.mod +BRAMS/i10dbg/bin/ex_full_buff_mod.mod +BRAMS/i10dbg/bin/exhtend_ad_mod.mod +BRAMS/i10dbg/bin/exhtend_st_mod.mod +BRAMS/i10dbg/bin/ex_lbc_buff_mod.mod +BRAMS/i10dbg/bin/expected_mod.mod +BRAMS/i10dbg/bin/expmsq_mod.mod +BRAMS/i10dbg/bin/ex_st_buff_mod.mod +BRAMS/i10dbg/bin/exthvadv_mod.mod +BRAMS/i10dbg/bin/extras.mod +BRAMS/i10dbg/bin/ezcntr_mod.mod +BRAMS/i10dbg/bin/fail_whale_mod.mod +BRAMS/i10dbg/bin/fallpart_mod.mod +BRAMS/i10dbg/bin/fa_preptc_adap_mod.mod +BRAMS/i10dbg/bin/fa_preptc_mod.mod +BRAMS/i10dbg/bin/farq_leuning.mod +BRAMS/i10dbg/bin/fatal_error_mod.mod +BRAMS/i10dbg/bin/fa_xc_adap_mod.mod +BRAMS/i10dbg/bin/fa_xc_mod.mod +BRAMS/i10dbg/bin/fa_yc_adap_mod.mod +BRAMS/i10dbg/bin/fa_yc_mod.mod +BRAMS/i10dbg/bin/fa_zc_adap_mod.mod +BRAMS/i10dbg/bin/fa_zc_mod.mod +BRAMS/i10dbg/bin/fa_zc_plumerise_mod.mod +BRAMS/i10dbg/bin/fb_dy_step_trunc_mod.mod +BRAMS/i10dbg/bin/fb_sanity_check_mod.mod +BRAMS/i10dbg/bin/fcorio_mod.mod +BRAMS/i10dbg/bin/fdback_mod.mod +BRAMS/i10dbg/bin/fdbackp_mod.mod +BRAMS/i10dbg/bin/filesize4_mod.mod +BRAMS/i10dbg/bin/fill_cyc_mod.mod +BRAMS/i10dbg/bin/fill_datp_mod.mod +BRAMS/i10dbg/bin/fill_dn0uv_mod.mod +BRAMS/i10dbg/bin/fill_history_grid_mod.mod +BRAMS/i10dbg/bin/fill_history_patch_mod.mod +BRAMS/i10dbg/bin/fill_history_polygon_mod.mod +BRAMS/i10dbg/bin/fill_history_site_mod.mod +BRAMS/i10dbg/bin/fillscr_mod.mod +BRAMS/i10dbg/bin/fill_site_precip_mod.mod +BRAMS/i10dbg/bin/fill_thermovars_mod.mod +BRAMS/i10dbg/bin/fill_thvlast_mod.mod +BRAMS/i10dbg/bin/fill_toptuvm_mod.mod +BRAMS/i10dbg/bin/fillvar_l_mod.mod +BRAMS/i10dbg/bin/fillvar_mod.mod +BRAMS/i10dbg/bin/find_actual_densities_mod.mod +BRAMS/i10dbg/bin/find_avg_winds_mod.mod +BRAMS/i10dbg/bin/find_closing_comment_mod.mod +BRAMS/i10dbg/bin/find_frqsum_mod.mod +BRAMS/i10dbg/bin/findgood_mod.mod +BRAMS/i10dbg/bin/findgrid_mod.mod +BRAMS/i10dbg/bin/findln_mod.mod +BRAMS/i10dbg/bin/find_rank_mod.mod +BRAMS/i10dbg/bin/findtime_mod.mod +BRAMS/i10dbg/bin/find_walcek_densities_mod.mod +BRAMS/i10dbg/bin/fire_frequency_mod.mod +BRAMS/i10dbg/bin/first_rams_mod.mod +BRAMS/i10dbg/bin/flag_stable_cohorts_mod.mod +BRAMS/i10dbg/bin/fldinit_mod.mod +BRAMS/i10dbg/bin/flds3d_adap_mod.mod +BRAMS/i10dbg/bin/flds3d_mod.mod +BRAMS/i10dbg/bin/flxlw_mod.mod +BRAMS/i10dbg/bin/flxsw_mod.mod +BRAMS/i10dbg/bin/fmdn0_isan_mod.mod +BRAMS/i10dbg/bin/fmdn0_mod.mod +BRAMS/i10dbg/bin/fmint2d_mod.mod +BRAMS/i10dbg/bin/fmint3_mod.mod +BRAMS/i10dbg/bin/fmint4_isan_mod.mod +BRAMS/i10dbg/bin/fmint4_mod.mod +BRAMS/i10dbg/bin/fmint5_mod.mod +BRAMS/i10dbg/bin/fmpmove_mod.mod +BRAMS/i10dbg/bin/fmpmoves_mod.mod +BRAMS/i10dbg/bin/fmrefs1d_isan_mod.mod +BRAMS/i10dbg/bin/fmrefs1d_mod.mod +BRAMS/i10dbg/bin/fmrefs3d_isan_mod.mod +BRAMS/i10dbg/bin/fmrefs3d_mod.mod +BRAMS/i10dbg/bin/frame_mod.mod +BRAMS/i10dbg/bin/frstpt_mod.mod +BRAMS/i10dbg/bin/fuse_fiss_utils.mod +BRAMS/i10dbg/bin/fusion_fission_coms.mod +BRAMS/i10dbg/bin/fuso_check_mod.mod +BRAMS/i10dbg/bin/fusoinit_mod.mod +BRAMS/i10dbg/bin/fusonest_mod.mod +BRAMS/i10dbg/bin/fuso_read_mod.mod +BRAMS/i10dbg/bin/fuso_write_mod.mod +BRAMS/i10dbg/bin/gacwk_mod.mod +BRAMS/i10dbg/bin/gammln_mod.mod +BRAMS/i10dbg/bin/gam_mod.mod +BRAMS/i10dbg/bin/gammp_mod.mod +BRAMS/i10dbg/bin/gammq_mod.mod +BRAMS/i10dbg/bin/gcf_mod.mod +BRAMS/i10dbg/bin/gclks_mod.mod +BRAMS/i10dbg/bin/gclrwk_mod.mod +BRAMS/i10dbg/bin/gclwk_mod.mod +BRAMS/i10dbg/bin/gdawk_mod.mod +BRAMS/i10dbg/bin/gdtost2_mod.mod +BRAMS/i10dbg/bin/gdtost_mod.mod +BRAMS/i10dbg/bin/geodat_mod.mod +BRAMS/i10dbg/bin/geonest_file_mod.mod +BRAMS/i10dbg/bin/geonest_nofile_mod.mod +BRAMS/i10dbg/bin/gessdc_mod.mod +BRAMS/i10dbg/bin/gesspn_mod.mod +BRAMS/i10dbg/bin/getconfigint_mod.mod +BRAMS/i10dbg/bin/getconfigreal_mod.mod +BRAMS/i10dbg/bin/getconfigstring_mod.mod +BRAMS/i10dbg/bin/get_convflx_mod.mod +BRAMS/i10dbg/bin/get_dn01d_mod.mod +BRAMS/i10dbg/bin/getdrag_mod.mod +BRAMS/i10dbg/bin/get_env_condition_mod.mod +BRAMS/i10dbg/bin/get_errmax_mod.mod +BRAMS/i10dbg/bin/get_file_indices_mod.mod +BRAMS/i10dbg/bin/get_fire_properties_mod.mod +BRAMS/i10dbg/bin/geth5dims_mod.mod +BRAMS/i10dbg/bin/getict_mod.mod +BRAMS/i10dbg/bin/get_obs_value_mod.mod +BRAMS/i10dbg/bin/get_press_mod.mod +BRAMS/i10dbg/bin/get_sc_dn_mod.mod +BRAMS/i10dbg/bin/get_sc_up_mod.mod +BRAMS/i10dbg/bin/get_sc_up_wet_mod.mod +BRAMS/i10dbg/bin/get_se_mod.mod +BRAMS/i10dbg/bin/getset_mod.mod +BRAMS/i10dbg/bin/get_stcum_detrain_mod.mod +BRAMS/i10dbg/bin/get_stcum_mod.mod +BRAMS/i10dbg/bin/get_triinds_mod.mod +BRAMS/i10dbg/bin/get_upaobs_value_mod.mod +BRAMS/i10dbg/bin/getusv_mod.mod +BRAMS/i10dbg/bin/get_wet_deposited_mass_mod.mod +BRAMS/i10dbg/bin/get_yscal_mod.mod +BRAMS/i10dbg/bin/get_zi_mod.mod +BRAMS/i10dbg/bin/gfa_mod.mod +BRAMS/i10dbg/bin/gflas1_mod.mod +BRAMS/i10dbg/bin/gflas2_mod.mod +BRAMS/i10dbg/bin/gflas3_mod.mod +BRAMS/i10dbg/bin/glaciate_mod.mod +BRAMS/i10dbg/bin/gopks_mod.mod +BRAMS/i10dbg/bin/gopwk_mod.mod +BRAMS/i10dbg/bin/gpl_mod.mod +BRAMS/i10dbg/bin/gpm_mod.mod +BRAMS/i10dbg/bin/gqasf_mod.mod +BRAMS/i10dbg/bin/gqcntn_mod.mod +BRAMS/i10dbg/bin/gqcr_mod.mod +BRAMS/i10dbg/bin/gqnt_mod.mod +BRAMS/i10dbg/bin/gqplci_mod.mod +BRAMS/i10dbg/bin/gqtxci_mod.mod +BRAMS/i10dbg/bin/grad_mod.mod +BRAMS/i10dbg/bin/gradxt_mod.mod +BRAMS/i10dbg/bin/gradxu_mod.mod +BRAMS/i10dbg/bin/gradyt_mod.mod +BRAMS/i10dbg/bin/gradyv_mod.mod +BRAMS/i10dbg/bin/gradzt_mod.mod +BRAMS/i10dbg/bin/gradzw_mod.mod +BRAMS/i10dbg/bin/grdspc_mod.mod +BRAMS/i10dbg/bin/grell_arakschu_solver_mod.mod +BRAMS/i10dbg/bin/grell_buoy_below_lfc_mod.mod +BRAMS/i10dbg/bin/grell_cldwork_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_cldwork_updraft_mod.mod +BRAMS/i10dbg/bin/grell_coms.mod +BRAMS/i10dbg/bin/grell_cupar_area_scaler_mod.mod +BRAMS/i10dbg/bin/grell_cupar_driver_mod.mod +BRAMS/i10dbg/bin/grell_cupar_dynamic_mod.mod +BRAMS/i10dbg/bin/grell_cupar_feedback_mod.mod +BRAMS/i10dbg/bin/grell_cupar_initial_mod.mod +BRAMS/i10dbg/bin/grell_cupar_output_mod.mod +BRAMS/i10dbg/bin/grell_cupar_static_driver_mod.mod +BRAMS/i10dbg/bin/grell_cupar_static_mod.mod +BRAMS/i10dbg/bin/grell_dellabot_ensemble_mod.mod +BRAMS/i10dbg/bin/grell_dellas_ensemble_mod.mod +BRAMS/i10dbg/bin/grell_draft_area_mod.mod +BRAMS/i10dbg/bin/grell_dyncontrol_ensemble_mod.mod +BRAMS/i10dbg/bin/grell_efficiency_ensemble_mod.mod +BRAMS/i10dbg/bin/grell_feedback_driver_mod.mod +BRAMS/i10dbg/bin/grell_find_cloud_lfc_mod.mod +BRAMS/i10dbg/bin/grell_find_downdraft_origin_mod.mod +BRAMS/i10dbg/bin/grell_find_pbl_height_mod.mod +BRAMS/i10dbg/bin/grell_grell_solver_mod.mod +BRAMS/i10dbg/bin/grell_inre_solver_mod.mod +BRAMS/i10dbg/bin/grell_massflx_stats_mod.mod +BRAMS/i10dbg/bin/grell_most_thermo_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_most_thermo_updraft_mod.mod +BRAMS/i10dbg/bin/grell_nms_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_nms_updraft_mod.mod +BRAMS/i10dbg/bin/grell_sanity_check_mod.mod +BRAMS/i10dbg/bin/grell_sanity_thil2tqall_mod.mod +BRAMS/i10dbg/bin/grell_theiv_downdraft_mod.mod +BRAMS/i10dbg/bin/grell_theiv_updraft_mod.mod +BRAMS/i10dbg/bin/grell_thermo_cldlev_mod.mod +BRAMS/i10dbg/bin/grell_updraft_origin_mod.mod +BRAMS/i10dbg/bin/grid_coms.mod +BRAMS/i10dbg/bin/grid_dims.mod +BRAMS/i10dbg/bin/gridinit_mod.mod +BRAMS/i10dbg/bin/gridloc_prt_mod.mod +BRAMS/i10dbg/bin/gridset_mod.mod +BRAMS/i10dbg/bin/grid_setup_mod.mod +BRAMS/i10dbg/bin/grid_struct.mod +BRAMS/i10dbg/bin/growth_balive.mod +BRAMS/i10dbg/bin/gsasf_mod.mod +BRAMS/i10dbg/bin/gsclip_mod.mod +BRAMS/i10dbg/bin/gscr_mod.mod +BRAMS/i10dbg/bin/gselnt_mod.mod +BRAMS/i10dbg/bin/gser_mod.mod +BRAMS/i10dbg/bin/gsetmarkercolourind_mod.mod +BRAMS/i10dbg/bin/gsfaci_mod.mod +BRAMS/i10dbg/bin/gsfais_mod.mod +BRAMS/i10dbg/bin/gslwsc_mod.mod +BRAMS/i10dbg/bin/gsmk_mod.mod +BRAMS/i10dbg/bin/gsmksc_mod.mod +BRAMS/i10dbg/bin/gsplci_mod.mod +BRAMS/i10dbg/bin/gspmci_mod.mod +BRAMS/i10dbg/bin/gstxci_mod.mod +BRAMS/i10dbg/bin/h5_output_mod.mod +BRAMS/i10dbg/bin/hadvance_mod.mod +BRAMS/i10dbg/bin/hadvance_plumerise_mod.mod +BRAMS/i10dbg/bin/harr_coms.mod +BRAMS/i10dbg/bin/harr_lwrad_mod.mod +BRAMS/i10dbg/bin/harr_raddriv_mod.mod +BRAMS/i10dbg/bin/harr_radinit1_mod.mod +BRAMS/i10dbg/bin/harr_radinit_mod.mod +BRAMS/i10dbg/bin/harr_swrad_mod.mod +BRAMS/i10dbg/bin/harv_immat_patches_mod.mod +BRAMS/i10dbg/bin/harv_mat_patches_mod.mod +BRAMS/i10dbg/bin/haznuc_mod.mod +BRAMS/i10dbg/bin/hdf5_coms.mod +BRAMS/i10dbg/bin/hdf5_utils.mod +BRAMS/i10dbg/bin/hdf_getslab_d_mod.mod +BRAMS/i10dbg/bin/hdf_getslab_i_mod.mod +BRAMS/i10dbg/bin/hdf_getslab_r_mod.mod +BRAMS/i10dbg/bin/heav_mod.mod +BRAMS/i10dbg/bin/hemintrp_cof_mod.mod +BRAMS/i10dbg/bin/hemintrp_mod.mod +BRAMS/i10dbg/bin/hemintrp_table_mod.mod +BRAMS/i10dbg/bin/hemintt_mod.mod +BRAMS/i10dbg/bin/hemintuv_mod.mod +BRAMS/i10dbg/bin/het_resp_weight_mod.mod +BRAMS/i10dbg/bin/heun_integ_mod.mod +BRAMS/i10dbg/bin/heun_stepper_mod.mod +BRAMS/i10dbg/bin/heun_timestep_mod.mod +BRAMS/i10dbg/bin/hg_xy_mod.mod +BRAMS/i10dbg/bin/hg_z_mod.mod +BRAMS/i10dbg/bin/hi_avgu_mod.mod +BRAMS/i10dbg/bin/hi_avgv_mod.mod +BRAMS/i10dbg/bin/hi_avgw_mod.mod +BRAMS/i10dbg/bin/hifromx_mod.mod +BRAMS/i10dbg/bin/hi_interp_mod.mod +BRAMS/i10dbg/bin/hintrp_cc_mod.mod +BRAMS/i10dbg/bin/history_start_mod.mod +BRAMS/i10dbg/bin/hist_pol_read_mod.mod +BRAMS/i10dbg/bin/hist_read_mod.mod +BRAMS/i10dbg/bin/hiswrt_mod.mod +BRAMS/i10dbg/bin/hlsrgb_mod.mod +BRAMS/i10dbg/bin/homfrzcl_mod.mod +BRAMS/i10dbg/bin/how_to_read_a_file_mod.mod +BRAMS/i10dbg/bin/hsvrgb_mod.mod +BRAMS/i10dbg/bin/htint2_mod.mod +BRAMS/i10dbg/bin/htintcp_mod.mod +BRAMS/i10dbg/bin/htint_index_mod.mod +BRAMS/i10dbg/bin/htint_inter_mod.mod +BRAMS/i10dbg/bin/htint_mod.mod +BRAMS/i10dbg/bin/hybrid_integ_mod.mod +BRAMS/i10dbg/bin/hybrid_timestep_mod.mod +BRAMS/i10dbg/bin/hydrol_mod.mod +BRAMS/i10dbg/bin/hydrology_coms.mod +BRAMS/i10dbg/bin/hydrology_constants.mod +BRAMS/i10dbg/bin/hydro_mod.mod +BRAMS/i10dbg/bin/i1mach_mod.mod +BRAMS/i10dbg/bin/ibias_mod.mod +BRAMS/i10dbg/bin/ibindec_mod.mod +BRAMS/i10dbg/bin/icenuc_mod.mod +BRAMS/i10dbg/bin/ifirstchar_mod.mod +BRAMS/i10dbg/bin/inc_fwd_patch_mod.mod +BRAMS/i10dbg/bin/include_shal_effect_mod.mod +BRAMS/i10dbg/bin/inc_rk4_patch_mod.mod +BRAMS/i10dbg/bin/init_can_air_params_mod.mod +BRAMS/i10dbg/bin/init_can_lyr_params_mod.mod +BRAMS/i10dbg/bin/init_can_rad_params_mod.mod +BRAMS/i10dbg/bin/init_cohorts_by_layers_mod.mod +BRAMS/i10dbg/bin/init_conc1_mod.mod +BRAMS/i10dbg/bin/init_conc2_mod.mod +BRAMS/i10dbg/bin/init_conc_prev_mod.mod +BRAMS/i10dbg/bin/init_decomp_params_mod.mod +BRAMS/i10dbg/bin/init_disturb_params_mod.mod +BRAMS/i10dbg/bin/init_ed_cohort_vars_mod.mod +BRAMS/i10dbg/bin/init_ed_misc_coms_mod.mod +BRAMS/i10dbg/bin/init_ed_patch_vars_mod.mod +BRAMS/i10dbg/bin/init_ed_poly_vars_mod.mod +BRAMS/i10dbg/bin/init_ed_site_vars_mod.mod +BRAMS/i10dbg/bin/init_ff_coms_mod.mod +BRAMS/i10dbg/bin/init_fields_mod.mod +BRAMS/i10dbg/bin/init_full_history_restart_mod.mod +BRAMS/i10dbg/bin/initg_mod.mod +BRAMS/i10dbg/bin/ini_tg_profile_mod.mod +BRAMS/i10dbg/bin/init_grid_spacing_mod.mod +BRAMS/i10dbg/bin/inithh_mod.mod +BRAMS/i10dbg/bin/inithis_mod.mod +BRAMS/i10dbg/bin/init_hydro_coms_mod.mod +BRAMS/i10dbg/bin/inithydrology_mod.mod +BRAMS/i10dbg/bin/inithydrosubsurface_mod.mod +BRAMS/i10dbg/bin/initial_grid_grell_mod.mod +BRAMS/i10dbg/bin/initialize_ed2leaf_mod.mod +BRAMS/i10dbg/bin/initialize_rk4patches_mod.mod +BRAMS/i10dbg/bin/initial_mod.mod +BRAMS/i10dbg/bin/initial_tend_grell_mod.mod +BRAMS/i10dbg/bin/initial_thermo_grell_mod.mod +BRAMS/i10dbg/bin/initial_winds_grell_mod.mod +BRAMS/i10dbg/bin/init_lapse_params_mod.mod +BRAMS/i10dbg/bin/initlz_mod.mod +BRAMS/i10dbg/bin/init_master_work_mod.mod +BRAMS/i10dbg/bin/init_met_params_mod.mod +BRAMS/i10dbg/bin/init_nbg_cohorts_mod.mod +BRAMS/i10dbg/bin/init_node_work_mod.mod +BRAMS/i10dbg/bin/init_params_mod.mod +BRAMS/i10dbg/bin/init_pft_alloc_params_mod.mod +BRAMS/i10dbg/bin/init_pft_derived_params_mod.mod +BRAMS/i10dbg/bin/init_pft_leaf_params_mod.mod +BRAMS/i10dbg/bin/init_pft_mort_params_mod.mod +BRAMS/i10dbg/bin/init_pft_nitro_params_mod.mod +BRAMS/i10dbg/bin/init_pft_photo_params_mod.mod +BRAMS/i10dbg/bin/init_pft_repro_params_mod.mod +BRAMS/i10dbg/bin/init_pft_resp_params_mod.mod +BRAMS/i10dbg/bin/init_phen_coms_mod.mod +BRAMS/i10dbg/bin/init_physiology_params_mod.mod +BRAMS/i10dbg/bin/initqin_mod.mod +BRAMS/i10dbg/bin/init_rk4_params_mod.mod +BRAMS/i10dbg/bin/init_soil_coms_mod.mod +BRAMS/i10dbg/bin/input_rawi_mod.mod +BRAMS/i10dbg/bin/input_sfc_mod.mod +BRAMS/i10dbg/bin/integ_liq_ice_mod.mod +BRAMS/i10dbg/bin/integrate_ed_daily_output_flux_mod.mod +BRAMS/i10dbg/bin/integrate_ed_daily_output_state_mod.mod +BRAMS/i10dbg/bin/integrate_ed_monthly_output_vars_mod.mod +BRAMS/i10dbg/bin/integrate_lake_mod.mod +BRAMS/i10dbg/bin/integrate_patch_euler_mod.mod +BRAMS/i10dbg/bin/integrate_patch_heun_mod.mod +BRAMS/i10dbg/bin/int_met_avg_mod.mod +BRAMS/i10dbg/bin/intrp_mod.mod +BRAMS/i10dbg/bin/intrrap_mod.mod +BRAMS/i10dbg/bin/inventory_mat_forests_mod.mod +BRAMS/i10dbg/bin/io_params.mod +BRAMS/i10dbg/bin/ipaths_cyc_alloc_mod.mod +BRAMS/i10dbg/bin/iprim_mod.mod +BRAMS/i10dbg/bin/iran_recsize_mod.mod +BRAMS/i10dbg/bin/isan_comp_dn0_mod.mod +BRAMS/i10dbg/bin/isan_coms.mod +BRAMS/i10dbg/bin/isan_driver_mod.mod +BRAMS/i10dbg/bin/isan_file_inv_mod.mod +BRAMS/i10dbg/bin/isenio_mod.mod +BRAMS/i10dbg/bin/is_finite8_mod.mod +BRAMS/i10dbg/bin/is_finite_mod.mod +BRAMS/i10dbg/bin/ishift_mod.mod +BRAMS/i10dbg/bin/isleap_mod.mod +BRAMS/i10dbg/bin/ismax_mod.mod +BRAMS/i10dbg/bin/ismin_mod.mod +BRAMS/i10dbg/bin/isnsig_mod.mod +BRAMS/i10dbg/bin/isnstage_mod.mod +BRAMS/i10dbg/bin/is_resolvable_mod.mod +BRAMS/i10dbg/bin/ivalugp_mod.mod +BRAMS/i10dbg/bin/izero_mod.mod +BRAMS/i10dbg/bin/jnmbinit_mod.mod +BRAMS/i10dbg/bin/julday1000_mod.mod +BRAMS/i10dbg/bin/julday_mod.mod +BRAMS/i10dbg/bin/ke_coms.mod +BRAMS/i10dbg/bin/klbnd_mod.mod +BRAMS/i10dbg/bin/krig_mod.mod +BRAMS/i10dbg/bin/kuocp_mod.mod +BRAMS/i10dbg/bin/kuo_cupar_driver_mod.mod +BRAMS/i10dbg/bin/lake_coms.mod +BRAMS/i10dbg/bin/lake_derived_thbounds_mod.mod +BRAMS/i10dbg/bin/lake_derivs_mod.mod +BRAMS/i10dbg/bin/lake_diagnostics_mod.mod +BRAMS/i10dbg/bin/lake_heun_mod.mod +BRAMS/i10dbg/bin/lake_rk4_mod.mod +BRAMS/i10dbg/bin/lake_sanity_check_mod.mod +BRAMS/i10dbg/bin/lambcon_ps_mod.mod +BRAMS/i10dbg/bin/landuse_init_mod.mod +BRAMS/i10dbg/bin/landuse_opqr_mod.mod +BRAMS/i10dbg/bin/large_error_mod.mod +BRAMS/i10dbg/bin/lastchar_mod.mod +BRAMS/i10dbg/bin/lastmonthdate_mod.mod +BRAMS/i10dbg/bin/lastslash_mod.mod +BRAMS/i10dbg/bin/latbnd_mod.mod +BRAMS/i10dbg/bin/latlon_ps_mod.mod +BRAMS/i10dbg/bin/latnormv_mod.mod +BRAMS/i10dbg/bin/latset_mod.mod +BRAMS/i10dbg/bin/latset_tracer_mod.mod +BRAMS/i10dbg/bin/lblbar_mod.mod +BRAMS/i10dbg/bin/lbound_mod.mod +BRAMS/i10dbg/bin/lbseti_mod.mod +BRAMS/i10dbg/bin/lc2ll_mod.mod +BRAMS/i10dbg/bin/lc_ll_mod.mod +BRAMS/i10dbg/bin/leaf0_mod.mod +BRAMS/i10dbg/bin/leaf2ed_soil_moist_energy_mod.mod +BRAMS/i10dbg/bin/leaf3_adjust_sfcw_mod.mod +BRAMS/i10dbg/bin/leaf3_aerodynamic_conductances_mod.mod +BRAMS/i10dbg/bin/leaf3_atmo1d_mod.mod +BRAMS/i10dbg/bin/leaf3_bcond_mod.mod +BRAMS/i10dbg/bin/leaf3_can_diag_mod.mod +BRAMS/i10dbg/bin/leaf3_canopy_mod.mod +BRAMS/i10dbg/bin/leaf3_clone_mod.mod +BRAMS/i10dbg/bin/leaf3_grndvap_mod.mod +BRAMS/i10dbg/bin/leaf3init_overwrite_mod.mod +BRAMS/i10dbg/bin/leaf3_ocean_diag_mod.mod +BRAMS/i10dbg/bin/leaf3_ocean_mod.mod +BRAMS/i10dbg/bin/leaf3_prognostic_mod.mod +BRAMS/i10dbg/bin/leaf3_reduced_wind_mod.mod +BRAMS/i10dbg/bin/leaf3_roughness_mod.mod +BRAMS/i10dbg/bin/leaf3_sfclmcv_mod.mod +BRAMS/i10dbg/bin/leaf3_sfcrad_mod.mod +BRAMS/i10dbg/bin/leaf3_sflux_w_mod.mod +BRAMS/i10dbg/bin/leaf3_soilsfcw_diag_mod.mod +BRAMS/i10dbg/bin/leaf3_solve_veg_mod.mod +BRAMS/i10dbg/bin/leaf3_stars_mod.mod +BRAMS/i10dbg/bin/leaf3_step_startup_mod.mod +BRAMS/i10dbg/bin/leaf3_teb_interface_mod.mod +BRAMS/i10dbg/bin/leaf3_timestep_mod.mod +BRAMS/i10dbg/bin/leaf3_tw_mod.mod +BRAMS/i10dbg/bin/leaf3_veg_diag_mod.mod +BRAMS/i10dbg/bin/leaf_coms.mod +BRAMS/i10dbg/bin/leaf_database_mod.mod +BRAMS/i10dbg/bin/leaf_datp_datq_mod.mod +BRAMS/i10dbg/bin/leaf_datp_datsoil_mod.mod +BRAMS/i10dbg/bin/leaf_derivs_mod.mod +BRAMS/i10dbg/bin/leaftw_derivs_mod.mod +BRAMS/i10dbg/bin/le_fontes_mod.mod +BRAMS/i10dbg/bin/libxml2f90__closeall_mod.mod +BRAMS/i10dbg/bin/libxml2f90__closefile_mod.mod +BRAMS/i10dbg/bin/libxml2f90_error_getline_mod.mod +BRAMS/i10dbg/bin/libxml2f90__existid_mod.mod +BRAMS/i10dbg/bin/libxml2f90_existid_mod.mod +BRAMS/i10dbg/bin/libxml2f90__existpid_mod.mod +BRAMS/i10dbg/bin/libxml2f90__findinchara_mod.mod +BRAMS/i10dbg/bin/libxml2f90__flush_mod.mod +BRAMS/i10dbg/bin/libxml2f90__get_fileunit_mod.mod +BRAMS/i10dbg/bin/libxml2f90_getline_mod.mod +BRAMS/i10dbg/bin/libxml2f90_getsafec8_mod.mod +BRAMS/i10dbg/bin/libxml2f90_getsafei4_mod.mod +BRAMS/i10dbg/bin/libxml2f90_getsafel4_mod.mod +BRAMS/i10dbg/bin/libxml2f90_getsafer8_mod.mod +BRAMS/i10dbg/bin/libxml2f90__getunit_mod.mod +BRAMS/i10dbg/bin/libxml2f90_interface_module.mod +BRAMS/i10dbg/bin/libxml2f90__ll_addid_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_addid_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_add_list_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_add_list_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_addpid_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_addpid_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_addpureid_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_closetag_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_closetag_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_down_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_edit_id_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_edit_id_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_edit_pid_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_edit_pid_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_exist_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getc8__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getc8_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getc8_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getch_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getch_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getch_scal_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_geti4__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_geti4_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_geti4_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getl4__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getl4_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getl4_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpc8__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpc8_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpch_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpi4__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpi4_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpl4__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpl4_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpr8__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpr8_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpsize_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpstring__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getpstring_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getr8__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getr8_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getr8_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getsize_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getsize_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getstring__mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_getstring_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_getstring_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_initlist_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_inittag_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_opentag_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_opentag_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_report_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_report_rec_mod.mod +BRAMS/i10dbg/bin/libxml2f90_ll_report_rec_wrap_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_selectlist_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_selecttag_mod.mod +BRAMS/i10dbg/bin/libxml2f90__ll_up_mod.mod +BRAMS/i10dbg/bin/libxml2f90_module.mod +BRAMS/i10dbg/bin/libxml2f90__openfile_mod.mod +BRAMS/i10dbg/bin/libxml2f90_parse_file_mod.mod +BRAMS/i10dbg/bin/libxml2f90_parse_find_char_mod.mod +BRAMS/i10dbg/bin/libxml2f90__readin_file_mod.mod +BRAMS/i10dbg/bin/libxml2f90_readin_file_mod.mod +BRAMS/i10dbg/bin/libxml2f90__readin_nfil_mod.mod +BRAMS/i10dbg/bin/libxml2f90__set_casesensitive_mod.mod +BRAMS/i10dbg/bin/libxml2f90__set_default_ll_id_mod.mod +BRAMS/i10dbg/bin/libxml2f90__setformat_mod.mod +BRAMS/i10dbg/bin/libxml2f90__set_paw_mod.mod +BRAMS/i10dbg/bin/libxml2f90__set_rmcomma_mod.mod +BRAMS/i10dbg/bin/libxml2f90__set_rmquotes_mod.mod +BRAMS/i10dbg/bin/libxml2f90__settransform_exm_mod.mod +BRAMS/i10dbg/bin/libxml2f90__setwrite_exm_mod.mod +BRAMS/i10dbg/bin/libxml2f90_strings_module.mod +BRAMS/i10dbg/bin/libxml2f90_tostringa_mod.mod +BRAMS/i10dbg/bin/libxml2f90_tostring_mod.mod +BRAMS/i10dbg/bin/libxml2f90_transform_paw_mod.mod +BRAMS/i10dbg/bin/lined_mod.mod +BRAMS/i10dbg/bin/line_mod.mod +BRAMS/i10dbg/bin/lisys_solver8_mod.mod +BRAMS/i10dbg/bin/lisys_solver_mod.mod +BRAMS/i10dbg/bin/lite_varset_mod.mod +BRAMS/i10dbg/bin/ll2lc_mod.mod +BRAMS/i10dbg/bin/ll_lc_mod.mod +BRAMS/i10dbg/bin/ll_module.mod +BRAMS/i10dbg/bin/ll_rotate_lc_mod.mod +BRAMS/i10dbg/bin/ll_xy_mod.mod +BRAMS/i10dbg/bin/load_ecosystem_state_mod.mod +BRAMS/i10dbg/bin/load_ed_ecosystem_params_mod.mod +BRAMS/i10dbg/bin/lpuvw_init_mod.mod +BRAMS/i10dbg/bin/lsl_particles_mod.mod +BRAMS/i10dbg/bin/lubksb_dble_mod.mod +BRAMS/i10dbg/bin/ludcmp_dble_mod.mod +BRAMS/i10dbg/bin/lw_multiple_scatter_mod.mod +BRAMS/i10dbg/bin/lwradc_mod.mod +BRAMS/i10dbg/bin/lwradp_mod.mod +BRAMS/i10dbg/bin/lw_twostream_mod.mod +BRAMS/i10dbg/bin/machine_arq.mod +BRAMS/i10dbg/bin/make_autotab_mod.mod +BRAMS/i10dbg/bin/makefnam_mod.mod +BRAMS/i10dbg/bin/makeplume_mod.mod +BRAMS/i10dbg/bin/make_sfcfiles_mod.mod +BRAMS/i10dbg/bin/makevarf_mod.mod +BRAMS/i10dbg/bin/mapaci_mod.mod +BRAMS/i10dbg/bin/mapbla_mod.mod +BRAMS/i10dbg/bin/mapdrw_mod.mod +BRAMS/i10dbg/bin/mapint_mod.mod +BRAMS/i10dbg/bin/mapiqa_mod.mod +BRAMS/i10dbg/bin/mapiq_mod.mod +BRAMS/i10dbg/bin/mapita_mod.mod +BRAMS/i10dbg/bin/mapit_mod.mod +BRAMS/i10dbg/bin/mappos_mod.mod +BRAMS/i10dbg/bin/maproj_mod.mod +BRAMS/i10dbg/bin/maprs_mod.mod +BRAMS/i10dbg/bin/mapset_mod.mod +BRAMS/i10dbg/bin/mapstc_mod.mod +BRAMS/i10dbg/bin/mapsti_mod.mod +BRAMS/i10dbg/bin/maptra_mod.mod +BRAMS/i10dbg/bin/maptri_mod.mod +BRAMS/i10dbg/bin/maptrn_mod.mod +BRAMS/i10dbg/bin/master_ed_init_mod.mod +BRAMS/i10dbg/bin/master_getall_mod.mod +BRAMS/i10dbg/bin/master_getanl_mod.mod +BRAMS/i10dbg/bin/master_getcflcpu_mod.mod +BRAMS/i10dbg/bin/master_putcflmax_mod.mod +BRAMS/i10dbg/bin/masterput_cofnest_mod.mod +BRAMS/i10dbg/bin/master_putdtsched_mod.mod +BRAMS/i10dbg/bin/master_putdxt_mod.mod +BRAMS/i10dbg/bin/masterput_ednl_mod.mod +BRAMS/i10dbg/bin/masterput_grid_dimens_mod.mod +BRAMS/i10dbg/bin/masterput_gridinit_mod.mod +BRAMS/i10dbg/bin/masterput_gridset_mod.mod +BRAMS/i10dbg/bin/masterput_micphys_mod.mod +BRAMS/i10dbg/bin/masterput_misc_mod.mod +BRAMS/i10dbg/bin/masterput_nl_mod.mod +BRAMS/i10dbg/bin/masterput_oda_mod.mod +BRAMS/i10dbg/bin/masterput_processid_mod.mod +BRAMS/i10dbg/bin/master_sendinit_mod.mod +BRAMS/i10dbg/bin/mat_forest_harv_rates_mod.mod +BRAMS/i10dbg/bin/maximi_mod.mod +BRAMS/i10dbg/bin/mcphys_main_mod.mod +BRAMS/i10dbg/bin/mean_daysecz_mod.mod +BRAMS/i10dbg/bin/melt_mod.mod +BRAMS/i10dbg/bin/mem_aerad.mod +BRAMS/i10dbg/bin/mem_all.mod +BRAMS/i10dbg/bin/mem_basic.mod +BRAMS/i10dbg/bin/mem_carma.mod +BRAMS/i10dbg/bin/mem_cuparm.mod +BRAMS/i10dbg/bin/mem_edcp.mod +BRAMS/i10dbg/bin/mem_emiss.mod +BRAMS/i10dbg/bin/mem_ensemble.mod +BRAMS/i10dbg/bin/mem_gaspart.mod +BRAMS/i10dbg/bin/mem_globaer.mod +BRAMS/i10dbg/bin/mem_globrad.mod +BRAMS/i10dbg/bin/mem_grell_param.mod +BRAMS/i10dbg/bin/mem_grid_dim_defs.mod +BRAMS/i10dbg/bin/mem_grid.mod +BRAMS/i10dbg/bin/mem_harr.mod +BRAMS/i10dbg/bin/mem_leaf.mod +BRAMS/i10dbg/bin/mem_mass.mod +BRAMS/i10dbg/bin/mem_mclat.mod +BRAMS/i10dbg/bin/mem_micro.mod +BRAMS/i10dbg/bin/mem_mksfc.mod +BRAMS/i10dbg/bin/mem_mnt_advec.mod +BRAMS/i10dbg/bin/mem_nestb.mod +BRAMS/i10dbg/bin/mem_oda.mod +BRAMS/i10dbg/bin/mem_opt.mod +BRAMS/i10dbg/bin/mem_polygons.mod +BRAMS/i10dbg/bin/mem_radiate.mod +BRAMS/i10dbg/bin/mem_scalar.mod +BRAMS/i10dbg/bin/mem_scratch1_grell.mod +BRAMS/i10dbg/bin/mem_scratch1.mod +BRAMS/i10dbg/bin/mem_scratch2_grell.mod +BRAMS/i10dbg/bin/mem_scratch2_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch3_grell.mod +BRAMS/i10dbg/bin/mem_scratch3_grell_sh.mod +BRAMS/i10dbg/bin/mem_scratch_grell.mod +BRAMS/i10dbg/bin/mem_scratch.mod +BRAMS/i10dbg/bin/mem_soil_moisture.mod +BRAMS/i10dbg/bin/mem_tconv.mod +BRAMS/i10dbg/bin/mem_teb_common.mod +BRAMS/i10dbg/bin/mem_teb.mod +BRAMS/i10dbg/bin/mem_tend.mod +BRAMS/i10dbg/bin/mem_turb.mod +BRAMS/i10dbg/bin/mem_turb_scalar.mod +BRAMS/i10dbg/bin/mem_varinit.mod +BRAMS/i10dbg/bin/met_driver_coms.mod +BRAMS/i10dbg/bin/met_sanity_check_mod.mod +BRAMS/i10dbg/bin/micinit_mod.mod +BRAMS/i10dbg/bin/micphys.mod +BRAMS/i10dbg/bin/micro_1st_mod.mod +BRAMS/i10dbg/bin/micro_coms.mod +BRAMS/i10dbg/bin/micro_data_mod.mod +BRAMS/i10dbg/bin/micro_driver_mod.mod +BRAMS/i10dbg/bin/micro_master_mod.mod +BRAMS/i10dbg/bin/migs_mod.mod +BRAMS/i10dbg/bin/minimi_mod.mod +BRAMS/i10dbg/bin/minmax_mod.mod +BRAMS/i10dbg/bin/minvap_1d_adj_mod.mod +BRAMS/i10dbg/bin/mk_adv_buff_mod.mod +BRAMS/i10dbg/bin/mkcoltb_mod.mod +BRAMS/i10dbg/bin/mk_cyc_buff_mod.mod +BRAMS/i10dbg/bin/mk_full_buff_mod.mod +BRAMS/i10dbg/bin/mk_lbc_buff_mod.mod +BRAMS/i10dbg/bin/mknest_buff_mod.mod +BRAMS/i10dbg/bin/mksedim_tab_mod.mod +BRAMS/i10dbg/bin/mk_st_buff_mod.mod +BRAMS/i10dbg/bin/model_mod.mod +BRAMS/i10dbg/bin/mod_ghostblock.mod +BRAMS/i10dbg/bin/mod_ghostblockpartition.mod +BRAMS/i10dbg/bin/modsched_mod.mod +BRAMS/i10dbg/bin/monotonic_advec_mod.mod +BRAMS/i10dbg/bin/mortality.mod +BRAMS/i10dbg/bin/movenest_mod.mod +BRAMS/i10dbg/bin/mpilbc_driver_mod.mod +BRAMS/i10dbg/bin/mprove_mod.mod +BRAMS/i10dbg/bin/mpsetc_mod.mod +BRAMS/i10dbg/bin/mxdefm_mod.mod +BRAMS/i10dbg/bin/mxdefm_tracer_mod.mod +BRAMS/i10dbg/bin/mxtked_mod.mod +BRAMS/i10dbg/bin/nakanishi_mod.mod +BRAMS/i10dbg/bin/nameout_mod.mod +BRAMS/i10dbg/bin/ncarg_dummies_mod.mod +BRAMS/i10dbg/bin/nc_get_press_mod.mod +BRAMS/i10dbg/bin/nc_pressure_stage_mod.mod +BRAMS/i10dbg/bin/nc_prfill_mod.mod +BRAMS/i10dbg/bin/ndvi_check_header_mod.mod +BRAMS/i10dbg/bin/ndvi_file_inv_mod.mod +BRAMS/i10dbg/bin/ndviinit_mod.mod +BRAMS/i10dbg/bin/ndviinit_user_mod.mod +BRAMS/i10dbg/bin/ndvinest_mod.mod +BRAMS/i10dbg/bin/ndvi_read_dataheader_mod.mod +BRAMS/i10dbg/bin/ndvi_read_mod.mod +BRAMS/i10dbg/bin/ndvi_update_mod.mod +BRAMS/i10dbg/bin/ndvi_write_mod.mod +BRAMS/i10dbg/bin/near_bare_ground_big_leaf_init_mod.mod +BRAMS/i10dbg/bin/near_bare_ground_init_mod.mod +BRAMS/i10dbg/bin/nearest_neighbour_sm_mod.mod +BRAMS/i10dbg/bin/negadj1_mod.mod +BRAMS/i10dbg/bin/nest_interpolated_topo_mod.mod +BRAMS/i10dbg/bin/newgrid_mod.mod +BRAMS/i10dbg/bin/new_patch_sfc_props_mod.mod +BRAMS/i10dbg/bin/newtemp_mod.mod +BRAMS/i10dbg/bin/niceinc6_mod.mod +BRAMS/i10dbg/bin/niceinc_mod.mod +BRAMS/i10dbg/bin/node_cycinit_mod.mod +BRAMS/i10dbg/bin/node_decomp_mod.mod +BRAMS/i10dbg/bin/node_ed_init_mod.mod +BRAMS/i10dbg/bin/node_getadv_mod.mod +BRAMS/i10dbg/bin/node_getcflmax_mod.mod +BRAMS/i10dbg/bin/nodeget_cofnest_mod.mod +BRAMS/i10dbg/bin/node_getcyclic_mod.mod +BRAMS/i10dbg/bin/node_getdtsched_mod.mod +BRAMS/i10dbg/bin/node_getdxt_mod.mod +BRAMS/i10dbg/bin/nodeget_ednl_mod.mod +BRAMS/i10dbg/bin/node_getfeed_mod.mod +BRAMS/i10dbg/bin/nodeget_grid_dimens_mod.mod +BRAMS/i10dbg/bin/nodeget_gridinit_mod.mod +BRAMS/i10dbg/bin/nodeget_gridset_mod.mod +BRAMS/i10dbg/bin/node_getinit_mod.mod +BRAMS/i10dbg/bin/node_getlbc_mod.mod +BRAMS/i10dbg/bin/nodeget_micphys_mod.mod +BRAMS/i10dbg/bin/nodeget_misc_mod.mod +BRAMS/i10dbg/bin/node_getnbc_mod.mod +BRAMS/i10dbg/bin/nodeget_nl_mod.mod +BRAMS/i10dbg/bin/nodeget_oda_mod.mod +BRAMS/i10dbg/bin/nodeget_processid_mod.mod +BRAMS/i10dbg/bin/node_getst_mod.mod +BRAMS/i10dbg/bin/node_index_mod.mod +BRAMS/i10dbg/bin/node_mod.mod +BRAMS/i10dbg/bin/node_putcflcpu_mod.mod +BRAMS/i10dbg/bin/node_sendadv_mod.mod +BRAMS/i10dbg/bin/node_sendall_mod.mod +BRAMS/i10dbg/bin/node_sendanl_mod.mod +BRAMS/i10dbg/bin/node_sendcyclic_mod.mod +BRAMS/i10dbg/bin/node_sendfeed_mod.mod +BRAMS/i10dbg/bin/node_sendlbc_mod.mod +BRAMS/i10dbg/bin/node_sendnbc_mod.mod +BRAMS/i10dbg/bin/node_sendst_mod.mod +BRAMS/i10dbg/bin/normal_accfluxes_mod.mod +BRAMS/i10dbg/bin/normalize_averaged_vars_mod.mod +BRAMS/i10dbg/bin/normalize_ed_dailynpp_vars_mod.mod +BRAMS/i10dbg/bin/normalize_ed_daily_output_vars_mod.mod +BRAMS/i10dbg/bin/normalize_ed_daily_vars_mod.mod +BRAMS/i10dbg/bin/normalize_ed_monthly_output_vars_mod.mod +BRAMS/i10dbg/bin/norm_harv_patch_mod.mod +BRAMS/i10dbg/bin/nstbdriv_mod.mod +BRAMS/i10dbg/bin/nstb_mod.mod +BRAMS/i10dbg/bin/nstbtnd_mod.mod +BRAMS/i10dbg/bin/nstfeed_mod.mod +BRAMS/i10dbg/bin/nud_cond_accum_mod.mod +BRAMS/i10dbg/bin/nud_file_inv_mod.mod +BRAMS/i10dbg/bin/nudge_cond_mod.mod +BRAMS/i10dbg/bin/nudge_mod.mod +BRAMS/i10dbg/bin/nud_read_mod.mod +BRAMS/i10dbg/bin/nud_update_mod.mod +BRAMS/i10dbg/bin/num_days_mod.mod +BRAMS/i10dbg/bin/obanl_mod.mod +BRAMS/i10dbg/bin/obj_anal_mod.mod +BRAMS/i10dbg/bin/obs_input.mod +BRAMS/i10dbg/bin/obs_isen_mod.mod +BRAMS/i10dbg/bin/obs_sigz_mod.mod +BRAMS/i10dbg/bin/oda_file_inv_mod.mod +BRAMS/i10dbg/bin/oda_nudge_init_mod.mod +BRAMS/i10dbg/bin/oda_nudge_mod.mod +BRAMS/i10dbg/bin/oda_obs_alloc_mod.mod +BRAMS/i10dbg/bin/oda_proc_obs_mod.mod +BRAMS/i10dbg/bin/oda_read_mod.mod +BRAMS/i10dbg/bin/oda_sta_count_mod.mod +BRAMS/i10dbg/bin/oda_sta_input_mod.mod +BRAMS/i10dbg/bin/oda_tendency_mod.mod +BRAMS/i10dbg/bin/odeint_mod.mod +BRAMS/i10dbg/bin/old_grell_cupar_driver_mod.mod +BRAMS/i10dbg/bin/old_prep_convflx_to_mass_mod.mod +BRAMS/i10dbg/bin/onenode_mod.mod +BRAMS/i10dbg/bin/operts_mod.mod +BRAMS/i10dbg/bin/opngks_mod.mod +BRAMS/i10dbg/bin/opspec1_mod.mod +BRAMS/i10dbg/bin/opspec2_mod.mod +BRAMS/i10dbg/bin/opspec3_mod.mod +BRAMS/i10dbg/bin/opspec4_mod.mod +BRAMS/i10dbg/bin/opspec_fatal_mod.mod +BRAMS/i10dbg/bin/opspec_mess_mod.mod +BRAMS/i10dbg/bin/optimiz_coms.mod +BRAMS/i10dbg/bin/optlib_mod.mod +BRAMS/i10dbg/bin/overwrite_with_xml_config_mod.mod +BRAMS/i10dbg/bin/ozone_const.mod +BRAMS/i10dbg/bin/ozone_mod.mod +BRAMS/i10dbg/bin/par_bintp_mod.mod +BRAMS/i10dbg/bin/par_decomp_bounds_mod.mod +BRAMS/i10dbg/bin/par_decomp_input_mod.mod +BRAMS/i10dbg/bin/par_decomp_mod.mod +BRAMS/i10dbg/bin/par_est_time_mod.mod +BRAMS/i10dbg/bin/par_model_mod.mod +BRAMS/i10dbg/bin/par_node_paths_mod.mod +BRAMS/i10dbg/bin/parsefnam_mod.mod +BRAMS/i10dbg/bin/parse_mod.mod +BRAMS/i10dbg/bin/patch_array_size_mod.mod +BRAMS/i10dbg/bin/patch_interp_driver_mod.mod +BRAMS/i10dbg/bin/patch_interp_mod.mod +BRAMS/i10dbg/bin/patch_land_average_mod.mod +BRAMS/i10dbg/bin/patch_land_copy2_mod.mod +BRAMS/i10dbg/bin/patch_land_unaverage_mod.mod +BRAMS/i10dbg/bin/patch_latlon_mod.mod +BRAMS/i10dbg/bin/patch_minsize_mod.mod +BRAMS/i10dbg/bin/path_lengths_mod.mod +BRAMS/i10dbg/bin/pc03_mod.mod +BRAMS/i10dbg/bin/pcgeti_mod.mod +BRAMS/i10dbg/bin/pcgetr_mod.mod +BRAMS/i10dbg/bin/pcseti_mod.mod +BRAMS/i10dbg/bin/perim_mod.mod +BRAMS/i10dbg/bin/pft_coms.mod +BRAMS/i10dbg/bin/phenology_aux.mod +BRAMS/i10dbg/bin/phenology_coms.mod +BRAMS/i10dbg/bin/phenology_driver_eq_0_mod.mod +BRAMS/i10dbg/bin/phenology_driver_mod.mod +BRAMS/i10dbg/bin/phenology_startup.mod +BRAMS/i10dbg/bin/phenology_thresholds_mod.mod +BRAMS/i10dbg/bin/physiology_coms.mod +BRAMS/i10dbg/bin/plant_structural_allocation_mod.mod +BRAMS/i10dbg/bin/plchhq_mod.mod +BRAMS/i10dbg/bin/plchlq_mod.mod +BRAMS/i10dbg/bin/plchmq_mod.mod +BRAMS/i10dbg/bin/plin_mod.mod +BRAMS/i10dbg/bin/plkavg_mod.mod +BRAMS/i10dbg/bin/plotif_mod.mod +BRAMS/i10dbg/bin/plotit_mod.mod +BRAMS/i10dbg/bin/plumerise_driver_mod.mod +BRAMS/i10dbg/bin/plumerise_mod.mod +BRAMS/i10dbg/bin/plume_utils.mod +BRAMS/i10dbg/bin/point_mod.mod +BRAMS/i10dbg/bin/points_mod.mod +BRAMS/i10dbg/bin/polarst_mod.mod +BRAMS/i10dbg/bin/posidef_mod.mod +BRAMS/i10dbg/bin/prdctp1_adap_mod.mod +BRAMS/i10dbg/bin/prdctp1_new_mod.mod +BRAMS/i10dbg/bin/prdctp2_adap_mod.mod +BRAMS/i10dbg/bin/prdctp2_mod.mod +BRAMS/i10dbg/bin/prdctu_adap_mod.mod +BRAMS/i10dbg/bin/prdctu_mod.mod +BRAMS/i10dbg/bin/prdctv_adap_mod.mod +BRAMS/i10dbg/bin/prdctv_mod.mod +BRAMS/i10dbg/bin/prdctw1_adap_mod.mod +BRAMS/i10dbg/bin/prdctw1_mod.mod +BRAMS/i10dbg/bin/prdctw2_adap_mod.mod +BRAMS/i10dbg/bin/prdctw2_mod.mod +BRAMS/i10dbg/bin/prdctw3_adap_mod.mod +BRAMS/i10dbg/bin/prdctw3_mod.mod +BRAMS/i10dbg/bin/prebarn_mod.mod +BRAMS/i10dbg/bin/predict_mod.mod +BRAMS/i10dbg/bin/predtr_mod.mod +BRAMS/i10dbg/bin/prep_advflx_to_mass_mod.mod +BRAMS/i10dbg/bin/prepare_timeavg_driver_mod.mod +BRAMS/i10dbg/bin/prepare_timeavg_to_mass_mod.mod +BRAMS/i10dbg/bin/prep_convflx_to_mass_mod.mod +BRAMS/i10dbg/bin/prep_lnthetv_mod.mod +BRAMS/i10dbg/bin/prep_lnthvtend_mod.mod +BRAMS/i10dbg/bin/prep_timeave_mod.mod +BRAMS/i10dbg/bin/prescribed_event_mod.mod +BRAMS/i10dbg/bin/press_miss_mod.mod +BRAMS/i10dbg/bin/pressure_stage_mod.mod +BRAMS/i10dbg/bin/prfill_mod.mod +BRAMS/i10dbg/bin/prgintrp_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_t_mod.mod +BRAMS/i10dbg/bin/pr_hystatic_z_mod.mod +BRAMS/i10dbg/bin/print_c_and_n_budgets_mod.mod +BRAMS/i10dbg/bin/print_csiteipa_mod.mod +BRAMS/i10dbg/bin/pr_interp_mod.mod +BRAMS/i10dbg/bin/print_errmax_mod.mod +BRAMS/i10dbg/bin/print_field_node_mod.mod +BRAMS/i10dbg/bin/print_fields_mod.mod +BRAMS/i10dbg/bin/print_lake_errmax_mod.mod +BRAMS/i10dbg/bin/print_lakesite_mod.mod +BRAMS/i10dbg/bin/print_longwave_mod.mod +BRAMS/i10dbg/bin/print_photo_details_mod.mod +BRAMS/i10dbg/bin/print_rk4patch_mod.mod +BRAMS/i10dbg/bin/print_rk4_state_mod.mod +BRAMS/i10dbg/bin/print_soil_info_mod.mod +BRAMS/i10dbg/bin/pr_miss_fill_mod.mod +BRAMS/i10dbg/bin/prt2d_mod.mod +BRAMS/i10dbg/bin/prtlev_mod.mod +BRAMS/i10dbg/bin/prtopt_mod.mod +BRAMS/i10dbg/bin/prtout_mod.mod +BRAMS/i10dbg/bin/psfill_mod.mod +BRAMS/i10dbg/bin/ps_ps_mod.mod +BRAMS/i10dbg/bin/ps_ps_rot_mod.mod +BRAMS/i10dbg/bin/psxfer_mod.mod +BRAMS/i10dbg/bin/putconfigint_mod.mod +BRAMS/i10dbg/bin/putconfigreal8_mod.mod +BRAMS/i10dbg/bin/putconfigreal_mod.mod +BRAMS/i10dbg/bin/putconfigstring_mod.mod +BRAMS/i10dbg/bin/pwritx_mod.mod +BRAMS/i10dbg/bin/q8qst4_mod.mod +BRAMS/i10dbg/bin/rad_carma.mod +BRAMS/i10dbg/bin/radcomp_mod.mod +BRAMS/i10dbg/bin/rad_copy2scratch_mod.mod +BRAMS/i10dbg/bin/radiate_driver_mod.mod +BRAMS/i10dbg/bin/radiate_mod.mod +BRAMS/i10dbg/bin/rad_mclat_mod.mod +BRAMS/i10dbg/bin/radvc_mnt_driver_mod.mod +BRAMS/i10dbg/bin/ralph_vars_mod.mod +BRAMS/i10dbg/bin/ramran_mod.mod +BRAMS/i10dbg/bin/rams2_mm_mod.mod +BRAMS/i10dbg/bin/rams_aprep_hkh_mod.mod +BRAMS/i10dbg/bin/rams_aprep_p_mod.mod +BRAMS/i10dbg/bin/rams_aprep_vkh_mod.mod +BRAMS/i10dbg/bin/rams_dintsort_mod.mod +BRAMS/i10dbg/bin/rams_filelist_mod.mod +BRAMS/i10dbg/bin/rams_fltsort_mod.mod +BRAMS/i10dbg/bin/rams_f_open_mod.mod +BRAMS/i10dbg/bin/rams_getvar_mod.mod +BRAMS/i10dbg/bin/rams_grad_mod.mod +BRAMS/i10dbg/bin/rams_intsort_mod.mod +BRAMS/i10dbg/bin/rams_master_mod.mod +BRAMS/i10dbg/bin/rams_mem_alloc_mod.mod +BRAMS/i10dbg/bin/rams_mm_mod.mod +BRAMS/i10dbg/bin/rams_node_mod.mod +BRAMS/i10dbg/bin/rams_output_mod.mod +BRAMS/i10dbg/bin/rams_read_header_mod.mod +BRAMS/i10dbg/bin/rams_sort_dint3_mod.mod +BRAMS/i10dbg/bin/rams_unique_dint_mod.mod +BRAMS/i10dbg/bin/rank_down_mod.mod +BRAMS/i10dbg/bin/rank_up_mod.mod +BRAMS/i10dbg/bin/rayf_adap_mod.mod +BRAMS/i10dbg/bin/rayf_mod.mod +BRAMS/i10dbg/bin/rayft_mod.mod +BRAMS/i10dbg/bin/rayleigh_mod.mod +BRAMS/i10dbg/bin/rconstants.mod +BRAMS/i10dbg/bin/rconv_driver_mod.mod +BRAMS/i10dbg/bin/read_ed10_ed20_history_file_mod.mod +BRAMS/i10dbg/bin/read_ed21_history_file_mod.mod +BRAMS/i10dbg/bin/read_ed21_history_unstruct_mod.mod +BRAMS/i10dbg/bin/read_ed21_polyclone_mod.mod +BRAMS/i10dbg/bin/read_ednl_mod.mod +BRAMS/i10dbg/bin/read_ed_xml_config_mod.mod +BRAMS/i10dbg/bin/read_events_xml_mod.mod +BRAMS/i10dbg/bin/read_hdf_mod.mod +BRAMS/i10dbg/bin/read_header_mod.mod +BRAMS/i10dbg/bin/read_nl_mod.mod +BRAMS/i10dbg/bin/read_plantation_fractions_mod.mod +BRAMS/i10dbg/bin/read_site_file_mod.mod +BRAMS/i10dbg/bin/read_soil_depth_mod.mod +BRAMS/i10dbg/bin/read_soil_moist_temp_mod.mod +BRAMS/i10dbg/bin/read_sources_teb_mod.mod +BRAMS/i10dbg/bin/rearrange_mod.mod +BRAMS/i10dbg/bin/recycle_mod.mod +BRAMS/i10dbg/bin/refs1d_mod.mod +BRAMS/i10dbg/bin/refs3d_mod.mod +BRAMS/i10dbg/bin/ref_sounding.mod +BRAMS/i10dbg/bin/relms_mod.mod +BRAMS/i10dbg/bin/reord_mod.mod +BRAMS/i10dbg/bin/reorganize_sources_teb_mod.mod +BRAMS/i10dbg/bin/reproduction_eq_0_mod.mod +BRAMS/i10dbg/bin/reproduction_mod.mod +BRAMS/i10dbg/bin/reset_averaged_vars_mod.mod +BRAMS/i10dbg/bin/reset_mod.mod +BRAMS/i10dbg/bin/resp_f_decomp_mod.mod +BRAMS/i10dbg/bin/resp_rh_mod.mod +BRAMS/i10dbg/bin/rgbhls_mod.mod +BRAMS/i10dbg/bin/rk4_coms.mod +BRAMS/i10dbg/bin/rk4_driver.mod +BRAMS/i10dbg/bin/rk4_stepper.mod +BRAMS/i10dbg/bin/road_wall_layer_e_budget_mod.mod +BRAMS/i10dbg/bin/roof_layer_e_budget_mod.mod +BRAMS/i10dbg/bin/root_resp_norm_mod.mod +BRAMS/i10dbg/bin/rotate_winds_mod.mod +BRAMS/i10dbg/bin/rotate_winds_obs_mod.mod +BRAMS/i10dbg/bin/rowcolmn_mod.mod +BRAMS/i10dbg/bin/rpara.mod +BRAMS/i10dbg/bin/rr_sfc_obs_mod.mod +BRAMS/i10dbg/bin/rr_sfc_ver_mod.mod +BRAMS/i10dbg/bin/rr_upa_obs_mod.mod +BRAMS/i10dbg/bin/rr_upa_ver_mod.mod +BRAMS/i10dbg/bin/rtgintrp_isan_mod.mod +BRAMS/i10dbg/bin/rtgintrp_mod.mod +BRAMS/i10dbg/bin/satadjst_mod.mod +BRAMS/i10dbg/bin/scale_ed_radiation_mod.mod +BRAMS/i10dbg/bin/scl_advectc_plumerise_mod.mod +BRAMS/i10dbg/bin/scl_misc_mod.mod +BRAMS/i10dbg/bin/sedim_mod.mod +BRAMS/i10dbg/bin/sedim_particles_mod.mod +BRAMS/i10dbg/bin/seed_dispersal_mod.mod +BRAMS/i10dbg/bin/selective_gaussian_2body_mod.mod +BRAMS/i10dbg/bin/seter_mod.mod +BRAMS/i10dbg/bin/set_flam_vert_mod.mod +BRAMS/i10dbg/bin/set_grid_mod.mod +BRAMS/i10dbg/bin/setgv_mod.mod +BRAMS/i10dbg/bin/setlapseparms_mod.mod +BRAMS/i10dbg/bin/set_mod.mod +BRAMS/i10dbg/bin/set_polygon_coordinates_edcp_mod.mod +BRAMS/i10dbg/bin/set_polygon_coordinates_mod.mod +BRAMS/i10dbg/bin/set_site_defprops_mod.mod +BRAMS/i10dbg/bin/setusv_mod.mod +BRAMS/i10dbg/bin/sfc_check_mod.mod +BRAMS/i10dbg/bin/sfc_data_convert_mod.mod +BRAMS/i10dbg/bin/sfcdata_ed_mod.mod +BRAMS/i10dbg/bin/sfcdata_mod.mod +BRAMS/i10dbg/bin/sfc_fields_adap_mod.mod +BRAMS/i10dbg/bin/sfc_fields_mod.mod +BRAMS/i10dbg/bin/sfcinit_file_mod.mod +BRAMS/i10dbg/bin/sfcinit_file_user_mod.mod +BRAMS/i10dbg/bin/sfcinit_hstart_mod.mod +BRAMS/i10dbg/bin/sfcinit_nofile_mod.mod +BRAMS/i10dbg/bin/sfcinit_nofile_user_mod.mod +BRAMS/i10dbg/bin/sfc_obs_convert_mod.mod +BRAMS/i10dbg/bin/sfcopqr_mod.mod +BRAMS/i10dbg/bin/sfc_pcp_mod.mod +BRAMS/i10dbg/bin/sfcproc_mod.mod +BRAMS/i10dbg/bin/sfcprt_mod.mod +BRAMS/i10dbg/bin/sfcqual_mod.mod +BRAMS/i10dbg/bin/sfcrad_ed_mod.mod +BRAMS/i10dbg/bin/sfc_read_mod.mod +BRAMS/i10dbg/bin/sfc_write_mod.mod +BRAMS/i10dbg/bin/sflush_mod.mod +BRAMS/i10dbg/bin/sfseti_mod.mod +BRAMS/i10dbg/bin/sfsgfa_mod.mod +BRAMS/i10dbg/bin/sh2mod_mod.mod +BRAMS/i10dbg/bin/shcu_env_mod.mod +BRAMS/i10dbg/bin/shcupar_mod.mod +BRAMS/i10dbg/bin/shcu_vars_const.mod +BRAMS/i10dbg/bin/short2diff_sib_mod.mod +BRAMS/i10dbg/bin/short_bdown_weissnorman_mod.mod +BRAMS/i10dbg/bin/shradc_mod.mod +BRAMS/i10dbg/bin/shradp_mod.mod +BRAMS/i10dbg/bin/sh_rates_mod.mod +BRAMS/i10dbg/bin/sigzio_mod.mod +BRAMS/i10dbg/bin/simple_lake_model_mod.mod +BRAMS/i10dbg/bin/sndproc_mod.mod +BRAMS/i10dbg/bin/sngloff_mod.mod +BRAMS/i10dbg/bin/snowinit_mod.mod +BRAMS/i10dbg/bin/soil_coms.mod +BRAMS/i10dbg/bin/soil_depth_fill_mod.mod +BRAMS/i10dbg/bin/soil_idx2water_mod.mod +BRAMS/i10dbg/bin/soil_moisture_init_mod.mod +BRAMS/i10dbg/bin/soil_respiration_mod.mod +BRAMS/i10dbg/bin/solar_radiation_breakdown_mod.mod +BRAMS/i10dbg/bin/sort3_mod.mod +BRAMS/i10dbg/bin/sort_down_mod.mod +BRAMS/i10dbg/bin/sort_up_mod.mod +BRAMS/i10dbg/bin/soundtopo_mod.mod +BRAMS/i10dbg/bin/sources_teb_mod.mod +BRAMS/i10dbg/bin/souza_cupar_driver_mod.mod +BRAMS/i10dbg/bin/spatial_averages_mod.mod +BRAMS/i10dbg/bin/spline1_mod.mod +BRAMS/i10dbg/bin/spline2_mod.mod +BRAMS/i10dbg/bin/sst_check_header_mod.mod +BRAMS/i10dbg/bin/sst_file_inv_mod.mod +BRAMS/i10dbg/bin/sstinit_mod.mod +BRAMS/i10dbg/bin/sstinit_user_mod.mod +BRAMS/i10dbg/bin/sstnest_mod.mod +BRAMS/i10dbg/bin/sst_read_dataheader_mod.mod +BRAMS/i10dbg/bin/sst_read_mod.mod +BRAMS/i10dbg/bin/sst_read_new_mod.mod +BRAMS/i10dbg/bin/sst_update_mod.mod +BRAMS/i10dbg/bin/sst_write_mod.mod +BRAMS/i10dbg/bin/ssum_mod.mod +BRAMS/i10dbg/bin/stable_mod.mod +BRAMS/i10dbg/bin/stainterp_mod.mod +BRAMS/i10dbg/bin/staprt_mod.mod +BRAMS/i10dbg/bin/stline_mod.mod +BRAMS/i10dbg/bin/storage_theta_mod.mod +BRAMS/i10dbg/bin/strain_adap_mod.mod +BRAMS/i10dbg/bin/strain_mod.mod +BRAMS/i10dbg/bin/strmfun_mod.mod +BRAMS/i10dbg/bin/strmln_mod.mod +BRAMS/i10dbg/bin/structural_growth_eq_0_mod.mod +BRAMS/i10dbg/bin/structural_growth_mod.mod +BRAMS/i10dbg/bin/sublimate_mod.mod +BRAMS/i10dbg/bin/sumn_mod.mod +BRAMS/i10dbg/bin/sum_plant_cfluxes_mod.mod +BRAMS/i10dbg/bin/sunavg_mod.mod +BRAMS/i10dbg/bin/surface_aero_cond_mod.mod +BRAMS/i10dbg/bin/surface_cd_mod.mod +BRAMS/i10dbg/bin/surface_ri_mod.mod +BRAMS/i10dbg/bin/swap32_mod.mod +BRAMS/i10dbg/bin/sw_multiple_scatter_mod.mod +BRAMS/i10dbg/bin/sw_twostream_clump_mod.mod +BRAMS/i10dbg/bin/sxy_mod.mod +BRAMS/i10dbg/bin/tabhab_mod.mod +BRAMS/i10dbg/bin/tabmelt_mod.mod +BRAMS/i10dbg/bin/tebc_init_mod.mod +BRAMS/i10dbg/bin/teb_init_mod.mod +BRAMS/i10dbg/bin/teb_spm_start.mod +BRAMS/i10dbg/bin/teb_vars_const.mod +BRAMS/i10dbg/bin/tend0_mod.mod +BRAMS/i10dbg/bin/tend0_plumerise_mod.mod +BRAMS/i10dbg/bin/tend_accum_mod.mod +BRAMS/i10dbg/bin/tendgas_mod.mod +BRAMS/i10dbg/bin/test_mod.mod +BRAMS/i10dbg/bin/therm_lib8.mod +BRAMS/i10dbg/bin/therm_lib.mod +BRAMS/i10dbg/bin/thermo_boundary_driver_mod.mod +BRAMS/i10dbg/bin/thermo_mod.mod +BRAMS/i10dbg/bin/timestep_mod.mod +BRAMS/i10dbg/bin/timing_mod.mod +BRAMS/i10dbg/bin/tkeeps_mod.mod +BRAMS/i10dbg/bin/tkeinit_mod.mod +BRAMS/i10dbg/bin/tkemy_mod.mod +BRAMS/i10dbg/bin/tkescl_mod.mod +BRAMS/i10dbg/bin/tokenize1_mod.mod +BRAMS/i10dbg/bin/tokenize_mod.mod +BRAMS/i10dbg/bin/tokfind_mod.mod +BRAMS/i10dbg/bin/tolower_mod.mod +BRAMS/i10dbg/bin/top_check_mod.mod +BRAMS/i10dbg/bin/topobnd_mod.mod +BRAMS/i10dbg/bin/topoq_mod.mod +BRAMS/i10dbg/bin/toposmooth_mod.mod +BRAMS/i10dbg/bin/top_read_mod.mod +BRAMS/i10dbg/bin/topset_mod.mod +BRAMS/i10dbg/bin/toptinit_mod.mod +BRAMS/i10dbg/bin/toptinit_user_mod.mod +BRAMS/i10dbg/bin/toptnest_mod.mod +BRAMS/i10dbg/bin/toptsmth_mod.mod +BRAMS/i10dbg/bin/top_write_mod.mod +BRAMS/i10dbg/bin/trans_conv_mflx_mod.mod +BRAMS/i10dbg/bin/transfer_ed2leaf_mod.mod +BRAMS/i10dbg/bin/transfm_mod.mod +BRAMS/i10dbg/bin/tricheck_mod.mod +BRAMS/i10dbg/bin/trid2_mod.mod +BRAMS/i10dbg/bin/tridiff1_adap_mod.mod +BRAMS/i10dbg/bin/tridiff1_mod.mod +BRAMS/i10dbg/bin/tridiff2_mod.mod +BRAMS/i10dbg/bin/tridiff2orig_mod.mod +BRAMS/i10dbg/bin/trid_mod.mod +BRAMS/i10dbg/bin/tri_intp_cofs_mod.mod +BRAMS/i10dbg/bin/trncl1_mod.mod +BRAMS/i10dbg/bin/trncl2_mod.mod +BRAMS/i10dbg/bin/trsets_mod.mod +BRAMS/i10dbg/bin/trtend_mod.mod +BRAMS/i10dbg/bin/trueps60_ps_mod.mod +BRAMS/i10dbg/bin/trueps60_ps_rot_mod.mod +BRAMS/i10dbg/bin/trueps60_uevetouv_mod.mod +BRAMS/i10dbg/bin/trueps60_uvtoueve_mod.mod +BRAMS/i10dbg/bin/truhor_mod.mod +BRAMS/i10dbg/bin/truhor_opt_mod.mod +BRAMS/i10dbg/bin/turb_coms.mod +BRAMS/i10dbg/bin/uevetouv_mod.mod +BRAMS/i10dbg/bin/ugetarg_mod.mod +BRAMS/i10dbg/bin/unarrange_mod.mod +BRAMS/i10dbg/bin/unfdbackp_fixed_mod.mod +BRAMS/i10dbg/bin/unfdbackp_mod.mod +BRAMS/i10dbg/bin/unfpack1_mod.mod +BRAMS/i10dbg/bin/unfpack_mod.mod +BRAMS/i10dbg/bin/unmkbuff_mod.mod +BRAMS/i10dbg/bin/upa_get_profile_mod.mod +BRAMS/i10dbg/bin/upa_interp_mod.mod +BRAMS/i10dbg/bin/update_budget_mod.mod +BRAMS/i10dbg/bin/update_c_and_n_pools_mod.mod +BRAMS/i10dbg/bin/update_derived_cohort_props_mod.mod +BRAMS/i10dbg/bin/update_derived_props_mod.mod +BRAMS/i10dbg/bin/update_diagnostic_vars_mod.mod +BRAMS/i10dbg/bin/update_ed_yearly_vars_mod.mod +BRAMS/i10dbg/bin/updatehydroparms_mod.mod +BRAMS/i10dbg/bin/update_model_time_dm_mod.mod +BRAMS/i10dbg/bin/update_mod.mod +BRAMS/i10dbg/bin/update_patch_derived_props_mod.mod +BRAMS/i10dbg/bin/update_patch_thermo_props_mod.mod +BRAMS/i10dbg/bin/update_phenology_eq_0_mod.mod +BRAMS/i10dbg/bin/update_phenology_mod.mod +BRAMS/i10dbg/bin/update_plumerise_mod.mod +BRAMS/i10dbg/bin/update_polygon_derived_props_mod.mod +BRAMS/i10dbg/bin/update_psibar_mod.mod +BRAMS/i10dbg/bin/update_rad_avg_mod.mod +BRAMS/i10dbg/bin/update_site_derived_props_mod.mod +BRAMS/i10dbg/bin/update_thermo_mod.mod +BRAMS/i10dbg/bin/update_vital_rates_mod.mod +BRAMS/i10dbg/bin/updatewatertableadd_mod.mod +BRAMS/i10dbg/bin/updatewatertablebaseflow_mod.mod +BRAMS/i10dbg/bin/updatewatertablesubtract_mod.mod +BRAMS/i10dbg/bin/update_workload_mod.mod +BRAMS/i10dbg/bin/urban_canopy_mod.mod +BRAMS/i10dbg/bin/urban_drag_mod.mod +BRAMS/i10dbg/bin/urban_hydro_mod.mod +BRAMS/i10dbg/bin/urban_lw_coef_mod.mod +BRAMS/i10dbg/bin/urban_mod.mod +BRAMS/i10dbg/bin/urban_solar_abs_mod.mod +BRAMS/i10dbg/bin/urb_drag_init_mod.mod +BRAMS/i10dbg/bin/urb_tend_mod.mod +BRAMS/i10dbg/bin/uvlc_uvll_mod.mod +BRAMS/i10dbg/bin/uvll_uvlc_mod.mod +BRAMS/i10dbg/bin/uvtoueve_mod.mod +BRAMS/i10dbg/bin/uwc_mod.mod +BRAMS/i10dbg/bin/uwcomp_mod.mod +BRAMS/i10dbg/bin/valugp_mod.mod +BRAMS/i10dbg/bin/vapdiff_mod.mod +BRAMS/i10dbg/bin/vapflux_mod.mod +BRAMS/i10dbg/bin/vapthrm_mod.mod +BRAMS/i10dbg/bin/varf_adap_mod.mod +BRAMS/i10dbg/bin/varf_file_inv_mod.mod +BRAMS/i10dbg/bin/varfile_nstfeed_mod.mod +BRAMS/i10dbg/bin/varfile_refstate_mod.mod +BRAMS/i10dbg/bin/varf_read_mod.mod +BRAMS/i10dbg/bin/varf_update_mod.mod +BRAMS/i10dbg/bin/varref_mod.mod +BRAMS/i10dbg/bin/var_tables.mod +BRAMS/i10dbg/bin/varuv_mod.mod +BRAMS/i10dbg/bin/varweight_mod.mod +BRAMS/i10dbg/bin/vcirec_mod.mod +BRAMS/i10dbg/bin/vcorec_mod.mod +BRAMS/i10dbg/bin/vctran_mod.mod +BRAMS/i10dbg/bin/vector_mod.mod +BRAMS/i10dbg/bin/vegetation_dynamics_eq_0_mod.mod +BRAMS/i10dbg/bin/vegetation_dynamics_mod.mod +BRAMS/i10dbg/bin/vegndvi_mod.mod +BRAMS/i10dbg/bin/vel_advectc_adap_mod.mod +BRAMS/i10dbg/bin/vel_advectc_mod.mod +BRAMS/i10dbg/bin/vel_advectc_plumerise_mod.mod +BRAMS/i10dbg/bin/velvct_mod.mod +BRAMS/i10dbg/bin/vertmap2_mod.mod +BRAMS/i10dbg/bin/vfinit_mod.mod +BRAMS/i10dbg/bin/vfintrpf_mod.mod +BRAMS/i10dbg/bin/vfirec_mod.mod +BRAMS/i10dbg/bin/vforec_mod.mod +BRAMS/i10dbg/bin/viirec_mod.mod +BRAMS/i10dbg/bin/viorec_mod.mod +BRAMS/i10dbg/bin/visc_w_mod.mod +BRAMS/i10dbg/bin/visurf_mod.mod +BRAMS/i10dbg/bin/vmissr_mod.mod +BRAMS/i10dbg/bin/vmissw_mod.mod +BRAMS/i10dbg/bin/vpsets_mod.mod +BRAMS/i10dbg/bin/vshyd_mod.mod +BRAMS/i10dbg/bin/vtables2_mod.mod +BRAMS/i10dbg/bin/vtables_scalar_mod.mod +BRAMS/i10dbg/bin/vtables_scalar_new_mod.mod +BRAMS/i10dbg/bin/vterpp_i_mod.mod +BRAMS/i10dbg/bin/vterpp_s_mod.mod +BRAMS/i10dbg/bin/vwrti_mod.mod +BRAMS/i10dbg/bin/vwrt_mod.mod +BRAMS/i10dbg/bin/w3fb06_mod.mod +BRAMS/i10dbg/bin/w3fb07_mod.mod +BRAMS/i10dbg/bin/walltime_mod.mod +BRAMS/i10dbg/bin/warning_mod.mod +BRAMS/i10dbg/bin/waterbal_mod.mod +BRAMS/i10dbg/bin/wetthrm3_mod.mod +BRAMS/i10dbg/bin/winddf_mod.mod +BRAMS/i10dbg/bin/winduv_mod.mod +BRAMS/i10dbg/bin/writebin_mod.mod +BRAMS/i10dbg/bin/write_ed_xml_config_mod.mod +BRAMS/i10dbg/bin/writehydro_mod.mod +BRAMS/i10dbg/bin/w_shallow_mod.mod +BRAMS/i10dbg/bin/wtstr_mod.mod +BRAMS/i10dbg/bin/x02_mod.mod +BRAMS/i10dbg/bin/xcol2array_mod.mod +BRAMS/i10dbg/bin/xj_mod.mod +BRAMS/i10dbg/bin/xy_ij_mod.mod +BRAMS/i10dbg/bin/xy_ll_mod.mod +BRAMS/i10dbg/bin/ycol2array_mod.mod +BRAMS/i10dbg/bin/yesterday_mod.mod +BRAMS/i10dbg/bin/zcol2array_mod.mod +BRAMS/i10dbg/bin/ze_dims_mod.mod +BRAMS/i10dbg/bin/zen_mod.mod +BRAMS/i10dbg/bin/zeragas_mod.mod +BRAMS/i10dbg/bin/zero_ed_daily_output_vars_mod.mod +BRAMS/i10dbg/bin/zero_ed_daily_vars_mod.mod +BRAMS/i10dbg/bin/zero_ed_monthly_output_vars_mod.mod +BRAMS/i10dbg/bin/zero_ed_yearly_vars_mod.mod +BRAMS/i10dbg/bin/zeroout_mod.mod +BRAMS/i10dbg/bin/zoq_mod.mod +BRAMS/i10dbg/*.F90 +BRAMS/i10dbg/*.c +BRAMS/i10dbg/edbrams-opt +BRAMS/i10dbg/bin/asnc.F90 +BRAMS/i10dbg/bin/consts_coms.F90 +BRAMS/i10dbg/bin/ed_filelist.F90 +BRAMS/i10dbg/bin/ed_init_atm.F90 +BRAMS/i10dbg/bin/ed_init_full_history.F90 +BRAMS/i10dbg/bin/ed_max_dims.F90 +BRAMS/i10dbg/bin/ed_opspec.F90 +BRAMS/i10dbg/bin/ed_read_ed21_history.F90 +BRAMS/i10dbg/bin/filelist.F90 +BRAMS/i10dbg/bin/h5_output.F90 +BRAMS/i10dbg/bin/harr_rad.F90 +BRAMS/i10dbg/bin/hdf5_coms.F90 +BRAMS/i10dbg/bin/hdf5_utils.F90 +BRAMS/i10dbg/bin/landuse_input.F90 +BRAMS/i10dbg/bin/machine_arq.F90 +BRAMS/i10dbg/bin/nest_drivers.F90 +BRAMS/i10dbg/bin/rhdf5.F90 +BRAMS/i10dbg/bin/rk4_derivs.F90 +BRAMS/i10dbg/bin/rk4_driver.F90 +BRAMS/i10dbg/bin/rk4_stepper.F90 +BRAMS/i10dbg/bin/rsys.F90 +BRAMS/i10dbg/bin/soil_coms.F90 +BRAMS/i10dbg/bin/dted.c +BRAMS/i10dbg/bin/eenviron.c +BRAMS/i10dbg/bin/tmpname.c +BRAMS/i10dbg/bin/utils_c.c +BRAMS/i12dbg/bin/adap_init.f90 +BRAMS/i12dbg/bin/allometry.f90 +BRAMS/i12dbg/bin/altera_dia.f90 +BRAMS/i12dbg/bin/an_header.f90 +BRAMS/i12dbg/bin/aobj.f90 +BRAMS/i12dbg/bin/asgen.f90 +BRAMS/i12dbg/bin/asti2.f90 +BRAMS/i12dbg/bin/asti.f90 +BRAMS/i12dbg/bin/astp.f90 +BRAMS/i12dbg/bin/avarf.f90 +BRAMS/i12dbg/bin/average_utils.f90 +BRAMS/i12dbg/bin/bdf2_solver.f90 +BRAMS/i12dbg/bin/budget_utils.f90 +BRAMS/i12dbg/bin/c34constants.f90 +BRAMS/i12dbg/bin/canopy_air_coms.f90 +BRAMS/i12dbg/bin/canopy_radiation_coms.f90 +BRAMS/i12dbg/bin/canopy_struct_dynamics.f90 +BRAMS/i12dbg/bin/catt_start.f90 +BRAMS/i12dbg/bin/charutils.f90 +BRAMS/i12dbg/bin/cond_read.f90 +BRAMS/i12dbg/bin/cond_update.f90 +BRAMS/i12dbg/bin/conv_coms.f90 +BRAMS/i12dbg/bin/coriolis.f90 +BRAMS/i12dbg/bin/cup_dn.f90 +BRAMS/i12dbg/bin/cup_env.f90 +BRAMS/i12dbg/bin/cup_grell2.f90 +BRAMS/i12dbg/bin/cup_grell2_shcu.f90 +BRAMS/i12dbg/bin/cup_up.f90 +BRAMS/i12dbg/bin/cu_read.f90 +BRAMS/i12dbg/bin/cyclic_mod.f90 +BRAMS/i12dbg/bin/dateutils.f90 +BRAMS/i12dbg/bin/dealloc.f90 +BRAMS/i12dbg/bin/decomp_coms.f90 +BRAMS/i12dbg/bin/detailed_coms.f90 +BRAMS/i12dbg/bin/diffsclr.f90 +BRAMS/i12dbg/bin/diffuse.f90 +BRAMS/i12dbg/bin/disturbance.f90 +BRAMS/i12dbg/bin/disturb_coms.f90 +BRAMS/i12dbg/bin/domain_decomp.f90 +BRAMS/i12dbg/bin/dry_dep.f90 +BRAMS/i12dbg/bin/edcp_driver.f90 +BRAMS/i12dbg/bin/edcp_init.f90 +BRAMS/i12dbg/bin/edcp_lake_driver.f90 +BRAMS/i12dbg/bin/edcp_lake_misc.f90 +BRAMS/i12dbg/bin/edcp_lake_stepper.f90 +BRAMS/i12dbg/bin/edcp_load_namelist.f90 +BRAMS/i12dbg/bin/edcp_met.f90 +BRAMS/i12dbg/bin/edcp_met_init.f90 +BRAMS/i12dbg/bin/edcp_model.f90 +BRAMS/i12dbg/bin/edcp_mpiutils.f90 +BRAMS/i12dbg/bin/edcp_para_init.f90 +BRAMS/i12dbg/bin/ed_grid.f90 +BRAMS/i12dbg/bin/ed_init.f90 +BRAMS/i12dbg/bin/edio.f90 +BRAMS/i12dbg/bin/ed_mem_grid_dim_defs.f90 +BRAMS/i12dbg/bin/ed_misc_coms.f90 +BRAMS/i12dbg/bin/ed_nbg_init.f90 +BRAMS/i12dbg/bin/ed_node_coms.f90 +BRAMS/i12dbg/bin/ed_para_coms.f90 +BRAMS/i12dbg/bin/ed_params.f90 +BRAMS/i12dbg/bin/ed_print.f90 +BRAMS/i12dbg/bin/ed_read_ed10_20_history.f90 +BRAMS/i12dbg/bin/ed_state_vars.f90 +BRAMS/i12dbg/bin/ed_therm_lib.f90 +BRAMS/i12dbg/bin/ed_type_init.f90 +BRAMS/i12dbg/bin/ed_var_tables.f90 +BRAMS/i12dbg/bin/ed_work_vars.f90 +BRAMS/i12dbg/bin/ed_xml_config.f90 +BRAMS/i12dbg/bin/emission_source_map.f90 +BRAMS/i12dbg/bin/ename_coms.f90 +BRAMS/i12dbg/bin/error_mess.f90 +BRAMS/i12dbg/bin/euler_driver.f90 +BRAMS/i12dbg/bin/events.f90 +BRAMS/i12dbg/bin/extra.f90 +BRAMS/i12dbg/bin/farq_leuning.f90 +BRAMS/i12dbg/bin/fatal_error.f90 +BRAMS/i12dbg/bin/file_inv.f90 +BRAMS/i12dbg/bin/fire.f90 +BRAMS/i12dbg/bin/first_rams.f90 +BRAMS/i12dbg/bin/forestry.f90 +BRAMS/i12dbg/bin/fuse_fiss_utils.f90 +BRAMS/i12dbg/bin/fusion_fission_coms.f90 +BRAMS/i12dbg/bin/gaspart.f90 +BRAMS/i12dbg/bin/geodat.f90 +BRAMS/i12dbg/bin/getvar.f90 +BRAMS/i12dbg/bin/great_circle.f90 +BRAMS/i12dbg/bin/grell_coms.f90 +BRAMS/i12dbg/bin/grell_cupar_aux.f90 +BRAMS/i12dbg/bin/grell_cupar_downdraft.f90 +BRAMS/i12dbg/bin/grell_cupar_driver.f90 +BRAMS/i12dbg/bin/grell_cupar_dynamic.f90 +BRAMS/i12dbg/bin/grell_cupar_ensemble.f90 +BRAMS/i12dbg/bin/grell_cupar_environment.f90 +BRAMS/i12dbg/bin/grell_cupar_feedback.f90 +BRAMS/i12dbg/bin/grell_cupar_static.f90 +BRAMS/i12dbg/bin/grell_cupar_updraft.f90 +BRAMS/i12dbg/bin/grell_extras_catt.f90 +BRAMS/i12dbg/bin/grid_coms.f90 +BRAMS/i12dbg/bin/grid_dims.f90 +BRAMS/i12dbg/bin/gridset.f90 +BRAMS/i12dbg/bin/grid_struct.f90 +BRAMS/i12dbg/bin/growth_balive.f90 +BRAMS/i12dbg/bin/harr_coms.f90 +BRAMS/i12dbg/bin/harr_raddriv.f90 +BRAMS/i12dbg/bin/harr_radinit.f90 +BRAMS/i12dbg/bin/hemi2.f90 +BRAMS/i12dbg/bin/heun_driver.f90 +BRAMS/i12dbg/bin/htint-opt.f90 +BRAMS/i12dbg/bin/hybrid_driver.f90 +BRAMS/i12dbg/bin/hydrology_coms.f90 +BRAMS/i12dbg/bin/hydrology_constants.f90 +BRAMS/i12dbg/bin/inithis.f90 +BRAMS/i12dbg/bin/init_hydro_sites.f90 +BRAMS/i12dbg/bin/interp_lib.f90 +BRAMS/i12dbg/bin/invmondays.f90 +BRAMS/i12dbg/bin/io_params.f90 +BRAMS/i12dbg/bin/isan_coms.f90 +BRAMS/i12dbg/bin/isan_io.f90 +BRAMS/i12dbg/bin/ke_coms.f90 +BRAMS/i12dbg/bin/kuo_cupar_driver.f90 +BRAMS/i12dbg/bin/lake_coms.f90 +BRAMS/i12dbg/bin/landuse_init.f90 +BRAMS/i12dbg/bin/lapse.f90 +BRAMS/i12dbg/bin/leaf3_bc.f90 +BRAMS/i12dbg/bin/leaf3_can.f90 +BRAMS/i12dbg/bin/leaf3.f90 +BRAMS/i12dbg/bin/leaf3_hyd.f90 +BRAMS/i12dbg/bin/leaf3_init.f90 +BRAMS/i12dbg/bin/leaf3_ocean.f90 +BRAMS/i12dbg/bin/leaf3_teb.f90 +BRAMS/i12dbg/bin/leaf3_tw.f90 +BRAMS/i12dbg/bin/leaf3_utils.f90 +BRAMS/i12dbg/bin/leaf_coms.f90 +BRAMS/i12dbg/bin/leaf_database.f90 +BRAMS/i12dbg/bin/libxml2f90.f90_pp.f90 +BRAMS/i12dbg/bin/local_proc.f90 +BRAMS/i12dbg/bin/lsm_hyd.f90 +BRAMS/i12dbg/bin/map_proj.f90 +BRAMS/i12dbg/bin/mem_aerad.f90 +BRAMS/i12dbg/bin/mem_all.f90 +BRAMS/i12dbg/bin/mem_basic.f90 +BRAMS/i12dbg/bin/mem_carma.f90 +BRAMS/i12dbg/bin/mem_cuparm.f90 +BRAMS/i12dbg/bin/mem_edcp.f90 +BRAMS/i12dbg/bin/mem_emiss.f90 +BRAMS/i12dbg/bin/mem_ensemble.f90 +BRAMS/i12dbg/bin/mem_gaspart.f90 +BRAMS/i12dbg/bin/mem_globaer.f90 +BRAMS/i12dbg/bin/mem_globrad.f90 +BRAMS/i12dbg/bin/mem_grell_param2.f90 +BRAMS/i12dbg/bin/mem_grid_dim_defs.f90 +BRAMS/i12dbg/bin/mem_grid.f90 +BRAMS/i12dbg/bin/mem_harr.f90 +BRAMS/i12dbg/bin/mem_leaf.f90 +BRAMS/i12dbg/bin/mem_mass.f90 +BRAMS/i12dbg/bin/mem_mclat.f90 +BRAMS/i12dbg/bin/mem_micro.f90 +BRAMS/i12dbg/bin/mem_mksfc.f90 +BRAMS/i12dbg/bin/mem_mnt_advec.f90 +BRAMS/i12dbg/bin/mem_nestb.f90 +BRAMS/i12dbg/bin/mem_oda.f90 +BRAMS/i12dbg/bin/mem_opt_scratch.f90 +BRAMS/i12dbg/bin/mem_polygons.f90 +BRAMS/i12dbg/bin/mem_radiate.f90 +BRAMS/i12dbg/bin/mem_scalar.f90 +BRAMS/i12dbg/bin/mem_scratch1_brams.f90 +BRAMS/i12dbg/bin/mem_scratch1_grell.f90 +BRAMS/i12dbg/bin/mem_scratch2_grell.f90 +BRAMS/i12dbg/bin/mem_scratch2_grell_sh.f90 +BRAMS/i12dbg/bin/mem_scratch3_grell.f90 +BRAMS/i12dbg/bin/mem_scratch3_grell_sh.f90 +BRAMS/i12dbg/bin/mem_scratch.f90 +BRAMS/i12dbg/bin/mem_scratch_grell.f90 +BRAMS/i12dbg/bin/mem_soil_moisture.f90 +BRAMS/i12dbg/bin/mem_tconv.f90 +BRAMS/i12dbg/bin/mem_teb_common.f90 +BRAMS/i12dbg/bin/mem_teb.f90 +BRAMS/i12dbg/bin/mem_teb_vars_const.f90 +BRAMS/i12dbg/bin/mem_tend.f90 +BRAMS/i12dbg/bin/mem_turb.f90 +BRAMS/i12dbg/bin/mem_turb_scalar.f90 +BRAMS/i12dbg/bin/mem_varinit.f90 +BRAMS/i12dbg/bin/met_driver_coms.f90 +BRAMS/i12dbg/bin/mic_coll.f90 +BRAMS/i12dbg/bin/mic_driv.f90 +BRAMS/i12dbg/bin/mic_gamma.f90 +BRAMS/i12dbg/bin/mic_init.f90 +BRAMS/i12dbg/bin/mic_misc.f90 +BRAMS/i12dbg/bin/mic_nuc.f90 +BRAMS/i12dbg/bin/micphys.f90 +BRAMS/i12dbg/bin/micro_coms.f90 +BRAMS/i12dbg/bin/mic_tabs.f90 +BRAMS/i12dbg/bin/mic_vap.f90 +BRAMS/i12dbg/bin/mksfc_driver.f90 +BRAMS/i12dbg/bin/mksfc_fuso.f90 +BRAMS/i12dbg/bin/mksfc_ndvi.f90 +BRAMS/i12dbg/bin/mksfc_sfc.f90 +BRAMS/i12dbg/bin/mksfc_sst.f90 +BRAMS/i12dbg/bin/mksfc_top.f90 +BRAMS/i12dbg/bin/mnt_advec_aux.f90 +BRAMS/i12dbg/bin/mnt_advec_main.f90 +BRAMS/i12dbg/bin/mod_advect_kit.f90 +BRAMS/i12dbg/bin/model.f90 +BRAMS/i12dbg/bin/mod_GhostBlock.f90 +BRAMS/i12dbg/bin/mod_GhostBlockPartition.f90 +BRAMS/i12dbg/bin/mod_ozone.f90 +BRAMS/i12dbg/bin/modsched.f90 +BRAMS/i12dbg/bin/mortality.f90 +BRAMS/i12dbg/bin/mpass_advec.f90 +BRAMS/i12dbg/bin/mpass_cyclic.f90 +BRAMS/i12dbg/bin/mpass_dtl.f90 +BRAMS/i12dbg/bin/mpass_feed.f90 +BRAMS/i12dbg/bin/mpass_full.f90 +BRAMS/i12dbg/bin/mpass_init.f90 +BRAMS/i12dbg/bin/mpass_lbc.f90 +BRAMS/i12dbg/bin/mpass_nest.f90 +BRAMS/i12dbg/bin/mpass_oda.f90 +BRAMS/i12dbg/bin/mpass_st.f90 +BRAMS/i12dbg/bin/multiple_scatter.f90 +BRAMS/i12dbg/bin/ncarg_dummy.f90 +BRAMS/i12dbg/bin/ndvi_read.f90 +BRAMS/i12dbg/bin/nest_feed.f90 +BRAMS/i12dbg/bin/nest_filldens.f90 +BRAMS/i12dbg/bin/nest_geosst.f90 +BRAMS/i12dbg/bin/nest_init_aux.f90 +BRAMS/i12dbg/bin/nest_intrp.f90 +BRAMS/i12dbg/bin/nest_move.f90 +BRAMS/i12dbg/bin/node_mod.f90 +BRAMS/i12dbg/bin/nud_analysis.f90 +BRAMS/i12dbg/bin/nud_read.f90 +BRAMS/i12dbg/bin/nud_update.f90 +BRAMS/i12dbg/bin/numutils.f90 +BRAMS/i12dbg/bin/obs_input.f90 +BRAMS/i12dbg/bin/oda_krig.f90 +BRAMS/i12dbg/bin/oda_nudge.f90 +BRAMS/i12dbg/bin/oda_proc_obs.f90 +BRAMS/i12dbg/bin/oda_read.f90 +BRAMS/i12dbg/bin/oda_sta_count.f90 +BRAMS/i12dbg/bin/oda_sta_input.f90 +BRAMS/i12dbg/bin/old_grell_cupar_driver.f90 +BRAMS/i12dbg/bin/opspec.f90 +BRAMS/i12dbg/bin/optimiz_coms.f90 +BRAMS/i12dbg/bin/ozone.f90 +BRAMS/i12dbg/bin/para_init.f90 +BRAMS/i12dbg/bin/paral.f90 +BRAMS/i12dbg/bin/par_decomp.f90 +BRAMS/i12dbg/bin/pft_coms.f90 +BRAMS/i12dbg/bin/phenology_aux.f90 +BRAMS/i12dbg/bin/phenology_coms.f90 +BRAMS/i12dbg/bin/phenology_driv.f90 +BRAMS/i12dbg/bin/phenology_startup.f90 +BRAMS/i12dbg/bin/photosyn_driv.f90 +BRAMS/i12dbg/bin/physiology_coms.f90 +BRAMS/i12dbg/bin/plumerise_vector.f90 +BRAMS/i12dbg/bin/polarst.f90 +BRAMS/i12dbg/bin/raco_adap.f90 +BRAMS/i12dbg/bin/raco.f90 +BRAMS/i12dbg/bin/rad_carma.f90 +BRAMS/i12dbg/bin/rad_ccmp.f90 +BRAMS/i12dbg/bin/rad_driv.f90 +BRAMS/i12dbg/bin/radiate_driver.f90 +BRAMS/i12dbg/bin/radiate_utils.f90 +BRAMS/i12dbg/bin/rad_mclat.f90 +BRAMS/i12dbg/bin/rad_stable.f90 +BRAMS/i12dbg/bin/radvc_adap.f90 +BRAMS/i12dbg/bin/radvc.f90 +BRAMS/i12dbg/bin/radvc_new.f90 +BRAMS/i12dbg/bin/rams_grid.f90 +BRAMS/i12dbg/bin/rams_master.f90 +BRAMS/i12dbg/bin/rams_mem_alloc.f90 +BRAMS/i12dbg/bin/rams_read_header.f90 +BRAMS/i12dbg/bin/ranlavg.f90 +BRAMS/i12dbg/bin/rbnd_adap.f90 +BRAMS/i12dbg/bin/rbnd.f90 +BRAMS/i12dbg/bin/rcio.f90 +BRAMS/i12dbg/bin/rconstants.f90 +BRAMS/i12dbg/bin/rconv_driver.f90 +BRAMS/i12dbg/bin/rdint.f90 +BRAMS/i12dbg/bin/read_ralph.f90 +BRAMS/i12dbg/bin/recycle.f90 +BRAMS/i12dbg/bin/ref_sounding.f90 +BRAMS/i12dbg/bin/refstate.f90 +BRAMS/i12dbg/bin/reproduction.f90 +BRAMS/i12dbg/bin/rexev.f90 +BRAMS/i12dbg/bin/rgrad.f90 +BRAMS/i12dbg/bin/rhhi.f90 +BRAMS/i12dbg/bin/rinit.f90 +BRAMS/i12dbg/bin/rio.f90 +BRAMS/i12dbg/bin/rk4_coms.f90 +BRAMS/i12dbg/bin/rk4_integ_utils.f90 +BRAMS/i12dbg/bin/rk4_misc.f90 +BRAMS/i12dbg/bin/rmass.f90 +BRAMS/i12dbg/bin/rname.f90 +BRAMS/i12dbg/bin/rnest_par.f90 +BRAMS/i12dbg/bin/rnode.f90 +BRAMS/i12dbg/bin/rpara.f90 +BRAMS/i12dbg/bin/rprnt.f90 +BRAMS/i12dbg/bin/rthrm.f90 +BRAMS/i12dbg/bin/rtimh.f90 +BRAMS/i12dbg/bin/rtimi.f90 +BRAMS/i12dbg/bin/ruser.f90 +BRAMS/i12dbg/bin/shcu_vars_const.f90 +BRAMS/i12dbg/bin/soil_moisture_init.f90 +BRAMS/i12dbg/bin/soil_respiration.f90 +BRAMS/i12dbg/bin/souza_cupar_driver.f90 +BRAMS/i12dbg/bin/sst_read.f90 +BRAMS/i12dbg/bin/stable_cohorts.f90 +BRAMS/i12dbg/bin/structural_growth.f90 +BRAMS/i12dbg/bin/teb_spm_start.f90 +BRAMS/i12dbg/bin/therm_lib8.f90 +BRAMS/i12dbg/bin/therm_lib.f90 +BRAMS/i12dbg/bin/tkenn.f90 +BRAMS/i12dbg/bin/turb_coms.f90 +BRAMS/i12dbg/bin/turb_derivs.f90 +BRAMS/i12dbg/bin/turb_diff_adap.f90 +BRAMS/i12dbg/bin/turb_diff.f90 +BRAMS/i12dbg/bin/turb_k_adap.f90 +BRAMS/i12dbg/bin/turb_ke.f90 +BRAMS/i12dbg/bin/turb_k.f90 +BRAMS/i12dbg/bin/twostream_rad.f90 +BRAMS/i12dbg/bin/update_derived_props.f90 +BRAMS/i12dbg/bin/urban_canopy.f90 +BRAMS/i12dbg/bin/urban.f90 +BRAMS/i12dbg/bin/utils_f.f90 +BRAMS/i12dbg/bin/varf_read.f90 +BRAMS/i12dbg/bin/varf_update.f90 +BRAMS/i12dbg/bin/var_tables.f90 +BRAMS/i12dbg/bin/varutils.f90 +BRAMS/i12dbg/bin/vegetation_dynamics.f90 +BRAMS/i12dbg/bin/vformat.f90 +BRAMS/i12dbg/bin/v_interps.f90 +BRAMS/i12dbg/bin/vtab_fill.f90 +BRAMS/i12dbg/bin/asnc.F90 +BRAMS/i12dbg/bin/consts_coms.F90 +BRAMS/i12dbg/bin/ed_filelist.F90 +BRAMS/i12dbg/bin/ed_init_atm.F90 +BRAMS/i12dbg/bin/ed_init_full_history.F90 +BRAMS/i12dbg/bin/ed_max_dims.F90 +BRAMS/i12dbg/bin/ed_opspec.F90 +BRAMS/i12dbg/bin/ed_read_ed21_history.F90 +BRAMS/i12dbg/bin/filelist.F90 +BRAMS/i12dbg/bin/h5_output.F90 +BRAMS/i12dbg/bin/harr_rad.F90 +BRAMS/i12dbg/bin/hdf5_coms.F90 +BRAMS/i12dbg/bin/hdf5_utils.F90 +BRAMS/i12dbg/bin/landuse_input.F90 +BRAMS/i12dbg/bin/machine_arq.F90 +BRAMS/i12dbg/bin/nest_drivers.F90 +BRAMS/i12dbg/bin/rhdf5.F90 +BRAMS/i12dbg/bin/rk4_derivs.F90 +BRAMS/i12dbg/bin/rk4_driver.F90 +BRAMS/i12dbg/bin/rk4_stepper.F90 +BRAMS/i12dbg/bin/rsys.F90 +BRAMS/i12dbg/bin/soil_coms.F90 +BRAMS/i12dbg/bin/dted.c +BRAMS/i12dbg/bin/eenviron.c +BRAMS/i12dbg/bin/tmpname.c +BRAMS/i12dbg/bin/utils_c.c +BRAMS/i12dbg/bin/advect_kit.mod +BRAMS/i12dbg/bin/allometry.mod +BRAMS/i12dbg/bin/an_header.mod +BRAMS/i12dbg/bin/c34constants.mod +BRAMS/i12dbg/bin/canopy_air_coms.mod +BRAMS/i12dbg/bin/canopy_layer_coms.mod +BRAMS/i12dbg/bin/canopy_radiation_coms.mod +BRAMS/i12dbg/bin/canopy_struct_dynamics.mod +BRAMS/i12dbg/bin/catt_start.mod +BRAMS/i12dbg/bin/consts_coms.mod +BRAMS/i12dbg/bin/conv_coms.mod +BRAMS/i12dbg/bin/cyclic_mod.mod +BRAMS/i12dbg/bin/decomp_coms.mod +BRAMS/i12dbg/bin/detailed_coms.mod +BRAMS/i12dbg/bin/disturbance_utils.mod +BRAMS/i12dbg/bin/disturb_coms.mod +BRAMS/i12dbg/bin/domain_decomp.mod +BRAMS/i12dbg/bin/dtset.mod +BRAMS/i12dbg/bin/ed_max_dims.mod +BRAMS/i12dbg/bin/ed_mem_grid_dim_defs.mod +BRAMS/i12dbg/bin/ed_misc_coms.mod +BRAMS/i12dbg/bin/ed_node_coms.mod +BRAMS/i12dbg/bin/ed_para_coms.mod +BRAMS/i12dbg/bin/ed_state_vars.mod +BRAMS/i12dbg/bin/ed_therm_lib.mod +BRAMS/i12dbg/bin/ed_var_tables.mod +BRAMS/i12dbg/bin/ed_work_vars.mod +BRAMS/i12dbg/bin/emission_source_map.mod +BRAMS/i12dbg/bin/ename_coms.mod +BRAMS/i12dbg/bin/extras.mod +BRAMS/i12dbg/bin/farq_leuning.mod +BRAMS/i12dbg/bin/fuse_fiss_utils.mod +BRAMS/i12dbg/bin/fusion_fission_coms.mod +BRAMS/i12dbg/bin/grell_coms.mod +BRAMS/i12dbg/bin/grid_coms.mod +BRAMS/i12dbg/bin/grid_dims.mod +BRAMS/i12dbg/bin/grid_struct.mod +BRAMS/i12dbg/bin/growth_balive.mod +BRAMS/i12dbg/bin/harr_coms.mod +BRAMS/i12dbg/bin/hdf5_coms.mod +BRAMS/i12dbg/bin/hdf5_utils.mod +BRAMS/i12dbg/bin/hydrology_coms.mod +BRAMS/i12dbg/bin/hydrology_constants.mod +BRAMS/i12dbg/bin/io_params.mod +BRAMS/i12dbg/bin/isan_coms.mod +BRAMS/i12dbg/bin/ke_coms.mod +BRAMS/i12dbg/bin/lake_coms.mod +BRAMS/i12dbg/bin/leaf_coms.mod +BRAMS/i12dbg/bin/libxml2f90_interface_module.mod +BRAMS/i12dbg/bin/libxml2f90_module.mod +BRAMS/i12dbg/bin/libxml2f90_strings_module.mod +BRAMS/i12dbg/bin/ll_module.mod +BRAMS/i12dbg/bin/machine_arq.mod +BRAMS/i12dbg/bin/mem_aerad.mod +BRAMS/i12dbg/bin/mem_all.mod +BRAMS/i12dbg/bin/mem_basic.mod +BRAMS/i12dbg/bin/mem_carma.mod +BRAMS/i12dbg/bin/mem_cuparm.mod +BRAMS/i12dbg/bin/mem_edcp.mod +BRAMS/i12dbg/bin/mem_emiss.mod +BRAMS/i12dbg/bin/mem_ensemble.mod +BRAMS/i12dbg/bin/mem_gaspart.mod +BRAMS/i12dbg/bin/mem_globaer.mod +BRAMS/i12dbg/bin/mem_globrad.mod +BRAMS/i12dbg/bin/mem_grell_param.mod +BRAMS/i12dbg/bin/mem_grid_dim_defs.mod +BRAMS/i12dbg/bin/mem_grid.mod +BRAMS/i12dbg/bin/mem_harr.mod +BRAMS/i12dbg/bin/mem_leaf.mod +BRAMS/i12dbg/bin/mem_mass.mod +BRAMS/i12dbg/bin/mem_mclat.mod +BRAMS/i12dbg/bin/mem_micro.mod +BRAMS/i12dbg/bin/mem_mksfc.mod +BRAMS/i12dbg/bin/mem_mnt_advec.mod +BRAMS/i12dbg/bin/mem_nestb.mod +BRAMS/i12dbg/bin/mem_oda.mod +BRAMS/i12dbg/bin/mem_opt.mod +BRAMS/i12dbg/bin/mem_polygons.mod +BRAMS/i12dbg/bin/mem_radiate.mod +BRAMS/i12dbg/bin/mem_scalar.mod +BRAMS/i12dbg/bin/mem_scratch1_grell.mod +BRAMS/i12dbg/bin/mem_scratch1.mod +BRAMS/i12dbg/bin/mem_scratch2_grell.mod +BRAMS/i12dbg/bin/mem_scratch2_grell_sh.mod +BRAMS/i12dbg/bin/mem_scratch3_grell.mod +BRAMS/i12dbg/bin/mem_scratch3_grell_sh.mod +BRAMS/i12dbg/bin/mem_scratch_grell.mod +BRAMS/i12dbg/bin/mem_scratch.mod +BRAMS/i12dbg/bin/mem_soil_moisture.mod +BRAMS/i12dbg/bin/mem_tconv.mod +BRAMS/i12dbg/bin/mem_teb_common.mod +BRAMS/i12dbg/bin/mem_teb.mod +BRAMS/i12dbg/bin/mem_tend.mod +BRAMS/i12dbg/bin/mem_turb.mod +BRAMS/i12dbg/bin/mem_turb_scalar.mod +BRAMS/i12dbg/bin/mem_varinit.mod +BRAMS/i12dbg/bin/met_driver_coms.mod +BRAMS/i12dbg/bin/micphys.mod +BRAMS/i12dbg/bin/micro_coms.mod +BRAMS/i12dbg/bin/mod_ghostblock.mod +BRAMS/i12dbg/bin/mod_ghostblockpartition.mod +BRAMS/i12dbg/bin/mortality.mod +BRAMS/i12dbg/bin/node_mod.mod +BRAMS/i12dbg/bin/obs_input.mod +BRAMS/i12dbg/bin/optimiz_coms.mod +BRAMS/i12dbg/bin/ozone_const.mod +BRAMS/i12dbg/bin/pft_coms.mod +BRAMS/i12dbg/bin/phenology_aux.mod +BRAMS/i12dbg/bin/phenology_coms.mod +BRAMS/i12dbg/bin/phenology_startup.mod +BRAMS/i12dbg/bin/physiology_coms.mod +BRAMS/i12dbg/bin/plume_utils.mod +BRAMS/i12dbg/bin/rad_carma.mod +BRAMS/i12dbg/bin/rconstants.mod +BRAMS/i12dbg/bin/ref_sounding.mod +BRAMS/i12dbg/bin/rk4_coms.mod +BRAMS/i12dbg/bin/rk4_driver.mod +BRAMS/i12dbg/bin/rk4_stepper.mod +BRAMS/i12dbg/bin/rpara.mod +BRAMS/i12dbg/bin/shcu_vars_const.mod +BRAMS/i12dbg/bin/soil_coms.mod +BRAMS/i12dbg/bin/teb_spm_start.mod +BRAMS/i12dbg/bin/teb_vars_const.mod +BRAMS/i12dbg/bin/therm_lib8.mod +BRAMS/i12dbg/bin/therm_lib.mod +BRAMS/i12dbg/bin/turb_coms.mod +BRAMS/i12dbg/bin/var_tables.mod +BRAMS/i12dbg/edbrams-opt diff --git a/BRAMS/Template/RAMSIN b/BRAMS/Template/RAMSIN index 772d01180..6090e294f 100644 --- a/BRAMS/Template/RAMSIN +++ b/BRAMS/Template/RAMSIN @@ -92,10 +92,10 @@ $MODEL_GRIDS ! a lot, leave this set to 1. One value for all grids. ! !---------------------------------------------------------------------------------------! NGRIDS = 1, - NNXP = 132, 68, 230, - NNYP = 114, 56, 161, + NNXP = 177, 68, 230, + NNYP = 98, 56, 161, NNZP = 44, 44, 44, - NZG = 10, + NZG = 16, NZS = 1, !---------------------------------------------------------------------------------------! @@ -154,8 +154,8 @@ $MODEL_GRIDS ! DZMAX -- maximum grid spacing in metres. ! ! ZZ -- discrete layers in case you set DELTAZ to zero. ! !---------------------------------------------------------------------------------------! - DELTAX = 21000., - DELTAY = 21000., + DELTAX = 25000., + DELTAY = 25000., DELTAZ = 100., DZRAT = 1.08, DZMAX = 1000., @@ -185,7 +185,7 @@ $MODEL_GRIDS ! vary as needed. It is useful for a first guess of DTLONG, but not ! ! a good option for actual runs because NACOUST tends to be too small. ! !---------------------------------------------------------------------------------------! - DTLONG = 40., + DTLONG = 30., NACOUST = 4, IDELTAT = 0, !---------------------------------------------------------------------------------------! @@ -232,10 +232,10 @@ $MODEL_GRIDS ! CENTLAT -- Latitude of the central point. One value for each grid. ! ! CENTLON -- Longitude of the central point. One value for each grid. ! !---------------------------------------------------------------------------------------! - POLELAT = -3.8, - POLELON = -56.5, - CENTLAT = -3.8, - CENTLON = -56.5, + POLELAT = -4.00, + POLELON = -53.00, + CENTLAT = -4.00, + CENTLON = -53.00, !---------------------------------------------------------------------------------------! @@ -417,10 +417,10 @@ $END ! WT_NUDGE_CO2 -- Relative weight for CO2 mixing ratio. ! !---------------------------------------------------------------------------------------! NUDLAT = 5 , - TNUDLAT = 1200., - TNUDCENT = 64800., + TNUDLAT = 3600., + TNUDCENT = 43200., TNUDTOP = 10800., - ZNUDTOP = 16000., + ZNUDTOP = 18000., WT_NUDGE_GRID = 1., 0.80, WT_NUDGE_UV = 1., WT_NUDGE_TH = 1., @@ -617,7 +617,7 @@ $END ICLOBBER = 1, IHISTDEL = 0, FRQHIS = 86400., - FRQANL = 3600., + FRQANL = 10800., !---------------------------------------------------------------------------------------! @@ -788,7 +788,7 @@ $END !---------------------------------------------------------------------------------------! ITOPTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/topo/EL', ISSTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/weeklysst/W', - IVEGTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/veg_usgs/VUSGS_', + IVEGTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/veg_defsce/bau2002/BAU-2002_', ISOILFN = '/n/Moorcroft_Lab/Lab/data/brams_data/soil_brams406/RADAM+Quesada+IGBP/RADAM+Quesada+IGBP_', NDVIFN = '/n/Moorcroft_Lab/Lab/data/brams_data/lai-modis/2001LAI', !---------------------------------------------------------------------------------------! @@ -889,7 +889,7 @@ $CUPARM_OPTIONS ! PS3: If NCLOUDS >= 3, then the middle ones will necessarily use Grell's ! ! parameterization. ! !---------------------------------------------------------------------------------------! - NCLOUDS = 4, + NCLOUDS = 2, !---------------------------------------------------------------------------------------! @@ -917,8 +917,8 @@ $CUPARM_OPTIONS ! CONFRQ: how often should the cumulus parametrisation be updated? ! ! CPTIME: when I should start computing the cumulus parametrisation. ! !---------------------------------------------------------------------------------------! - CONFRQ = 720., - CPTIME = 0., + CONFRQ = 900., + CPTIME = 0., !---------------------------------------------------------------------------------------! @@ -945,8 +945,8 @@ $CUPARM_OPTIONS ! (grell_coms.f90). Default min_down_radius is 900. ! ! DEPTH_MIN - Minimum depth that the cloud must have [m]. ! !---------------------------------------------------------------------------------------! - RADIUS = 12000., 4800., 1800., 600., - DEPTH_MIN = 6000., 2400., 900., 200., + RADIUS = 8000., 800., + DEPTH_MIN = 8000., 800., !---------------------------------------------------------------------------------------! @@ -971,11 +971,11 @@ $CUPARM_OPTIONS !---------------------------------------------------------------------------------------! ! The following variables are scalars. ! !---------------------------------------------------------------------------------------! - CLD2PREC = 0.002, ! Ratio of conversion of condensates to precipitation. [ ---] + CLD2PREC = -0.03, ! 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] - MAX_HEAT = 250., ! Maximum heating rate allowed for feedback [ K/day] + MAX_HEAT = 400., ! Maximum heating rate allowed for feedback [ K/day] !---------------------------------------------------------------------------------------! @@ -990,6 +990,7 @@ $CUPARM_OPTIONS ! !------+--------------------------------+------+------+----------------------------! ! ! ! EN | Ensemble (all closures) | yes | no | Grell and Dévényi, 2002 ! ! ! ! NC | Ensemble, excluding LO and MC | yes | yes | Grell and Dévényi, 2002 ! ! + ! ! QI | Ensemble, with AS and KF only | yes | yes | Grell and Dévényi, 2002 ! ! ! ! GR | Modified quasi-equilibrium ABE | yes | yes | Grell, 1993 ! ! ! ! LO | Low level omega | yes | no | Frank and Cohen, 1987 ! ! ! ! MC | moisture convergence | yes | no | Krishnamurti et al., 1983 ! ! @@ -998,7 +999,7 @@ $CUPARM_OPTIONS ! !----------------------------------------------------------------------------------! ! ! ! !---------------------------------------------------------------------------------------! - CLOSURE_TYPE = 'NC', + CLOSURE_TYPE = 'KF', !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! @@ -1055,7 +1056,7 @@ $MODEL_OPTIONS !---------------------------------------------------------------------------------------! ! IADVEC -- 1 - Original advection scheme ! - ! 2 - Monotic advection scheme, as in Freitas et al. (2001, in press JAMES). ! + ! 2 - Monotic advection scheme, as in Freitas et al. (2012, in press JAMES). ! !---------------------------------------------------------------------------------------! IADVEC = 2, !---------------------------------------------------------------------------------------! @@ -1172,9 +1173,9 @@ $MODEL_OPTIONS ! 1 -- yes. That's the standard for most runs. ! !---------------------------------------------------------------------------------------! ISWRTYP = 3, - ILWRTYP = 4, + ILWRTYP = 1, ICUMFDBK = 1, - RADFRQ = 600., + RADFRQ = 300., LONRAD = 1, !---------------------------------------------------------------------------------------! @@ -1392,32 +1393,34 @@ $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. ! + ! ISOILCOL -- LEAF-3 and ED-2 soil colour classes. 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 | ! - ! |-----------------------------------------------------------------------| ! + ! |-----------------------------------------------------------------------| ! + ! | | 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. ! + ! the default in ED-2.1. ! !------------------------------------------------------------------------------------! ISOILCOL = 2, !------------------------------------------------------------------------------------! @@ -1501,29 +1504,29 @@ $MODEL_OPTIONS ! 2 = porosity (saturation) ! ! STGOFF - initial temperature offset (soil temperature = air temperature + offset) ! !------------------------------------------------------------------------------------! - SLZ = -6.000, -4.662, -3.452, -2.480, -1.693, - -1.078, -0.620, -0.304, -0.111, -0.020, - SLMSTR = 1.00, 1.00, 1.00, 1.00, 1.00, - 1.00, 1.00, 1.00, 1.00, 1.00, - STGOFF = 0.00, 0.00, 0.00, 0.00, 0.00, - 0.00, 0.00, 0.00, 0.00, 0.00, + SLZ = -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, + SLMSTR = 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, + STGOFF = 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, !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! - ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Both ! - ! ED and BRAMS use it. If unsure, use 0 for short-term simulations ! - ! (couple of days), and 1 for long-term simulations (months to years). ! - ! 0. Bedrock. Flux from the bottom of the bottommost layer is set to 0. ! - ! 1. Gravitational flow. The flux from the bottom of the bottommost ! - ! layer is due to gradient of height only. ! - ! 2. Super drainage. Soil moisture of the ficticious layer beneath the ! - ! bottom is always at dry air soil moisture. ! - ! 3. Half-way. Assume that the fictious layer beneath the bottom is ! - ! always at field capacity. ! - ! 4. Aquifer. Soil moisture of the ficticious layer beneath the bottom ! + ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. ! + ! For regional runs, it is wise to use options 1 or 2, especially for ! + ! long runs. ! + ! 0. Flat bedrock. Flux from the bottom of the bottommost layer is 0. ! + ! 1. Gravitational flow (free drainage). The flux from the bottom of ! + ! the bottommost layer is due to gradient of height only. ! + ! 2. Lateral drainage. Similar to free drainage, but the gradient is ! + ! reduced by the slope not being completely vertical. The reduction ! + ! is controlled by variable SLDRAIN. In the future options 0, 1, and ! + ! 2 may be combined into a single option. ! + ! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom ! ! is always at saturation. ! !------------------------------------------------------------------------------------! ISOILBC = 1, @@ -1532,6 +1535,19 @@ $MODEL_OPTIONS + !------------------------------------------------------------------------------------! + ! SLDRAIN -- This is used only when ISOILBC is set to 2. In this case SLDRAIN is ! + ! the equivalent slope that will slow down drainage. If this is set to ! + ! zero, then lateral drainage reduces to flat bedrock, and if this is set ! + ! to 90, then lateral drainage becomes free drainage. SLDRAIN must be ! + ! between 0 and 90. ! + !------------------------------------------------------------------------------------! + SLDRAIN = 10., + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! ! IPERCOL -- This controls percolation and infiltration, and it is used by both ! ! LEAF-3 and ED-2. ! @@ -1777,7 +1793,7 @@ $MODEL_OPTIONS ! is set to 5, CPARM represents the concentration of CCN. Otherwise, the ! ! value is ignored if the IXXXX variable is set to 5. ! !------------------------------------------------------------------------------------! - CPARM = 1.3e9, ! cloud droplets, or less frequently, CCN + CPARM = 3.e8, ! cloud droplets, or less frequently, CCN RPARM = 1e-3, ! rain drops PPARM = 0., ! pristine ice (ignored as IPRIS must be 5) SPARM = 1e-3, ! snow @@ -1829,7 +1845,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 = 240.0, + DTLSM = 120.0, !---------------------------------------------------------------------------------------! @@ -1974,7 +1990,7 @@ $ED2_INFO ! path+prefix will be used, as the history for every grid must have come ! ! from the same simulation. ! !---------------------------------------------------------------------------------------! - SFILIN = '/n/Moorcroft_Lab/Lab/data/ed2_data/21restart/sa2.2008/BAU', + SFILIN = '/n/moorcroft_data/data/ed2_data/restarts_sci_006/potveg/PVE_', !---------------------------------------------------------------------------------------! @@ -2000,8 +2016,8 @@ $ED2_INFO ! THSUMS_DATABASE - input directory for chd and dgd (not sure for what this is used). ! !---------------------------------------------------------------------------------------! VEG_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/oge2OLD/OGE2_', - SOIL_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/faoOLD/FAO_', - LU_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/land_use/glu-3.3.1+sa1/half/glu-3.3.1+sa1-', + SOIL_DATABASE = '/n/moorcroft_data/data/ed2_data/soil_ed22/Quesada+RADAM+IGBP/Quesada+RADAM+IGBP_', + LU_DATABASE = '/n/moorcroft_data/mlongo/scenarios/glu-3.3.1+sb1/one/glu-3.3.1+sb1-', PLANTATION_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/', @@ -2080,7 +2096,7 @@ $ED2_INFO ! 3. Hybrid Stepping (BDF2 implicit step for the canopy air and ! ! leaf temp, forward Euler for else, under development). ! !---------------------------------------------------------------------------------------! - INTEGRATION_SCHEME = 1, + INTEGRATION_SCHEME = 3, !---------------------------------------------------------------------------------------! @@ -2157,7 +2173,20 @@ $ED2_INFO ! a few genuses in Costa Rica. References: ! ! Cole and Ewel (2006), and Calvo Alvarado et al. (2008). ! !---------------------------------------------------------------------------------------! - IALLOM = 1, + IALLOM = 2, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! IGRASS -- This controls the dynamics and growth calculation for grasses. A new ! + ! grass scheme is now available where bdead = 0, height is a function of bleaf! + ! and growth happens daily. ALS (3/3/12) ! + ! 0: grasses behave like trees as in ED2.1 (old scheme) ! + ! ! + ! 1: new grass scheme as described above ! + !---------------------------------------------------------------------------------------! + IGRASS = 0, !---------------------------------------------------------------------------------------! @@ -2302,9 +2331,16 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! DECOMP_SCHEME -- This specifies the dependence of soil decomposition on temperature. ! - ! 0. ED-2.0 default, the original exponential ! + ! 0. ED-2.1 default, the original exponential (low temperature ! + ! limitation only). ! ! 1. Lloyd and Taylor (1994) model ! ! [[option 1 requires parameters to be set in xml]] ! + ! 2. Similar to ED-1.0 and CENTURY model, heterotrophic respiration ! + ! reaches a maximum at around 38C (using the default parameters), ! + ! then quickly falls to zero at around 50C. It applies a similar ! + ! function for soil moisture, which allows higher decomposition ! + ! rates when it is close to the optimal, plumetting when it is ! + ! almost saturated. ! !---------------------------------------------------------------------------------------! DECOMP_SCHEME = 0, !---------------------------------------------------------------------------------------! @@ -2327,13 +2363,40 @@ $ED2_INFO ! (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 ! + ! matric potentials at wilting point and field capacity. ! !---------------------------------------------------------------------------------------! H2O_PLANT_LIM = 2, !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! IDDMORT_SCHEME -- This flag determines whether storage should be accounted in the ! + ! carbon balance. ! + ! 0 -- Carbon balance is done in terms of fluxes only. This is the ! + ! default in ED-2.1 ! + ! 1 -- Carbon balance is offset by the storage pool. Plants will be ! + ! in negative carbon balance only when they run out of storage ! + ! and are still losing more carbon than gaining. ! + ! ! + ! DDMORT_CONST -- This constant (k) determines the relative contribution of light ! + ! and soil moisture to the density-dependent mortality rate. Values ! + ! range from 0 (soil moisture only) to 1 (light only). ! + ! ! + ! mort1 ! + ! mu_DD = ------------------------- ! + ! 1 + exp [ mort2 * cr ] ! + ! ! + ! CB CB ! + ! cr = k ------------- + (1 - k) ------------- ! + ! CB_lightmax CB_watermax ! + !---------------------------------------------------------------------------------------! + IDDMORT_SCHEME = 0, + DDMORT_CONST = 1., + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! The following variables are factors that control photosynthesis and respiration. ! @@ -2376,25 +2439,25 @@ $ED2_INFO ! 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.00, - VMFACT_C4 = 1.00, - MPHOTO_TRC3 = 9.0, - MPHOTO_TEC3 = 7.2, - MPHOTO_C4 = 5.2, + VMFACT_C3 = 1.00, + VMFACT_C4 = 1.00, + MPHOTO_TRC3 = 9.0, + MPHOTO_TEC3 = 7.2, + MPHOTO_C4 = 5.2, BPHOTO_BLC3 = 10000., BPHOTO_NLC3 = 1000., BPHOTO_C4 = 10000., - KW_GRASS = 600., - KW_TREE = 450., - GAMMA_C3 = 0.015, - GAMMA_C4 = 0.040, - D0_GRASS = 0.016, - D0_TREE = 0.016, - ALPHA_C3 = 0.080, - ALPHA_C4 = 0.055, - KLOWCO2IN = 4000., - RRFFACT = 1.000, - GROWTHRESP = 0.33333333333, + KW_GRASS = 900., + KW_TREE = 600., + GAMMA_C3 = 0.015, + GAMMA_C4 = 0.040, + D0_GRASS = 0.016, + D0_TREE = 0.016, + ALPHA_C3 = 0.080, + ALPHA_C4 = 0.055, + KLOWCO2IN = 4000., + RRFFACT = 1.000, + GROWTHRESP = 0.333, LWIDTH_GRASS = 0.05, LWIDTH_BLTREE = 0.10, LWIDTH_NLTREE = 0.05, @@ -2414,7 +2477,7 @@ $ED2_INFO ! ing point is by definition -1.5MPa, so make sure that the value ! ! is above -1.5. ! !---------------------------------------------------------------------------------------! - THETACRIT = -1.15, + THETACRIT = -1.20, !---------------------------------------------------------------------------------------! @@ -2462,20 +2525,27 @@ $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. ! + ! 3. Fire will be triggered with enough biomass and accumulated ! + ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! + ! This is soil independent. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! - ! 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 1m ! - ! that will prevent fires to happen. ! - ! < 0. - Minimum mean soil moisture potential in MPa of the top 1m ! - ! 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. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2 or 3, and it has different ! + ! meanings. The sign here matters. ! + ! When INCLUDE_FIRE = 2: ! + ! >= 0. - Minimum relative soil moisture above dry air of the top ! + ! 1m that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top ! + ! 1m 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. ! + ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! + ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, - FIRE_PARAMETER = 0.1, - SM_FIRE = -1.45, + FIRE_PARAMETER = 0.5, + SM_FIRE = -1.40, !---------------------------------------------------------------------------------------! @@ -2486,7 +2556,7 @@ $ED2_INFO ! 0. no anthropogenic disturbance. ! ! 1. use anthropogenic disturbance dataset. ! !---------------------------------------------------------------------------------------! - IANTH_DISTURB = 1, + IANTH_DISTURB = 0, !---------------------------------------------------------------------------------------! @@ -2532,7 +2602,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, AGRI_STOCK = 1, PLANTATION_STOCK = 3, !---------------------------------------------------------------------------------------! @@ -2569,8 +2639,8 @@ $ED2_INFO ! MIN_PATCH_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). ! !---------------------------------------------------------------------------------------! - MAXPATCH = 10, - MAXCOHORT = 60, + MAXPATCH = 20, + MAXCOHORT = 80, MIN_PATCH_AREA = 0.005, !---------------------------------------------------------------------------------------! @@ -2637,7 +2707,7 @@ $ED2_INFO ! between direct and diffuse is done by the Harrington scheme, and we just do a split ! ! between NIR and PAR using some standard factors. ! !---------------------------------------------------------------------------------------! - IMETRAD = 0, + IMETRAD = 2, !---------------------------------------------------------------------------------------! diff --git a/BRAMS/Template/callopenmpi.sh b/BRAMS/Template/callopenmpi.sh index b0a52732b..f8518b7ca 100755 --- a/BRAMS/Template/callopenmpi.sh +++ b/BRAMS/Template/callopenmpi.sh @@ -10,8 +10,8 @@ #module add hpc/hdf5-intel #------------------------------- CHANGE YOUR SETTINGS HERE. -------------------------------# -here=`pwd` # Folder to start the run -brams=${here}'/edbrams' # Executable +here='thispath' # Folder to start the run +brams=${here}'/edbrams' # Executable logfile=${here}'/out.out' # Log file errfile=${here}'/out.err' # MPI error file mpirun='mpirun' diff --git a/BRAMS/Template/orun.sh b/BRAMS/Template/orun.sh index 73fa6e5b9..b24076e8e 100755 --- a/BRAMS/Template/orun.sh +++ b/BRAMS/Template/orun.sh @@ -19,7 +19,8 @@ numcore=60 # Number of cores -#----- Getting the number of nodes from prompt if given... --------------------------------# + +#----- Get the number of nodes from prompt if given... ------------------------------------# if [ 'x'${1} != 'x' ] then numcore=${1} @@ -30,7 +31,8 @@ fi #------------------------------------------------------------------------------------------# -# Define the number of hosts. This is to avoid dumping 8 jobs on moorcrofth... # +# Check whether to spread cores to as few nodes as possible or go for first come first # +# serve... # #------------------------------------------------------------------------------------------# if [ ${nodespread} == 'yes' ] then @@ -72,7 +74,7 @@ fi -#----- Erasing old logfiles and joblogs ---------------------------------------------------# +#----- Erase old logfiles and joblogs -----------------------------------------------------# if [ -s ${joblog} ] then rm -fv ${joblog} @@ -82,7 +84,7 @@ fi -#----- Checking whether this is a MAKEVFILE/MAKESFC run or an actual run ------------------# +#----- Check whether this is a MAKEVFILE/MAKESFC run or an actual run ---------------------# makevfile=`grep "'MAKEVFILE'," ${namelist} | wc -l` makesfc=`grep "'MAKESFC'," ${namelist} | wc -l` preponly=`expr ${makevfile} + ${makesfc}` @@ -109,7 +111,7 @@ fi -#----- Changing the output filename to change for different processors --------------------# +#----- Change the output filename to change for different processors. ---------------------# if [ ${numcore} -lt 10 ] then joblog=`dirname ${joblog}`'/00'${numcore}'_'`basename ${joblog}` diff --git a/BRAMS/Template/setup.sh b/BRAMS/Template/setup.sh index 3cc742b6e..462feef48 100755 --- a/BRAMS/Template/setup.sh +++ b/BRAMS/Template/setup.sh @@ -7,7 +7,7 @@ here=`pwd` # Local disk moi=`whoami` # User name diskthere='/n/moorcroftfs2' # Output directory -queue='camd' # Queue to be used +queue='moorcroft_6100b' # Queue to be used whena='01-01-2008 00:00' # Initial time for simulation whenz='01-01-2009 00:00' # Final time for simulation isfcl=5 # 1 = LEAF-3 run, 5 = ED-2.2 run @@ -158,6 +158,13 @@ sed -i s@thisjob@${thissim}@g ${here}/orun.sh #------------------------------------------------------------------------------------------# +#----- Replace some flags in callopenmpi.sh. ----------------------------------------------# +sed -i s@thispath@${here}@g ${here}/callopenmpi.sh +sed -i s@thisqueue@${queue}@g ${here}/callopenmpi.sh +sed -i s@thisjob@${thissim}@g ${here}/callopenmpi.sh +#------------------------------------------------------------------------------------------# + + #----- Replace some flags in purge.sh -----------------------------------------------------# sed -i s@myoutpath@${there}@g ${here}/purge.sh #------------------------------------------------------------------------------------------# diff --git a/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh b/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh index ec6916165..b9f29882e 100755 --- a/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh +++ b/BRAMS/Template/tothere/rpost/1eachtime-sigma.sh @@ -11,18 +11,19 @@ #------------------------------------------------------------------------------------------# # CHANGE LOG # #------------------------------------------------------------------------------------------# -ramspost='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/ramspost_6.2' # Name of executable file -tmpfolder='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/.temp' # Name of a timestrrary folder -nice='' # Command to "nice" the job. Put nothing if you don't want - # to be nice -runoutput='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/ramspost.out' # Name of a renewable output file -compression='none' # Kind of compression:(Z, bz2, zip, gz, or none) -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='/n/moorcroftfs2/mlongo/EDBRAMS/coupled/monotonic-test/rpost/serial_out.out' # File for 1eachtime-sigma.sh output +ramspost='myoutpath/rpost/ramspost_6.2' # Name of executable file +tmpfolder='myoutpath/rpost/.temp' # Name of a timestrrary folder +nice='' # Command to "nice" the job. Put nothing + # if you don't want to be nice +runoutput='myoutpath/rpost/ramspost.out' # Name of a renewable output file +compression='none' # Kind of compression: + # (Z, bz2, zip, gz, or none) +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' # Create an output file for shell +shellout='myoutpath/rpost/serial_out.out' # File for 1eachtime-sigma.sh output #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# diff --git a/BRAMS/build/bin/2ndcomp.sh b/BRAMS/build/bin/2ndcomp.sh index 789605a96..5c1267e4a 100755 --- a/BRAMS/build/bin/2ndcomp.sh +++ b/BRAMS/build/bin/2ndcomp.sh @@ -291,7 +291,7 @@ rm -fv decomp_coms.o decomp_coms.mod rm -fv detailed_coms.o detailed_coms.mod rm -fv disturb_coms.o disturb_coms.mod rm -fv disturbance.o disturbance.mod -rm -fv ed_bare_restart.o ed_bare_restart.mod +rm -fv ed_bigleaf_init.o ed_bigleaf_init.mod rm -fv ed_filelist.o ed_filelist.mod rm -fv ed_grid.o ed_grid.mod rm -fv ed_init.o ed_init.mod diff --git a/BRAMS/build/bin/Makefile b/BRAMS/build/bin/Makefile index bd8f8c219..0a6c9c215 100644 --- a/BRAMS/build/bin/Makefile +++ b/BRAMS/build/bin/Makefile @@ -17,8 +17,10 @@ FPP_COMMAND = $(F_COMP) -c -DUSE_INTERF=$(USE_INTERF) -DUSENC=$(USENC) -D$(CMAC CXX_COMMAND = $(C_COMP) -c $(C_OPTS) -D$(CMACH) $(INCLUDES) $(PAR_DEFS) #----- Define archive and executable names. -----------------------------------------------# -EXE=$(BASE)/edbrams-$(OPT) -LIBMODEL=$(BASE)/edbrams-$(OPT).a +# EXE=$(BASE)/edbrams-$(OPT) +# LIBMODEL=$(BASE)/edbrams-$(OPT).a +EXE=$(BASE)/edbrams-opt +LIBMODEL=$(BASE)/edbrams-opt.a include objects.mk diff --git a/BRAMS/build/bin/dependency.mk b/BRAMS/build/bin/dependency.mk index e1527ea0d..91cf609a3 100644 --- a/BRAMS/build/bin/dependency.mk +++ b/BRAMS/build/bin/dependency.mk @@ -72,8 +72,6 @@ shcu_vars_const.o: conv_coms.mod grid_dims.mod souza_cupar_driver.o: conv_coms.mod mem_basic.mod mem_cuparm.mod mem_grid.mod souza_cupar_driver.o: mem_micro.mod mem_scratch.mod mem_tend.mod mem_turb.mod souza_cupar_driver.o: node_mod.mod shcu_vars_const.mod therm_lib.mod -~grell_cupar_static.o: grid_dims.mod mem_ensemble.mod mem_scratch_grell.mod -~grell_cupar_static.o: rconstants.mod therm_lib.mod edcp_driver.o: consts_coms.mod ed_misc_coms.mod ed_node_coms.mod edcp_driver.o: ed_state_vars.mod ed_work_vars.mod grid_coms.mod io_params.mod edcp_driver.o: leaf_coms.mod mem_edcp.mod mem_grid.mod mem_leaf.mod @@ -447,14 +445,14 @@ bdf2_solver.o: consts_coms.mod ed_misc_coms.mod ed_state_vars.mod bdf2_solver.o: ed_therm_lib.mod grid_coms.mod rk4_coms.mod soil_coms.mod bdf2_solver.o: therm_lib8.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: canopy_layer_coms.mod consts_coms.mod ed_misc_coms.mod canopy_struct_dynamics.o: ed_state_vars.mod grid_coms.mod met_driver_coms.mod canopy_struct_dynamics.o: pft_coms.mod phenology_coms.mod physiology_coms.mod canopy_struct_dynamics.o: rk4_coms.mod soil_coms.mod therm_lib.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_aux.mod +disturbance.o: mem_polygons.mod mortality.mod pft_coms.mod phenology_aux.mod disturbance.o: phenology_coms.mod euler_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod euler_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod @@ -466,13 +464,14 @@ 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 +fire.o: consts_coms.mod disturb_coms.mod ed_misc_coms.mod ed_state_vars.mod +fire.o: grid_coms.mod soil_coms.mod +forestry.o: disturb_coms.mod disturbance_utils.mod ed_max_dims.mod forestry.o: ed_misc_coms.mod 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 +growth_balive.o: fuse_fiss_utils.mod grid_coms.mod mortality.mod pft_coms.mod +growth_balive.o: phenology_coms.mod physiology_coms.mod heun_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod heun_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod @@ -499,7 +498,7 @@ phenology_driv.o: 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 +photosyn_driv.o: soil_coms.mod therm_lib.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 @@ -526,13 +525,17 @@ 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 +structural_growth.o: detailed_coms.mod ed_max_dims.mod ed_misc_coms.mod +structural_growth.o: ed_state_vars.mod ed_therm_lib.mod pft_coms.mod +structural_growth.o: physiology_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 disturbance_utils.mod ed_misc_coms.mod vegetation_dynamics.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod vegetation_dynamics.o: growth_balive.mod mem_polygons.mod +ed_bigleaf_init.o: allometry.mod consts_coms.mod ed_max_dims.mod +ed_bigleaf_init.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_bigleaf_init.o: fuse_fiss_utils.mod pft_coms.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 @@ -649,10 +652,9 @@ budget_utils.o: therm_lib.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 +ed_therm_lib.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod +ed_therm_lib.o: ed_misc_coms.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 fatal_error.o: ed_node_coms.mod fuse_fiss_utils.o: allometry.mod canopy_layer_coms.mod decomp_coms.mod fuse_fiss_utils.o: disturb_coms.mod ed_max_dims.mod ed_misc_coms.mod diff --git a/BRAMS/build/bin/include.mk.opt.odyssey b/BRAMS/build/bin/include.mk.opt.odyssey index c12b52bb1..e7c372403 100644 --- a/BRAMS/build/bin/include.mk.opt.odyssey +++ b/BRAMS/build/bin/include.mk.opt.odyssey @@ -60,7 +60,7 @@ HDF4_LIBS=-lmfhdf -ldf -lz -ljpeg # library files. Make sure you include the zlib.a location too. USE_HDF5=1 HDF5_INCS= -HDF5_LIBS=-lhdf5_fortran -lhdf5 -lhdf5_hl -lz -l, +HDF5_LIBS=-lhdf5_fortran -lhdf5 -lhdf5_hl -lz -lm #HDF5_INCS= #HDF5_LIBS=-L/n/sw/hdf5-1.8.5_intel-11.1.072/ -lhdf5 -lm -lhdf5_fortran -lhdf5 -lhdf5_hl -lz # MPI_Wtime. --------------------------------------------------- @@ -301,11 +301,10 @@ ifeq ($(KIND_COMP),D) endif ifeq ($(KIND_COMP),E) USE_INTERF=1 - F_OPTS= -FR -O3 -recursive -traceback -assume byterecl -static -axP \ - -openmp + F_OPTS= -FR -O3 -recursive -unroll -traceback C_OPTS= -O3 -DLITTLE -traceback - LOADER_OPTS= -FR -O3 -traceback -assume byterecl -unroll -axP -openmp - C_LOADER_OPTS=-v -traceback + LOADER_OPTS= -FR -O3 -unroll -traceback + C_LOADER_OPTS=-v #---------------------------------------------------------------------------------------# endif #------------------------------------------------------------------------------------------# diff --git a/BRAMS/build/bin/objects.mk b/BRAMS/build/bin/objects.mk index 6463edfb5..2a220dca4 100644 --- a/BRAMS/build/bin/objects.mk +++ b/BRAMS/build/bin/objects.mk @@ -292,6 +292,7 @@ OBJ_MODEL = \ decomp_coms.o \ disturb_coms.o \ disturbance.o \ + ed_bigleaf_init.o \ ed_filelist.o \ ed_grid.o \ ed_init_full_history.o \ diff --git a/BRAMS/build/bin/rules.mk b/BRAMS/build/bin/rules.mk index 7a51d3614..34a635586 100644 --- a/BRAMS/build/bin/rules.mk +++ b/BRAMS/build/bin/rules.mk @@ -1434,6 +1434,11 @@ disturbance.o : $(ED_DYNAMICS)/disturbance.f90 $(F90_COMMAND) $({'source_file'} = $filename; + $self->{'filepath'} = $path; + $self->{'includes'} = {}; + $self->{'uses'} = {}; + $self->{'modules'} = {}; + bless $self; +} + +sub find_includes { + my $self = shift; + my $file = $self->{'filepath'}; + my($after, $filepath, $ref, $included, $use, $modname); + local(*FILE); + local($_); + + if (-f $file) { + open(FILE, $file) || warn "Can't open $file: $!\n"; + } elsif (-f "RCS/$file,v" || -f "$file,v" ) { + system("co $file"); + open(FILE, $file) || warn "Can't open $file: $!\n"; + $main::rcs{$file} = 1; + } else { + return; + } + while () { + $included = ""; + $use = ""; + # look for Fortran style includes + if (/^\s*include\s*['"]([^"']*)["']/i) { + $included = $1; + $after = $'; + # C preprocessor style includes + } elsif (/^#\s*include\s*["<]([^">]*)[">]/) { + $included = $1; + $after = $'; + # Fortran 90 "use" + } elsif (/^\s*use\s+(\w+)/i) { + $use = $1; +# Make the module name lowercase except for SGI & HP. +# May be compiler dependent!! + if ($main::sgi || $main::hp) { + $use = uc($use); + } else { + $use = lc($use); + } + $self->{'uses'}{$use} = 1; + # Fortran 90 module + } elsif (/^\s*module\s+(\w+)/i) { + $modname = $1; + if ($main::sgi || $main::hp) { + $modname = uc($modname); + } else { + $modname = lc($modname); + } + unless (lc($modname) eq "procedure") { + $main::mod_files{$modname} = $file; + $self->{'modules'}{$modname} = 1; + } + } + if ($included) { + if ( $inc_files{$included} ) { + $filepath = $inc_files{$included}{'filepath'}; + } else { + $filepath = &main::findfile($included); + $ref = new source_file($included, $filepath); + $inc_files{$included} = $ref; +# Search included file for includes + $ref->find_includes(); + } + if ( $filepath ) { + $self->{'includes'}{$included} = 1; + } else { + if ($after !~ /bogus/i) { + warn "Can't find file: $included\n"; + } + } + } + } + close FILE; +} + +sub print_includes { + my $self = shift; + my $target = shift; + my $len_sum = shift; + my($file, $ref); + my %printed = (); + + foreach $file (keys %{$self->{'includes'}}) { + next if $printed{$file}; + $ref = $inc_files{$file}; + my $len = length($ref->{'filepath'}) + 1; + if (($len_sum + $len > 80) && + (length($target) + 1 < $len_sum)) { + print "\n$target:"; + $len_sum = length($target) + 1; + } + print " " . $ref->{'filepath'}; + $printed{$file} = 1; + $len_sum += $len; + $len_sum = $ref->print_includes($target, $len_sum); + } + $len_sum; +} + +# return list of modules used by included files +sub inc_mods { + my $self = shift; + my($file, $ref, $mod, @sub_list); + my @list = (); + my %printed = (); + + foreach $mod (keys %{$self->{'uses'}}) { + push(@list, $mod); + } + + foreach $file (keys %{$self->{'includes'}}) { + next if $printed{$file}; + $ref = $inc_files{$file}; + $printed{$file} = 1; + @sub_list = $ref->inc_mods(); + @list = (@list, @sub_list); + } + @list; +} + +# filenames containing the list of modules used by file and all its includes +sub find_mods { + my $self = shift; + my($ref, $modname, $file, @list, $base); + my @module_files = (); + my @mod_list = (); + my @tmp_list = (); + +# find modules used by include files + if (%{$self->{'includes'}}) { + foreach $file (keys %{$self->{'includes'}}) { + $ref = $inc_files{$file}; + @list = $ref->inc_mods(); + @tmp_list = @mod_list; + @mod_list = (@tmp_list, @list); + } + } + +# add them to the uses list (hash ensures uniqueness) + foreach $modname (@mod_list) { + $self->{'uses'}{$modname} = 1; + } + +# now find the filename that contains the module information + foreach $modname (keys %{$self->{'uses'}}) { + if ($main::cray || $main::parasoft) { + if ($file = $main::mod_files{$modname}) { + $base = &main::basename($file, @main::suffixes); + $file = $base . "." . $main::obj_ext; + push(@module_files, $file); + } else { + warn "Don't know where module $modname lives.\n"; + } + } else { + $modname .= "." . $main::mod_ext; + push(@module_files, $modname); + } + } + sort(@module_files); +} + +sub print { + my $self = shift; + my $source = $self->{'source_file'}; + my $compile_string = "\t" . '$(CFT) $(FFLAGS) -c'; + my($base, $object, $modname, $flag, $target, $ftarget); + + $base = &main::basename($source, @main::suffixes); + $target = $base . "." . $main::obj_ext; + if ($main::stupid) { + $ftarget = $base . "." . $main::ext; + } + + if ($main::cray) { + $flag = " -p "; + } elsif ($main::parasoft) { + $flag = " -module "; + } + +# print out "include" dependencies + if (%{$self->{'includes'}}) { + my $len_sum = length($target) + 1; + if ($main::add_ext) { + $target .= " $base.$main::add_ext"; + $len_sum += length($base) + length($main::add_ext) + 2; + } + print "$target:"; + $self->print_includes($target, $len_sum); + print "\n"; + if ($main::stupid) { + $len_sum = length($ftarget) + 1; + print "$ftarget:"; + $self->print_includes($ftarget, $len_sum); + print "\n"; + } + } + +# clean out "use" of modules in own file + foreach $mod ( keys %{$self->{'uses'}} ) { + if ( ${$self->{'modules'}}{$mod} ) { + delete ${$self->{'uses'}}{$mod}; + } + } + +# print out "use" dependencies + if (%{$self->{'uses'}} || %{$self->{'includes'}}) { + @module_files = $self->find_mods(); + my $len_sum = length($target) + 1; + print "$target:"; + foreach $file (@module_files) { + my $len = length($file) + 1; + if (($len_sum + $len > 80) && + (length($target) + 1 < $len_sum)) { + print "\n$target:"; + $len_sum = length($target) + 1; + } + $len_sum += $len; + print " " . $file; + } + if ($main::need_f) { + my $len = length($ftarget) + 1; + if (($len_sum + $len > 80) && + (length($target) + 1 < $len_sum)) { + print "\n$target:"; + $len_sum = length($target) + 1; + } + print " " . $ftarget; + } + print "\n"; +# extra Cray / Parasoft stuff + if ($main::cray || $main::parasoft) { + print $compile_string; + foreach $file (@module_files) { + print $flag . $file; + } + if ($main::stupid) { + print " " . $ftarget . "\n"; + } else { + print " " . $source . "\n"; + } + } + } +} + + +# Start of main program +package main; + +if ($] < 5.000) { die "Need perl 5.000 or newer\n"; } +use File::Basename; +use Getopt::Long; +@suffixes = qw( .c .C .cc .cxx .cpp .f .F .fcm .FCM .f90 .F90 .for); + +GetOptions("s", "e=s", "f=s", "I=s@", "m=s", "c", "p", "g", "h", "o=s", "a=s") + || die "problem in GetOptions"; + +# For compilers that don't invoke cpp for you +if ($opt_s) { + $stupid = 1; +} +if ($opt_e) { + $ext = $opt_e; +} else { + $ext = "f"; +} + +# list of directories to search, starting with current directory +if (@opt_I) { + @incdirs = @opt_I; +} elsif (@opt_i) { + @incdirs = @opt_i; +} + +if ($opt_f) { + $mf = $opt_f; +} elsif (-f "makefile") { + $mf = 'makefile'; +} else { + $mf = 'Makefile'; +} +if ( !(-f $mf)) { + system "touch $mf"; +} + +# extension used for compiler's private module information +if ($opt_m) { + $mod_ext = $opt_m; +} else { + $mod_ext = 'mod'; +} + +if ($opt_c) { + $cray = 1; +} + +if ($opt_p) { + $parasoft = 1; +} + +if ($opt_g) { + $sgi = 1; + $mod_ext = 'kmo'; +} + +if ($opt_h) { + $hp = 1; +} + +# need to add some more dependencies so the .f file gets created +if ($stupid && ($cray || $parasoft)) { + $need_f = 1; +} + +if ($opt_c && $opt_p) { + die "Doesn't make sense to have both Cray and Parasoft options!"; +} + +# object file extension +if ($opt_o) { + $obj_ext = $opt_o; +} else { + $obj_ext = 'o'; +} + +# extension for additional targets (like .prj) +if ($opt_a) { + $add_ext = $opt_a; +} + +$mystring = '# DO NOT DELETE THIS LINE - used by make depend'; + + +# Search for the includes in all the files +foreach $file (@ARGV) { + $sources{$file} = new source_file($file, $file); + $sources{$file}->find_includes(); +} + +# Create new Makefile with new dependencies. + +open(MFILE, $mf) || die "can't read Makefile $mf: $!\n"; +open(NMFILE, "> Makefile.new") || die "can't write Makefile.new: $!\n"; +select(NMFILE); + +while () { + if (!/$mystring/) { + print; + } else { + last; + } +} + +print $mystring, "\n"; + +# Now print out include and use dependencies in sorted order. +foreach $target (sort keys(%sources)) { + $sources{$target}->print(); +} + +# print out module dependencies +if ( !( $cray || $parasoft) ) { + foreach $modname (sort keys(%mod_files)) { + ($name, $path, $suffix) = + &fileparse($sources{$mod_files{$modname}}->{'filepath'}, @suffixes); + $object = $name . "." . $obj_ext; +## $object = $path . "/" . $name . "." . $obj_ext; + print "$modname.$mod_ext: $object\n"; + } +} + +# Sort out the Makefiles + +rename($mf, "$mf.old") || warn "can't overwrite $mf.old: $!\n"; +rename('Makefile.new', $mf) || + warn "can't move Makefile.new to $mf: $!\n"; + +# Delete those RCS files we checked out +foreach $file (keys %rcs) { + unlink($file); +} + +# +# End of main +# + +sub findfile { +# Let's see if we can find the included file. Look in current +# directory first, then in directories from -I arguments. Finally, +# look for RCS files in current directory. + my $file = shift; + my($found, $i, $filepath); + + $found = 0; + + if ( -f $file ) { + $found = 1; + $file =~ s#^\./##; # convert ./foo.h to foo.h + return $file; + } + foreach $i (0 .. $#incdirs) { + $filepath = $incdirs[$i]."/".$file; + if ( -f $filepath ) { + $found = 1; + $filepath =~ s#^\./##; # convert ./foo.h to foo.h + return $filepath; + } + } +#see if it is a checked-in RCS file + if (-f "RCS/$file,v" || -f "$file,v" ) { + $found = 1; + system("co $file"); + $filepath = $file; + $rcs{$file} = 1; + } + if ( ! $found ) { + $filepath = ""; + } + $filepath; +} diff --git a/BRAMS/run/RAMSIN b/BRAMS/run/RAMSIN index 5533ea2cf..8ff1749af 100644 --- a/BRAMS/run/RAMSIN +++ b/BRAMS/run/RAMSIN @@ -39,7 +39,7 @@ $MODEL_GRIDS ! change IMONTHH, IDATEH,... and HFILIN, but do NOT change IMONTHA, ! ! IDATEA,... ! !---------------------------------------------------------------------------------------! - RUNTYPE = 'MAKESFC', + RUNTYPE = 'INITIAL', !---------------------------------------------------------------------------------------! @@ -55,8 +55,8 @@ $MODEL_GRIDS ! Start of simulation or isentropic analysis processing. Information must be given ! ! in UTC time. ! !---------------------------------------------------------------------------------------! - IMONTHA = 05, - IDATEA = 01, + IMONTHA = 05, + IDATEA = 01, IYEARA = 2009, ITIMEA = 0000, !---------------------------------------------------------------------------------------! @@ -66,8 +66,8 @@ $MODEL_GRIDS ! End of simulation or isentropic analysis processing. Information must be given ! ! in UTC time. ! !---------------------------------------------------------------------------------------! - IMONTHZ = 05, - IDATEZ = 31, + IMONTHZ = 06, + IDATEZ = 01, IYEARZ = 2009, ITIMEZ = 0000, !---------------------------------------------------------------------------------------! @@ -92,8 +92,8 @@ $MODEL_GRIDS ! a lot, leave this set to 1. One value for all grids. ! !---------------------------------------------------------------------------------------! NGRIDS = 1, - NNXP = 132, 68, 230, - NNYP = 114, 56, 161, + NNXP = 177, 68, 230, + NNYP = 98, 56, 161, NNZP = 44, 44, 44, NZG = 10, NZS = 1, @@ -153,8 +153,8 @@ $MODEL_GRIDS ! DZMAX -- maximum grid spacing in metres. ! ! ZZ -- discrete layers in case you set DELTAZ to zero. ! !---------------------------------------------------------------------------------------! - DELTAX = 21000., - DELTAY = 21000., + DELTAX = 25000., + DELTAY = 25000., DELTAZ = 100., DZRAT = 1.08, DZMAX = 1000., @@ -184,8 +184,8 @@ $MODEL_GRIDS ! vary as needed. It is useful for a first guess of DTLONG, but not ! ! a good option for actual runs because NACOUST tends to be too small. ! !---------------------------------------------------------------------------------------! - DTLONG = 40., - NACOUST = 4, + DTLONG = 30., + NACOUST = 3, IDELTAT = 0, !---------------------------------------------------------------------------------------! @@ -231,10 +231,10 @@ $MODEL_GRIDS ! CENTLAT -- Latitude of the central point. One value for each grid. ! ! CENTLON -- Longitude of the central point. One value for each grid. ! !---------------------------------------------------------------------------------------! - POLELAT = -3.8, - POLELON = -56.5, - CENTLAT = -3.8, - CENTLON = -56.5, + POLELAT = -4.00, + POLELON = -53.00, + CENTLAT = -4.00, + CENTLON = -53.00, !---------------------------------------------------------------------------------------! @@ -383,10 +383,10 @@ $MODEL_FILE_INFO ! the model gives up and quit. ! ! NUD_HFILE -- This is the prefix for when NUD_TYPE is set to 1. ! !---------------------------------------------------------------------------------------! - VARFPFX = '/myoutpath/isean/mysimul', + VARFPFX = '/mypath/isean/ecmwf', VWAIT1 = 0., VWAITTOT = 0., - NUD_HFILE = '/myoutpath/histo/mysimul', + NUD_HFILE = '/mypath/histo/mysimul', !---------------------------------------------------------------------------------------! @@ -449,7 +449,7 @@ $MODEL_FILE_INFO ! WT_NUDGEC_GRID -- Grid relative weights for nudging of condensed/frozen water. ! !---------------------------------------------------------------------------------------! NUD_COND = 0, - COND_HFILE = '/myoutpath/histo/mysimul-H-2001-07-21-000000-head.txt', + COND_HFILE = '/mypath/histo/mysimul-H-2001-07-21-000000-head.txt', TCOND_BEG = 0., TCOND_END = 21600., T_NUDGE_RC = 3600., @@ -546,7 +546,7 @@ $MODEL_FILE_INFO ! interpolate. ! !---------------------------------------------------------------------------------------! IF_CUINV = 0, - CU_PREFIX = '/myoutpath/cumul/mysimul-C-', + CU_PREFIX = '/mypath/cumul/mysimul-C-', TNUDCU = 900., WT_CU_GRID = 1., 1., .5, TCU_BEG = 0., @@ -572,7 +572,7 @@ $MODEL_FILE_INFO IDATEH = 01, IYEARH = 2009, ITIMEH = 0600, - HFILIN = '/myoutpath/histo/mysimul', + HFILIN = '/mypath/histo/mysimul', !---------------------------------------------------------------------------------------! @@ -586,7 +586,7 @@ $MODEL_FILE_INFO ! PASTFN -- In case IPASTIN is 1, this is the input analysis file name. ! !---------------------------------------------------------------------------------------! IPASTIN = 0, - PASTFN = '/myoutpath/analy/mysimul-A-2000-01-09-000000-head.txt', + PASTFN = '/mypath/analy/mysimul-A-2000-01-09-000000-head.txt', !---------------------------------------------------------------------------------------! @@ -613,12 +613,12 @@ $MODEL_FILE_INFO ! FRQANL -- time interval between analysis files. ! !---------------------------------------------------------------------------------------! IOUTPUT = 2, - HFILOUT = '/myoutpath/histo/mysimul', - AFILOUT = '/myoutpath/analy/mysimul', + HFILOUT = '/mypath/histo/support', + AFILOUT = '/mypath/analy/support', ICLOBBER = 1, IHISTDEL = 0, FRQHIS = 86400., - FRQANL = 3600., + FRQANL = 10800., !---------------------------------------------------------------------------------------! @@ -644,18 +644,21 @@ $MODEL_FILE_INFO XLITE = '/0:0/', YLITE = '/0:0/', ZLITE = '/0:0/', - NLITE_VARS = 54, - LITE_VARS = 'GLAT', 'GLON', 'UP', 'VP', 'WP', - 'THETA', 'PP', 'RV', 'TOPT', 'TKEP', - 'CFXUP1', 'CFXUP2', 'CFXDN1', 'DFXUP1', 'DFXUP2', - 'EFXUP1', 'EFXUP2', 'DFXDN1', 'EFXDN1', 'SFLUX_U', - 'SFLUX_V', 'RSHORT', 'RLONG', 'ACCPR', 'ACCPP', - 'ACCPS', 'ACCPA', 'ACCPG', 'ACCPH', 'ACONPR', - 'PATCH_AREA', 'USTAR', 'TSTAR', 'RSTAR', 'PBLHGT', - 'SFLUX_T', 'SFLUX_R', 'RLONGUP', 'VEG_TEMP', 'ALBEDT', - 'SOIL_WATER', 'VEG_LAI', 'SFLUX_W', 'CAN_TEMP', 'CAN_RVAP', - 'SOIL_ENERGY', 'SOIL_ROUGH', 'RCP', 'RRP', 'RPP', - 'RSP', 'RAP', 'RGP', 'RHP', + NLITE_VARS = 71, + LITE_VARS = 'GLON', 'GLAT', 'TOPT', 'CONPRR', 'PCPRR', + 'PCPRP', 'PCPRS', 'PCPRA', 'PCPRG', 'PCPRH', + 'ACONPR', 'ACCPR', 'ACCPP', 'ACCPS', 'ACCPA', + 'ACCPG', 'ACCPH', 'PP', 'UP', 'VP', + 'TKEP', 'SIGW', 'THETA', 'RV', 'CO2P', + 'RCP', 'RRP', 'RPP', 'RSP', 'RAP', + 'RGP', 'RHP', 'Q6', 'Q7', 'CUPRLIQ', + 'CUPRICE', 'PATCH_AREA', 'PATCH_ROUGH', 'VEG_HEIGHT', 'CAN_PRSS', + 'CAN_THETA', 'CAN_RVAP', 'CAN_CO2', 'USTAR', 'TSTAR', + 'RSTAR', 'CSTAR', 'VEG_LAI', 'RIBULK', 'ZETA', + 'SFLUX_T', 'SFLUX_R', 'SFLUX_C', 'SFLUX_U', 'SFLUX_V', + 'SFLUX_W', 'PBLHGT', 'RSHORT', 'RLONG', 'RLONGUP', + 'ALBEDT', 'MYNUM', 'SOIL_ENERGY', 'SOIL_WATER', 'SOIL_TEXT', + 'LEAF_CLASS', !---------------------------------------------------------------------------------------! @@ -718,10 +721,10 @@ $MODEL_FILE_INFO ! SSTFPFX -- File path and prefix for SST files ! ! NDVIFPFX -- File path and prefix for NDVI or LAI files (see IUSELAI). ! !---------------------------------------------------------------------------------------! - TOPFILES = '/myoutpath/surfa/mysimul-topog', - SFCFILES = '/myoutpath/surfa/mysimul-surfa', - SSTFPFX = '/myoutpath/surfa/mysimul-seast', - NDVIFPFX = '/myoutpath/surfa/mysimul-laidx', + TOPFILES = '/mypath/surfa/topog', + SFCFILES = '/mypath/surfa/surfa', + SSTFPFX = '/mypath/surfa/seast', + NDVIFPFX = '/mypath/surfa/laidx', !---------------------------------------------------------------------------------------! @@ -789,7 +792,7 @@ $MODEL_FILE_INFO !---------------------------------------------------------------------------------------! ITOPTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/topo/EL', ISSTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/weeklysst/W', - IVEGTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/veg_usgs/VUSGS_', + IVEGTFN = '/n/Moorcroft_Lab/Lab/data/brams_data/veg_defsce/bau2002/BAU-2002_', ISOILFN = '/n/Moorcroft_Lab/Lab/data/brams_data/soil_brams406/RADAM+Quesada+IGBP/RADAM+Quesada+IGBP_', NDVIFN = '/n/Moorcroft_Lab/Lab/data/brams_data/lai-modis/2001LAI', !---------------------------------------------------------------------------------------! @@ -852,7 +855,7 @@ $MODEL_FILE_INFO ! COLTABFN -- path and file name for the collection table. ! !---------------------------------------------------------------------------------------! MKCOLTAB = 1, - COLTABFN = '/myoutpath/micro/mysimul_4.0.6', + COLTABFN = '/mypath/micro/coltab_4.0.6', !---------------------------------------------------------------------------------------! $END !==========================================================================================! @@ -890,7 +893,7 @@ $CUPARM_OPTIONS ! PS3: If NCLOUDS >= 3, then the middle ones will necessarily use Grell's ! ! parameterization. ! !---------------------------------------------------------------------------------------! - NCLOUDS = 2, + NCLOUDS = 1, !---------------------------------------------------------------------------------------! @@ -946,8 +949,8 @@ $CUPARM_OPTIONS ! (grell_coms.f90). Default min_down_radius is 900. ! ! DEPTH_MIN - Minimum depth that the cloud must have [m]. ! !---------------------------------------------------------------------------------------! - RADIUS = 12000., 600., ! 4577., 1746., 666., - DEPTH_MIN = 1200., 100., ! 457.7, 174.6, 66.6, + RADIUS = 9000., 3000., 600., + DEPTH_MIN = 3000., 1000., 200., !---------------------------------------------------------------------------------------! @@ -964,7 +967,7 @@ $CUPARM_OPTIONS ! velocity and sigma-w and assuming normal distribution, so this option works ! ! only when IDIFFK is 1 or 7. ! !---------------------------------------------------------------------------------------! - CAP_MAXS = -25., + CAP_MAXS = -25.0, !---------------------------------------------------------------------------------------! @@ -972,11 +975,11 @@ $CUPARM_OPTIONS !---------------------------------------------------------------------------------------! ! The following variables are scalars. ! !---------------------------------------------------------------------------------------! - 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] - MAX_HEAT = 600., ! Maximum heating rate allowed for feedback [ K/day] + CLD2PREC = -0.500, ! 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] + MAX_HEAT = 400., ! Maximum heating rate allowed for feedback [ K/day] !---------------------------------------------------------------------------------------! @@ -991,6 +994,7 @@ $CUPARM_OPTIONS ! !------+--------------------------------+------+------+----------------------------! ! ! ! EN | Ensemble (all closures) | yes | no | Grell and Dévényi, 2002 ! ! ! ! NC | Ensemble, excluding LO and MC | yes | yes | Grell and Dévényi, 2002 ! ! + ! ! QI | Ensemble, with AS and KF only | yes | yes | Grell and Dévényi, 2002 ! ! ! ! GR | Modified quasi-equilibrium ABE | yes | yes | Grell, 1993 ! ! ! ! LO | Low level omega | yes | no | Frank and Cohen, 1987 ! ! ! ! MC | moisture convergence | yes | no | Krishnamurti et al., 1983 ! ! @@ -999,9 +1003,11 @@ $CUPARM_OPTIONS ! !----------------------------------------------------------------------------------! ! ! ! !---------------------------------------------------------------------------------------! - CLOSURE_TYPE = 'NC', + CLOSURE_TYPE = 'QI', !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! The following variables will define the ensemble members other than the reference ! ! updraft mass flux which you have just defined. For the next ones, odd numbers are ! @@ -1057,9 +1063,9 @@ $MODEL_OPTIONS !---------------------------------------------------------------------------------------! ! IADVEC -- 1 - Original advection scheme ! - ! 2 - Monotic advection scheme, as in Freitas et al. (2001, in press JAMES). ! + ! 2 - Monotonic advection scheme, Freitas et al. (2012, in press JAMES). ! !---------------------------------------------------------------------------------------! - IADVEC = 1, + IADVEC = 2, !---------------------------------------------------------------------------------------! @@ -1208,8 +1214,8 @@ $MODEL_OPTIONS ! will be the minimum SITE area (I know it's confusing, but the ! ! definition of PATCH in LEAF is different from ED). ! !------------------------------------------------------------------------------------! - NPATCH = 5, - NVEGPAT = 4, + NPATCH = 2, + NVEGPAT = 1, MIN_PATCH_AREA = 0.005, !------------------------------------------------------------------------------------! @@ -1235,7 +1241,7 @@ $MODEL_OPTIONS ! must not exceed DTLONG. In case DTLONG < DTLEAF, DTLONG will be used ! ! instead !------------------------------------------------------------------------------------! - ISFCL = 1, + ISFCL = 5, DTLEAF = 6., !------------------------------------------------------------------------------------! @@ -1342,7 +1348,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 = 0, + ICO2 = 1, CO2CON = 380., !------------------------------------------------------------------------------------! @@ -1481,8 +1487,8 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! SOIL_MOIST = 'i', SOIL_MOIST_FAIL = 's', - USDATA_IN = '/n/Moorcroft_Lab/Lab/data/brams_data/soilmoisture/mysmds/GL_SM.mysmds.', - USMODEL_IN = '/myoutpath/surfa/mysimul-lesmo', + USDATA_IN = '/n/Moorcroft_Lab/Lab/data/brams_data/soilmoisture/GPNR/GL_SM.GPNR.', + USMODEL_IN = '/mypath/surfa/lesmo', !------------------------------------------------------------------------------------! @@ -1515,17 +1521,17 @@ $MODEL_OPTIONS !------------------------------------------------------------------------------------! - ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Both ! - ! ED and BRAMS use it. If unsure, use 0 for short-term simulations ! - ! (couple of days), and 1 for long-term simulations (months to years). ! - ! 0. Bedrock. Flux from the bottom of the bottommost layer is set to 0. ! - ! 1. Gravitational flow. The flux from the bottom of the bottommost ! - ! layer is due to gradient of height only. ! - ! 2. Super drainage. Soil moisture of the ficticious layer beneath the ! - ! bottom is always at dry air soil moisture. ! - ! 3. Half-way. Assume that the fictious layer beneath the bottom is ! - ! always at field capacity. ! - ! 4. Aquifer. Soil moisture of the ficticious layer beneath the bottom ! + ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. ! + ! For regional runs, it is wise to use options 1 or 2, especially for ! + ! long runs. ! + ! 0. Flat bedrock. Flux from the bottom of the bottommost layer is 0. ! + ! 1. Gravitational flow (free drainage). The flux from the bottom of ! + ! the bottommost layer is due to gradient of height only. ! + ! 2. Lateral drainage. Similar to free drainage, but the gradient is ! + ! reduced by the slope not being completely vertical. The reduction ! + ! is controlled by variable SLDRAIN. In the future options 0, 1, and ! + ! 2 may be combined into a single option. ! + ! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom ! ! is always at saturation. ! !------------------------------------------------------------------------------------! ISOILBC = 1, @@ -1534,6 +1540,19 @@ $MODEL_OPTIONS + !------------------------------------------------------------------------------------! + ! SLDRAIN -- This is used only when ISOILBC is set to 2. In this case SLDRAIN is ! + ! the equivalent slope that will slow down drainage. If this is set to ! + ! zero, then lateral drainage reduces to flat bedrock, and if this is set ! + ! to 90, then lateral drainage becomes free drainage. SLDRAIN must be ! + ! between 0 and 90. ! + !------------------------------------------------------------------------------------! + SLDRAIN = 10., + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! ! IPERCOL -- This controls percolation and infiltration, and it is used by both ! ! LEAF-3 and ED-2. ! @@ -1788,7 +1807,7 @@ $MODEL_OPTIONS ! is set to 5, CPARM represents the concentration of CCN. Otherwise, the ! ! value is ignored if the IXXXX variable is set to 5. ! !------------------------------------------------------------------------------------! - CPARM = .3e9, ! cloud droplets, or less frequently, CCN + CPARM = 3.e8, ! cloud droplets, or less frequently, CCN RPARM = 1e-3, ! rain drops PPARM = 0., ! pristine ice (ignored as IPRIS must be 5) SPARM = 1e-3, ! snow @@ -1841,7 +1860,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 = 240.0, + DTLSM = 600.0, !---------------------------------------------------------------------------------------! @@ -1915,8 +1934,8 @@ $ED2_INFO ! FFILOUT -- Path and prefix for analysis files (all but history/restart). ! ! SFILOUT -- Path and prefix for history files. ! !---------------------------------------------------------------------------------------! - FFILOUT = '/myoutpath/ecoss/mysimul', - SFILOUT = '/myoutpath/ecort/mysimul', + FFILOUT = '/mypath/ecoss/support', + SFILOUT = '/mypath/ecort/support', !---------------------------------------------------------------------------------------! @@ -1959,6 +1978,13 @@ $ED2_INFO ! ! ! 6 - Initialize with ED-2 style files without multiple sites, exactly like option ! ! 2, except that the PFT types are preserved. ! + ! ! + ! 7. Initialize from a list of both POI and gridded ED2.1 state files, organized ! + ! in the same manner as 5. This method overrides the soil database info and ! + ! takes the soil texture and soil moisture information from the initializing ! + ! ED2.1 state file. It allows for different layering, and assigns via nearest ! + ! neighbor. Set ISOILSTATE=0 for compatibility purposes. ! + ! ! !---------------------------------------------------------------------------------------! IED_INIT_MODE = 5, !---------------------------------------------------------------------------------------! @@ -1986,7 +2012,7 @@ $ED2_INFO ! path+prefix will be used, as the history for every grid must have come ! ! from the same simulation. ! !---------------------------------------------------------------------------------------! - SFILIN = '/n/Moorcroft_Lab/Lab/data/ed2_data/21restart/sa2.2008/BAU', + SFILIN = '/n/moorcroft_data/data/ed2_data/restarts_sci_006/potveg/PVE_', !---------------------------------------------------------------------------------------! @@ -2013,7 +2039,7 @@ $ED2_INFO !---------------------------------------------------------------------------------------! VEG_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/oge2OLD/OGE2_', SOIL_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/faoOLD/FAO_', - LU_DATABASE = '/n/Moorcroft_Lab/Lab/data/ed2_data/land_use/glu/glu-', + LU_DATABASE = '/n/moorcroft_data/mlongo/scenarios/glu-3.3.1+sb1/one/glu-3.3.1+sb1-', PLANTATION_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/', @@ -2121,7 +2147,7 @@ $ED2_INFO ! 2. Similar to 1, but branches are treated as separate pools in the ! ! biophysics (thus doubling the number of prognostic variables). ! !---------------------------------------------------------------------------------------! - IBRANCH_THERMO = 0, + IBRANCH_THERMO = 1, !---------------------------------------------------------------------------------------! @@ -2175,6 +2201,20 @@ $ED2_INFO + !---------------------------------------------------------------------------------------! + ! IGRASS -- This controls the dynamics and growth calculation for grasses. A new ! + ! grass scheme is now available where bdead = 0, height is a function of bleaf! + ! and growth happens daily. ALS (3/3/12) ! + ! 0: grasses behave like trees as in ED2.1 (old scheme) ! + ! ! + ! 1: new grass scheme as described above ! + !---------------------------------------------------------------------------------------! + IGRASS = 0, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! IPHEN_SCHEME -- It controls the phenology scheme. Even within each scheme, the ! ! actual phenology will be different depending on the PFT. ! @@ -2298,14 +2338,14 @@ $ED2_INFO ! lim -> 0. Black hole (0 itself is unacceptable) ! ! 1. Homogeneously spread over the layer (i.e., no clumping) ! !---------------------------------------------------------------------------------------! - 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, + ICANRAD = 0, + LTRANS_VIS = 0.050, + LTRANS_NIR = 0.270, + LREFLECT_VIS = 0.100, + LREFLECT_NIR = 0.540, + ORIENT_TREE = 0.100, + ORIENT_GRASS = -0.100, + CLUMP_TREE = 0.800, CLUMP_GRASS = 1.000, !---------------------------------------------------------------------------------------! @@ -2314,9 +2354,16 @@ $ED2_INFO !---------------------------------------------------------------------------------------! ! DECOMP_SCHEME -- This specifies the dependence of soil decomposition on temperature. ! - ! 0. ED-2.0 default, the original exponential ! + ! 0. ED-2.1 default, the original exponential (low temperature ! + ! limitation only). ! ! 1. Lloyd and Taylor (1994) model ! ! [[option 1 requires parameters to be set in xml]] ! + ! 2. Similar to ED-1.0 and CENTURY model, heterotrophic respiration ! + ! reaches a maximum at around 38C (using the default parameters), ! + ! then quickly falls to zero at around 50C. It applies a similar ! + ! function for soil moisture, which allows higher decomposition ! + ! rates when it is close to the optimal, plumetting when it is ! + ! almost saturated. ! !---------------------------------------------------------------------------------------! DECOMP_SCHEME = 0, !---------------------------------------------------------------------------------------! @@ -2331,16 +2378,43 @@ $ED2_INFO ! 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. ! + ! 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. ! + !---------------------------------------------------------------------------------------! + H2O_PLANT_LIM = 2, + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! IDDMORT_SCHEME -- This flag determines whether storage should be accounted in the ! + ! carbon balance. ! + ! 0 -- Carbon balance is done in terms of fluxes only. This is the ! + ! default in ED-2.1 ! + ! 1 -- Carbon balance is offset by the storage pool. Plants will be ! + ! in negative carbon balance only when they run out of storage ! + ! and are still losing more carbon than gaining. ! + ! ! + ! DDMORT_CONST -- This constant (k) determines the relative contribution of light ! + ! and soil moisture to the density-dependent mortality rate. Values ! + ! range from 0 (soil moisture only) to 1 (light only). ! + ! ! + ! mort1 ! + ! mu_DD = ------------------------- ! + ! 1 + exp [ mort2 * cr ] ! + ! ! + ! CB CB ! + ! cr = k ------------- + (1 - k) ------------- ! + ! CB_lightmax CB_watermax ! !---------------------------------------------------------------------------------------! - H2O_PLANT_LIM = 1, + IDDMORT_SCHEME = 0, + DDMORT_CONST = 1., !---------------------------------------------------------------------------------------! @@ -2386,25 +2460,25 @@ $ED2_INFO ! 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, + VMFACT_C3 = 1.00, + VMFACT_C4 = 1.00, + MPHOTO_TRC3 = 9.0, + MPHOTO_TEC3 = 7.2, + MPHOTO_C4 = 5.2, 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, + BPHOTO_C4 = 10000., + KW_GRASS = 900., + KW_TREE = 600., + GAMMA_C3 = 0.015, + GAMMA_C4 = 0.040, + D0_GRASS = 0.016, + D0_TREE = 0.016, + ALPHA_C3 = 0.080, + ALPHA_C4 = 0.055, + KLOWCO2IN = 4000., + RRFFACT = 1.000, + GROWTHRESP = 0.333, LWIDTH_GRASS = 0.05, LWIDTH_BLTREE = 0.10, LWIDTH_NLTREE = 0.05, @@ -2425,7 +2499,7 @@ $ED2_INFO ! ing point is by definition -1.5MPa, so make sure that the value ! ! is above -1.5. ! !---------------------------------------------------------------------------------------! - THETACRIT = -0.75, + THETACRIT = -1.20, !---------------------------------------------------------------------------------------! @@ -2473,19 +2547,26 @@ $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. ! + ! 3. Fire will be triggered with enough biomass and accumulated ! + ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! + ! This is soil independent. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! - ! 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 1m ! - ! that will prevent fires to happen. ! - ! < 0. - Minimum mean soil moisture potential in MPa of the top 1m ! - ! 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. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2 or 3, and it has different ! + ! meanings. The sign here matters. ! + ! When INCLUDE_FIRE = 2: ! + ! >= 0. - Minimum relative soil moisture above dry air of the top ! + ! 1m that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top ! + ! 1m 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. ! + ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! + ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! !---------------------------------------------------------------------------------------! INCLUDE_FIRE = 2, - FIRE_PARAMETER = 1., + FIRE_PARAMETER = 0.5, SM_FIRE = -1.40, !---------------------------------------------------------------------------------------! @@ -2543,7 +2624,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, AGRI_STOCK = 1, PLANTATION_STOCK = 3, !---------------------------------------------------------------------------------------! @@ -2580,8 +2661,8 @@ $ED2_INFO ! MIN_PATCH_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). ! !---------------------------------------------------------------------------------------! - MAXPATCH = 10, - MAXCOHORT = 60, + MAXPATCH = 20, + MAXCOHORT = 80, MIN_PATCH_AREA = 0.005, !---------------------------------------------------------------------------------------! @@ -2649,7 +2730,7 @@ $ED2_INFO ! between direct and diffuse is done by the Harrington scheme, and we just do a split ! ! between NIR and PAR using some standard factors. ! !---------------------------------------------------------------------------------------! - IMETRAD = 0, + IMETRAD = 2, !---------------------------------------------------------------------------------------! @@ -2683,7 +2764,7 @@ $ED2_INFO !---------------------------------------------------------------------------------------! IEDCNFGF = 'config.xml', EVENT_FILE = '', - PHENPATH = '/myoutpath/inputs', + PHENPATH = '/mypath/inputs', !---------------------------------------------------------------------------------------! $END !==========================================================================================! @@ -2919,7 +3000,7 @@ $ISAN_CONTROL ! both VARPFX and VARFPFX set to the same name, so you can start running the ! ! RUNTYPE = 'INITIAL' right away. ! !---------------------------------------------------------------------------------------! - VARPFX = 'myoutpath/isean/mysimul', + VARPFX = '/n/moorcroftfs2/mlongo/EDBRAMS/coupled/sci006_spinup/optim_grell/isean/ecmwf', !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/core/rtimh.f90 b/BRAMS/src/core/rtimh.f90 index c9355a990..c6ee9533b 100644 --- a/BRAMS/src/core/rtimh.f90 +++ b/BRAMS/src/core/rtimh.f90 @@ -112,7 +112,7 @@ subroutine timestep() !---------------------------------------------------------------------------------------! if (.not. bulk_on) then t1 = cputime(w1) - call thermo(mzp,mxp,myp,ia,iz,ja,jz) + call thermo(mzp,mxp,myp,1,mxp,1,myp) if (acct) call acctimes('accu',3,'THERMO',t1,w1) end if !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/cuparm/grell_coms.f90 b/BRAMS/src/cuparm/grell_coms.f90 index baa7e340d..21616594f 100644 --- a/BRAMS/src/cuparm/grell_coms.f90 +++ b/BRAMS/src/cuparm/grell_coms.f90 @@ -203,10 +203,14 @@ subroutine define_grell_coms(ngrids,nclouds,mmzp,nnqparm,grell_1st,grell_last) integer, dimension(ngrids), intent(in) :: grell_1st ! First cloud for Grell to solve integer, dimension(ngrids), intent(in) :: grell_last ! Last cloud for Grell to solve integer :: icld ! Cloud counter + integer :: cldd ! Deepest possible cloud + integer :: clds ! Shallowest possible cloud real :: mycdf ! User-based CDF real , external :: cdf2normal ! Cumulative distribution func. !----- Getting the maximum number of layers among the grids -------------------------! - mgmzp = maxval(mmzp) + mgmzp = maxval(mmzp(1:ngrids)) + cldd = minval(grell_1st (1:ngrids)) + clds = maxval(grell_last(1:ngrids)) !------------------------------------------------------------------------------------! ! Now I check whether I am running an ensemble of a simple dynamic control, and ! @@ -248,16 +252,18 @@ subroutine define_grell_coms(ngrids,nclouds,mmzp,nnqparm,grell_1st,grell_last) !------------------------------------------------------------------------------------! select case (closure_type) case ('en') - if (.not. prec_cld(icld)) then - write(unit=*,fmt='(a)') '--------------------------------------------------' - write(unit=*,fmt='(a,1x,i4)') ' - For cloud #',icld - write(unit=*,fmt='(a,1x,f8.2)') ' - Radius is ',radius(icld) - write(unit=*,fmt='(a,1x,a)') ' - Closure type is ',closure_type - write(unit=*,fmt='(a,1x,f8.2)') ' - Minimum radius for this closure ', & - min_down_radius - call abort_run('Radius is too small for the chosen clousure type', & - 'define_grell_coms','grell_coms.f90') - end if + do icld=cldd,clds + if (.not. prec_cld(icld)) then + write(unit=*,fmt='(a)') '--------------------------------------------------' + write(unit=*,fmt='(a,1x,i4)') ' - For cloud #',icld + write(unit=*,fmt='(a,1x,f8.2)') ' - Radius is ',radius(icld) + write(unit=*,fmt='(a,1x,a)') ' - Closure type is ',closure_type + write(unit=*,fmt='(a,1x,f8.2)') ' - Minimum radius for this closure ', & + min_down_radius + call abort_run('Radius is too small for the chosen clousure type', & + 'define_grell_coms','grell_coms.f90') + end if + end do maxens_dyn = 16 comp_noforc_cldwork = .true. comp_modif_thermo = .true. @@ -267,6 +273,11 @@ subroutine define_grell_coms(ngrids,nclouds,mmzp,nnqparm,grell_1st,grell_last) comp_noforc_cldwork = .true. comp_modif_thermo = .true. + case ('qi') + maxens_dyn = 7 + comp_noforc_cldwork = .true. + comp_modif_thermo = .true. + case ('kf','gr') maxens_dyn = 1 comp_noforc_cldwork = .true. @@ -278,16 +289,18 @@ subroutine define_grell_coms(ngrids,nclouds,mmzp,nnqparm,grell_1st,grell_last) comp_modif_thermo = .true. case default - if (.not. prec_cld(icld)) then - write(unit=*,fmt='(a)') '--------------------------------------------------' - write(unit=*,fmt='(a,1x,i4)') ' - For cloud #',icld - write(unit=*,fmt='(a,1x,f8.2)') ' - Radius is ',radius(icld) - write(unit=*,fmt='(a,1x,a)') ' - Closure type is ',closure_type - write(unit=*,fmt='(a,1x,f8.2)') ' - Minimum radius for this closure ', & - min_down_radius - call abort_run('Radius is too small for the chosen clousure type', & - 'define_grell_coms','grell_coms.f90') - end if + do icld=cldd,clds + if (.not. prec_cld(icld)) then + write(unit=*,fmt='(a)') '--------------------------------------------------' + write(unit=*,fmt='(a,1x,i4)') ' - For cloud #',icld + write(unit=*,fmt='(a,1x,f8.2)') ' - Radius is ',radius(icld) + write(unit=*,fmt='(a,1x,a)') ' - Closure type is ',closure_type + write(unit=*,fmt='(a,1x,f8.2)') ' - Minimum radius for this closure ', & + min_down_radius + call abort_run('Radius is too small for the chosen clousure type', & + 'define_grell_coms','grell_coms.f90') + end if + end do maxens_dyn = 1 comp_noforc_cldwork = .false. comp_modif_thermo = .false. diff --git a/BRAMS/src/cuparm/grell_cupar_aux.f90 b/BRAMS/src/cuparm/grell_cupar_aux.f90 index 0ed5f2eac..7807542f5 100644 --- a/BRAMS/src/cuparm/grell_cupar_aux.f90 +++ b/BRAMS/src/cuparm/grell_cupar_aux.f90 @@ -310,6 +310,7 @@ subroutine initial_thermo_grell(m1,mgmzp,dtime,thp,theta,rtp,co2p,pi0,pp,pc,wp,d qice0(k) = max(0.,rice(kr)) qvap0(k) = max(toodry,qtot0(k)-qice0(k)-qliq0(k)) t0(k) = extheta2temp(exner0(k),theta(kr)) + call grell_sanity_thil2tqall(k,z(k),thil0(k),exner0(k),p0(k),qtot0(k),'thermo_zero') !------ 4. Finding the ice-vapour equivalent potential temperature ------------------! theiv0(k) = thetaeiv(thil0(k),p0(k),t0(k),qvap0(k),qtot0(k)) @@ -348,6 +349,7 @@ subroutine initial_thermo_grell(m1,mgmzp,dtime,thp,theta,rtp,co2p,pi0,pp,pc,wp,d qtot(k) = max(toodry,rtp(kr) + dqtotdt(k) * dtime) !------ 5. Find the equilibrium state. Temperature 1st guess is simply t0. ----------! t(k) = t0(k) + call grell_sanity_thil2tqall(k,z(k),thil(k),exner(k),p(k),qtot(k),'thermo_extrap') call thil2tqall(thil(k),exner(k),p(k),qtot(k),qliq(k),qice(k),t(k),qvap(k),qsat) !------ 6. Finding the ice-vapour equivalent potential temperature ------------------! theiv(k) = thetaeiv(thil(k),p(k),t(k),qvap(k),qtot(k)) @@ -405,6 +407,7 @@ subroutine initial_thermo_grell(m1,mgmzp,dtime,thp,theta,rtp,co2p,pi0,pp,pc,wp,d !----- 10. Air density -----------------------------------------------------------------! rhosur = idealdens(psur,tsur,qvapsur,qtotsur) rho1(1) = rhosur + call grell_sanity_thil2tqall(1,z1(1),thil1(1),exner1(1),p1(1),qtot1(1),'thermo_surface') !---------------------------------------------------------------------------------------! !]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]! @@ -648,7 +651,8 @@ subroutine grell_massflx_stats(m1,icld,itest,dti,maxens_dyn,maxens_lsf,maxens_ef ,maxens_cap,inv_ensdim,closure_type,ierr_cap,upmf_ens & ,sgrell1_3d,sgrell2_3d) - use rconstants , only : hr_sec + use rconstants , only : hr_sec & ! intent(in) + , onethird ! ! intent(in) use mem_ensemble, only : ensemble_vars ! ! type use mem_scratch_grell, only: & kgoff & ! intent(in) - BRAMS grid offset @@ -767,34 +771,33 @@ subroutine grell_massflx_stats(m1,icld,itest,dti,maxens_dyn,maxens_lsf,maxens_ef do icap=1,maxens_cap upmf_ave_cap5(icap)= sum(upmf_ens(1,:,:,icap)) * maxens_efflsf_i end do - case ('nc','en') + case ('nc','en','qi') !------------------------------------------------------------------------------------! ! This became quite out of order after I changed the order in which each closure ! ! is called. I will keep "disorganized" for back compability. ! - ! 1-3: Grell (upmf_ave_cap1) ! + ! 1-3: Kain-Fritsch (upmf_ave_cap4) ! ! 4-7: Arakawa-Schubert (upmf_ave_cap5) ! - ! 8-10: Kain-Fritsch (upmf_ave_cap4) ! + ! 8-10: Grell (upmf_ave_cap1) ! ! 11-13: Krishnamurti (upmf_ave_cap3) ! ! 14-16: Frank-Cohen (upmf_ave_cap2) ! !------------------------------------------------------------------------------------! do icap=1,maxens_cap - upmf_ave_cap1(icap) = sum(upmf_ens(1:3,:,:,icap))*0.3333333333*maxens_efflsf_i + upmf_ave_cap4(icap) = sum(upmf_ens(1:3,:,:,icap)) * onethird * maxens_efflsf_i end do do icap=1,maxens_cap upmf_ave_cap5(icap) = sum(upmf_ens(4:7,:,:,icap))*0.250*maxens_efflsf_i end do - do icap=1,maxens_cap - upmf_ave_cap4(icap) = sum(upmf_ens(8:10,:,:,icap)) & - * 0.3333333333 * maxens_efflsf_i - end do + if (closure_type == 'nc' .or. closure_type == 'en') then + do icap=1,maxens_cap + upmf_ave_cap1(icap) = sum(upmf_ens(8:10,:,:,icap)) * onethird * maxens_efflsf_i + end do + end if if (closure_type == 'en') then do icap=1,maxens_cap - upmf_ave_cap3(icap) = sum(upmf_ens(11:13,:,:,icap)) & - * 0.3333333333*maxens_efflsf_i + upmf_ave_cap3(icap) = sum(upmf_ens(11:13,:,:,icap)) * onethird*maxens_efflsf_i end do do imbp=1,maxens_lsf - upmf_ave_cap2(icap) = sum(upmf_ens(14:16,:,:,icap)) & - * 0.3333333333*maxens_efflsf_i + upmf_ave_cap2(icap) = sum(upmf_ens(14:16,:,:,icap)) * onethird*maxens_efflsf_i end do end if end select @@ -889,13 +892,15 @@ subroutine grell_massflx_stats(m1,icld,itest,dti,maxens_dyn,maxens_lsf,maxens_ef sgrell1_3d(8) = 0. sgrell1_3d(9) = 0. sgrell1_3d(10) = upmf_ave(1) - case ('nc','en') - sgrell1_3d(6) = .3333333 * sum(upmf_ave(1:3)) - sgrell1_3d(9) = .3333333 * sum(upmf_ave(8:10)) + case ('nc','en','qi') + sgrell1_3d(9) = onethird * sum(upmf_ave(1:3)) sgrell1_3d(10) = .25 * sum(upmf_ave(4:7)) + if (closure_type == 'nc' .or. closure_type == 'en') then + sgrell1_3d(6) = onethird * sum(upmf_ave(8:10)) + end if if (closure_type == 'en') then - sgrell1_3d(7) = .3333333 * sum(upmf_ave(14:16)) - sgrell1_3d(8) = .3333333 * sum(upmf_ave(11:13)) + sgrell1_3d(7) = onethird * sum(upmf_ave(14:16)) + sgrell1_3d(8) = onethird * sum(upmf_ave(11:13)) else sgrell1_3d(7) = 0. sgrell1_3d(8) = 0. @@ -953,13 +958,15 @@ subroutine grell_massflx_stats(m1,icld,itest,dti,maxens_dyn,maxens_lsf,maxens_ef sgrell1_3d(13) = 0. sgrell1_3d(14) = 0. sgrell1_3d(15) = upmf_ave(1)*hr_sec - case ('nc','en') - sgrell1_3d(11) = .3333333 * sum(upmf_ave(1:3))*hr_sec - sgrell1_3d(14) = .3333333 * sum(upmf_ave(8:10))*hr_sec - sgrell1_3d(15) = .25 * sum(upmf_ave(4:7))*hr_sec + case ('nc','en','qi') + sgrell1_3d(14) = onethird * sum(upmf_ave(1:3)) *hr_sec + sgrell1_3d(15) = .25 * sum(upmf_ave(4:7)) *hr_sec + if (closure_type == 'nc' .or. closure_type == 'en') then + sgrell1_3d(11) = onethird * sum(upmf_ave(8:10))*hr_sec + end if if (closure_type == 'en') then - sgrell1_3d(12)= .3333333 * sum(upmf_ave(14:16))*hr_sec - sgrell1_3d(13)= .3333333 * sum(upmf_ave(11:13))*hr_sec + sgrell1_3d(12)= onethird * sum(upmf_ave(14:16))*hr_sec + sgrell1_3d(13)= onethird * sum(upmf_ave(11:13))*hr_sec else sgrell1_3d(12)= 0. sgrell1_3d(13)= 0. @@ -1012,10 +1019,12 @@ subroutine grell_massflx_stats(m1,icld,itest,dti,maxens_dyn,maxens_lsf,maxens_ef sgrell1_3d(21) = 0. sgrell1_3d(22) = upmf_ave(1) sgrell1_3d(23) = 0. - case ('nc') - sgrell1_3d(21) = .3333333 * sum(upmf_ave(1:3))*hr_sec + case ('nc','qi') + sgrell1_3d(23) = onethird * sum(upmf_ave(1:3))*hr_sec sgrell1_3d(22) = .25 * sum(upmf_ave(4:7))*hr_sec - sgrell1_3d(23) = .3333333 * sum(upmf_ave(8:10))*hr_sec + if (closure_type == 'nc') then + sgrell1_3d(21) = onethird * sum(upmf_ave(8:10))*hr_sec + end if end select end if return @@ -1085,7 +1094,7 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli integer :: m ! Counter [ --] !---------------------------------------------------------------------------------------! - + !---------------------------------------------------------------------------------------! ! Let's be optimistic and assume that everything is fine. ! @@ -1101,12 +1110,12 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli ! Find derived bounds. ! !------------------------------------------------------------------------------------! !----- Temperature. -----------------------------------------------------------------! - grellmin_t = grellmin_t0 - gocp * z(k) + grellmin_t = max(t00-120.,grellmin_t0 - gocp * z(k)) grellmax_t = grellmax_t0 - grell_lapse_wet * z(k) everything_fine = t(k) >= grellmin_t .and. t(k) <= grellmax_t !----- Vapour pressure. -------------------------------------------------------------! grellmin_pvap = grellmin_rhv * eslif(grellmin_t) - grellmin_pvap = grellmax_rhv * eslif(grellmax_t) + grellmax_pvap = grellmax_rhv * eslif(grellmax_t) !----- Vapour mixing ratio. ---------------------------------------------------------! grellmin_qvap = ep * grellmin_pvap / (press(k) - grellmin_pvap) grellmax_qvap = ep * grellmax_pvap / (press(k) - grellmax_pvap) @@ -1133,10 +1142,10 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli ! disappointed... But hey, don't hate me messenger, I'm just going to print ! ! this so you can work towards a better model. ! !---------------------------------------------------------------------------------! - write (unit=*,fmt='(150a)' ) ('-',m=1,169) + write (unit=*,fmt='(169a)' ) ('-',m=1,169) write (unit=*,fmt='(3(a,1x))' ) ' -> Event: ',trim(which) & ,' has unrealistic thermodynamics...' - write (unit=*,fmt='(150a)' ) ('-',m=1,169) + write (unit=*,fmt='(169a)' ) ('-',m=1,169) write (unit=*,fmt='(a)' ) ' BOUNDS' write (unit=*,fmt='(a)' ) '' write (unit=*,fmt='(a,es12.5)') ' Min TEMP [ degC]: ',grellmin_t - t00 @@ -1154,7 +1163,7 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli write (unit=*,fmt='(a,es12.5)') ' Min CO2 [umol/mol]: ',grellmin_co2 write (unit=*,fmt='(a,es12.5)') ' Max CO2 [umol/mol]: ',grellmax_co2 write (unit=*,fmt='(a)' ) '' - write (unit=*,fmt='(150a)' ) ('-',m=1,169) + write (unit=*,fmt='(169a)' ) ('-',m=1,169) write (unit=*,fmt='(13(a,1x))') ' LAYER',' HEIGHT',' PRESSURE' & ,' EXNER',' TEMP',' THETA_IL' & ,' THETAT_EIV',' QVAP',' QLIQ' & @@ -1165,14 +1174,14 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli ,' K',' g/kg',' g/kg' & ,' g/kg',' g/kg',' kg/m3' & ,' umol/mol' - write (unit=*,fmt='(150a)' ) ('-',m=1,169) + write (unit=*,fmt='(169a)' ) ('-',m=1,169) do l=mkx,1,-1 write (unit=*,fmt='(i12,1x,12(f12.2))') & l,z(l),press(l)*0.01,exner(l),t(l)-t00,thil(l) & ,theiv(l),qvap(l)*1000.,qliq(l)*1000. & ,qice(l)*1000.,qtot(l)*1000.,rho(l),co2(l) end do - write (unit=*,fmt='(150a)' ) ('-',m=1,169) + write (unit=*,fmt='(169a)' ) ('-',m=1,169) write (unit=*,fmt='(a)' ) '' call brams_fail_whale() call abort_run('Unreasonable thermodynamic variables','grell_sanity_check' & @@ -1187,3 +1196,127 @@ subroutine grell_sanity_check(mkx,mgmzp,z,press,exner,theiv,thil,t,qtot,qvap,qli end subroutine grell_sanity_check !==========================================================================================! !==========================================================================================! + + + + + + +!==========================================================================================! +!==========================================================================================! +! This sub-routine checks whether the partial results in the cumulus parametrisation ! +! make sense or not. ! +!------------------------------------------------------------------------------------------! +subroutine grell_sanity_thil2tqall(k,z,thil,exner,press,qtot,which) + use grell_coms, only : grellmax_zcheck & ! intent(in) + , grell_lapse_wet & ! intent(in) + , grellmin_t0 & ! intent(in) + , grellmax_t0 & ! intent(in) + , grellmin_rhv & ! intent(in) + , grellmax_rhv & ! intent(in) + , grellmin_co2 & ! intent(in) + , grellmax_co2 ! ! intent(in) + use therm_lib , only : extemp2theta & ! intent(in) + , eslif & ! intent(in) + , thetaeivs ! ! intent(in) + use rconstants, only : ep & ! intent(in) + , t00 & ! intent(in) + , gocp ! ! intent(in) + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: k ! Counter [ --] + real , intent(in) :: z ! Height [ m] + real , intent(in) :: thil ! I.L. Pot. temp. [ K] + real , intent(in) :: exner ! Exner function [ J/kg/K] + real , intent(in) :: press ! Pressure [ Pa] + real , intent(in) :: qtot ! Total mixing ratio [ kg/kg] + character(len=*), intent(in) :: which ! Which call? + !----- Local variables. ----------------------------------------------------------------! + real :: grellmin_t ! Minimum temperature [ K] + real :: grellmax_t ! Maximum temperature [ K] + real :: grellmin_thil ! Minimum ice-liquid potential temperature [ K] + real :: grellmax_thil ! Maximum ice-liquid potential temperature [ K] + real :: grellmin_pvap ! Minimum vapour pressure [ Pa] + real :: grellmax_pvap ! Maximum vapour pressure [ Pa] + real :: grellmin_qvap ! Minimum vapour mixing ratio [ kg/kg] + real :: grellmax_qvap ! Maximum vapour mixing ratio [ kg/kg] + real :: grellmin_qtot ! Minimum total mixing ratio [ kg/kg] + real :: grellmax_qtot ! Maximum total mixing ratio [ kg/kg] + logical :: everything_fine ! This will become false if anything looks wrong [ T|F] + integer :: m ! Counter + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Let's be optimistic and assume that everything is fine. ! + !---------------------------------------------------------------------------------------! + everything_fine = .true. + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Find derived bounds. ! + !---------------------------------------------------------------------------------------! + !----- Temperature. --------------------------------------------------------------------! + grellmin_t = max(t00-120.,grellmin_t0 - gocp * z) + grellmax_t = grellmax_t0 - grell_lapse_wet * z + !----- Vapour pressure. ----------------------------------------------------------------! + grellmin_pvap = grellmin_rhv * eslif(grellmin_t) + grellmax_pvap = grellmax_rhv * eslif(grellmax_t) + !----- Vapour mixing ratio. ------------------------------------------------------------! + grellmin_qvap = ep * grellmin_pvap / (press - grellmin_pvap) + grellmax_qvap = ep * grellmax_pvap / (press - grellmax_pvap) + !----- Total mixing ratio. Minimum is unsaturated, maximum assumed to 2*qvap... -------! + grellmin_qtot = grellmin_qvap + grellmax_qtot = grellmax_qvap * 2.0 + everything_fine = qtot >= grellmin_qtot .and. qtot <= grellmax_qtot + !----- Ice-liquid potential temperature. -----------------------------------------------! + grellmin_thil = extemp2theta(exner,grellmin_t) + grellmax_thil = extemp2theta(exner,grellmax_t) + everything_fine = thil >= grellmin_thil .and. thil <= grellmax_thil + !---------------------------------------------------------------------------------------! + + if (.not. everything_fine) then + !------------------------------------------------------------------------------------! + ! This is the problem of being optimistic: more often than not you may be ! + ! disappointed... But hey, don't hate me messenger, I'm just going to print ! + ! this so you can work towards a better model. ! + !------------------------------------------------------------------------------------! + write (unit=*,fmt='(92a)' ) ('-',m=1,92) + write (unit=*,fmt='(3(a,1x))' ) ' -> Event: ',trim(which) & + ,' has unrealistic thermodynamics...' + write (unit=*,fmt='(92a)' ) ('-',m=1,92) + write (unit=*,fmt='(a)' ) ' BOUNDS' + write (unit=*,fmt='(a)' ) '' + write (unit=*,fmt='(a,es12.5)' ) ' - Min TEMP [ degC]: ',grellmin_t - t00 + write (unit=*,fmt='(a,es12.5)' ) ' - Max TEMP [ degC]: ',grellmax_t - t00 + write (unit=*,fmt='(a,es12.5)' ) ' - Min THIL [ K]: ',grellmin_thil + write (unit=*,fmt='(a,es12.5)' ) ' - Max THIL [ K]: ',grellmax_thil + write (unit=*,fmt='(a,es12.5)' ) ' - Min PVAP [ hPa]: ',grellmin_pvap * 0.01 + write (unit=*,fmt='(a,es12.5)' ) ' - Max PVAP [ hPa]: ',grellmax_pvap * 0.01 + write (unit=*,fmt='(a,es12.5)' ) ' - Min QVAP [ g/kg]: ',grellmin_qvap * 1000. + write (unit=*,fmt='(a,es12.5)' ) ' - Max QVAP [ g/kg]: ',grellmax_qvap * 1000. + write (unit=*,fmt='(a,es12.5)' ) ' - Min QTOT [ g/kg]: ',grellmin_qtot * 1000. + write (unit=*,fmt='(a,es12.5)' ) ' - Max QTOT [ g/kg]: ',grellmax_qtot * 1000. + write (unit=*,fmt='(a)' ) '' + write (unit=*,fmt='(a)' ) ' VALUES' + write (unit=*,fmt='(a)' ) '' + write (unit=*,fmt='(a,1x,i6)' ) ' - K : ',k + write (unit=*,fmt='(a,1x,f12.2)') ' - THIL [ K]: ',thil + write (unit=*,fmt='(a,1x,f12.2)') ' - EXNER [ J/Kg/K]: ',exner + write (unit=*,fmt='(a,1x,f12.2)') ' - PRESS [ hPa]: ',press * 0.01 + write (unit=*,fmt='(a,1x,f12.2)') ' - QTOT [ g/kg]: ',qtot * 1000. + write (unit=*,fmt='(92a)' ) ('-',m=1,92) + write (unit=*,fmt='(a)' ) '' + call brams_fail_whale() + call abort_run('Unreasonable thermodynamic variables','grell_sanity_thil2tqall' & + ,'grell_cupar_aux.f90') + !------------------------------------------------------------------------------------! + end if + !---------------------------------------------------------------------------------------! + + return +end subroutine grell_sanity_thil2tqall +!==========================================================================================! +!==========================================================================================! diff --git a/BRAMS/src/cuparm/grell_cupar_downdraft.f90 b/BRAMS/src/cuparm/grell_cupar_downdraft.f90 index 7ccf27529..53f2b1006 100644 --- a/BRAMS/src/cuparm/grell_cupar_downdraft.f90 +++ b/BRAMS/src/cuparm/grell_cupar_downdraft.f90 @@ -263,7 +263,8 @@ subroutine grell_theiv_downdraft(mkx,mgmzp,klod,cdd,mentrd_rate,theiv,theiv_cup, + mentrd_rate(k)*dzd_cld(k)*theiv(k)) & / (1.+(mentrd_rate(k)- 0.5*cdd(k))*dzd_cld(k)) end do - + !---------------------------------------------------------------------------------------! + return end subroutine grell_theiv_downdraft !==========================================================================================! @@ -279,12 +280,12 @@ end subroutine grell_theiv_downdraft ! This subroutine computes the moisture profile, as well as the evaporation rate ! ! associated with each level. ! !------------------------------------------------------------------------------------------! -subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p_cup & +subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,z_cup,p_cup & ,exner_cup,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup & ,qice_cup,qsat_cup,co2_cup,rho_cup,pwav,theivd_cld & ,etad_cld,dzd_cld,thild_cld,td_cld,qtotd_cld & ,qvapd_cld,qliqd_cld,qiced_cld,qsatd_cld,co2d_cld & - ,rhod_cld,dbyd,pwd_cld,pwev,ierr) + ,rhod_cld,dbyd,pwd_cld,pwev,ierr,which) use rconstants, only : epi & ! intent(in) , rdry & ! intent(in) , t00 & ! intent(in) @@ -307,6 +308,7 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p real, dimension(mgmzp), intent(in) :: mentrd_rate ! Entrainment rate; [ 1/m] real, dimension(mgmzp), intent(in) :: cdd ! Detrainment function; [ 1/m] !----- Variables at cloud levels -------------------------------------------------------! + real, dimension(mgmzp), intent(in) :: z_cup ! Height @ cloud levels [ m] real, dimension(mgmzp), intent(in) :: p_cup ! Pressure @ cloud levels [ Pa] real, dimension(mgmzp), intent(in) :: exner_cup ! Exner fctn. @ cloud lev. [J/kg/K] real, dimension(mgmzp), intent(in) :: thil_cup ! Theta_il [ K] @@ -339,6 +341,8 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p real , intent(out) :: pwev ! Total evaporation flux [ kg/kg] !----- Variable that may change in this subroutine -------------------------------------! integer , intent(inout) :: ierr ! Error flag + !----- Flag to tell which call is this one. --------------------------------------------! + character(len=*) , intent(in) :: which !----- Local variables -----------------------------------------------------------------! integer :: k ! Counter [ ----] integer :: it ! Iteration counter [ ----] @@ -356,6 +360,8 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p real, dimension(mgmzp) :: evapd_cld ! Evaporated mix. ratio [ kg/kg] real :: tdbis ! Scratch var. for temperature [ K] real :: delta ! Aux. var. for bisection 2nd guess [ kg/kg] + !----- Local constants. ----------------------------------------------------------------! + logical, parameter :: debug =.false. ! Print debug info? [ T|F] !----- External functions --------------------------------------------------------------! real, external :: buoyancy_acc ! Buoyancy acceleration funtion. !---------------------------------------------------------------------------------------! @@ -397,26 +403,34 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p ! entrainment and detrainment not happen. ! !---------------------------------------------------------------------------------------! do k=klod,1,-1 - !------------------------------------------------------------------------------------! - ! This is the mixing ratio the downdraft would have did evaporation not happen. ! - !------------------------------------------------------------------------------------! denomin = 1.+(mentrd_rate(k)-0.5*cdd(k))*dzd_cld(k) denomini = 1./denomin - qtotd_0_evap = (qtotd_cld(k+1)*(1.-0.5*cdd(k)*dzd_cld(k)) & - + mentrd_rate(k)*dzd_cld(k)*qtot(k) -0.5*evapd_cld(k+1)) & - * denomini !----- CO2 is assumed to be an inert gas (i.e., no sources or sinks). ---------------! co2d_cld(k) = (co2d_cld(k+1)*(1.-0.5*cdd(k)*dzd_cld(k)) & + mentrd_rate(k)*dzd_cld(k)*co2(k) ) & * denomini + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! This is the mixing ratio the downdraft would have did evaporation not happen. ! + ! This is also the first guess. ! + !------------------------------------------------------------------------------------! + qtotd_0_evap = ( qtotd_cld(k+1) * (1. - 0.5 * cdd(k) * dzd_cld(k)) & + + mentrd_rate(k) * dzd_cld(k) * qtot(k) ) * denomini + !------------------------------------------------------------------------------------! + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=28,fmt='(2(a,1x,i5,1x),a,1x,l1,1x,8(a,1x,f10.4,1x),a,1x,es12.5)') & - ! 'k=',k,'it=',0,'bisection=',.false.,'q000=',1000.*qtotd_0_evap & - ! ,'qtot=',1000.*qtotdc,'evap=',1000.*evapd_cld(k),'qsat=',1000.*qsatd_cld(k) & - ! ,'qvap=',1000.*qvapd_cld(k),'qliq=',1000.*qliqd_cld(k) & - ! ,'qice=',1000.*qiced_cld(k),'temp=',td_cld(k)-t00,'func=',func + if (debug) then + write (unit=28,fmt='(2(a,1x,i5,1x),a,1x,l1,1x,8(a,1x,f10.4,1x),a,1x,es12.5)') & + 'k=',k,'it=',0,'bisection=',.false.,'q000=',1000.*qtotd_0_evap & + ,'qtot=',1000.*qtotdc,'evap=',1000.*evapd_cld(k) & + ,'qsat=',1000.*qsatd_cld(k),'qvap=',1000.*qvapd_cld(k) & + ,'qliq=',1000.*qliqd_cld(k),'qice=',1000.*qiced_cld(k) & + ,'temp=',td_cld(k)-t00,'func=',func + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -533,11 +560,13 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p qtotdz = min(max(toodry,qtotda + real((-1)**it * (it+3)/2) * delta),toowet) !----- Finding this equilibrium state --------------------------------------! thild_cld(k) = thetaeiv2thil(theivd_cld(k),p_cup(k),qtotdz) + call grell_sanity_thil2tqall(k,z_cup(k),thild_cld(k),exner_cup(k),p_cup(k) & + ,qtotdz,which) call thil2tqall(thild_cld(k),exner_cup(k),p_cup(k),qtotdz & ,qliqd_cld(k),qiced_cld(k),tdbis,qvapd_cld(k) & ,qsatd_cld(k)) - evapd_cld(k) = min(0., 2. * (qtotd_0_evap - qsatd_cld(k)) * denomin ) - funz = qtotdz - qtotd_0_evap + 0.5 * evapd_cld(k) * denomini + evapd_cld(k) = min(0., qtotd_0_evap - qsatd_cld(k) ) + funz = qtotdz - (qtotd_0_evap - evapd_cld(k) ) bisection = funa*funz < 0. if (bisection) exit zgssloop @@ -553,12 +582,14 @@ subroutine grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then + if (printing .and. anyzero) then uni = 60 + mynum - write(unit=uni,fmt='(a)') '---------------------------------------------------------' - write(unit=uni,fmt=fmti ) ' I =', i - write(unit=uni,fmt=fmti ) ' J =', j - write(unit=uni,fmt='(a)') ' ' + write (unit=uni,fmt='(299a)' ) ('=',k=1,299) + write (unit=uni,fmt='(a,1x,i5)' ) ' I =', i + write (unit=uni,fmt='(a,1x,i5)' ) ' J =', j + write (unit=uni,fmt='(299a)' ) ('-',k=1,299) + write (unit=uni,fmt='(23(a,1x))') ' ICAP',' IEDT',' IMBP' & + ,' ICLD',' JCLD',' IDYN' & + ,' IERR',' ZKLOU',' ZKLFC' & + ,' ZKLNB',' ZKTOP',' EDT' & + ,' MBPRIME',' TSCAL_KF',' DTIME' & + ,' AATOT0',' AATOT',' X_AATOT' & + ,' MFKE',' DNMF_DYN',' DNMX_DYN' & + ,' UPMF_DYN',' UPMX_DYN' + write (unit=uni,fmt='(299a)') ('-',k=1,299) end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -483,36 +492,11 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max ! mass flux will then have maxens_eff × maxens_lsf × maxens_dyn different values. ! !---------------------------------------------------------------------------------------! stacloop2: do icap=1,maxens_cap - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then - write(unit=uni,fmt=fmti ) ' IEDT =', iedt - write(unit=uni,fmt='(a)') ' ' - end if - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - mbprimeloop2: do imbp=1,maxens_lsf - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then - write(unit=uni,fmt=fmti ) ' IMBP =', imbp - write(unit=uni,fmt=fmtf ) ' MBPRIME =', mbprime(1) - write(unit=uni,fmt='(a)') ' ' - end if - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + !------------------------------------------------------------------------------! ! 6a. Copying some variables to scratch arrays. ! @@ -536,34 +520,6 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max pwev(icld) = ensemble_e(icld)%pwev_cap(icap) prev_dnmf(icld) = ensemble_e(icld)%prev_dnmf(1) - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then - write(unit=uni,fmt=fmti ) ' ICLD =', icld - write(unit=uni,fmt=fmtf ) ' EDT =', edt(icld) - write(unit=uni,fmt=fmtf ) ' TSCAL_KF =', tscal_kf - write(unit=uni,fmt=fmtf ) ' DTIME =', dtime - if (klou(icld) > 0) then - write(unit=uni,fmt=fmtf ) ' KLOU =', z(klou(icld)) - end if - if (klfc(icld) > 0) then - write(unit=uni,fmt=fmtf ) ' KLFC =', z(klfc(icld)) - end if - if (klnb(icld) > 0) then - write(unit=uni,fmt=fmtf ) ' KLNB =', z(klnb(icld)) - end if - if (ktop(icld) > 0) then - write(unit=uni,fmt=fmtf ) ' KTOP =', z(ktop(icld)) - end if - write(unit=uni,fmt=fmti ) ' IERR =', ierr(icld) - write(unit=uni,fmt=fmtf ) ' AATOT0 =' & - , ensemble_e(icld)%aatot0_eff(iedt,icap) - write(unit=uni,fmt=fmtf ) ' AATOT =' & - , ensemble_e(icld)%aatot_eff(iedt,icap) - write(unit=uni,fmt='(a)') ' ' - end if - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !---------------------------------------------------------------------------! @@ -572,18 +528,6 @@ subroutine grell_cupar_dynamic(cldd,clds,nclouds,dtime,maxens_cap,maxens_eff,max do jcld=cldd,clds mfke(icld,jcld) = ( ensemble_e(icld)%x_aatot(jcld,imbp,iedt,icap) & - aatot(icld)) / (mbprime(imbp) * dtime) - - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then - write(unit=uni,fmt=fmti ) ' ICLD =', icld - write(unit=uni,fmt='(a)') ' ' - end if - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - do idyn=1,maxens_dyn ensemble_e(icld)%dnmf_ens(idyn,imbp,iedt,icap) = dnmf_dyn(icld,idyn) ensemble_e(icld)%upmf_ens(idyn,imbp,iedt,icap) = upmf_dyn(icld,idyn) ensemble_e(icld)%dnmx_ens(idyn,imbp,iedt,icap) = dnmx_dyn(icld,idyn) ensemble_e(icld)%upmx_ens(idyn,imbp,iedt,icap) = upmx_dyn(icld,idyn) + + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - if (printing) then - write(unit=uni,fmt='(a)') '---------------------------------------------------------' - write(unit=uni,fmt='(a)') ' ' + if (printing .and. anyzero) then + uni = 60 + mynum + write (unit=uni,fmt='(299a)') ('=',k=1,299) + write (unit=uni,fmt='(a)') ' ' end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -779,17 +736,17 @@ subroutine grell_dyncontrol_ensemble(nclouds,mgmzp,maxens_dyn,cldd,clds,dtime,cl ! Here for each different dynamic control style, the first element is the standard, ! ! like in the previous cases, and the others are perturbations. ! !---------------------------------------------------------------------------------------! - case ('en','nc') + case ('en','nc','qi') !------------------------------------------------------------------------------------! - ! 6a. Grell (1993), modified quasi-equilibrium buoyant energy. ! + ! 6a. Kain and Fritsch (1990), instability removal. ! !------------------------------------------------------------------------------------! - call grell_grell_solver(nclouds,cldd,clds,dtime,1.0,aatot0,aatot,mfke,ierr & - ,upmf_dyn(1:nclouds,1),upmx_dyn(1:nclouds,1)) - call grell_grell_solver(nclouds,cldd,clds,dtime,0.9,aatot0,aatot,mfke,ierr & - ,upmf_dyn(1:nclouds,2),upmx_dyn(1:nclouds,2)) - call grell_grell_solver(nclouds,cldd,clds,dtime,1.1,aatot0,aatot,mfke,ierr & - ,upmf_dyn(1:nclouds,3),upmx_dyn(1:nclouds,3)) + call grell_inre_solver(nclouds,cldd,clds,tscal_kf,1.0,aatot0,mfke,ierr & + ,upmf_dyn(1:nclouds,1),upmx_dyn(1:nclouds,1)) + call grell_inre_solver(nclouds,cldd,clds,tscal_kf,0.9,aatot0,mfke,ierr & + ,upmf_dyn(1:nclouds,2),upmx_dyn(1:nclouds,2)) + call grell_inre_solver(nclouds,cldd,clds,tscal_kf,1.1,aatot0,mfke,ierr & + ,upmf_dyn(1:nclouds,3),upmx_dyn(1:nclouds,3)) !------------------------------------------------------------------------------------! ! 6b. Arakawa and Schubert (1974), quasi-equilibrium buoyant energy. ! @@ -804,17 +761,23 @@ subroutine grell_dyncontrol_ensemble(nclouds,mgmzp,maxens_dyn,cldd,clds,dtime,cl call grell_arakschu_solver(nclouds,cldd,clds,mgmzp,dtime,p_cup,2,2,ktop,aatot,mfke & ,ierr,upmf_dyn(1:nclouds,7),upmx_dyn(1:nclouds,7)) - !------------------------------------------------------------------------------------! - ! 6c. Kain and Fritsch (1990), instability removal. ! - !------------------------------------------------------------------------------------! - call grell_inre_solver(nclouds,cldd,clds,tscal_kf,1.0,aatot0,mfke,ierr & - ,upmf_dyn(1:nclouds,8),upmx_dyn(1:nclouds,8)) - call grell_inre_solver(nclouds,cldd,clds,tscal_kf,0.9,aatot0,mfke,ierr & - ,upmf_dyn(1:nclouds,9),upmx_dyn(1:nclouds,9)) - call grell_inre_solver(nclouds,cldd,clds,tscal_kf,1.1,aatot0,mfke,ierr & - ,upmf_dyn(1:nclouds,10),upmx_dyn(1:nclouds,10)) - if (closure_type == 'en') then + select case (closure_type) + case ('en','nc') + !---------------------------------------------------------------------------------! + ! 6c. Grell (1993), modified quasi-equilibrium buoyant energy. ! + !---------------------------------------------------------------------------------! + call grell_grell_solver(nclouds,cldd,clds,dtime,1.0,aatot0,aatot,mfke,ierr & + ,upmf_dyn(1:nclouds,8),upmx_dyn(1:nclouds,8)) + call grell_grell_solver(nclouds,cldd,clds,dtime,0.9,aatot0,aatot,mfke,ierr & + ,upmf_dyn(1:nclouds,9),upmx_dyn(1:nclouds,9)) + call grell_grell_solver(nclouds,cldd,clds,dtime,1.1,aatot0,aatot,mfke,ierr & + ,upmf_dyn(1:nclouds,10),upmx_dyn(1:nclouds,10)) + !---------------------------------------------------------------------------------! + end select + + select case (closure_type) + case ('en') !---------------------------------------------------------------------------------! ! 6d. Frank and Cohen (1987), low-level environment mass flux. ! !---------------------------------------------------------------------------------! @@ -849,7 +812,7 @@ subroutine grell_dyncontrol_ensemble(nclouds,mgmzp,maxens_dyn,cldd,clds,dtime,cl upmx_dyn(icld,15) = upmf_dyn(icld,15) upmx_dyn(icld,16) = upmf_dyn(icld,16) end do enmcloop - end if + end select end select do idyn=1,maxens_dyn diff --git a/BRAMS/src/cuparm/grell_cupar_ensemble.f90 b/BRAMS/src/cuparm/grell_cupar_ensemble.f90 index e5a94ab1b..b389d9cb4 100644 --- a/BRAMS/src/cuparm/grell_cupar_ensemble.f90 +++ b/BRAMS/src/cuparm/grell_cupar_ensemble.f90 @@ -92,7 +92,7 @@ subroutine grell_dellas_ensemble(mgmzp,checkmass,masstol,edt,kdet,klou,klfc,klod use rconstants, only : grav implicit none - + !----- Arguments. ----------------------------------------------------------------------! integer , intent(in) :: mgmzp ! Number of levels logical , intent(in) :: checkmass ! Flag for mass balance check real , intent(in) :: masstol ! Mass tolerance. @@ -102,7 +102,6 @@ subroutine grell_dellas_ensemble(mgmzp,checkmass,masstol,edt,kdet,klou,klfc,klod integer , intent(in) :: klfc ! Level of free convection integer , intent(in) :: klod ! Level of origin of downdraft integer , intent(in) :: ktop ! Cloud top - real, dimension(mgmzp), intent(in) :: this ! Thermo variable @ model levels real, dimension(mgmzp), intent(in) :: p_cup ! Pressure at cloud levels [Pa] real, dimension(mgmzp), intent(in) :: this_cup ! Thermo variable @ cloud levels @@ -116,7 +115,7 @@ subroutine grell_dellas_ensemble(mgmzp,checkmass,masstol,edt,kdet,klou,klfc,klod real, dimension(mgmzp), intent(in) :: thisd_cld ! Thermo variable at downdraft; real, dimension(mgmzp), intent(in) :: thisu_cld ! Thermo variable at updraft; real, dimension(mgmzp), intent(inout) :: dellathis ! Change of thermo per unit of mass - + !----- Local variables. ----------------------------------------------------------------! integer :: k ! Counter real :: subin ! Subsidence from level aloft; real :: subout ! Subsidence to level below; @@ -125,6 +124,10 @@ subroutine grell_dellas_ensemble(mgmzp,checkmass,masstol,edt,kdet,klou,klfc,klod real :: detup ! Updraft detrainment term real :: entup ! Updraft entrainment term real :: totmass ! Total mass balance + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! The vertical loop is done between the 2nd level and cloud top. The first level was ! @@ -264,38 +267,44 @@ end subroutine grell_dellas_ensemble ! verification. J. Atm. Sci., vol. 43(18). 1913-1943. (zf or ZF86). ! !------------------------------------------------------------------------------------------! subroutine grell_efficiency_ensemble(mkx,mgmzp,maxens_eff,klou,klfc,ktop,edtmin,edtmax & - ,pwav,pwev,z_cup,uwind,vwind,dzd_cld,edt_eff) + ,pwav,pwev,z_cup,uwind,vwind,dzd_cld,edt_eff,icld,icap) implicit none - - integer , intent(in) :: mkx, mgmzp ! Grid dimesnsions - integer , intent(in) :: maxens_eff ! # of prec. efficiency members - integer , intent(in) :: klou ! Updraft origin - integer , intent(in) :: klfc ! Level of free convection - integer , intent(in) :: ktop ! Cloud top - - - real , intent(in) :: edtmin ! Minimum efficiency - real , intent(in) :: edtmax ! Maximum efficiency - real , intent(in) :: pwav ! Integrated updraft cond. (I1) - real , intent(in) :: pwev ! Integrated downdraft evap. (-I2) - real, dimension(mgmzp) , intent(in) :: z_cup ! Height @ cloud levels; - real, dimension(mgmzp) , intent(in) :: uwind ! Zonal wind @ model levels; - real, dimension(mgmzp) , intent(in) :: vwind ! Meridional wind @ model levels; - real, dimension(mgmzp) , intent(in) :: dzd_cld ! Layer thickness - real, dimension(maxens_eff), intent(out) :: edt_eff ! Prec. efficiency for ensemble. - - integer :: k,e ! Counters - integer :: incr ! Increment - real :: botwind ! Wind magnitude at cloud bottom; - real :: topwind ! Wind magnitude at cloud top; - real :: vshear ! Wind shear - real :: edt ! Standard prec. Efficiency - real :: delta_edt ! Efficiency "step" for ensemble. - real :: pef_fc ! Precipitation efficiency (FC80). - real :: er_zf ! Temporary variable to compute... - real :: pef_zf ! Prec. efficiency (ZF86) - real :: zkbc_kft ! Level of free convection height + !----- Arguments. ----------------------------------------------------------------------! + integer , intent(in) :: mkx ! Grid dimesnsion + integer , intent(in) :: mgmzp ! Grid dimesnsion + integer , intent(in) :: maxens_eff ! # of prec. efficiency members + integer , intent(in) :: klou ! Updraft origin + integer , intent(in) :: klfc ! Level of free convection + integer , intent(in) :: ktop ! Cloud top + integer , intent(in) :: icld ! Cloud type + integer , intent(in) :: icap ! Static control type + real , intent(in) :: edtmin ! Minimum efficiency + real , intent(in) :: edtmax ! Maximum efficiency + real , intent(in) :: pwav ! Integ. updraft cond. (I1) + real , intent(in) :: pwev ! Integ. downdraft evap. (-I2) + real, dimension(mgmzp) , intent(in) :: z_cup ! Height @ cloud levels; + real, dimension(mgmzp) , intent(in) :: uwind ! Zonal wind @ model levels; + real, dimension(mgmzp) , intent(in) :: vwind ! Meridional wind @ model levels; + real, dimension(mgmzp) , intent(in) :: dzd_cld ! Layer thickness + real, dimension(maxens_eff), intent(out) :: edt_eff ! Prec. efficiency for ensemble. + !----- Local variables. ----------------------------------------------------------------! + integer :: k ! Counter + integer :: e ! Counter + integer :: iun ! File unit + integer :: incr ! Increment + real :: botwind ! Wind magnitude at cloud bottom + real :: topwind ! Wind magnitude at cloud top + real :: vshear ! Wind shear + real :: edt ! Standard prec. Efficiency + real :: delta_edt ! Efficiency "step" for ensemble. + real :: pef_fc ! Precipitation efficiency (FC80). + real :: er_zf ! Temp. variable to compute... + real :: pef_zf ! Prec. efficiency (ZF86) + real :: zkbc_kft ! Level of free convection height + !---------------------------------------------------------------------------------------! + ! Local constants. ! + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! The coefficients below were extracted from the papers, and they are named after ! ! the equation they came from. For example fc58 is the vector with all coefficients ! @@ -311,6 +320,10 @@ subroutine grell_efficiency_ensemble(mkx,mgmzp,maxens_eff,klou,klfc,ktop,edtmin, real, dimension(0:5) , parameter :: zf13=(/ .96729352,-.70034167,.162179896 & ,-1.2569798E-2, 4.2772E-4, -5.44E-6 /) !---------------------------------------------------------------------------------------! + ! Variable that allow extra information to be printed. ! + !---------------------------------------------------------------------------------------! + logical , parameter :: debug = .false. + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! @@ -382,21 +395,6 @@ subroutine grell_efficiency_ensemble(mkx,mgmzp,maxens_eff,klou,klfc,ktop,edtmin, !---------------------------------------------------------------------------------------! pef_zf = 1./(1. + er_zf) - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=57,fmt='(a)') '-------------------------------------------------------------' - !write (unit=57,fmt='(5(a9,1x),a12,2(1x,a8))') & - ! ' botwind',' topwind',' z(klou)','z(klfc)',' z(ktop)',' wind_shear' & - ! ,' pef_fc',' pef_zf' - !write (unit=57,fmt='(5(f9.3,1x),es12.5,2(1x,f8.4))') & - ! botwind ,topwind ,z_cup(klou),z_cup(klfc),z_cup(ktop),vshear,pef_fc ,pef_zf - !write (unit=57,fmt='(a)') ' ' - !write (unit=57,fmt='(2(a,1x,es11.4,1x))') 'pwav=',pwav,'pwev=',pwev - !write (unit=57,fmt='(a)') '-------------------------------------------------------------' - !write (unit=57,fmt='(a)') ' ' - !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !---------------------------------------------------------------------------------------! ! The standard precipitation efficiency is simply the average between both methods. ! @@ -417,6 +415,31 @@ subroutine grell_efficiency_ensemble(mkx,mgmzp,maxens_eff,klou,klfc,ktop,edtmin, !----- Shifted from edt -------------------------------------------------------------! ! edt_eff(e) = max(edtmin,min(edtmax,edt-float(k-1)*edtinc)) end do + + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + if (debug) then + iun = 50 + icld + write (unit=iun,fmt='(a)') '-----------------------------------------------' + write (unit=iun,fmt='(a,1x,i5)' ) ' ICAP =',icap + write (unit=iun,fmt='(a)') ' ' + write (unit=iun,fmt='(a,1x,f11.4)') ' BOTWIND [ m/s] =',botwind + write (unit=iun,fmt='(a,1x,f11.4)') ' TOPWIND [ m/s] =',topwind + write (unit=iun,fmt='(a,1x,f11.4)') ' ZKLOU [ m] =',z_cup(klou) + write (unit=iun,fmt='(a,1x,f11.4)') ' ZKLFC [ m] =',z_cup(klfc) + write (unit=iun,fmt='(a,1x,f11.4)') ' ZKTOP [ m] =',z_cup(ktop) + write (unit=iun,fmt='(a,1x,f11.4)') ' VSHEAR [m/s/km] =',vshear*1000. + write (unit=iun,fmt='(a,1x,f11.4)') ' PEF_FC [ ---] =',pef_fc + write (unit=iun,fmt='(a,1x,f11.4)') ' PEF_ZF [ ---] =',pef_zf + write (unit=iun,fmt='(a,1x,f11.4)') ' PWAV [ g/kg] =',pwav*1000. + write (unit=iun,fmt='(a,1x,f11.4)') ' PWEV [ g/kg] =',pwev*1000. + write (unit=iun,fmt='(a,1x,f11.4)') ' EDT [ ---] =',edt + write (unit=iun,fmt='(a)') '-----------------------------------------------' + write (unit=iun,fmt='(a)') ' ' + write (unit=iun,fmt='(a)') ' ' + end if + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! return end subroutine grell_efficiency_ensemble diff --git a/BRAMS/src/cuparm/grell_cupar_feedback.f90 b/BRAMS/src/cuparm/grell_cupar_feedback.f90 index 43dffd8ea..0053be459 100644 --- a/BRAMS/src/cuparm/grell_cupar_feedback.f90 +++ b/BRAMS/src/cuparm/grell_cupar_feedback.f90 @@ -12,7 +12,8 @@ subroutine grell_cupar_feedback(mgmzp,maxens_cap,maxens_eff,maxens_lsf,maxens_dy use rconstants , only : day_sec ! ! intent(in) use mem_ensemble , only : ensemble_vars ! ! type - use mem_scratch_grell , only : mkx ! ! intent(out) + use mem_scratch_grell , only : mkx & ! intent(in) + , z_cup ! ! intent(in) implicit none !----- Arguments, input variables. -----------------------------------------------------! integer , intent(in) :: mgmzp ! # of levels @@ -132,8 +133,18 @@ subroutine grell_cupar_feedback(mgmzp,maxens_cap,maxens_eff,maxens_lsf,maxens_dy !---------------------------------------------------------------------------------------! - ! Find the averaged mass fluxes for each static control. ! + ! Find the averaged mass fluxes for each static control. We will average over all ! + ! members. Here we are also doing something slightly different from the original code: ! + ! upmf (the mb term using Grell's notation) is simply the average accross all members, ! + ! not only the positive ones. This should avoid biasing the convection towards the ! + ! strong convective members. The argument here is that if most terms are zero, then ! + ! the environment is unfavourable for convection, so little, if any, convection should ! + ! happen. ! !---------------------------------------------------------------------------------------! + dnmf = 0. + dnmx = 0. + upmf = 0. + upmx = 0. do icap=1,maxens_cap dnmf_cap(icap) = 0. @@ -142,8 +153,12 @@ subroutine grell_cupar_feedback(mgmzp,maxens_cap,maxens_eff,maxens_lsf,maxens_dy do iedt=1,maxens_eff do imbp=1,maxens_lsf do idyn=1,maxens_dyn - dnmf_cap(icap) = dnmf_cap(icap) + dnmf_ens(idyn,imbp,iedt,icap) - upmf_cap(icap) = upmf_cap(icap) + upmf_ens(idyn,imbp,iedt,icap) + dnmf_cap(icap) = dnmf_cap(icap) + max(0.,dnmf_ens(idyn,imbp,iedt,icap)) + upmf_cap(icap) = upmf_cap(icap) + max(0.,upmf_ens(idyn,imbp,iedt,icap)) + dnmf = dnmf + max(0.,dnmf_ens(idyn,imbp,iedt,icap)) + dnmx = dnmx + max(0.,dnmx_ens(idyn,imbp,iedt,icap)) + upmf = upmf + max(0.,upmf_ens(idyn,imbp,iedt,icap)) + upmx = upmx + max(0.,upmx_ens(idyn,imbp,iedt,icap)) end do end do end do @@ -151,49 +166,90 @@ subroutine grell_cupar_feedback(mgmzp,maxens_cap,maxens_eff,maxens_lsf,maxens_dy !----- Normalise the mass fluxes. ---------------------------------------------------! dnmf_cap(icap) = dnmf_cap(icap) * inv_maxens_eld upmf_cap(icap) = upmf_cap(icap) * inv_maxens_eld + !------------------------------------------------------------------------------------! end do !---------------------------------------------------------------------------------------! - + !----- Normalise the mass fluxes. ------------------------------------------------------! + dnmf = dnmf * inv_ensdim + dnmx = dnmx * inv_ensdim + upmf = upmf * inv_ensdim + upmx = upmx * inv_ensdim !---------------------------------------------------------------------------------------! - ! We will average over all members. Here we are also doing something slightly ! - ! different from the original code: upmf (the mb term using Grell's notation) is simply ! - ! the average accross all members, not only the positive ones. This should avoid bias- ! - ! ing the convection towards the strong convective members. The argument here is that ! - ! if most terms are zero, then the environment is unfavourable for convection, so ! - ! little, if any, convection should happen. ! + + + !---------------------------------------------------------------------------------------! - upmf=sum(upmf_ens) * inv_ensdim - if (any(comp_down_cap) .and. upmf > 0) then - !------------------------------------------------------------------------------------! - ! Convection happened and it this cloud supports downdrafts. Find the downdraft ! - ! reference and the ratio between downdrafts and updrafts, and the potential mass ! - ! fluxes if the clouds were the only size that had happened. ! - !------------------------------------------------------------------------------------! - dnmf = sum(dnmf_ens) * inv_ensdim - upmx = sum(upmx_ens) * inv_ensdim - dnmx = sum(dnmx_ens) * inv_ensdim - elseif (upmf == 0.) then + if (upmf == 0. .and. any(ierr_cap == 0)) then !------------------------------------------------------------------------------------! ! Unlikely, but if the reference upward mass flux is zero, that means that there ! ! is no cloud... ! !------------------------------------------------------------------------------------! + + + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> 0.) then edt = dnmf/upmf end if + !---------------------------------------------------------------------------------------! - !----- If the user wants print outs, now that is the time... ---------------------------! - if (print_debug) then + + + + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + ! If the user wants print outs, now that is the time... ! + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! return end subroutine grell_cupar_feedback @@ -576,6 +654,8 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx real :: exner ! Exner fctn. for tend. conv. [ J/kg/K] real :: nmoki ! 1/nmok real :: zhgt ! Height + real :: f_dn ! Fraction for downdraft + real :: f_up ! Fraction for updraft integer :: klod ! Downdraft origin integer :: klou ! Updraft origin integer :: klcl ! Lifting condensation level @@ -583,9 +663,17 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx integer :: kdet ! Origin of downdraft detrainment integer :: klnb ! Cloud top integer :: ktop ! Cloud top + real, dimension(m1) :: cuprliqd ! Cumulus water mixing ratio [ kg/kg] + real, dimension(m1) :: cupriced ! Cumulus ice mixing ratio [ kg/kg] + real, dimension(m1) :: cuprliqu ! Cumulus water mixing ratio [ kg/kg] + real, dimension(m1) :: cupriceu ! Cumulus ice mixing ratio [ kg/kg] !----- Aux. variables for fractional area. ---------------------------------------------! real, dimension(m1,maxens_cap) :: cuprliq_cap ! Cumulus water mixing ratio [ kg/kg] real, dimension(m1,maxens_cap) :: cuprice_cap ! Cumulus ice mixing ratio [ kg/kg] + real, dimension(m1,maxens_cap) :: cuprliqd_cap ! Cumulus water mixing ratio [ kg/kg] + real, dimension(m1,maxens_cap) :: cupriced_cap ! Cumulus ice mixing ratio [ kg/kg] + real, dimension(m1,maxens_cap) :: cuprliqu_cap ! Cumulus water mixing ratio [ kg/kg] + real, dimension(m1,maxens_cap) :: cupriceu_cap ! Cumulus ice mixing ratio [ kg/kg] !----- Local constants, for debugging. -------------------------------------------------! integer :: iun logical , parameter :: print_debug=.false. @@ -595,27 +683,35 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx !---------------------------------------------------------------------------------------! ! Flushing all variables to zero in case convection didn't happen. ! !---------------------------------------------------------------------------------------! - thsrc = 0. - rtsrc = 0. - co2src = 0. - cuprliq = 0. - cuprice = 0. - cuprliq_cap = 0. - cuprice_cap = 0. - - areadn = 0. - areaup = 0. - conprr = 0. - zkdt = 0. - zklou = 0. - zklcl = 0. - zklfc = 0. - zklod = 0. - zklnb = 0. - zktop = 0. - wdndraft = 0. - wupdraft = 0. - wbuoymin = 0. + thsrc = 0. + rtsrc = 0. + co2src = 0. + cuprliq = 0. + cuprice = 0. + cuprliqd = 0. + cupriced = 0. + cuprliqu = 0. + cupriceu = 0. + cuprliq_cap = 0. + cuprice_cap = 0. + cuprliqd_cap = 0. + cupriced_cap = 0. + cuprliqu_cap = 0. + cupriceu_cap = 0. + + areadn = 0. + areaup = 0. + conprr = 0. + zkdt = 0. + zklou = 0. + zklcl = 0. + zklfc = 0. + zklod = 0. + zklnb = 0. + zktop = 0. + wdndraft = 0. + wupdraft = 0. + wbuoymin = 0. !---------------------------------------------------------------------------------------! ! Find the number of clouds and the cloud mask. ! @@ -691,18 +787,33 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx if (ierr_cap(icap) == 0) then !---------------------------------------------------------------------------------! - ! I compute the cloud condensed mixing ratio for this realisation. This is ! - ! used by Harrington when cumulus feedback is requested, so we rescale the liquid ! - ! water at the downdrafts and updrafts by their area. ! + ! Find the fraction due to downdrafts and updrafts. ! + !---------------------------------------------------------------------------------! + f_dn = areadn_cap(icap) / (areadn_cap(icap) + areaup_cap(icap)) + f_up = areaup_cap(icap) / (areadn_cap(icap) + areaup_cap(icap)) !---------------------------------------------------------------------------------! - do k=1,ktop_cap(icap) + + + + !---------------------------------------------------------------------------------! + ! Compute the cloud condensed mixing ratio for this realisation. This is used ! + ! by Harrington when cumulus feedback is requested, so we rescale the liquid ! + ! water at the downdrafts and updrafts by their area. Levels outside the cloud ! + ! range may contain environment values, and we don't want to double account. ! + !---------------------------------------------------------------------------------! + do k=1,klod_cap(icap) + kr=k+kgoff + cuprliq_cap (kr,icap) = cuprliq_cap (kr,icap) + qliqd_cld_cap(k,icap) * f_dn + cuprice_cap (kr,icap) = cuprice_cap (kr,icap) + qiced_cld_cap(k,icap) * f_dn + cuprliqd_cap(kr,icap) = qliqd_cld_cap(k,icap) + cupriced_cap(kr,icap) = qiced_cld_cap(k,icap) + end do + do k=klou_cap(icap),ktop_cap(icap) kr=k+kgoff - cuprliq_cap(kr,icap) = max(0., ( qliqd_cld_cap(k,icap) * areadn_cap(icap) & - + qliqu_cld_cap(k,icap) * areaup_cap(icap) ) & - / (areadn_cap(icap) + areaup_cap(icap) ) ) - cuprice_cap(kr,icap) = max(0., ( qiced_cld_cap(k,icap) * areadn_cap(icap) & - + qiceu_cld_cap(k,icap) * areaup_cap(icap) ) & - / (areadn_cap(icap) + areaup_cap(icap) ) ) + cuprliq_cap (kr,icap) = cuprliq_cap (kr,icap) + qliqu_cld_cap(k,icap) * f_up + cuprice_cap (kr,icap) = cuprice_cap (kr,icap) + qiceu_cld_cap(k,icap) * f_up + cuprliqu_cap(kr,icap) = qliqu_cld_cap(k,icap) + cupriceu_cap(kr,icap) = qiceu_cld_cap(k,icap) end do end if end do stacloop @@ -718,8 +829,12 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx wbuoymin = sum(wbuoymin_cap) * nmoki do icap=1,maxens_cap do kr=1,m1 - cuprliq(kr) = cuprliq(kr) + cuprliq_cap(kr,icap) * nmoki - cuprice(kr) = cuprice(kr) + cuprice_cap(kr,icap) * nmoki + cuprliq (kr) = cuprliq (kr) + cuprliq_cap (kr,icap) * nmoki + cuprice (kr) = cuprice (kr) + cuprice_cap (kr,icap) * nmoki + cuprliqd(kr) = cuprliqd(kr) + cuprliqd_cap(kr,icap) * nmoki + cupriced(kr) = cupriced(kr) + cupriced_cap(kr,icap) * nmoki + cuprliqu(kr) = cuprliqu(kr) + cuprliqu_cap(kr,icap) * nmoki + cupriceu(kr) = cupriceu(kr) + cupriceu_cap(kr,icap) * nmoki end do end do !---------------------------------------------------------------------------------------! @@ -731,7 +846,7 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx ! characteristics. ! !---------------------------------------------------------------------------------------! if (print_debug) then - write(unit=20+icld,fmt='(92a)' ) ('-',k=1,92) + write(unit=20+icld,fmt='(143a)' ) ('-',k=1,143) write(unit=20+icld,fmt='(a)' ) '' write(unit=20+icld,fmt='(a,1x,i5)' ) ' I =',i write(unit=20+icld,fmt='(a,1x,i5)' ) ' J =',j @@ -756,22 +871,27 @@ subroutine grell_cupar_output(m1,mgmzp,maxens_cap,rtgt,zm,zt,dnmf,upmf,dnmx,upmx write(unit=20+icld,fmt='(a,1x,es12.5)' ) ' WBUOYMIN =',wbuoymin write(unit=20+icld,fmt='(a,1x,es12.5)' ) ' CONPRR =',conprr * day_sec write(unit=20+icld,fmt='(a)' ) '' - write(unit=20+icld,fmt='(7(a,1x))') ' K',' HEIGHT',' THSRC' & + write(unit=20+icld,fmt='(11(a,1x))') ' K',' HEIGHT',' THSRC' & ,' RTSRC',' CO2SRC',' CUPRICE' & - ,' CUPRLIQ' - write(unit=20+icld,fmt='(92(a))') ('-',k=1,92) + ,' CUPRLIQ',' CUPRICE_DN',' CUPRLIQ_DN' & + ,' CUPRICE_UP',' CUPRLIQ_UP' + write(unit=20+icld,fmt='(143(a))') ('-',k=1,143) do k=m1,1,-1 zhgt = ( zt(k+kgoff) - zm(kgoff) ) * rtgt - write (unit=20+icld,fmt='(i12,1x,f12.2,1x,5(es12.5,1x))') & + write (unit=20+icld,fmt='(i12,1x,f12.2,1x,9(es12.5,1x))') & k & , zhgt & - , thsrc (k) * day_sec & - , rtsrc (k) * day_sec * 1000. & - , co2src (k) * day_sec & - , cuprice(k) * 1000. & - , cuprliq(k) * 1000. + , thsrc (k) * day_sec & + , rtsrc (k) * day_sec*1000. & + , co2src (k) * day_sec & + , cuprice(k) * 1000. & + , cuprliq(k) * 1000. & + , cupriced(k) * 1000. & + , cuprliqd(k) * 1000. & + , cupriceu(k) * 1000. & + , cuprliqu(k) * 1000. end do - write(unit=20+icld,fmt='(92(a))') ('-',k=1,92) + write(unit=20+icld,fmt='(143(a))') ('-',k=1,143) write(unit=20+icld,fmt='(a)' ) '' end if !---------------------------------------------------------------------------------------! diff --git a/BRAMS/src/cuparm/grell_cupar_static.f90 b/BRAMS/src/cuparm/grell_cupar_static.f90 index 80693b312..416d19b29 100644 --- a/BRAMS/src/cuparm/grell_cupar_static.f90 +++ b/BRAMS/src/cuparm/grell_cupar_static.f90 @@ -181,7 +181,8 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ,theivs_cup & ! intent(out) - Sat. Ice-vapour equiv. pot. temp. w/ forcing[ K] ,wbuoymin0 & ! intent(out) - Updraft Minimum buoyant velocity [ m/s] ,wbuoymin ! ! intent(out) - Minimum buoyancy velocity [ ---] - use rconstants, only : toodry + use rconstants, only : toodry & ! intent(in) + , t00 ! ! intent(in) use therm_lib , only : toler implicit none @@ -294,6 +295,7 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap integer :: klnb0 ! klnb, but it is just a dummy variable. integer :: ktop0 ! ktop, but it is just a dummy variable. integer :: iun ! Unit number, for debugging only + integer :: l ! Counter for drawing lines logical :: comp_dn0 ! Flag for downdraft !---------------------------------------------------------------------------------------! ! Miscellaneous parameters ! @@ -307,7 +309,8 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap !----- String for sanity check. --------------------------------------------------------! character(len=str_len) :: which !----- Parameter to print debug stuff. -------------------------------------------------! - logical, parameter :: print_debug=.false. + logical , parameter :: print_debug = .false. + character(len=11) :: levname !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! @@ -399,7 +402,7 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ! ting all to a non-sense value to make the point that convection did not happen. ! !------------------------------------------------------------------------------------! klod = 0 - klou = 0 + klou = 1 klcl = 0 klfc = 0 kdet = 0 @@ -436,7 +439,7 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ![[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[! !------------------------------------------------------------------------------------! - ! I. Finding some updraft properties, namely the levels in which updrafts originate, ! + ! I. Find some updraft properties, namely the levels in which updrafts originate, ! ! the level of free convection and the cloud top, and the updraft-related energy, ! ! mass, and moisture properties. ! !------------------------------------------------------------------------------------! @@ -454,6 +457,7 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap !------------------------------------------------------------------------------------! call grell_updraft_origin(mkx,mgmzp,iupmethod,kpbl,kbmax,z,wwind,sigw,tke,qice,qliq & ,theiv_cup,ierr,klou) + !------------------------------------------------------------------------------------! if (ierr /= 0) then @@ -466,12 +470,12 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ! a. This call may end up preventing convection, so I must check after the call ! ! b. This subroutine may also affect the updraft originating level. ! !------------------------------------------------------------------------------------! - call grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wbuoy_max,wwind,sigw,exner_cup & - ,p_cup,theiv_cup,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup & - ,qice_cup,qsat_cup,co2_cup,rho_cup,dzd_cld,mentru_rate & - ,theivu_cld,thilu_cld,tu_cld,qtotu_cld,qvapu_cld,qliqu_cld & - ,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld,dbyu,klou,ierr,klcl & - ,klfc,wbuoymin) + call grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wbuoy_max,wwind,sigw,z_cup & + ,exner_cup,p_cup,theiv_cup,thil_cup,t_cup,qtot_cup,qvap_cup & + ,qliq_cup,qice_cup,qsat_cup,co2_cup,rho_cup,dzd_cld & + ,mentru_rate,theivu_cld,thilu_cld,tu_cld,qtotu_cld & + ,qvapu_cld,qliqu_cld,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld & + ,dbyu,klou,ierr,klcl,klfc,wbuoymin) if (ierr /= 0) then ierr_cap(icap) = ierr @@ -502,29 +506,36 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap !------------------------------------------------------------------------------------! call grell_theiv_updraft(mkx,mgmzp,klou,klfc,cdu,mentru_rate,theiv,theiv_cup,dzu_cld & ,theivu_cld) + !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! - ! 7. Find the normalized mass fluxes associated with updrafts. Since we are using ! + ! 7. Find the normalized mass fluxes associated with updrafts. Since we are using ! ! height-based vertical coordinate, there is no need to find the forced ! ! normalized mass flux, they'll be the same, so just copy it afterwards. ! !------------------------------------------------------------------------------------! call grell_nms_updraft(mkx,mgmzp,klou,klfc,ktpse,mentru_rate,cdu,dzu_cld,etau_cld) + !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! ! 8. Find the moisture profiles associated with updrafts, and check whether the ! ! profile makes sense or not. ! !------------------------------------------------------------------------------------! - call grell_most_thermo_updraft(prec_cld,.true.,mkx,mgmzp,klfc,ktpse & - ,cld2prec,cdu,mentru_rate,qtot,co2,p_cup,exner_cup & + write(which,fmt='(2(a,i4.4))') 'extrap_updraft_icap=',icap,'_icld=',icld + call grell_most_thermo_updraft(prec_cld,.true.,mkx,mgmzp,klfc,ktpse,cld2prec,cdu & + ,mentru_rate,qtot,co2,z_cup,p_cup,exner_cup & ,theiv_cup,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup & ,qice_cup,qsat_cup,co2_cup,rho_cup,theivu_cld,etau_cld & ,dzu_cld,thilu_cld,tu_cld,qtotu_cld,qvapu_cld & ,qliqu_cld,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld,dbyu & - ,pwu_cld,pwav,klnb,ktop,ierr) - write(which,fmt='(2(a,i4.4))') 'extrap_updraft_icap=',icap,'_icld=',icld + ,pwu_cld,pwav,klnb,ktop,ierr,which) call grell_sanity_check(mkx,mgmzp,z_cup,p_cup,exner_cup,theivu_cld,thilu_cld,tu_cld & ,qtotu_cld,qvapu_cld,qliqu_cld,qiceu_cld,co2u_cld,rhou_cld & ,which) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! ! 9. Check whether we found a cloud top. Since this may keep convection to ! @@ -543,6 +554,9 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ierr_cap(icap) = 7 cycle stacloop end if + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! !10. Find the cloud work function associated with updrafts. If this cloud doesn't ! @@ -551,13 +565,93 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap call grell_cldwork_updraft(mkx,mgmzp,klou,ktop,dbyu,dzu_cld,etau_cld,aau) if (aau == 0.) then ierr_cap(icap) = 10 + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + if (print_debug) then + iun=icld+80 + write(unit=iun,fmt='(348a)') ('=',l=1,348) + write(unit=iun,fmt='(348a)') ('=',l=1,348) + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' I =',i + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' J =',j + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' IEDT =',iedt + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' ICAP =',icap + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOU =',z(klou),klou + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLCL =',z(klcl),klcl + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLFC =',z(klfc),klfc + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KDET =',z(kdet),kdet + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOD =',z(klod),klod + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLNB =',z(klnb),klnb + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KTOP =',z(ktop),ktop + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' PWAV =',pwav + write(unit=iun,fmt='(348a)') ('-',l=1,348) + write(unit=iun,fmt='(29(1x,a))') & + ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVU_CLD' & + ,' T',' T_CUP',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOU_CLD' & + ,' PWU_CLD',' PW_TOT' + write(unit=iun,fmt='(348a)') ('-',l=1,348) + do k=mkx,1,-1 + if (k == ktop) then + levname = ' TOP' + elseif (k == klnb) then + levname = ' LNB' + elseif (k == klfc) then + levname = ' LFC' + elseif (k == klou) then + levname = ' LOU' + elseif (k == klcl) then + levname = ' LCL' + else + levname = ' ' + end if + + write (unit=iun,fmt='(1x,a,28(1x,f11.4))') levname,z_cup(k) & + ,0.01*p_cup(k),thil(k),thil_cup(k),thilu_cld(k),theiv(k) & + ,theiv_cup(k),theivd_cld(k),t(k)-t00,t_cup(k)-t00 & + ,tu_cld(k)-t00,1000.*qtot(k),1000.*qtot_cup(k) & + ,1000.*qtotu_cld(k),co2(k),co2_cup(k) & + ,co2u_cld(k),1000.*qvap(k),1000.*qvap_cup(k) & + ,1000.*qvapu_cld(k),1000.*(qliq(k)+qice(k)) & + ,1000.*(qliq_cup(k)+qice_cup(k)) & + ,1000.*(qliqu_cld(k)+qiceu_cld(k)),rho(k),rho_cup(k) & + ,rhou_cld(k),1000.*pwu_cld(k),1000.*pw_eff(k,iedt,icap) + end do + write(unit=iun,fmt='(348a)') ('-',l=1,348) + write(unit=iun,fmt='(29(1x,a))') & + ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVU_CLD' & + ,' T',' T_CUP',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOU_CLD' & + ,' PWU_CLD',' PW_TOT' + write(unit=iun,fmt='(348a)') ('=',l=1,348) + write(unit=iun,fmt='(348a)') ('=',l=1,348) + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + end if + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! cycle stacloop end if - !]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]! + ![[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[! !------------------------------------------------------------------------------------! ! J. Find the downdraft counterpart of the above properties, namely where the ! @@ -597,32 +691,41 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap + (1. - (pmass_kept*z_cup(k) + pmass_left*z_cup(kdet)) & / (pmass_kept*z_cup(k+1) + pmass_left*z_cup(kdet)) )/dzd_cld(k) end do + !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! ! 4. Normalised mass fluxes. ! !---------------------------------------------------------------------------------! call grell_nms_downdraft(mkx,mgmzp,kdet,klod,mentrd_rate,cdd,z_cup,dzd_cld & ,etad_cld) + !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! ! 5. Moist static energy. ! !---------------------------------------------------------------------------------! call grell_theiv_downdraft(mkx,mgmzp,klod,cdd,mentrd_rate,theiv,theiv_cup & ,theivs_cup,dzd_cld,theivd_cld) + !---------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------! ! 6. Moisture properties of downdraft, and its sanity check. Besides the thermo- ! ! dynamics, we must check whether buoyancy makes sense, in case it doesn't we ! ! will assign an error flag to this cloud and don't let it happen. ! !---------------------------------------------------------------------------------! - call grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,p_cup & - ,exner_cup,thil_cup,t_cup,qtot_cup,qvap_cup & + write(which,fmt='(2(a,i4.4))') 'extrap_downdraft_icap=',icap,'_icld=',icld + call grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot,co2,mentrd_rate,cdd,z_cup & + ,p_cup,exner_cup,thil_cup,t_cup,qtot_cup,qvap_cup & ,qliq_cup,qice_cup,qsat_cup,co2_cup,rho_cup,pwav & ,theivd_cld,etad_cld,dzd_cld,thild_cld,td_cld & ,qtotd_cld,qvapd_cld,qliqd_cld,qiced_cld & ,qsatd_cld,co2d_cld,rhod_cld,dbyd,pwd_cld,pwev & - ,ierr) - write(which,fmt='(2(a,i4.4))') 'extrap_downdraft_icap=',icap,'_icld=',icld + ,ierr,which) call grell_sanity_check(mkx,mgmzp,z_cup,p_cup,exner_cup,theivd_cld,thild_cld & ,td_cld,qtotd_cld,qvapd_cld,qliqd_cld,qiced_cld,co2d_cld & ,rhod_cld,which) @@ -630,6 +733,7 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ierr_cap(icap) = ierr cycle stacloop end if + !---------------------------------------------------------------------------------! !---------------------------------------------------------------------------------! ! 7. Compute the downdraft strength in terms of windshear. Remembering that edt ! @@ -637,8 +741,8 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap !---------------------------------------------------------------------------------! call grell_efficiency_ensemble(mkx,mgmzp,maxens_eff,klou,klfc,klnb,edtmin,edtmax & ,pwav,pwev,z_cup,uwind,vwind,dzd_cld & - ,edt_eff(:,icap)) - !------------------------------------------------------------------------------------! + ,edt_eff(:,icap),icld,icap) + !---------------------------------------------------------------------------------! @@ -647,10 +751,101 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ! downdraft is always saturated, and it gets the moisture from the rain. How- ! ! ever, it cannot require more rain than what is available, so if that would ! ! be the case, we don't allow this cloud to exist. ! - !------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------! ddcheckloop: do iedt = 1, maxens_eff if (pwav + edt_eff(iedt,icap) * pwev < 0. ) then ierr_cap(icap) = 9 + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! + if (print_debug) then + iun=icld+90 + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' I =',i + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' J =',j + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' IEDT =',iedt + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' ICAP =',icap + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOU =',z(klou),klou + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLCL =',z(klcl),klcl + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLFC =',z(klfc),klfc + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KDET =',z(kdet),kdet + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOD =',z(klod),klod + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLNB =',z(klnb),klnb + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KTOP =',z(ktop),ktop + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' PWAV =',pwav + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' PWEV =',pwev + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' EDT =',edt + write(unit=iun,fmt='(504a)') ('-',l=1,504) + write(unit=iun,fmt='(42(1x,a))') & + ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILD_CLD',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVD_CLD',' THEIVU_CLD' & + ,' T',' T_CUP',' TD_CLD',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTD_CLD',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2D_CLD',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPD_CLD',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCOND_CLD',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOD_CLD',' RHOU_CLD' & + ,' PWD_CLD',' PWU_CLD',' PW_TOT' & + ,' DELLA_THIL','DELLA_THEIV',' DELLA_QTOT',' DELLA_CO2' + write(unit=iun,fmt='(504a)') ('-',l=1,504) + do k=mkx,1,-1 + if (k == ktop) then + levname = ' TOP' + elseif (k == klnb) then + levname = ' LNB' + elseif (k == klod) then + levname = ' LOD' + elseif (k == kdet) then + levname = ' DET' + elseif (k == klfc) then + levname = ' LFC' + elseif (k == klou) then + levname = ' LOU' + elseif (k == klcl) then + levname = ' LCL' + else + levname = ' ' + end if + + write (unit=iun,fmt='(1x,a,41(1x,f11.4))') levname,z_cup(k) & + ,0.01*p_cup(k),thil(k),thil_cup(k),thild_cld(k),thilu_cld(k),theiv(k) & + ,theiv_cup(k),theivd_cld(k),theivu_cld(k),t(k)-t00,t_cup(k)-t00 & + ,td_cld(k)-t00,tu_cld(k)-t00,1000.*qtot(k),1000.*qtot_cup(k) & + ,1000.*qtotd_cld(k),1000.*qtotu_cld(k),co2(k),co2_cup(k),co2d_cld(k) & + ,co2u_cld(k),1000.*qvap(k),1000.*qvap_cup(k),1000.*qvapd_cld(k) & + ,1000.*qvapu_cld(k),1000.*(qliq(k)+qice(k)) & + ,1000.*(qliq_cup(k)+qice_cup(k)),1000.*(qliqd_cld(k)+qiced_cld(k)) & + ,1000.*(qliqu_cld(k)+qiceu_cld(k)),rho(k),rho_cup(k),rhod_cld(k) & + ,rhou_cld(k),1000.*pwd_cld(k),1000.*pwu_cld(k) & + ,1000.*pw_eff(k,iedt,icap),dellathil_eff(k,iedt,icap) & + ,dellatheiv_eff(k,iedt,icap),1000*dellaqtot_eff(k,iedt,icap) & + ,dellaco2_eff(k,iedt,icap) + end do + write(unit=iun,fmt='(504a)') ('-',l=1,504) + write(unit=iun,fmt='(42(1x,a))') & + ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILD_CLD',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVD_CLD',' THEIVU_CLD' & + ,' T',' T_CUP',' TD_CLD',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTD_CLD',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2D_CLD',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPD_CLD',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCOND_CLD',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOD_CLD',' RHOU_CLD' & + ,' PWD_CLD',' PWU_CLD',' PW_TOT' & + ,' DELLA_THIL','DELLA_THEIV',' DELLA_QTOT',' DELLA_CO2' + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + end if + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! cycle stacloop end if end do ddcheckloop @@ -727,11 +922,12 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ! iv. Calculate the thermodynamic properties below the level of free convec- ! ! tion. ! !---------------------------------------------------------------------------------! - call grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,exner0_cup,p0_cup,theiv0_cup & + write(which,fmt='(2(a,i4.4))') 'buoy_below_lfc_icap=',icap,'_icld=',icld + call grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,z_cup,exner0_cup,p0_cup,theiv0_cup & ,thil0_cup,t0_cup,qtot0_cup,qvap0_cup,qliq0_cup & ,qice0_cup,qsat0_cup,co20_cup,rho0_cup,theiv0u_cld & ,thil0u_cld,t0u_cld,qtot0u_cld,qvap0u_cld,qliq0u_cld & - ,qice0u_cld,qsat0u_cld,co20u_cld,rho0u_cld,dby0u) + ,qice0u_cld,qsat0u_cld,co20u_cld,rho0u_cld,dby0u,which) !---------------------------------------------------------------------------------! ! v. Calculate the incloud ice-vapour equivalent potential temperature ! @@ -743,15 +939,15 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ! vi. Find the moisture profiles associated with updrafts, and check whether ! ! they make sense or not. ! !---------------------------------------------------------------------------------! + write(which,fmt='(2(a,i4.4))') 'zero_updraft_icap=',icap call grell_most_thermo_updraft(comp_down_cap(icap),.false.,mkx,mgmzp,klfc,ktop & - ,cld2prec,cdu,mentru_rate,qtot0,co20,p0_cup & + ,cld2prec,cdu,mentru_rate,qtot0,co20,z_cup,p0_cup & ,exner0_cup,theiv0_cup,thil0_cup,t0_cup,qtot0_cup & ,qvap0_cup,qliq0_cup,qice0_cup,qsat0_cup,co20_cup & ,rho0_cup,theiv0u_cld,etau_cld,dzu_cld,thil0u_cld & ,t0u_cld,qtot0u_cld,qvap0u_cld,qliq0u_cld & ,qice0u_cld,qsat0u_cld,co20u_cld,rho0u_cld,dby0u & - ,pw0u_cld,pwav0,klnb0,ktop0,ierr0) - write(which,fmt='(2(a,i4.4))') 'zero_updraft_icap=',icap + ,pw0u_cld,pwav0,klnb0,ktop0,ierr0,which) call grell_sanity_check(mkx,mgmzp,z_cup,p0_cup,exner0_cup,theiv0u_cld,thil0u_cld & ,t0u_cld,qtot0u_cld,qvap0u_cld,qliq0u_cld,qice0u_cld & ,co20u_cld,rho0u_cld,which) @@ -772,15 +968,15 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap !------------------------------------------------------------------------------! ! ix. Moisture properties of downdraft ! !------------------------------------------------------------------------------! - call grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot0,co20,mentrd_rate,cdd & - ,p0_cup,exner0_cup,thil0_cup,t0_cup,qtot0_cup & - ,qvap0_cup,qliq0_cup,qice0_cup,qsat0_cup & - ,co20_cup,rho0_cup,pwav0,theiv0d_cld,etad_cld & - ,dzd_cld,thil0d_cld,t0d_cld,qtot0d_cld & - ,qvap0d_cld,qliq0d_cld,qice0d_cld,qsat0d_cld & - ,co20d_cld,rho0d_cld,dby0d,pw0d_cld,pwev0 & - ,ierr0) write(which,fmt='(a,i4.4)') 'zero_downdraft_icap=',icap + call grell_most_thermo_downdraft(mkx,mgmzp,klod,qtot0,co20,mentrd_rate,cdd & + ,z_cup,p0_cup,exner0_cup,thil0_cup,t0_cup & + ,qtot0_cup,qvap0_cup,qliq0_cup,qice0_cup & + ,qsat0_cup,co20_cup,rho0_cup,pwav0,theiv0d_cld & + ,etad_cld,dzd_cld,thil0d_cld,t0d_cld & + ,qtot0d_cld,qvap0d_cld,qliq0d_cld,qice0d_cld & + ,qsat0d_cld,co20d_cld,rho0d_cld,dby0d,pw0d_cld & + ,pwev0,ierr0,which) call grell_sanity_check(mkx,mgmzp,z_cup,p0_cup,exner0_cup,theiv0d_cld & ,thil0d_cld,t0d_cld,qtot0d_cld,qvap0d_cld,qliq0d_cld & ,qice0d_cld,co20d_cld,rho0d_cld,which) @@ -861,56 +1057,110 @@ subroutine grell_cupar_static(comp_noforc_cldwork,checkmass,iupmethod,maxens_cap ,dzd_cld,etad_cld,etau_cld,co2d_cld,co2u_cld & ,dellaco2_eff(:,iedt,icap)) + !---------------------------------------------------------------------------------! + ! 5. Computing the rainfall flux, which will be simply all the fall-out water ! + ! that wasn't consumed by the downdrafts. ! + !---------------------------------------------------------------------------------! + do k=1,ktop + !------ Precipitation ---------------------------------------------------------! + pw_eff(k,iedt,icap) = pwu_cld(k) + edt * pwd_cld(k) + end do + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! if (print_debug) then - iun=mynum+20 - write(unit=iun,fmt='(a)') '---------------------------------------------------' - write(unit=iun,fmt='(2(a,1x,i5,1x))') ' I=',i,'J=',icap - write(unit=iun,fmt='(2(a,1x,i5,1x))') ' IEDT=',iedt,'ICAP=',icap - write(unit=iun,fmt='(7(a,1x,f10.4,1x))') ' KLOU =',z(klou) & - ,'KLCL =',z(klcl) & - ,'KLFC =',z(klfc) & - ,'KDET =',z(kdet) & - ,'KLOD =',z(klod) & - ,'KLNB =',z(klnb) & - ,'KTOP =',z(ktop) - write(unit=iun,fmt='(a,34(1x,a))') 'Level' & - ,' THIL',' THIL0',' THIL_CUP',' THILD_CLD',' THILD_CLD' & - ,' THEIV',' THEIV0',' THEIV_CUP',' THEIVD_CLD',' THEIVD_CLD' & - ,' QTOT',' QTOT0',' QTOT_CUP',' QTOTD_CLD',' QTOTU_CLD' & - ,' QVAP',' QVAP0',' QVAP_CUP',' QVAPD_CLD',' QVAPU_CLD' & - ,' QLIQ',' QLIQ0',' QLIQ_CUP',' QLIQD_CLD',' QLIQU_CLD' & - ,' QICE',' QICE0',' QICE_CUP',' QICED_CLD',' QICEU_CLD' & - ,' CO2',' CO20',' CO2_CUP',' CO2D_CLD',' CO2U_CLD' & - ,' DELLA_THIL','DELLA_THEIV',' DELLA_QTOT',' DELLA_CO2' - do k=1,mkx - write(unit=iun,fmt='(i5,34(1x,es12.5))') & - k, thil(k), thil0(k), thil_cup(k), thild_cld(k), thilu_cld(k) & - ,theiv(k),theiv0(k),theiv_cup(k),theivd_cld(k),theivu_cld(k) & - , qtot(k), qtot0(k), qtot_cup(k), qtotd_cld(k), qtotu_cld(k) & - , qvap(k), qvap0(k), qvap_cup(k), qvapd_cld(k), qvapu_cld(k) & - , qliq(k), qliq0(k), qliq_cup(k), qliqd_cld(k), qliqu_cld(k) & - , qice(k), qice0(k), qice_cup(k), qiced_cld(k), qiceu_cld(k) & - , co2(k), co20(k), co2_cup(k), co2d_cld(k), co2u_cld(k) & - ,dellathil_eff(k,iedt,icap),dellatheiv_eff(k,iedt,icap) & - ,dellaqtot_eff(k,iedt,icap),dellaco2_eff(k,iedt,icap) + iun=icld+70 + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' I =',i + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' J =',j + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' IEDT =',iedt + write(unit=iun,fmt='((a,1x,i5,1x))' ) ' ICAP =',icap + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOU =',z(klou),klou + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLCL =',z(klcl),klcl + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLFC =',z(klfc),klfc + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KDET =',z(kdet),kdet + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLOD =',z(klod),klod + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KLNB =',z(klnb),klnb + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' KTOP =',z(ktop),ktop + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' PWAV =',pwav + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' PWEV =',pwev + write(unit=iun,fmt='(a,1x,f10.4,1x,i5)') ' EDT =',edt + write(unit=iun,fmt='(504a)') ('-',l=1,504) + write(unit=iun,fmt='(a,3(1x,a))' ) ' Type' ,' AA_DOWN',' AA_UP' & + ,' AA_TOT' + write(unit=iun,fmt='(a,3(1x,f11.4))') ' Zero',aa0d,aa0u,aatot0_eff(iedt,icap) + write(unit=iun,fmt='(a,3(1x,f11.4))') ' One ',aad ,aau ,aatot_eff (iedt,icap) + write(unit=iun,fmt='(504a)') ('-',l=1,504) + write(unit=iun,fmt='(42(1x,a))') ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILD_CLD',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVD_CLD',' THEIVU_CLD' & + ,' T',' T_CUP',' TD_CLD',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTD_CLD',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2D_CLD',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPD_CLD',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCOND_CLD',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOD_CLD',' RHOU_CLD' & + ,' PWD_CLD',' PWU_CLD',' PW_TOT' & + ,' DELLA_THIL','DELLA_THEIV',' DELLA_QTOT',' DELLA_CO2' + write(unit=iun,fmt='(504a)') ('-',l=1,504) + do k=mkx,1,-1 + if (k == ktop) then + levname = ' TOP' + elseif (k == klnb) then + levname = ' LNB' + elseif (k == klod) then + levname = ' LOD' + elseif (k == kdet) then + levname = ' DET' + elseif (k == klfc) then + levname = ' LFC' + elseif (k == klou) then + levname = ' LOU' + elseif (k == klcl) then + levname = ' LCL' + else + levname = ' ' + end if + + write(unit=iun,fmt='(1x,a,41(1x,f11.4))') levname,z_cup(k),0.01*p_cup(k) & + , thil(k), thil_cup(k), thild_cld(k), thilu_cld(k) & + , theiv(k), theiv_cup(k), theivd_cld(k), theivu_cld(k) & + , t(k)-t00, t_cup(k)-t00, td_cld(k)-t00, tu_cld(k)-t00 & + ,1000.*qtot(k),1000.*qtot_cup(k),1000.*qtotd_cld(k),1000.*qtotu_cld(k) & + , co2(k), co2_cup(k), co2d_cld(k), co2u_cld(k) & + ,1000.*qvap(k),1000.*qvap_cup(k),1000.*qvapd_cld(k),1000.*qvapu_cld(k) & + ,1000.*(qliq(k)+qice(k)),1000.*(qliq_cup(k)+qice_cup(k)) & + ,1000.*(qliqd_cld(k)+qiced_cld(k)),1000.*(qliqu_cld(k)+qiceu_cld(k)) & + , rho(k), rho_cup(k), rhod_cld(k), rhou_cld(k) & + ,1000.*pwd_cld(k),1000.*pwu_cld(k),1000.*pw_eff(k,iedt,icap) & + ,dellathil_eff(k,iedt,icap) ,dellatheiv_eff(k,iedt,icap) & + ,1000*dellaqtot_eff(k,iedt,icap),dellaco2_eff(k,iedt,icap) end do - write(unit=iun,fmt='(a)') '---------------------------------------------------' + write(unit=iun,fmt='(504a)') ('-',l=1,504) + write(unit=iun,fmt='(42(1x,a))') ' LEVEL',' Z_CUP',' P_CUP' & + ,' THIL',' THIL_CUP',' THILD_CLD',' THILU_CLD' & + ,' THEIV',' THEIV_CUP',' THEIVD_CLD',' THEIVU_CLD' & + ,' T',' T_CUP',' TD_CLD',' TU_CLD' & + ,' QTOT',' QTOT_CUP',' QTOTD_CLD',' QTOTU_CLD' & + ,' CO2',' CO2_CUP',' CO2D_CLD',' CO2U_CLD' & + ,' QVAP',' QVAP_CUP',' QVAPD_CLD',' QVAPU_CLD' & + ,' QCON',' QCON_CUP',' QCOND_CLD',' QCONU_CLD' & + ,' RHO',' RHO_CUP',' RHOD_CLD',' RHOU_CLD' & + ,' PWD_CLD',' PWU_CLD',' PW_TOT' & + ,' DELLA_THIL','DELLA_THEIV',' DELLA_QTOT',' DELLA_CO2' + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(504a)') ('=',l=1,504) + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' + write(unit=iun,fmt='(a)') ' ' write(unit=iun,fmt='(a)') ' ' end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - - !---------------------------------------------------------------------------------! - ! 5. Computing the rainfall flux, which will be simply all the fall-out water ! - ! that wasn't consumed by the downdrafts. ! - !---------------------------------------------------------------------------------! - do k=1,ktop - !------ Precipitation ---------------------------------------------------------! - pw_eff(k,iedt,icap) = pwu_cld(k) + edt * pwd_cld(k) - end do end do effloop !]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]]! diff --git a/BRAMS/src/cuparm/grell_cupar_updraft.f90 b/BRAMS/src/cuparm/grell_cupar_updraft.f90 index bfc3b7156..af8cb7e67 100644 --- a/BRAMS/src/cuparm/grell_cupar_updraft.f90 +++ b/BRAMS/src/cuparm/grell_cupar_updraft.f90 @@ -40,7 +40,7 @@ subroutine grell_updraft_origin(mkx,mgmzp,iupmethod,kpbl,kbmax,z,wwind,sigw,tke, real, dimension(mgmzp) :: wboth ! Combination of w and sigw [ m/s] integer :: kpblloc ! Local PBL top level [ ---] !----- Constant. Avoding using too levels too close to the surface ---------------------! - integer , parameter :: kstart=2 ! Minimum level + integer , parameter :: kstart=3 ! Minimum level !---------------------------------------------------------------------------------------! @@ -71,7 +71,7 @@ subroutine grell_updraft_origin(mkx,mgmzp,iupmethod,kpbl,kbmax,z,wwind,sigw,tke, case (4) ! Combined mechanical forcing and turbulent if (kpbl /= 0) then ! Nakanishi and Niino is used, sigw is available wboth = wwind + sigw - klou = (kstart-1) + maxloc(wboth(kstart:kpbl),dim=1) + klou = max(kstart,maxloc(wboth(1:kpbl),dim=1)) else ! Estimate sigw as the square root of 2 TKE call grell_find_pbl_height(mkx,mgmzp,z,tke,qliq,qice,kpblloc) wboth = wwind + sqrt(2.*tke) @@ -110,7 +110,7 @@ end subroutine grell_updraft_origin ! base and the level that updrafts origin, we may push the latter up and try again. ! !------------------------------------------------------------------------------------------! recursive subroutine grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwind,sigw & - ,exner_cup,p_cup,theiv_cup,thil_cup,t_cup & + ,z_cup,exner_cup,p_cup,theiv_cup,thil_cup,t_cup & ,qtot_cup,qvap_cup,qliq_cup,qice_cup,qsat_cup & ,co2_cup,rho_cup,dzd_cld,mentru_rate,theivu_cld & ,thilu_cld,tu_cld,qtotu_cld,qvapu_cld,qliqu_cld & @@ -133,6 +133,7 @@ recursive subroutine grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwin !----- Input environment variables -----------------------------------------------------! real, dimension(mgmzp), intent(in) :: wwind ! Vertical velocity [ m/s] real, dimension(mgmzp), intent(in) :: sigw ! wwind standard deviation [ m/s] + real, dimension(mgmzp), intent(in) :: z_cup ! Height @ cloud level [ m] real, dimension(mgmzp), intent(in) :: exner_cup ! Exner f. @ cloud level [J/kg/K] real, dimension(mgmzp), intent(in) :: p_cup ! Pressure @ cloud level [ Pa] real, dimension(mgmzp), intent(in) :: theiv_cup ! Thetae_iv [ K] @@ -207,6 +208,11 @@ recursive subroutine grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwin ! fore klcl will be set to the nearest level above the actual LCL (or at it if we are ! ! really lucky...). ! !---------------------------------------------------------------------------------------! + if (klou > kbmax) then + !------ Gave up... Cloud would be too high to be a cumulus. -------------------------! + ierr = 3 + return + end if call lcl_il(thil_cup(klou),p_cup(klou),t_cup(klou),qtot_cup(klou),qvap_cup(klou) & ,tlcl,plcl,dzlcl) klcl = klou @@ -241,6 +247,8 @@ recursive subroutine grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwin qtotu_cld (klfc) = qtot_cup (klou) co2u_cld (klfc) = co2_cup (klou) !------ Finding a consistent set of temperature and mixing ratios -------------------! + call grell_sanity_thil2tqall(klfc,z_cup(klfc),thilu_cld(klfc),exner_cup(klfc) & + ,p_cup(klfc),qtotu_cld(klfc),'find_cld_lfc') call thil2tqall(thilu_cld(klfc),exner_cup(klfc),p_cup(klfc),qtotu_cld(klfc) & ,qliqu_cld(klfc),qiceu_cld(klfc),tu_cld(klfc),qvapu_cld(klfc) & ,qsatu_cld(klfc)) @@ -296,12 +304,12 @@ recursive subroutine grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwin if (pushup) then klou = klou + 1 - call grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwind,sigw,exner_cup & - ,p_cup,theiv_cup,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup & - ,qice_cup,qsat_cup,co2_cup,rho_cup,dzd_cld,mentru_rate & - ,theivu_cld,thilu_cld,tu_cld,qtotu_cld,qvapu_cld,qliqu_cld & - ,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld,dbyu,klou,ierr,klcl & - ,klfc,wbuoymin) + call grell_find_cloud_lfc(mkx,mgmzp,kbmax,cap_max,wnorm_max,wwind,sigw,z_cup & + ,exner_cup,p_cup,theiv_cup,thil_cup,t_cup,qtot_cup,qvap_cup & + ,qliq_cup,qice_cup,qsat_cup,co2_cup,rho_cup,dzd_cld & + ,mentru_rate,theivu_cld,thilu_cld,tu_cld,qtotu_cld & + ,qvapu_cld,qliqu_cld,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld & + ,dbyu,klou,ierr,klcl,klfc,wbuoymin) end if @@ -320,10 +328,11 @@ end subroutine grell_find_cloud_lfc ! This subroutine should be used only for "0" and "x" thermodynamics. This is using the ! ! klou and klfc already found, and computing the buoyancy at this lowest part. ! !------------------------------------------------------------------------------------------! -subroutine grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,exner_cup,p_cup,theiv_cup,thil_cup & - ,t_cup,qtot_cup,qvap_cup,qliq_cup,qice_cup,qsat_cup,co2_cup & - ,rho_cup,theivu_cld,thilu_cld,tu_cld,qtotu_cld,qvapu_cld & - ,qliqu_cld,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld,dbyu) +subroutine grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,z_cup,exner_cup,p_cup,theiv_cup & + ,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup,qice_cup & + ,qsat_cup,co2_cup,rho_cup,theivu_cld,thilu_cld,tu_cld & + ,qtotu_cld,qvapu_cld,qliqu_cld,qiceu_cld,qsatu_cld,co2u_cld & + ,rhou_cld,dbyu,which) use rconstants, only : epi & ! intent(in) , rdry ! ! intent(in) use therm_lib , only : idealdens & ! function @@ -335,6 +344,7 @@ subroutine grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,exner_cup,p_cup,theiv_cup,th integer , intent(in) :: klou ! Level of origin of updrafts integer , intent(in) :: klfc ! Level of free convection !----- Input environment variables -----------------------------------------------------! + real, dimension(mgmzp), intent(in) :: z_cup ! Height @ cloud level [ m] real, dimension(mgmzp), intent(in) :: exner_cup ! Exner f. @ cloud level [J/kg/K] real, dimension(mgmzp), intent(in) :: p_cup ! Pressure @ cloud level [ Pa] real, dimension(mgmzp), intent(in) :: theiv_cup ! Thetae_iv [ K] @@ -359,6 +369,8 @@ subroutine grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,exner_cup,p_cup,theiv_cup,th real, dimension(mgmzp), intent(inout):: co2u_cld ! Updraft CO2 mixing ratio [ ppm] real, dimension(mgmzp), intent(inout):: rhou_cld ! Updraft density [ kg/m³] real, dimension(mgmzp), intent(inout):: dbyu ! Buoyancy acceleration [ m/s²] + !----- Flag for debugging. -------------------------------------------------------------! + character(len=*) , intent(in) :: which ! Where routine was called [ --] !----- External functions --------------------------------------------------------------! real , external :: buoyancy_acc ! Buoyancy acceleration funtion. !----- Local variables -----------------------------------------------------------------! @@ -392,6 +404,8 @@ subroutine grell_buoy_below_lfc(mkx,mgmzp,klou,klfc,exner_cup,p_cup,theiv_cup,th qtotu_cld (k) = qtot_cup (klou) co2u_cld (k) = co2_cup (klou) !------ Finding a consistent set of temperature and mixing ratios -------------------! + call grell_sanity_thil2tqall(k,z_cup(k),thilu_cld(k),exner_cup(k),p_cup(k) & + ,qtotu_cld(k),which) call thil2tqall(thilu_cld(k),exner_cup(k),p_cup(k),qtotu_cld(k),qliqu_cld(k) & ,qiceu_cld(k),tu_cld(k),qvapu_cld(k),qsatu_cld(k)) !------ Finding the draft density, assuming pu_cld = p_cup... -----------------------! @@ -515,14 +529,22 @@ end subroutine grell_nms_updraft ! in particular those affected by phase change. ! !------------------------------------------------------------------------------------------! subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2prec,cdu & - ,mentru_rate,qtot,co2,p_cup,exner_cup,theiv_cup & + ,mentru_rate,qtot,co2,z_cup,p_cup,exner_cup,theiv_cup & ,thil_cup,t_cup,qtot_cup,qvap_cup,qliq_cup,qice_cup & ,qsat_cup,co2_cup,rho_cup,theivu_cld,etau_cld,dzu_cld & ,thilu_cld,tu_cld,qtotu_cld,qvapu_cld,qliqu_cld & ,qiceu_cld,qsatu_cld,co2u_cld,rhou_cld,dbyu,pwu_cld & - ,pwavu,klnb,ktop,ierr) - use rconstants, only : epi,rdry, t00, toodry, toowet - use therm_lib , only : thetaeiv2thil, thil2tqall, idealdens, toler, maxfpo + ,pwavu,klnb,ktop,ierr,which) + use rconstants, only : epi & ! intent(in) + , rdry & ! intent(in) + , t00 & ! intent(in) + , toodry & ! intent(in) + , toowet ! ! intent(in) + use therm_lib , only : thetaeiv2thil & ! subroutine + , thil2tqall & ! subroutine + , idealdens & ! function + , toler & ! intent(in) + , maxfpo ! ! intent(in) implicit none !----- Several scalars. ----------------------------------------------------------------! logical , intent(in) :: preccld ! Flag for precipitation @@ -539,7 +561,8 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 real, dimension(mgmzp), intent(in) :: qtot ! Total mixing ratio [ kg/kg] real, dimension(mgmzp), intent(in) :: co2 ! CO2 mixing ratio [ ppm] !----- Variables at cloud levels -------------------------------------------------------! - real, dimension(mgmzp), intent(in) :: p_cup ! Pressure @ cloud levels [ 1/m] + real, dimension(mgmzp), intent(in) :: z_cup ! Height @ cloud levels [ m] + real, dimension(mgmzp), intent(in) :: p_cup ! Pressure @ cloud levels [ Pa] real, dimension(mgmzp), intent(in) :: exner_cup ! Exner fctn. @ cloud lev. [J/kg/K] real, dimension(mgmzp), intent(in) :: theiv_cup ! Thetae_iv [ K] real, dimension(mgmzp), intent(in) :: thil_cup ! Theta_il [ K] @@ -572,6 +595,8 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 real , intent(out) :: pwavu ! Total normalized integrated cond. integer , intent(out) :: klnb ! Level of neutral buoyancy. integer , intent(out) :: ktop ! Cloud top. + !----- Flag to tell which call is this one. --------------------------------------------! + character(len=*) , intent(in) :: which !----- Local variables -----------------------------------------------------------------! integer :: k ! Counter [ ----] integer :: it ! Iteration counter [ ----] @@ -592,36 +617,26 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 real, dimension(mgmzp) :: leftu_cld ! Total condensation that left cloud [ kg/kg] real :: tubis ! Scratch var. for temperature [ K] real :: delta ! Aux. var. for bisection 2nd guess [ kg/kg] - + !----- Local constants. ----------------------------------------------------------------! + logical, parameter :: debug =.false. ! Print debug info? [ T|F] !----- External functions --------------------------------------------------------------! - real, external :: buoyancy_acc ! Buoyancy acceleration funtion. + real, external :: buoyancy_acc ! Buoyancy acceleration funtion. !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! 1. First of all, I'll check whether this is a precipitating cloud or not. The ! - ! conversion rate from cloud to rain should be a function of the cloud size and wind ! - ! shear, but it is only a step function, 0 if the radius is small, or a non-zero ! - ! constant otherwise. Perhaps this should be done in a different way in the future. ! - !---------------------------------------------------------------------------------------! - if (preccld) then - c0 = cld2prec - else - c0 = 0. - end if - - !---------------------------------------------------------------------------------------! - ! 2. Initialise integrated condensation and top flag. ! + ! Initialise integrated condensation and top flag. ! !---------------------------------------------------------------------------------------! pwavu = 0. pwu_cld = 0. leftu_cld = 0. - - !---------------------------------------------------------------------------------------! - ! 3. Initialise the cloud top check. The check is done only once. The non-forced and ! - ! the modified profiles should use the original cloud top definition. ! + + + !---------------------------------------------------------------------------------------! + ! Initialise the cloud top check. The check is done only once. The non-forced and ! + ! the modified profiles should use the original cloud top definition. ! !---------------------------------------------------------------------------------------! if (check_top) then foundtop = .false. @@ -630,13 +645,15 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 klnb = ktpse ktop = ktpse end if + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! - ! 4. Between the surface and the level of free convection, everything is already set up ! - ! (it was done at the grell_find_cloud_lfc subroutine) but between the LFC and the ! - ! cloud top I will need a first guess for most variables, so I will initialise with ! - ! the environment. Above the cloud top, no mass flux, nothing happens in terms of ! - ! updraft, so I will set up the variables with environment values. ! + ! Between the surface and the level of free convection, everything is already set up ! + ! (it was done at the grell_find_cloud_lfc subroutine) but between the LFC and the ! + ! cloud top we need first guesses for most variables, so we initialise with the ! + ! environment. Above the cloud top, no mass flux, nothing happens in terms of updraft, ! + ! so we set up the variables with environment values. ! !---------------------------------------------------------------------------------------! thilu_cld((klfc+1):mkx) = thil_cup((klfc+1):mkx) tu_cld ((klfc+1):mkx) = t_cup ((klfc+1):mkx) @@ -647,16 +664,44 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 co2u_cld ((klfc+1):mkx) = co2_cup ((klfc+1):mkx) rhou_cld ((klfc+1):mkx) = rho_cup ((klfc+1):mkx) dbyu ((klfc+1):mkx) = 0. + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! 5. Between the LFC and the cloud top, we need to consider entrainment and detrainment ! - ! contributions. Also, as the air parcel moves upward, condensation will happen, and ! - ! a fraction of this condensation will fall out as rainfall. Here we will compute ! - ! all these variables, some of them in an iterative way. ! + ! Between the LFC and the cloud top, we need to consider entrainment and detrainment ! + ! contributions. Also, as the air parcel moves upward, condensation will happen, and a ! + ! fraction of this condensation will fall out as rainfall. Here we will compute all ! + ! these variables, some of them in an iterative way. ! !---------------------------------------------------------------------------------------! vertiloop: do k=klfc,ktpse + + + + + !------------------------------------------------------------------------------------! + ! Check whether this is a precipitating cloud or not. The conversion rate from ! + ! cloud to rain ultimately should be a function of the cloud size and wind shear. ! + ! These parameters are very unconstrained so we keep it simple here. Right now only ! + ! three options exist: ! + ! 1. The cloud radius is too small so the lost water is assumed zero. ! + ! 2. cld2prec is positive. The fraction is a function of the layer thickness, al- ! + ! though we make sure that the actual fraction never exceeds one. ! + ! 3. cld2prec is negative, so we simply assume a constant rate throughout the cloud. ! + !------------------------------------------------------------------------------------! + if (preccld) then + if (cld2prec > 0.) then + c0 = max(0.,min(cld2prec * dzu_cld(k),1.0)) + else + c0 = -cld2prec + end if + else + c0 = 0. + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! ! The total mixing ratio is what came from level immediately beneath us plus ! ! entrainment and detrainment, plus the water and ice that is about to leave the ! @@ -664,21 +709,35 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 !------------------------------------------------------------------------------------! denomin = 1.+(mentru_rate(k)-0.5*cdu(k))*dzu_cld(k) denomini = 1./denomin - qeverything = max(toodry,( qtotu_cld(k-1)*(1.-.5*cdu(k)*dzu_cld(k)) & - + qtot(k-1)*mentru_rate(k)*dzu_cld(k) - 0.5*leftu_cld(k-1)) & - * denomini ) + !------------------------------------------------------------------------------------! + + !----- CO2 will not fall through precipitation, a simple balance is enough. ---------! co2u_cld(k) = ( co2u_cld(k-1)*(1.-.5*cdu(k)*dzu_cld(k)) & + co2(k-1)*mentru_rate(k)*dzu_cld(k)) & * denomini + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Qeverything is the total mixing ration in case all water remained in the cloud. ! + ! It will also be the first guess. ! + !------------------------------------------------------------------------------------! + qeverything = max(toodry, ( qtotu_cld(k-1) * (1. - 0.5 * cdu(k) * dzu_cld(k)) & + + qtot(k-1) * mentru_rate(k) * dzu_cld(k) ) * denomini ) + !------------------------------------------------------------------------------------! + !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=38,fmt='(2(a,1x,i5,1x),a,1x,l1,1x,8(a,1x,f10.4,1x),a,1x,es12.5)') & - ! 'k=',k,'it=',0,'bisection=',.false.,'qall=',1000.*qeverything & - ! ,'qtot=',1000.*qtotuc,'left=',1000.*leftu_cld(k),'qsat=',1000.*qsatu_cld(k) & - ! ,'qvap=',1000.*qvapu_cld(k),'qliq=',1000.*qliqu_cld(k) & - ! ,'qice=',1000.*qiceu_cld(k),'temp=',tu_cld(k)-t00,'func=',1000.*func + if (debug) then + write (unit=38,fmt='(2(a,1x,i5,1x),a,1x,l1,1x,9(a,1x,f10.4,1x),a,1x,es12.5)') & + 'k=',k,'it=',0,'bisection=',.false.,'qall=',1000.*qeverything & + ,'qtot=',1000.*qtotuc,'left=',1000.*leftu_cld(k),'qsat=',1000.*qsatu_cld(k) & + ,'qvap=',1000.*qvapu_cld(k),'qliq=',1000.*qliqu_cld(k) & + ,'qice=',1000.*qiceu_cld(k),'thil=',thilu_cld(k),'temp=',tu_cld(k)-t00 & + ,'func=',1000.*func + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -788,11 +862,13 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 !----- Finding this equilibrium state --------------------------------------! thilu_cld(k) = thetaeiv2thil(theivu_cld(k),p_cup(k),qtotuz) + call grell_sanity_thil2tqall(k,z_cup(k),thilu_cld(k),exner_cup(k),p_cup(k) & + ,qtotuz,which) call thil2tqall(thilu_cld(k),exner_cup(k),p_cup(k),qtotuz & ,qliqu_cld(k),qiceu_cld(k),tubis,qvapu_cld(k) & ,qsatu_cld(k)) - leftu_cld(k) = c0 * (qliqu_cld(k) + qiceu_cld(k)) * dzu_cld(k) - funz = qtotuz - qeverything + 0.5 * leftu_cld(k) * denomini + leftu_cld(k) = c0 * (qliqu_cld(k) + qiceu_cld(k)) + funz = qtotuz - ( qeverything - leftu_cld(k) ) bisection = funa*funz < 0. if (bisection) exit zgssloop @@ -808,11 +884,14 @@ subroutine grell_most_thermo_updraft(preccld,check_top,mkx,mgmzp,klfc,ktpse,cld2 end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> zrough & ! intent(in) , leaf_isoilbc => isoilbc & ! intent(in) + , leaf_sldrain => sldrain & ! intent(in) , leaf_ipercol => ipercol & ! intent(in) , leaf_runoff_time => runoff_time ! ! intent(in) use leaf_coms , only : leaf_ubmin => ubmin & ! intent(in) @@ -211,7 +216,11 @@ subroutine read_ednl(iunit,filename) , leaf_min_patch_area => min_patch_area ! ! intent(in) use mem_radiate , only : radfrq ! ! intent(in) use consts_coms , only : day_sec ! ! intent(in) - use detailed_coms , only : idetailed & ! intent(in) + use detailed_coms , only : dt_census & ! intent(in) + , yr1st_census & ! intent(in) + , mon1st_census & ! intent(in) + , min_recruit_dbh & ! intent(in) + , idetailed & ! intent(in) , patch_keep ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! @@ -220,7 +229,6 @@ subroutine read_ednl(iunit,filename) !----- Local variables. ----------------------------------------------------------------! integer :: i integer :: err - integer :: decomp_scheme logical :: fexists logical :: op !----- Namelist. -----------------------------------------------------------------------! @@ -230,20 +238,20 @@ subroutine read_ednl(iunit,filename) ,plantation_file,lu_rescale_file,thsums_database,soilstate_db & ,soildepth_db,isoilstateinit,isoildepthflg,ivegt_dynamics,ibigleaf & ,integration_scheme,rk4_tolerance,ibranch_thermo,iphysiol,iallom & - ,iphen_scheme,radint,radslp,repro_scheme,lapse_scheme,crown_mod & - ,icanrad,ltrans_vis,ltrans_nir,lreflect_vis,lreflect_nir & + ,igrass,iphen_scheme,radint,radslp,repro_scheme,lapse_scheme & + ,crown_mod,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_c4,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,fire_parameter,sm_fire & - ,ianth_disturb,icanturb,include_these_pft,agri_stock & - ,plantation_stock,pft_1st_check,maxpatch,maxcohort,min_patch_area & - ,treefall_disturbance_rate,time2canopy,iprintpolys,npvars,printvars & - ,pfmtstr,ipmin,ipmax,imetrad,iphenys1,iphenysf,iphenyf1,iphenyff & - ,iedcnfgf,event_file,phenpath + ,h2o_plant_lim,iddmort_scheme,ddmort_const,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,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 & + ,fire_parameter,sm_fire,ianth_disturb,icanturb,include_these_pft & + ,agri_stock,plantation_stock,pft_1st_check,maxpatch,maxcohort & + ,min_patch_area,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 @@ -309,6 +317,7 @@ subroutine read_ednl(iunit,filename) write (unit=*,fmt=*) ' ibranch_thermo =',ibranch_thermo write (unit=*,fmt=*) ' iphysiol =',iphysiol write (unit=*,fmt=*) ' iallom =',iallom + write (unit=*,fmt=*) ' igrass =',igrass write (unit=*,fmt=*) ' iphen_scheme =',iphen_scheme write (unit=*,fmt=*) ' radint =',radint write (unit=*,fmt=*) ' radslp =',radslp @@ -326,6 +335,8 @@ subroutine read_ednl(iunit,filename) 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=*) ' iddmort_scheme =',iddmort_scheme + write (unit=*,fmt=*) ' ddmort_const =',ddmort_const write (unit=*,fmt=*) ' vmfact_c3 =',vmfact_c3 write (unit=*,fmt=*) ' vmfact_c4 =',vmfact_c4 write (unit=*,fmt=*) ' mphoto_trc3 =',mphoto_trc3 @@ -388,12 +399,6 @@ subroutine read_ednl(iunit,filename) call abort_run('Error reading namelist, ED2_INFO block.','read_ednl' & ,'edcp_load_namelist.f90') end if - - !---------------------------------------------------------------------------------------! - ! Decomposition scheme is not a real variable in the model, internally we use ! - ! Lloyd_Taylor instead. ! - !---------------------------------------------------------------------------------------! - LloydTaylor = decomp_scheme == 1 !---------------------------------------------------------------------------------------! ! Some variables that ED needs are also defined and used by other BRAMS modules. ! @@ -405,8 +410,8 @@ subroutine read_ednl(iunit,filename) ,deltay,polelat,polelon,centlat,centlon,nstratx,nstraty,iclobber & ,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) + ,leaf_sldrain,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 ! @@ -437,6 +442,11 @@ subroutine read_ednl(iunit,filename) ! outstate, the special flags cover all possibilities. slxclay = -1. ! This is not going to be used in coupled runs because the slxsand = -1. ! soil should come from lon/lat maps. + dt_census = 1 ! Dummy variable, we can't really track census in regional + ! runs + yr1st_census = 2000 ! Dummy variable + mon1st_census = 1 ! Dummy variable + min_recruit_dbh = 0. ! Dummy variable idetailed = 0 ! No detailed output in coupled runs (it is already too slow ! with the normal output...) patch_keep = 0 ! Keep all patches. @@ -560,8 +570,8 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz ,polelat_b,polelon_b,centlat_b,centlon_b,nstratx_b,nstraty_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 & - ,ribmax_b,leaf_maxwhc_b) + ,isoilbc_b,sldrain_b,ipercol_b,runoff_time_b,gamm_b,gamh_b & + ,tprandtl_b,ribmax_b,leaf_maxwhc_b) use ed_misc_coms , only : expnme & ! intent(out) , runtype & ! intent(out) , itimez & ! intent(out) @@ -601,6 +611,7 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz , slz & ! intent(out) , stgoff & ! intent(out) , isoilbc & ! intent(in) + , sldrain & ! intent(in) , runoff_time ! ! intent(in) use grid_dims , only : maxgrds & ! intent(out) , nzgmax ! ! intent(out) @@ -660,6 +671,7 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz real , intent(in) :: ugbmin_b ! Minimum u at leaf level real , intent(in) :: ustmin_b ! Minimum u* integer , intent(in) :: isoilbc_b ! Bottom soil boundary condition + real , intent(in) :: sldrain_b ! Drainage slope in degrees 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 @@ -719,6 +731,7 @@ subroutine copy_in_bramsnl(expnme_b,runtype_b,itimez_b,idatez_b,imonthz_b,iyearz ugbmin = ugbmin_b ustmin = ustmin_b isoilbc = isoilbc_b + sldrain = sldrain_b ipercol = ipercol_b runoff_time = runoff_time_b diff --git a/BRAMS/src/ed2/edcp_met.f90 b/BRAMS/src/ed2/edcp_met.f90 index 59cd468c9..343db1351 100644 --- a/BRAMS/src/ed2/edcp_met.f90 +++ b/BRAMS/src/ed2/edcp_met.f90 @@ -38,6 +38,7 @@ subroutine copy_atm2lsm(ifm,init) use mem_edcp , only : co2_offset & ! intent(in) , atm_co2_min ! ! intent(in) use therm_lib , only : thetaeiv & ! function + , vpdefil & ! function , rehuil & ! function , ptrh2rvapil & ! function , press2exner & ! function @@ -390,6 +391,12 @@ subroutine copy_atm2lsm(ifm,init) cgrid%met(ipy)%atm_theiv = thetaeiv(cgrid%met(ipy)%atm_theta,cgrid%met(ipy)%prss & ,cgrid%met(ipy)%atm_tmp,rtp_mean(ix,iy) & ,rtp_mean(ix,iy)) + !------------------------------------------------------------------------------------! + + !----- Find the vapour pressure deficit. --------------------------------------------! + cgrid%met(ipy)%atm_vpdef = vpdefil (cgrid%met(ipy)%prss,cgrid%met(ipy)%atm_tmp & + ,cgrid%met(ipy)%atm_shv,.true.) + !------------------------------------------------------------------------------------! end do polyloop1st !----- Filling the precipitation arrays. -----------------------------------------------! @@ -464,6 +471,12 @@ subroutine copy_atm2lsm(ifm,init) rvaux = cpoly%met(isi)%atm_shv / (1.0 - cpoly%met(isi)%atm_shv) cpoly%met(isi)%atm_theiv = thetaeiv(cpoly%met(isi)%atm_theta,cpoly%met(isi)%prss & ,cpoly%met(isi)%atm_tmp,rvaux,rvaux) + !---------------------------------------------------------------------------------! + + !----- Find the atmospheric vapour pressure deficit. -----------------------------! + cpoly%met(isi)%atm_vpdef = vpdefil(cpoly%met(isi)%prss,cpoly%met(isi)%atm_tmp & + ,cpoly%met(isi)%atm_shv,.true.) + !---------------------------------------------------------------------------------! !----- Solar radiation -----------------------------------------------------------! cpoly%met(isi)%rshort_diffuse = cpoly%met(isi)%par_diffuse & @@ -970,6 +983,7 @@ subroutine initialize_ed2leaf(ifm) use therm_lib , only : bulk_on & ! intent(in) , reducedpress & ! function , thetaeiv & ! function + , vpdefil & ! function , exner2press & ! function , extheta2temp ! ! function use ed_state_vars, only : edgrid_g & ! intent(in) @@ -1077,13 +1091,14 @@ subroutine initialize_ed2leaf(ifm) atm_temp = extheta2temp(pi0_mean(i,j),theta_mean(i,j)) !----- Compute the state variables. ----------------------------------------------! - leaf_g(ifm)%can_theta(i,j,1) = theta_mean(i,j) - leaf_g(ifm)%can_rvap (i,j,1) = rv_mean(i,j) - leaf_g(ifm)%can_prss (i,j,1) = reducedpress(atm_prss,theta_mean(i,j),atm_shv & - ,geoht(i,j),theta_mean(i,j) & - ,atm_shv,can_depth) - leaf_g(ifm)%can_theiv(i,j,1) = thetaeiv(thil_mean(i,j),atm_prss,atm_temp & - ,rtp_mean(i,j),rtp_mean(i,j)) + leaf_g(ifm)%can_theta (i,j,1) = theta_mean(i,j) + leaf_g(ifm)%can_rvap (i,j,1) = rv_mean(i,j) + leaf_g(ifm)%can_prss (i,j,1) = reducedpress(atm_prss,theta_mean(i,j),atm_shv & + ,geoht(i,j),theta_mean(i,j) & + ,atm_shv,can_depth) + leaf_g(ifm)%can_theiv (i,j,1) = thetaeiv(thil_mean(i,j),atm_prss,atm_temp & + ,rtp_mean(i,j),rtp_mean(i,j)) + leaf_g(ifm)%can_vpdef (i,j,1) = vpdefil(atm_prss,atm_temp,atm_shv,.true.) leaf_g(ifm)%gpp (i,j,1) = 0.0 leaf_g(ifm)%resphet (i,j,1) = 0.0 leaf_g(ifm)%plresp (i,j,1) = 0.0 @@ -1096,8 +1111,9 @@ subroutine initialize_ed2leaf(ifm) do ilp=2,npatch leaf_g(ifm)%can_theta (i,j,ilp) = leaf_g(ifm)%can_theta(i,j,1) leaf_g(ifm)%can_theiv (i,j,ilp) = leaf_g(ifm)%can_theiv(i,j,1) + leaf_g(ifm)%can_vpdef (i,j,ilp) = leaf_g(ifm)%can_vpdef(i,j,1) leaf_g(ifm)%can_rvap (i,j,ilp) = leaf_g(ifm)%can_rvap (i,j,1) - leaf_g(ifm)%can_prss (i,j,ilp) = leaf_g(ifm)%can_prss(i,j,1) + leaf_g(ifm)%can_prss (i,j,ilp) = leaf_g(ifm)%can_prss (i,j,1) leaf_g(ifm)%gpp (i,j,ilp) = 0.0 leaf_g(ifm)%resphet (i,j,ilp) = 0.0 leaf_g(ifm)%plresp (i,j,ilp) = 0.0 @@ -1704,6 +1720,7 @@ subroutine copy_avgvars_to_leaf(ifm) !---------------------------------------------------------------------------------! leaf_g(ifm)%can_theta (ix,iy,ilp) = cpoly%avg_can_theta(isi) leaf_g(ifm)%can_theiv (ix,iy,ilp) = cpoly%avg_can_theiv(isi) + leaf_g(ifm)%can_vpdef (ix,iy,ilp) = cpoly%avg_can_vpdef(isi) leaf_g(ifm)%can_co2 (ix,iy,ilp) = max( atm_co2_min & , cpoly%avg_can_co2(isi) - co2_offset) leaf_g(ifm)%can_prss (ix,iy,ilp) = cpoly%avg_can_prss(isi) diff --git a/BRAMS/src/ed2/edcp_mpiutils.f90 b/BRAMS/src/ed2/edcp_mpiutils.f90 index 74e0cf5e3..bf35d7e46 100644 --- a/BRAMS/src/ed2/edcp_mpiutils.f90 +++ b/BRAMS/src/ed2/edcp_mpiutils.f90 @@ -63,6 +63,7 @@ subroutine masterput_ednl(mainnum) , imonthh & ! intent(in) , idateh & ! intent(in) , iallom & ! intent(in) + , igrass & ! intent(in) , min_site_area ! ! intent(in) use grid_coms , only : nzg & ! intent(in) , nzs & ! intent(in) @@ -86,6 +87,7 @@ subroutine masterput_ednl(mainnum) , isoilstateinit & ! intent(in) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) + , sldrain & ! intent(in) , runoff_time & ! intent(in) , zrough ! ! intent(in) use met_driver_coms , only : lapse_scheme & ! intent(in) @@ -96,6 +98,8 @@ subroutine masterput_ednl(mainnum) , maxcohort ! ! intent(in) use physiology_coms , only : iphysiol & ! intent(in) , h2o_plant_lim & ! intent(in) + , iddmort_scheme & ! intent(in) + , ddmort_const & ! intent(in) , n_plant_lim & ! intent(in) , vmfact_c3 & ! intent(in) , vmfact_c4 & ! intent(in) @@ -133,7 +137,7 @@ subroutine masterput_ednl(mainnum) , radslp & ! intent(in) , thetacrit ! ! intent(in) use decomp_coms , only : n_decomp_lim & ! intent(in) - , LloydTaylor ! ! intent(in) + , decomp_scheme ! ! intent(in) use pft_coms , only : include_these_pft & ! intent(in) , agri_stock & ! intent(in) , plantation_stock & ! intent(in) @@ -174,7 +178,11 @@ subroutine masterput_ednl(mainnum) , ribmax & ! intent(in) , leaf_maxwhc ! ! intent(in) use mem_edcp , only : co2_offset ! ! intent(in) - use detailed_coms , only : idetailed & ! intent(in) + use detailed_coms , only : dt_census & ! intent(in) + , yr1st_census & ! intent(in) + , mon1st_census & ! intent(in) + , min_recruit_dbh & ! intent(in) + , idetailed & ! intent(in) , patch_keep ! ! intent(in) implicit none !----- Standard common blocks. ---------------------------------------------------------! @@ -237,6 +245,7 @@ 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(sldrain,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ivegt_dynamics,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(ibigleaf,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -244,6 +253,7 @@ subroutine masterput_ednl(mainnum) 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(iallom,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(igrass,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) call MPI_Bcast(radslp,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -259,8 +269,10 @@ subroutine masterput_ednl(mainnum) 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(decomp_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(iddmort_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ddmort_const,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) @@ -386,6 +398,10 @@ subroutine masterput_ednl(mainnum) call MPI_Bcast(leaf_maxwhc,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(dt_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(yr1st_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mon1st_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(min_recruit_dbh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(idetailed,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(patch_keep,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -462,6 +478,7 @@ subroutine nodeget_ednl(master_num) , imonthh & ! intent(out) , idateh & ! intent(out) , iallom & ! intent(out) + , igrass & ! intent(out) , min_site_area ! ! intent(out) use grid_coms , only : nzg & ! intent(out) , nzs & ! intent(out) @@ -485,6 +502,7 @@ subroutine nodeget_ednl(master_num) , isoilstateinit & ! intent(out) , isoildepthflg & ! intent(out) , isoilbc & ! intent(out) + , sldrain & ! intent(out) , runoff_time & ! intent(out) , zrough ! ! intent(out) use met_driver_coms , only : lapse_scheme & ! intent(out) @@ -495,6 +513,8 @@ subroutine nodeget_ednl(master_num) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) , h2o_plant_lim & ! intent(out) + , iddmort_scheme & ! intent(out) + , ddmort_const & ! intent(out) , n_plant_lim & ! intent(out) , vmfact_c3 & ! intent(out) , vmfact_c4 & ! intent(out) @@ -532,7 +552,7 @@ subroutine nodeget_ednl(master_num) , radslp & ! intent(out) , thetacrit ! ! intent(out) use decomp_coms , only : n_decomp_lim & ! intent(out) - , LloydTaylor ! ! intent(out) + , decomp_scheme ! ! intent(out) use pft_coms , only : include_these_pft & ! intent(out) , agri_stock & ! intent(out) , plantation_stock & ! intent(out) @@ -573,7 +593,11 @@ subroutine nodeget_ednl(master_num) , ribmax & ! intent(out) , leaf_maxwhc ! ! intent(out) use mem_edcp , only : co2_offset ! ! intent(out) - use detailed_coms , only : idetailed & ! intent(out) + use detailed_coms , only : dt_census & ! intent(out) + , yr1st_census & ! intent(out) + , mon1st_census & ! intent(out) + , min_recruit_dbh & ! intent(out) + , idetailed & ! intent(out) , patch_keep ! ! intent(out) implicit none !----- Standard common blocks. ---------------------------------------------------------! @@ -638,6 +662,7 @@ 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(sldrain,1,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(ibigleaf,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(integration_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -645,6 +670,7 @@ subroutine nodeget_ednl(master_num) 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(iallom,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(igrass,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) call MPI_Bcast(radslp,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) @@ -660,8 +686,10 @@ subroutine nodeget_ednl(master_num) 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(decomp_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(h2o_plant_lim,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(iddmort_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ddmort_const,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) @@ -786,6 +814,10 @@ subroutine nodeget_ednl(master_num) 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(dt_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(yr1st_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mon1st_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(min_recruit_dbh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(idetailed,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(patch_keep,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) diff --git a/BRAMS/src/init/rdint.f90 b/BRAMS/src/init/rdint.f90 index cd443cf3f..ad9b6e9f5 100644 --- a/BRAMS/src/init/rdint.f90 +++ b/BRAMS/src/init/rdint.f90 @@ -883,6 +883,7 @@ subroutine read_nl(filename) , stgoff & ! intent(out) , zrough & ! intent(out) , isoilbc & ! intent(out) + , sldrain & ! intent(out) , ipercol & ! intent(out) , runoff_time ! ! intent(out) use leaf_coms , only : ubmin & ! intent(out) @@ -1135,11 +1136,11 @@ subroutine read_nl(filename) ,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 + ,isoilbc,sldrain,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 namelist /MODEL_SOUND/ ipsflg,itsflg,irtsflg,iusflg,hs,ps,ts,rts,us,vs,co2s @@ -1821,6 +1822,7 @@ subroutine read_nl(filename) write (unit=*,fmt=*) ' slmstr =',slmstr write (unit=*,fmt=*) ' stgoff =',stgoff write (unit=*,fmt=*) ' isoilbc =',isoilbc + write (unit=*,fmt=*) ' sldrain =',sldrain write (unit=*,fmt=*) ' ipercol =',ipercol write (unit=*,fmt=*) ' runoff_time =',runoff_time write (unit=*,fmt=*) ' if_urban_canopy =',if_urban_canopy diff --git a/BRAMS/src/io/opspec.f90 b/BRAMS/src/io/opspec.f90 index 313d24c60..05e9f9eeb 100644 --- a/BRAMS/src/io/opspec.f90 +++ b/BRAMS/src/io/opspec.f90 @@ -781,7 +781,7 @@ subroutine opspec3 end do select case (closure_type) - case ('en','nc','gr','lo','mc','kf','as') + case ('en','nc','qi','gr','lo','mc','kf','as') continue case default print *, 'FATAL - Invalid closure_type for Grell''s convection.' @@ -815,8 +815,8 @@ subroutine opspec3 IFATERR=IFATERR+1 end if - if (cld2prec < 0. .or. cld2prec > 1.0) then - print *, 'FATAL - cld2prec must be between 0 and 1.' + if (cld2prec < -1.0 .or. cld2prec > 1.0) then + print *, 'FATAL - cld2prec must be between -1 and 1.' print *, 'Yours is currently set to ',cld2prec IFATERR=IFATERR+1 end if @@ -1031,9 +1031,13 @@ subroutine opspec3 ifaterr = ifaterr + 1 end if - if (isoilbc < 0 .or. isoilbc > 4) then + if (isoilbc < 0 .or. isoilbc > 3) then write (unit=*,fmt='(a,1x,i4,a)') & - 'Invalid ISOILBC, it must be between 0 and 4. Yours is set to',isoilbc,'...' + 'Invalid ISOILBC, it must be between 0 and 3. Yours is set to',isoilbc,'...' + ifaterr = ifaterr +1 + else if (isoilbc == 2 .and. (sldrain < 0. .or. sldrain > 90.)) then + write (unit=*,fmt='(a,1x,es12.5,a)') & + 'Invalid SLDRAIN, it must be between 0 and 90. Yours is set to ',sldrain,'...' ifaterr = ifaterr +1 end if diff --git a/BRAMS/src/io/rprnt.f90 b/BRAMS/src/io/rprnt.f90 index 956db7662..ef438bf36 100644 --- a/BRAMS/src/io/rprnt.f90 +++ b/BRAMS/src/io/rprnt.f90 @@ -294,6 +294,8 @@ subroutine sfcprt(n2,n3,mzg,mzs,npat,leaf,vnam,lprt) vnam2 = '[can_prss (Pa)] ' elseif (vnam == 'can_theiv' ) then vnam2 = '[can_theiv (K)] ' +elseif (vnam == 'can_vpdef' ) then + vnam2 = '[can_vpdef (Pa)] ' elseif (vnam == 'can_theta' ) then vnam2 = '[can_theta (K)] ' elseif (vnam == 'can_rvap' ) then @@ -505,6 +507,10 @@ subroutine sfcprt(n2,n3,mzg,mzs,npat,leaf,vnam,lprt) call plin(nc,j,ipat,3,1.e0 & ,leaf%can_theiv(i1:i2,j,ipat) & ,leaf%patch_area(i1:i2,j,ipat)) + elseif (vnam == 'can_vpdef' ) then + call plin(nc,j,ipat,3,1.e0 & + ,leaf%can_vpdef(i1:i2,j,ipat) & + ,leaf%patch_area(i1:i2,j,ipat)) elseif (vnam == 'can_theta' ) then call plin(nc,j,ipat,3,1.e0 & ,leaf%can_theta(i1:i2,j,ipat) & diff --git a/BRAMS/src/lib/therm_lib.f90 b/BRAMS/src/lib/therm_lib.f90 index 0468390af..fa22f2d44 100644 --- a/BRAMS/src/lib/therm_lib.f90 +++ b/BRAMS/src/lib/therm_lib.f90 @@ -2068,6 +2068,196 @@ end function rehuil + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! LIQUID PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefl(pres,temp,humi,is_shv) + use rconstants , only : ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + psat = eslf(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefl = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefl + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! ICE PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefi(pres,temp,humi,is_shv) + use rconstants , only : ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + psat = esif(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefi = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefi + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: This fucntion may consider whether the temperature is above or below the ! + ! freezing point to choose which saturation to use. It is possible to ! + ! explicitly force not to use ice in case level is 2 or if you have reasons ! + ! not to use ice (e.g. reading data that did not consider ice). ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefil(pres,temp,humi,is_shv,useice) + use rconstants , only : t3ple & ! intent(in) + , ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Required arguments. ----------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input is specific humidity [ T|F] + !----- Optional arguments. ----------------------------------------------------------! + logical , intent(in), optional :: useice ! May use ice thermodynamics [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + logical :: frozen ! Will use ice saturation now [ T|F] + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Check whether we should use ice or liquid saturation. ! + !------------------------------------------------------------------------------------! + if (present(useice)) then + frozen = useice .and. temp < t3ple + else + frozen = bulk_on .and. temp < t3ple + end if + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + if (frozen) then + psat = esif(temp) + else + psat = esif(temp) + end if + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefil = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefil + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! !=======================================================================================! ! This function finds the actual temperature based on the virtual temperature and ! @@ -3543,6 +3733,8 @@ real(kind=4) function thetaeiv2thil(theiv,pres,rtot,useice) logical :: converged ! Convergence handle logical :: zside ! Side checker for Regula Falsi logical :: frozen ! Will use ice thermodynamics + !----- Local constants. -------------------------------------------------------------! + logical , parameter :: debug = .false. !------------------------------------------------------------------------------------! @@ -3564,9 +3756,11 @@ real(kind=4) function thetaeiv2thil(theiv,pres,rtot,useice) !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=36,fmt='(a,1x,i5,1x,2(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & - ! 'NEWTON: it=',itn,'tlclz=',tlclz-t00,'pvap=',0.01*pvap,'fun=',funnow & - ! ,'deriv=',deriv + if (debug) then + write (unit=36,fmt='(a,1x,i5,1x,2(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & + 'NEWTON: it=',itn,'tlclz=',tlclz-t00,'pvap=',0.01*pvap,'fun=',funnow & + ,'deriv=',deriv + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -3652,9 +3851,11 @@ real(kind=4) function thetaeiv2thil(theiv,pres,rtot,useice) !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=36,fmt='(a,1x,i5,1x,2(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & - ! '2NGGSS: tt=',itb,'tlclz=',tlclz-t00,'pvap=',0.01*pvap,'fun=',funz & - ! ,'delta=',delta + if (debug) then + write (unit=36,fmt='(a,1x,i5,1x,2(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & + '2NGGSS: tt=',itb,'tlclz=',tlclz-t00,'pvap=',0.01*pvap,'fun=',funz & + ,'delta=',delta + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -3701,8 +3904,10 @@ real(kind=4) function thetaeiv2thil(theiv,pres,rtot,useice) !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=36,fmt='(a,1x,i5,1x,3(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & - ! 'ANSWER: itb=',itn,'tlcl=',tlcl-t00,'eslcl=',0.01*pvap & - ! ,'thil=',thetaeiv2thil,'funa=',funa,'funz=',funz - !write (unit=36,fmt='(a)') '-------------------------------------------------------' - !write (unit=36,fmt='(a)') ' ' + if (debug) then + write (unit=36,fmt='(a,1x,i5,1x,3(a,1x,f11.4,1x),2(a,1x,es11.4,1x))') & + 'ANSWER: itb=',itn,'tlcl=',tlcl-t00,'eslcl=',0.01*pvap & + ,'thil=',thetaeiv2thil,'funa=',funa,'funz=',funz + write (unit=36,fmt='(a)') '---------------------------------------------------' + write (unit=36,fmt='(a)') ' ' + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! else @@ -4373,6 +4580,8 @@ subroutine thil2tqall(thil,exner,pres,rtot,rliq,rice,temp,rvap,rsat) logical :: zside ! Aux. Flag, for two purposes: ! 1. Found a 2nd guess for regula falsi. ! 2. I retained the "zside" (T/F) + !----- Local constants. -------------------------------------------------------------! + logical , parameter :: debug = .false. !------------------------------------------------------------------------------------! t1stguess = temp @@ -4422,7 +4631,12 @@ subroutine thil2tqall(thil,exner,pres,rtot,rliq,rice,temp,rvap,rsat) !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! - !write (unit=46,fmt='(a,1x,i5,1x,6(a,1x,f11.4,1x),a,1x,es11.4,1x)') & - ! 'NEWTON: it=',itn,'temp=',tempz-t00,'rsat=',1000.*rsat,'rliq=',1000.*rliq & - ! ,'rice=',1000.*rice,'rvap=',1000.*rvap,'fun=',funnow,'deriv=',deriv + if (debug) then + write (unit=46,fmt='(a,1x,i5,1x,6(a,1x,f11.4,1x),a,1x,es11.4,1x)') & + 'NEWTON: it=',itn,'temp=',tempz-t00,'rsat=',1000.*rsat,'rliq=',1000.*rliq & + ,'rice=',1000.*rice,'rvap=',1000.*rvap,'fun=',funnow,'deriv=',deriv + end if !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! @@ -4545,9 +4763,9 @@ subroutine thil2tqall(thil,exner,pres,rtot,rliq,rice,temp,rvap,rsat) !---------------------------------------------------------------------------------! else if (abs(funnow-funa) < 100.*toler*tempa) then - delta = 100.*toler*tempa + delta = 0.5 else - delta = max(abs(funa)*abs((tempz-tempa)/(funnow-funa)),100.*toler*tempa) + delta = max(abs(funa)*abs((tempz-tempa)/(funnow-funa)),0.5) end if tempz = tempa + delta funz = funa @@ -4622,10 +4840,12 @@ subroutine thil2tqall(thil,exner,pres,rtot,rliq,rice,temp,rvap,rsat) !<><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><>! !><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><><> vctr14 & ! intent(out) @@ -730,20 +746,24 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n , newsfcw_depth => vctr18 ! ! intent(out) use rconstants , only : wdns & ! intent(in) , wdnsi & ! intent(in) - , uiliqt3 ! ! intent(in) + , uiliqt3 & ! intent(in) + , toodry ! ! intent(in) use therm_lib , only : uint2tl & ! sub-routine , uextcm2tl & ! sub-routine - , tl2uint ! ! function + , tl2uint & ! function + , alvi & ! function + , alvl ! ! function implicit none !----- Arguments. ----------------------------------------------------------------------! - integer, intent(in) :: mzg - integer, intent(in) :: mzs + integer , intent(in) :: mzg + integer , intent(in) :: mzs real , dimension(mzg), intent(inout) :: soil_energy real , dimension(mzg), intent(inout) :: soil_water real , dimension(mzg), intent(in) :: soil_text real , intent(inout) :: sfcwater_nlev real , dimension(mzs), intent(inout) :: sfcwater_mass real , dimension(mzs), intent(inout) :: sfcwater_depth + real , intent(inout) :: can_rvap !----- Local variables. ----------------------------------------------------------------! integer :: kold integer :: newlayers @@ -752,34 +772,74 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n integer :: ksnnew integer :: k integer :: nsoil - real :: wtold - real :: wtnew - real :: wdiff - real :: sum_sfcw_mass - real :: sum_sfcw_energy - real :: sum_sfcw_depth - real :: energy_free - real :: wmass_free - real :: depth_free - real :: wmass_perc - real :: energy_perc - real :: depth_perc - real :: i_energy_try - real :: energy_try - real :: wmass_try - real :: depth_try - real :: temp_try - real :: fliq_try - real :: energy_tot - real :: wmass_tot - real :: hcapdry_tot - real :: wmass_room - real :: depthloss - real :: snden - real :: sndenmin - real :: sndenmax - real :: cr ! snow water holding capacity - real :: gi ! Partial density of ice + real(kind=4) :: wtold + real(kind=4) :: wtnew + real(kind=4) :: wdiff + real(kind=4) :: sum_sfcw_mass + real(kind=4) :: sum_sfcw_energy + real(kind=4) :: sum_sfcw_depth + real(kind=4) :: energy_free + real(kind=4) :: wmass_free + real(kind=4) :: depth_free + real(kind=4) :: tempk_free + real(kind=4) :: fracliq_free + real(kind=4) :: energy_latent + real(kind=4) :: energy_available + real(kind=4) :: wmass_available + real(kind=4) :: depth_available + real(kind=4) :: tempk_available + real(kind=4) :: fracliq_available + real(kind=4) :: energy_needed + real(kind=4) :: wmass_needed + real(kind=4) :: depth_needed + real(kind=4) :: tempk_needed + real(kind=4) :: fracliq_needed + real(kind=4) :: wmass_perc + real(kind=4) :: energy_perc + real(kind=4) :: depth_perc + real(kind=4) :: i_energy_try + real(kind=4) :: energy_try + real(kind=4) :: wmass_try + real(kind=4) :: depth_try + real(kind=4) :: temp_try + real(kind=4) :: fliq_try + real(kind=4) :: energy_tot + real(kind=4) :: wmass_tot + real(kind=4) :: hcapdry_tot + real(kind=4) :: wmass_room + real(kind=4) :: energy_room + real(kind=4) :: depthloss + real(kind=4) :: snden + real(kind=4) :: sndenmin + real(kind=4) :: sndenmax + real(kind=4) :: wmass_cas_beg + real(kind=4) :: enthalpy_cas_beg + real(kind=4) :: wmass_virtual_beg + real(kind=4) :: energy_virtual_beg + real(kind=4) :: wmass_sfcw_beg + real(kind=4) :: energy_sfcw_beg + real(kind=4) :: wmass_soil_beg + real(kind=4) :: energy_soil_beg + real(kind=4) :: wmass_total_beg + real(kind=4) :: energy_total_beg + real(kind=4) :: wmass_cas_end + real(kind=4) :: enthalpy_cas_end + real(kind=4) :: wmass_virtual_end + real(kind=4) :: energy_virtual_end + real(kind=4) :: wmass_sfcw_end + real(kind=4) :: energy_sfcw_end + real(kind=4) :: wmass_soil_end + real(kind=4) :: energy_soil_end + real(kind=4) :: wmass_total_end + real(kind=4) :: energy_total_end + real(kind=4) :: wmass_total_rch + real(kind=4) :: energy_total_rch + real(kind=4) :: wcapcan + real(kind=4) :: hcapcan + real(kind=4) :: wcapcani + real(kind=4) :: hcapcani + real(kind=4) :: cr ! snow water holding capacity + real(kind=4) :: gi ! Partial density of ice !----- Constants -----------------------------------------------------------------------! real , parameter :: crmin = 0.03 real , parameter :: crmax = 0.1 @@ -796,6 +856,15 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n !----- Copy the soil type at the topmost level to nsoil. -------------------------------! nsoil = nint(soil_text(mzg)) !---------------------------------------------------------------------------------------! + + + + !----- Find the total area mass of the canopy air space. -------------------------------! + wcapcan = can_rhos * can_depth + hcapcan = can_rhos * can_depth + wcapcani = 1. / wcapcan + hcapcani = 1. / hcapcan + !---------------------------------------------------------------------------------------! @@ -815,13 +884,129 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n + !---------------------------------------------------------------------------------------! + ! Initialise the budget variables. ! + !---------------------------------------------------------------------------------------! + wmass_cas_beg = can_rvap * wcapcan + enthalpy_cas_beg = can_enthalpy * hcapcan + wmass_virtual_beg = virtual_water + energy_virtual_beg = virtual_energy + wmass_sfcw_beg = sum_sfcw_mass + energy_sfcw_beg = sum_sfcw_energy + wmass_soil_beg = soil_water(mzg) * dslz(mzg) * wdns + energy_soil_beg = soil_energy(mzg) * dslz(mzg) + wmass_total_beg = wmass_virtual_beg + wmass_sfcw_beg + wmass_soil_beg & + + wmass_cas_beg + energy_total_beg = energy_virtual_beg + energy_sfcw_beg + energy_soil_beg & + + enthalpy_cas_beg + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! Check the total amount of water that has just fallen plus the amount that is al- ! ! ready sitting over the top soil layer. We must do this as the first step because we ! ! may want to eliminate this water by binding it to the top soil layer in case there is ! ! too little water. ! !---------------------------------------------------------------------------------------! - if ((virtual_water + sum_sfcw_mass) < min_sfcwater_mass) then + if ((virtual_water + sum_sfcw_mass) < 0.0) then + !------------------------------------------------------------------------------------! + ! The mass of the potential new temporary surface water is within bounds but it ! + ! is negative. This can only happen if the layer evaporated more than what it ! + ! should, so we condense some of the water back from the canopy air space. If it is ! + ! going to deplete the canopy air space specific humidity too much, then we leave ! + ! the remainder to be stolen from the top soil, but this is dangerous because the ! + ! soil may be too dry too. ! + !------------------------------------------------------------------------------------! + wmass_needed = - (virtual_water + sum_sfcw_mass ) + energy_needed = - (virtual_energy + sum_sfcw_energy) + depth_needed = - (virtual_depth + sum_sfcw_depth ) + !------------------------------------------------------------------------------------! + + + + !----- Find the amount available at the canopy air space. ---------------------------! + wmass_available = wcapcan * (can_rvap - 5.0 * toodry) + !------------------------------------------------------------------------------------! + + if ( wmass_available >= wmass_needed) then + + !---------------------------------------------------------------------------------! + ! Find the latent heat associated with the phase change. ! + !---------------------------------------------------------------------------------! + call uint2tl(energy_needed/wmass_needed,tempk_needed,fracliq_needed) + !----- Remove the energy. --------------------------------------------------------! + energy_latent = wmass_needed * ( (1.0 - fracliq_needed) * alvi(tempk_needed) & + + fracliq_needed * alvl(tempk_needed) ) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! There is enough water vapour. The transfer will require phase change, so the ! + ! energy transfer will be a latent heat flux. Remove the water from the canopy ! + ! air space. The energy lost by the canopy air space to pad the missing water at ! + ! the virtual+temporary surface water layer must go somewhere, so we add it to ! + ! the soil because it is the closest to the pounding layer. ! + !---------------------------------------------------------------------------------! + can_rvap = can_rvap - wmass_needed * wcapcani + can_enthalpy = can_enthalpy - (energy_needed + energy_latent) * hcapcani + soil_energy(mzg) = soil_energy(mzg) + energy_latent * dslzi(mzg) + !---------------------------------------------------------------------------------! + + + wmass_free = 0.0 + energy_free = 0.0 + depth_free = 0.0 + + elseif (wmass_available > 0.0) then + + !---------------------------------------------------------------------------------! + ! Find the latent heat associated with the phase change. ! + !---------------------------------------------------------------------------------! + call uint2tl(energy_needed/wmass_needed,tempk_needed,fracliq_needed) + !----- Remove the energy. --------------------------------------------------------! + energy_available = wmass_available * energy_needed / wmass_needed + energy_latent = wmass_available * ( (1.0 - fracliq_needed) & + * alvi(tempk_needed) & + + fracliq_needed * alvl(tempk_needed) ) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! There is not enough water vapour. Dry down to the minimum, and correct ! + ! energy. Since there is so little negative mass needed, we include the latent ! + ! heat associated with this condensation to the soil, because otherwise we could ! + ! end up with energy and water mass with opposite signs. ! + !---------------------------------------------------------------------------------! + can_rvap = can_rvap - wmass_available * wcapcani + can_enthalpy = can_enthalpy - ( energy_available + energy_latent ) * hcapcani + soil_energy(mzg) = soil_energy(mzg) + energy_latent * dslzi(mzg) + !---------------------------------------------------------------------------------! + + wmass_free = wmass_available - wmass_needed + energy_free = energy_available - energy_needed + depth_free = depth_available - depth_needed + else + !---------------------------------------------------------------------------------! + ! There is not any water vapour. Hope for the best. ! + !---------------------------------------------------------------------------------! + wmass_free = wmass_needed + energy_free = energy_needed + depth_free = depth_needed + !---------------------------------------------------------------------------------! + end if + + !----- Reset both the temporary surface water and the virtual layer. ----------------! + virtual_water = 0.0 + virtual_energy = 0.0 + virtual_depth = 0.0 + sfcwater_mass (:) = 0.0 + sfcwater_energy_ext(:) = 0.0 + sfcwater_depth (:) = 0.0 + !----- Set ksnnew to zero to force all free water to go to the soil. ----------------! + ksnnew = 0 + + elseif ((virtual_water + sum_sfcw_mass) < min_sfcwater_mass) then !------------------------------------------------------------------------------------! ! The mass of the potential new temporary surface water is within bounds but it ! ! is too small to be maintained. We add both the virtual mass and the total surface ! @@ -835,9 +1020,9 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n virtual_water = 0.0 virtual_energy = 0.0 virtual_depth = 0.0 - sfcwater_mass(:) = 0.0 + sfcwater_mass (:) = 0.0 sfcwater_energy_ext(:) = 0.0 - sfcwater_depth(:) = 0.0 + sfcwater_depth (:) = 0.0 !----- Set ksnnew to zero to force all free water to go to the soil. ----------------! ksnnew = 0 else @@ -886,7 +1071,7 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n ! the sense that the water sitting on the top of the surface is in thermal ! ! equilibrium with the surface. ! !------------------------------------------------------------------------------------! - if (ksnnew == 1 .and. wmass_try < water_stab_thresh) then + if (flag_sfcwater /= 2 .or. (ksnnew == 1 .and. wmass_try < water_stab_thresh)) then !---------------------------------------------------------------------------------! ! Find the total internal energy of the combined pool (top soil layer plus ! ! the thin temporary surface water). The units of soil properties are J/m3 for ! @@ -1056,10 +1241,127 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n !---------------------------------------------------------------------------------------! - ! Add any remaining free water to the top soil layer. ! + ! There may be a tiny amount of free standing water left. We dump what we can in ! + ! the soil, and if there is still some water to be removed we evaporate what is left. ! !---------------------------------------------------------------------------------------! - soil_water(mzg) = soil_water(mzg) + wmass_free * dslzi(mzg) * wdnsi - soil_energy(mzg) = soil_energy(mzg) + energy_free * dslzi(mzg) + if (wmass_free >= 0.0) then + wmass_room = max(0.0, slmsts(nsoil) - soil_water(mzg)) * wdns * dslz(mzg) + energy_room = energy_free * wmass_room / wmass_free + + if (wmass_room >= wmass_free) then + !---------------------------------------------------------------------------------! + ! There is enough space in the top soil layer for the remaining water, put ! + ! all the free water there. ! + !---------------------------------------------------------------------------------! + soil_water (mzg) = soil_water(mzg) + wmass_free * dslzi(mzg) * wdnsi + soil_energy(mzg) = soil_energy(mzg) + energy_free * dslzi(mzg) + + wmass_free = 0.0 + energy_free = 0.0 + depth_free = 0.0 + else + !---------------------------------------------------------------------------------! + ! There is not enough space in the top soil layer for the remaining water, ! + ! put what we can there, and boil the remaining. ! + !---------------------------------------------------------------------------------! + + + !----- Remove the water that can go to the soil. ---------------------------------! + wmass_free = wmass_free - wmass_room + energy_free = energy_free - energy_room + !---------------------------------------------------------------------------------! + + + !----- Find the amount of latent heat associated with boiling. -------------------! + call uint2tl(energy_free/wmass_free,tempk_free,fracliq_free) + energy_latent = wmass_free * ( (1.0 - fracliq_free) * alvi(tempk_free) & + + fracliq_free * alvl(tempk_free) ) + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Dump what we can dump on the top soil layer. Since no energy will be left ! + ! in the free layer, we must get the energy for latent heat from somewhere, and ! + ! we take it from the top most soil layer. ! + !---------------------------------------------------------------------------------! + soil_water (mzg) = soil_water (mzg) + wmass_room * dslzi(mzg) * wdnsi + soil_energy(mzg) = soil_energy(mzg) + ( energy_room - energy_latent ) * dslzi(mzg) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Boil the remaining. ! + !---------------------------------------------------------------------------------! + !------ Update the canopy air space properties. ----------------------------------! + can_rvap = can_rvap + wmass_free * wcapcani + can_enthalpy = can_enthalpy + ( energy_free + energy_latent ) * hcapcani + !---------------------------------------------------------------------------------! + + wmass_free = 0.0 + energy_free = 0.0 + depth_free = 0.0 + end if + elseif (wmass_free < 0.0) then + wmass_needed = - wmass_free + energy_needed = - energy_free + depth_needed = - depth_free + + !------ Find the amount of water that the soil can provide. -------------------------! + wmass_available = max(0.0,soil_water(mzg) - soilcp(nsoil)) * wdns * dslz(mzg) + energy_available = energy_free * wmass_available / wmass_free + + if (wmass_available >= wmass_needed) then + !---------------------------------------------------------------------------------! + ! There is enough space in the top soil layer to correct remaining negative ! + ! water, get all the water needed there. ! + !---------------------------------------------------------------------------------! + soil_water (mzg) = soil_water(mzg) - wmass_needed * dslzi(mzg) * wdnsi + soil_energy(mzg) = soil_energy(mzg) - energy_needed * dslzi(mzg) + wmass_needed = 0.0 + energy_needed = 0.0 + depth_needed = 0.0 + else + !---------------------------------------------------------------------------------! + ! There is not enough space in the top soil layer to correct remaining ! + ! negative water, get all the water we can from the top soil and condense the ! + ! remaining. ! + !---------------------------------------------------------------------------------! + + + !----- Add the water that can come from the soil. --------------------------------! + wmass_needed = wmass_needed - wmass_available + energy_needed = energy_needed - energy_available + !---------------------------------------------------------------------------------! + + + !----- Find the amount of latent heat associated with condensation. --------------! + call uint2tl(energy_needed/wmass_needed,tempk_needed,fracliq_needed) + energy_latent = wmass_needed * ( (1.0 - fracliq_needed) * alvi(tempk_needed) & + + fracliq_needed * alvl(tempk_needed) ) + !---------------------------------------------------------------------------------! + + + !----- Dump what we can dump on the top soil layer. ------------------------------! + soil_water(mzg) = soil_water (mzg) - wmass_available * dslzi(mzg) * wdnsi + soil_energy(mzg) = soil_energy(mzg) & + - ( energy_available - energy_latent) * dslzi(mzg) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Condense the remaining, and hope for the best. ! + !---------------------------------------------------------------------------------! + !----- Update the canopy air space properties. -----------------------------------! + can_rvap = can_rvap - wmass_needed * wcapcani + can_enthalpy = can_enthalpy - ( energy_needed + energy_latent ) * hcapcani + wmass_free = 0.0 + energy_free = 0.0 + depth_free = 0.0 + !---------------------------------------------------------------------------------! + end if + !------------------------------------------------------------------------------------! + end if !---------------------------------------------------------------------------------------! @@ -1073,6 +1375,11 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n !------------------------------------------------------------------------------------! + !----- Update the flag for temporary surface water. ---------------------------------! + flag_sfcwater = 0 + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! ! The total mass should be either zero or greater than rk4tiny_sfcw_mass, ! @@ -1097,6 +1404,11 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n !------------------------------------------------------------------------------------! + !----- Update the flag for temporary surface water. ---------------------------------! + flag_sfcwater = 1 + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! ! If the total amount of temporary surface water is not enough to make it stable, ! ! we impose it to have a single layer with all the ponding/snow in there. ! @@ -1119,6 +1431,11 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n newsfcw_depth (:) = 0. + !----- Update the flag for temporary surface water. ---------------------------------! + flag_sfcwater = 2 + !------------------------------------------------------------------------------------! + + !---- Check whether there is enough snow for a new layer. ---------------------------! nlayers = ksnnew newlayers = 1 @@ -1196,6 +1513,72 @@ subroutine leaf3_adjust_sfcw(mzg,mzs,soil_energy,soil_water,soil_text,sfcwater_n end if !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! Compute the budget variables after the adjustments. ! + !---------------------------------------------------------------------------------------! + wmass_cas_end = can_rvap * wcapcan + enthalpy_cas_end = can_enthalpy * hcapcan + wmass_virtual_end = virtual_water + energy_virtual_end = virtual_energy + wmass_sfcw_end = sum_sfcw_mass + energy_sfcw_end = sum_sfcw_energy + wmass_soil_end = soil_water (mzg) * dslz(mzg) * wdns + energy_soil_end = soil_energy(mzg) * dslz(mzg) + wmass_total_end = wmass_virtual_end + wmass_sfcw_end + wmass_soil_end & + + wmass_cas_end + energy_total_end = energy_virtual_end + energy_sfcw_end + energy_soil_end & + + enthalpy_cas_end + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Check whether energy and mass are conserved. ! + !---------------------------------------------------------------------------------------! + wmass_total_rch = 2.0 * abs(wmass_total_end - wmass_total_beg) & + / (abs(wmass_total_end ) + abs(wmass_total_beg )) + energy_total_rch = 2.0 * abs(energy_total_end - energy_total_beg) & + / (abs(energy_total_end) + abs(energy_total_beg)) + if (wmass_total_rch > 1.e-6 .or. energy_total_rch > 1.e-6) then + write (unit=*,fmt='(a)') '------------------------------------------------' + write (unit=*,fmt='(a)') ' Water or energy conservation was violated!!! ' + write (unit=*,fmt='(a)') '------------------------------------------------' + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' - Initial conditions: ' + write (unit=*,fmt='(a,1x,es14.7)') ' + Total water mass = ',wmass_total_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + CAS mass = ',wmass_cas_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Virtual mass = ',wmass_virtual_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Ponding/snow mass = ',wmass_sfcw_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Soil mass = ',wmass_soil_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Total energy = ',energy_total_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + CAS enthalpy = ',enthalpy_cas_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Virtual energy = ',energy_virtual_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Ponding/snow energy = ',energy_sfcw_beg + write (unit=*,fmt='(a,1x,es14.7)') ' + Soil energy = ',energy_soil_beg + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' - Final conditions: ' + write (unit=*,fmt='(a,1x,es14.7)') ' + Total water mass = ',wmass_total_end + write (unit=*,fmt='(a,1x,es14.7)') ' + CAS mass = ',wmass_cas_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Virtual mass = ',wmass_virtual_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Ponding/snow mass = ',wmass_sfcw_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Soil mass = ',wmass_soil_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Total energy = ',energy_total_end + write (unit=*,fmt='(a,1x,es14.7)') ' + CAS enthalpy = ',enthalpy_cas_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Virtual energy = ',energy_virtual_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Ponding/snow energy = ',energy_sfcw_end + write (unit=*,fmt='(a,1x,es14.7)') ' + Soil energy = ',energy_soil_end + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' - Relative error: ' + write (unit=*,fmt='(a,1x,es14.7)') ' + Total water mass = ',wmass_total_rch + write (unit=*,fmt='(a,1x,es14.7)') ' + Total energy = ',energy_total_rch + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') '------------------------------------------------' + call abort_run('Energy or water is not being conserved!!!' & + ,'leaf3_adjust_sfcw','leaf3_tw.f90') + end if + !---------------------------------------------------------------------------------------! + return end subroutine leaf3_adjust_sfcw !==========================================================================================! diff --git a/BRAMS/src/surface/leaf3_utils.f90 b/BRAMS/src/surface/leaf3_utils.f90 index bb8a6a5a1..f0268451c 100644 --- a/BRAMS/src/surface/leaf3_utils.f90 +++ b/BRAMS/src/surface/leaf3_utils.f90 @@ -1302,8 +1302,9 @@ subroutine leaf3_sfcrad(mzg,mzs,ip,soil_water,soil_color,soil_text,sfcwater_dept !------ Diagnose snow temperature and the influence of snow covering veg. -----------! - nveg = nint(leaf_class) - ksn = nint(sfcwater_nlev) + nveg = nint(leaf_class) + nsoil = nint(soil_text(mzg)) + ksn = nint(sfcwater_nlev) !------ Defining the exposed area. --------------------------------------------------! vf = veg_fracarea * (1. - snowfac) @@ -1314,7 +1315,6 @@ subroutine leaf3_sfcrad(mzg,mzs,ip,soil_water,soil_color,soil_text,sfcwater_dept ! 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, use constants soil value for granite. ----------------------------! @@ -1710,11 +1710,13 @@ subroutine leaf3_atmo1d(m2,m3,i,j,thp,theta,rv,rtp,co2p,up,vp,pitot,dens,height , atm_vels & ! intent(out) , atm_temp & ! intent(out) , atm_theiv & ! intent(out) + , atm_vpdef & ! intent(out) , pcpgl & ! intent(out) , qpcpgl & ! intent(out) , dpcpgl ! ! intent(out) use rconstants, only : srtwo ! ! intent(in) use therm_lib , only : thetaeiv & ! function + , vpdefil & ! function , exner2press & ! function , extheta2temp ! ! function @@ -1771,6 +1773,7 @@ subroutine leaf3_atmo1d(m2,m3,i,j,thp,theta,rv,rtp,co2p,up,vp,pitot,dens,height atm_prss = exner2press(atm_exner) atm_temp = extheta2temp(atm_exner,atm_theta) atm_theiv = thetaeiv(atm_thil,atm_prss,atm_temp,atm_rvap,atm_rtot) + atm_vpdef = vpdefil(atm_prss,atm_temp,atm_shv,.true.) pcpgl = pcpg(i,j) qpcpgl = qpcpg(i,j) dpcpgl = dpcpg(i,j) @@ -1791,7 +1794,8 @@ end subroutine leaf3_atmo1d ! This sub-routine assigns various canopy air space variables for the case in which ! ! leaf is not solved. ! !------------------------------------------------------------------------------------------! -subroutine leaf0(m2,m3,mpat,i,j,can_theta,can_rvap,can_co2,can_prss,can_theiv,patch_area) +subroutine leaf0(m2,m3,mpat,i,j,can_theta,can_rvap,can_co2,can_prss,can_theiv,can_vpdef & + ,patch_area) use mem_leaf , only : dthcon & ! intent(in) , drtcon & ! intent(in) , pctlcon ! ! intent(in) @@ -1815,6 +1819,7 @@ subroutine leaf0(m2,m3,mpat,i,j,can_theta,can_rvap,can_co2,can_prss,can_theiv,pa , cpdry & ! intent(in) , cph2o ! ! intent(in) use therm_lib , only : thetaeiv & ! function + , vpdefil & ! function , rslif & ! function , reducedpress & ! function , idealdenssh & ! function @@ -1834,6 +1839,7 @@ subroutine leaf0(m2,m3,mpat,i,j,can_theta,can_rvap,can_co2,can_prss,can_theiv,pa real , dimension(m2,m3,mpat), intent(inout) :: can_co2 real , dimension(m2,m3,mpat), intent(inout) :: can_prss real , dimension(m2,m3,mpat), intent(inout) :: can_theiv + real , dimension(m2,m3,mpat), intent(inout) :: can_vpdef real , dimension(m2,m3,mpat), intent(inout) :: patch_area !---------------------------------------------------------------------------------------! @@ -1860,6 +1866,8 @@ subroutine leaf0(m2,m3,mpat,i,j,can_theta,can_rvap,can_co2,can_prss,can_theiv,pa can_theiv(i,j,2) = thetaeiv(can_theta(i,j,2),can_prss(i,j,2),can_temp,can_rvap(i,j,2) & ,can_rvap(i,j,2)) + can_vpdef(i,j,2) = vpdefil(can_prss(i,j,2),can_temp,can_shv,.true.) + can_enthalpy = tq2enthalpy(can_temp,can_shv,.true.) can_rhos = idealdenssh(can_prss(i,j,2),can_temp,can_shv) can_cp = (1.0 - can_shv) * cpdry + can_shv * cph2o diff --git a/BRAMS/src/surface/leaf_coms.f90 b/BRAMS/src/surface/leaf_coms.f90 index c41acb58c..53b315c7f 100644 --- a/BRAMS/src/surface/leaf_coms.f90 +++ b/BRAMS/src/surface/leaf_coms.f90 @@ -44,7 +44,7 @@ module leaf_coms ! Commons used by LEAF-3. ! !---------------------------------------------------------------------------------------! integer :: niter_leaf ! ! number of leaf timesteps - + integer :: flag_sfcwater ! ! flag to determine the pounding water stability. logical :: resolvable ! ! Flag to determine whether to resolve vegetation or not. real :: dtll & ! leaf timestep @@ -65,6 +65,7 @@ module leaf_coms , atm_shv & ! specific humidity at top of surface layer [ kg/kg] , atm_co2 & ! CO2 mixing ratio at top of surface layer [µmol/mol] , atm_theiv & ! atmospheric ice-vapour equiv. potential temp. [ K] + , atm_vpdef & ! atmospheric vapour pressure deficit [ Pa] , atm_rhos & ! air density [ kg/m³] , geoht & ! height at top of surface layer [ m] , atm_exner & ! "Exner" function at surface (Exner/cp) [ ---] @@ -556,24 +557,27 @@ subroutine flush_leaf_coms(idel) !------------------------------------------------------------------------------------! select case (trim(idel)) case ('INITIAL','GRID_POINT') - atm_up = 0 - atm_vp = 0. - atm_thil = 0. - atm_theta = 0 - atm_temp = 0. - atm_rvap = 0. - atm_rtot = 0 - atm_shv = 0. - atm_co2 = 0. - atm_theiv = 0 - atm_rhos = 0. - geoht = 0. - atm_exner = 0 - atm_prss = 0. - atm_vels = 0. - pcpgl = 0 - qpcpgl = 0. - dpcpgl = 0. + atm_up = 0 + atm_vp = 0. + atm_thil = 0. + atm_theta = 0 + atm_temp = 0. + atm_temp_zcan = 0. + atm_enthalpy = 0. + atm_rvap = 0. + atm_rtot = 0 + atm_shv = 0. + atm_co2 = 0. + atm_theiv = 0 + atm_vpdef = 0 + atm_rhos = 0. + geoht = 0. + atm_exner = 0 + atm_prss = 0. + atm_vels = 0. + pcpgl = 0 + qpcpgl = 0. + dpcpgl = 0. end select !------------------------------------------------------------------------------------! @@ -592,6 +596,7 @@ subroutine flush_leaf_coms(idel) can_exner = 0 can_rhos = 0. can_depth = 0. + flag_sfcwater = 0 sfcwater_energy_ext (:) = 0. @@ -625,6 +630,7 @@ subroutine flush_leaf_coms(idel) gsw = 0. ggnet = 0. ggbare = 0. + ggsoil = 0. ggveg = 0. rho_ustar = 0. diff --git a/BRAMS/src/surface/mem_leaf.f90 b/BRAMS/src/surface/mem_leaf.f90 index f05bac8af..badd8c603 100644 --- a/BRAMS/src/surface/mem_leaf.f90 +++ b/BRAMS/src/surface/mem_leaf.f90 @@ -69,6 +69,7 @@ Module mem_leaf real, dimension(:,:,:), pointer :: can_rvap & ! Vapour Mixing ratio [ kg/kg] , can_theta & ! Potential temperature [ K] , can_theiv & ! Theta_Eiv [ K] + , can_vpdef & ! Vapour press. deficit [ Pa] , can_prss & ! Pressure [ Pa] , can_co2 ! ! CO2 mixing ratio [ µmol/mol] @@ -167,9 +168,17 @@ Module mem_leaf ! 3. Test # 3 of Mahfouf and Noilhan (1991) ! 4. Test # 4 of Mahfouf and Noilhan (1991) integer :: isoilbc ! Bottom soil boundary condition. - ! 0. Bedrock - ! 1. Free drainage - ! 2. Half drainage + ! 0. Flat Bedrock (zero flow) + ! 1. Free drainage (gravity flow) + ! 2. Sink hole drainage (BC at -3.1MPa+z) + ! 3. Water table (BC at field capacity) + ! 4. Aquifer (BC at porosity) + ! 5. Lateral drainage (gravity flow at slope) + ! This requires sldrain, in future options + ! 0, 1, and 5 could be merged. + real :: sldrain ! Slope for lateral drainage in degrees. Values + ! can range between 0 (flat bedrock) and 90 + ! degrees (free drainage). integer :: ipercol ! Percolation scheme: ! 0. Original method, from LEAF-3. Shed liquid ! in excess of a 1:9 liquid-to-ice ratio @@ -257,6 +266,7 @@ subroutine alloc_leaf(leaf,nz,nx,ny,nzg,nzs,np,ng,teb_spm) allocate (leaf%can_rvap ( nx,ny,np)) allocate (leaf%can_theta ( nx,ny,np)) allocate (leaf%can_theiv ( nx,ny,np)) + allocate (leaf%can_vpdef ( nx,ny,np)) allocate (leaf%can_prss ( nx,ny,np)) allocate (leaf%can_co2 ( nx,ny,np)) @@ -355,6 +365,7 @@ subroutine nullify_leaf(leaf) nullify(leaf%can_rvap ) nullify(leaf%can_theta ) nullify(leaf%can_theiv ) + nullify(leaf%can_vpdef ) nullify(leaf%can_prss ) nullify(leaf%can_co2 ) @@ -452,6 +463,7 @@ subroutine zero_leaf(leaf) if (associated(leaf%can_rvap )) leaf%can_rvap = 0.0 if (associated(leaf%can_theta )) leaf%can_theta = 0.0 if (associated(leaf%can_theiv )) leaf%can_theiv = 0.0 + if (associated(leaf%can_vpdef )) leaf%can_vpdef = 0.0 if (associated(leaf%can_prss )) leaf%can_prss = 0.0 if (associated(leaf%can_co2 )) leaf%can_co2 = 0.0 @@ -547,6 +559,7 @@ subroutine dealloc_leaf(leaf) if (associated(leaf%can_rvap )) deallocate(leaf%can_rvap ) if (associated(leaf%can_theta )) deallocate(leaf%can_theta ) if (associated(leaf%can_theiv )) deallocate(leaf%can_theiv ) + if (associated(leaf%can_vpdef )) deallocate(leaf%can_vpdef ) if (associated(leaf%can_prss )) deallocate(leaf%can_prss ) if (associated(leaf%can_co2 )) deallocate(leaf%can_co2 ) @@ -775,6 +788,10 @@ subroutine filltab_leaf(leaf,leafm,imean,nmz,nmx,nmy,nmzg,nmzs,nmpat,ng) call vtables2(leaf%can_theiv,leafm%can_theta,ng,npts,imean & ,'CAN_THEIV :6:hist:anal:mpti:mpt3'//trim(str_recycle)) + if (associated(leaf%can_vpdef)) & + call vtables2(leaf%can_vpdef,leafm%can_vpdef,ng,npts,imean & + ,'CAN_VPDEF :6:hist:anal:mpti:mpt3'//trim(str_recycle)) + if (associated(leaf%can_prss)) & call vtables2(leaf%can_prss,leafm%can_prss,ng,npts,imean & ,'CAN_PRSS :6:hist:anal:mpti:mpt3'//trim(str_recycle)) diff --git a/BRAMS/src/surface/ruser.f90 b/BRAMS/src/surface/ruser.f90 index 963ba8901..7eda9d9f7 100644 --- a/BRAMS/src/surface/ruser.f90 +++ b/BRAMS/src/surface/ruser.f90 @@ -359,11 +359,12 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so ,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) + ,veg_water,veg_hcap,veg_energy,can_prss,can_theiv,can_vpdef & + ,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 @@ -433,6 +434,7 @@ 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_hcap real, dimension( n2,n3,npat), intent(inout) :: can_prss real, dimension( n2,n3,npat), intent(inout) :: can_theiv + real, dimension( n2,n3,npat), intent(inout) :: can_vpdef real, dimension( n2,n3,npat), intent(inout) :: can_theta real, dimension( n2,n3,npat), intent(inout) :: can_rvap real, dimension( n2,n3,npat), intent(inout) :: can_co2 @@ -504,7 +506,9 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so ! can_exner = press2exner(can_prss(i,j,1)) ! can_temp = extheta2temp(can_exner,theta(k2,i,j)) ! can_theiv(i,j,1) = thetaeiv(can_theta(i,j,1),can_prss(i,j,1),can_temp & - ! ,can_rvap(i,j,1),can_rvap(i,j,1),-91) + ! ,can_rvap(i,j,1),can_rvap(i,j,1)) + ! can_vpdef(i,j,1) = vpdefil (can_prss(i,j,1),can_temp,can_rvap(i,j,1) & + ! ,.false.) ! !----- Water patch, so we set vegetation properties to zero. -----------------! ! veg_energy(i,j,1) = 0.0 @@ -559,6 +563,7 @@ subroutine sfcinit_nofile_user(n1,n2,n3,mzg,mzs,npat,ifm,theta,pi0,pp,rv,co2p,so ! can_prss (i,j,ipat) = ! can_theiv(i,j,ipat) = + ! can_vpdef(i,j,ipat) = ! can_theta(i,j,ipat) = ! can_rvap (i,j,ipat) = ! can_co2 (i,j,ipat) = diff --git a/BRAMS/src/turb/mem_turb.f90 b/BRAMS/src/turb/mem_turb.f90 index 1e106f0f5..eb92e2d80 100644 --- a/BRAMS/src/turb/mem_turb.f90 +++ b/BRAMS/src/turb/mem_turb.f90 @@ -329,27 +329,27 @@ subroutine filltab_turb(turb,turbm,imean,n1,n2,n3,ng) if (associated(turb%sflux_u)) & call vtables2(turb%sflux_u,turbm%sflux_u,ng,npts,imean & - ,'SFLUX_U :2:anal:mpt3:mpt1') + ,'SFLUX_U :2:anal:mpti:mpt3:mpt1') if (associated(turb%sflux_v)) & call vtables2(turb%sflux_v,turbm%sflux_v,ng,npts,imean & - ,'SFLUX_V :2:anal:mpt3:mpt1') + ,'SFLUX_V :2:anal:mpti:mpt3:mpt1') if (associated(turb%sflux_w)) & call vtables2(turb%sflux_w,turbm%sflux_w,ng,npts,imean & - ,'SFLUX_W :2:anal:mpt3') + ,'SFLUX_W :2:anal:mpti:mpt3') if (associated(turb%sflux_t)) & call vtables2(turb%sflux_t,turbm%sflux_t,ng,npts,imean & - ,'SFLUX_T :2:anal:mpt3') + ,'SFLUX_T :2:anal:mpti:mpt3') if (associated(turb%sflux_r)) & call vtables2(turb%sflux_r,turbm%sflux_r,ng,npts,imean & - ,'SFLUX_R :2:anal:mpt3') + ,'SFLUX_R :2:anal:mpti:mpt3') if (associated(turb%sflux_c)) & call vtables2(turb%sflux_c,turbm%sflux_c,ng,npts,imean & - ,'SFLUX_C :2:anal:mpt3') + ,'SFLUX_C :2:anal:mpti:mpt3') if (associated(turb%akscal)) & call vtables2(turb%akscal,turbm%akscal,ng,npts,imean & diff --git a/BRAMS/src/turb/tkenn.f90 b/BRAMS/src/turb/tkenn.f90 index fdff04e5d..cf999fabd 100644 --- a/BRAMS/src/turb/tkenn.f90 +++ b/BRAMS/src/turb/tkenn.f90 @@ -244,8 +244,8 @@ subroutine nakanishi(m1,m2,m3,m4,ia,iz,ja,jz,jd,tkep,tket,vt3dd,vt3de,vt3dh,vt3d patchloop: do p=1,m4 if (patch_area(i,j,p) < min_patch_area) cycle patchloop z0w = z0w + patchz0(i,j,p) * patch_area(i,j,p) - ustarw = ustarw + ustar(i,j,p) * patch_area(i,j,p) - tstarw = tstarw + tstar(i,j,p) * patch_area(i,j,p) + ustarw = ustarw + ustar (i,j,p) * patch_area(i,j,p) + tstarw = tstarw + tstar (i,j,p) * patch_area(i,j,p) end do patchloop ustarw = max(ustarw,ustmin) !---------------------------------------------------------------------------------! diff --git a/ED/Template/Template/ED2IN b/ED/Template/Template/ED2IN index b047d679e..fa58f6b8b 100644 --- a/ED/Template/Template/ED2IN +++ b/ED/Template/Template/ED2IN @@ -412,10 +412,9 @@ $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. ! + ! ISOILCOL -- LEAF-3 and ED-2 soil colour classes. 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. ! !---------------------------------------------------------------------------------------! ! ! ! |-----------------------------------------------------------------------| ! @@ -552,17 +551,16 @@ $ED_NL !---------------------------------------------------------------------------------------! - ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. If ! - ! unsure, use 0 for short-term simulations (couple of days), and 1 for long- ! - ! -term simulations (months to years). ! - ! 0. Bedrock. Flux from the bottom of the bottommost layer is set to 0. ! - ! 1. Gravitational flow. The flux from the bottom of the bottommost layer ! - ! is due to gradient of height only. ! - ! 2. Super drainage. Soil moisture of the ficticious layer beneath the ! - ! bottom is always at dry air soil moisture. ! - ! 3. Half-way. Assume that the fictious layer beneath the bottom is always ! - ! at field capacity. ! - ! 4. Aquifer. Soil moisture of the ficticious layer beneath the bottom is ! + ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Choose ! + ! the option according to the site characteristics. ! + ! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. ! + ! 1. Gravitational flow (free drainage). The flux from the bottom of the ! + ! bottommost layer is due to gradient of height only. ! + ! 2. Lateral drainage. Similar to free drainage, but the gradient is ! + ! reduced by the slope not being completely vertical. The reduction is ! + ! controlled by variable SLDRAIN. In the future options 0, 1, and 5 may ! + ! be combined into a single option. ! + ! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom is ! ! always at saturation. ! !---------------------------------------------------------------------------------------! NL%ISOILBC = mysoilbc @@ -571,6 +569,19 @@ $ED_NL + !---------------------------------------------------------------------------------------! + ! SLDRAIN -- This is used only when ISOILBC is set to 2. In this case SLDRAIN is the ! + ! equivalent slope that will slow down drainage. If this is set to zero, ! + ! then lateral drainage reduces to flat bedrock, and if this is set to 90, ! + ! then lateral drainage becomes free drainage. SLDRAIN must be between 0 ! + ! and 90. ! + !---------------------------------------------------------------------------------------! + NL%SLDRAIN = mysldrain + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! IVEGT_DYNAMICS -- The vegetation dynamics scheme. ! ! 0. No vegetation dynamics, the initial state will be preserved, ! @@ -688,6 +699,19 @@ $ED_NL + !---------------------------------------------------------------------------------------! + ! IGRASS -- This controls the dynamics and growth calculation for grasses. A new ! + ! grass scheme is now available where bdead = 0, height is a function of bleaf! + ! and growth happens daily. ALS (3/3/12) ! + ! 0: grasses behave like trees as in ED2.1 (old scheme) ! + ! ! + ! 1: new grass scheme as described above ! + !---------------------------------------------------------------------------------------! + NL%IGRASS = 0 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! IPHEN_SCHEME -- It controls the phenology scheme. Even within each scheme, the ! @@ -828,11 +852,18 @@ $ED_NL !---------------------------------------------------------------------------------------! ! DECOMP_SCHEME -- This specifies the dependence of soil decomposition on temperature. ! - ! 0. ED-2.0 default, the original exponential ! + ! 0. ED-2.1 default, the original exponential (low temperature ! + ! limitation only). ! ! 1. Lloyd and Taylor (1994) model ! ! [[option 1 requires parameters to be set in xml]] ! + ! 2. Similar to ED-1.0 and CENTURY model, heterotrophic respiration ! + ! reaches a maximum at around 38C (using the default parameters), ! + ! then quickly falls to zero at around 50C. It applies a similar ! + ! function for soil moisture, which allows higher decomposition ! + ! rates when it is close to the optimal, plumetting when it is ! + ! almost saturated. ! !---------------------------------------------------------------------------------------! - NL%DECOMP_SCHEME = 0 + NL%DECOMP_SCHEME = mydecomp !---------------------------------------------------------------------------------------! @@ -859,6 +890,33 @@ $ED_NL !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! IDDMORT_SCHEME -- This flag determines whether storage should be accounted in the ! + ! carbon balance. ! + ! 0 -- Carbon balance is done in terms of fluxes only. This is the ! + ! default in ED-2.1 ! + ! 1 -- Carbon balance is offset by the storage pool. Plants will be ! + ! in negative carbon balance only when they run out of storage ! + ! and are still losing more carbon than gaining. ! + ! ! + ! DDMORT_CONST -- This constant (k) determines the relative contribution of light ! + ! and soil moisture to the density-dependent mortality rate. Values ! + ! range from 0 (soil moisture only) to 1 (light only). ! + ! ! + ! mort1 ! + ! mu_DD = ------------------------- ! + ! 1 + exp [ mort2 * cr ] ! + ! ! + ! CB CB ! + ! cr = k ------------- + (1 - k) ------------- ! + ! CB_lightmax CB_watermax ! + !---------------------------------------------------------------------------------------! + NL%IDDMORT_SCHEME = mymortscheme + NL%DDMORT_CONST = myddmortconst + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! The following variables are factors that control photosynthesis and respiration. ! ! Notice that some of them are relative values whereas others are absolute. ! @@ -987,16 +1045,23 @@ $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. ! + ! 3. Fire will be triggered with enough biomass and accumulated ! + ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! + ! This is soil independent. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! - ! 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 1m ! - ! that will prevent fires to happen. ! - ! < 0. - Minimum mean soil moisture potential in MPa of the top 1m ! - ! 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. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2 or 3, and it has different ! + ! meanings. The sign here matters. ! + ! When INCLUDE_FIRE = 2: ! + ! >= 0. - Minimum relative soil moisture above dry air of the top ! + ! 1m that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top ! + ! 1m 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. ! + ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! + ! the minimum water deficit, in kg/m2/day, to trigger fires. ! !---------------------------------------------------------------------------------------! NL%INCLUDE_FIRE = myfire NL%FIRE_PARAMETER = myfuel @@ -1211,7 +1276,7 @@ $ED_NL ! TREEFALL_DISTURBANCE_RATE is internally adjusted so the ! ! average patch age is still 1/TREEFALL_DISTURBANCE_RATE ! !---------------------------------------------------------------------------------------! - NL%TREEFALL_DISTURBANCE_RATE = 0.014 + NL%TREEFALL_DISTURBANCE_RATE = mytreefall NL%TIME2CANOPY = 0. !---------------------------------------------------------------------------------------! @@ -1354,6 +1419,27 @@ $ED_NL + !---------------------------------------------------------------------------------------! + ! Census variables. This is going to create unique census statuses to cohorts, to ! + ! better compare the model with census observations. In case you don't intend to ! + ! compare the model with census data, set up DT_CENSUS to 1., otherwise you may reduce ! + ! cohort fusion. ! + ! DT_CENSUS -- Time between census, in months. Currently the maximum is 60 ! + ! months, to avoid excessive memory allocation. Every time the ! + ! simulation reaches the census time step, all census tags will be ! + ! reset. ! + ! YR1ST_CENSUS -- In which year was the first census conducted? ! + ! MON1ST_CENSUS -- In which month was the first census conducted? ! + ! MIN_RECRUIT_DBH -- Minimum DBH that is measured in the census, in cm. ! + !---------------------------------------------------------------------------------------! + NL%DT_CENSUS = mydtcensus + NL%YR1ST_CENSUS = myyr1stcensus + NL%MON1ST_CENSUS = mymon1stcensus + NL%MIN_RECRUIT_DBH = myminrecruitdbh + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! The following variables are used to control the detailed output for debugging ! ! purposes. ! diff --git a/ED/Template/Template/callserial.sh b/ED/Template/Template/callserial.sh index 134540bac..50ded4b73 100755 --- a/ED/Template/Template/callserial.sh +++ b/ED/Template/Template/callserial.sh @@ -11,7 +11,7 @@ currloc=`pwd` # Current location mddir='met_driver' datasrc='mypackdata' -datadest='/scratch/ed2_data' +datadest='/scratch/mlongo' datasize=39000000 #------------------------------------------------------------------------------------------# @@ -117,7 +117,7 @@ else #----- 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} + rsync -Pruvaz ${datasrc}/${mddir} ${datadest} 1>> ${logfile} 2>> ${errfile} #----- Copy finished. Create a file to unlock this node. ------------------------# @@ -172,7 +172,7 @@ else #----- 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} + rsync -Pruvaz ${datasrc}/${mddir} ${datadest} 1>> ${logfile} 2>> ${errfile} #----- Copy finished. Create a file to unlock this node. ---------------------------# diff --git a/ED/Template/Template/patchprops.r b/ED/Template/Template/patchprops.r index 0119f98e1..6ebf54fa1 100644 --- a/ED/Template/Template/patchprops.r +++ b/ED/Template/Template/patchprops.r @@ -7,10 +7,11 @@ outroot = "thisoutroot" myplaces = c("thispoly") # Places to find patch properties -outform = "png" # Formats for output file. Supported formats are: +outform = "thisoutform" # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing depth = 96 # PNG resolution, in pixels per inch paper = "letter" # Paper size, to define the plot shape ptsz = 14 # Font size. @@ -315,7 +316,10 @@ for (ipy in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if #------------------------------------------------------------------------------# @@ -419,7 +423,11 @@ for (ipy in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) }#end if #------------------------------------------------------------------------# diff --git a/ED/Template/Template/plot_budget.r b/ED/Template/Template/plot_budget.r index cdc07fd02..7484c7be2 100644 --- a/ED/Template/Template/plot_budget.r +++ b/ED/Template/Template/plot_budget.r @@ -13,10 +13,11 @@ ptype = "l" # Type of plot ptyped = "p" # Type of plot ptypeb = "o" # Type of plot -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing cex.main = 0.8 # Scale coefficient for the title @@ -389,7 +390,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(theme," - ",thispoi$lieu,"(Patch ",ipa,")", diff --git a/ED/Template/Template/plot_census.r b/ED/Template/Template/plot_census.r new file mode 100644 index 000000000..c2ff39676 --- /dev/null +++ b/ED/Template/Template/plot_census.r @@ -0,0 +1,2573 @@ +rm(list=ls()) + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" +monthbeg = thismontha +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +metcyca = mymetcyca # First year of the met cycle +metcycz = mymetcycz # Last year of the met cycle +various.cycles = myvarcycle +myplaces = c("thispoly") +sasmonth.short = c(2,5,8,11) +sasmonth.long = 5 +nyears.long = 25 +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing + +byeold = TRUE # Remove old files of the given format? + +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? + +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # inset distance between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.20 +cex.main = 0.8 # Scale coefficient for the title +slz.min = -5.0 # Find the deepest depth that trees access water. +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Types of variables to use to determine mortality, growth, and recruitment. # +#------------------------------------------------------------------------------------------# +recr.vars = c("n") +recr.labels = c("Individuals") +mort.vars = c("n") +mort.labels = c("Individuals") +growth.vars = c("dbh","agb","ba") +growth.labels = c("DBH","Above Ground Biomass","Basal Area") +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Comparisons. # +#------------------------------------------------------------------------------------------# +#---- 1. Plot time series of median and confidence intervals. -----------------------------# +pratets = list() +pratets[[1]] = list( ed2.rate = "recr" + , sta.rate = "recr" + , sizetoo = FALSE + , pfttoo = TRUE + , desc.rate = "Recruitment rate" + , unit.rate = "%/yr" + , col.ed2 = c("chartreuse4","chartreuse") + , col.sta = c("grey21" ,"grey42" ) + , indiv = recr.vars + , desc.indiv = recr.labels + , legpos = "topright" + , plog = "" + )#end list +pratets[[2]] = list( ed2.rate = "mort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Mortality rate" + , unit.rate = "%/yr" + , col.ed2 = c("purple4","mediumpurple1") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "" + )#end list +pratets[[3]] = list( ed2.rate = "ddmort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Density-dependent mort. rate" + , unit.rate = "%/yr" + , col.ed2 = c("slateblue","slateblue1") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "" + )#end list +pratets[[4]] = list( ed2.rate = "dimort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Density-independent mort. rate" + , unit.rate = "%/yr" + , col.ed2 = c("royalblue4","steelblue") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "" + )#end list +pratets[[5]] = list( ed2.rate = "growth" + , sta.rate = "growth" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Growth rate" + , unit.rate = "%/yr" + , col.ed2 = c("saddlebrown","darkgoldenrod2") + , col.sta = c("grey21" ,"grey42" ) + , indiv = growth.vars + , desc.indiv = growth.labels + , legpos = "topright" + , plog = "" + )#end list + + + +#---- 2. Plot median and confidence intervals for all size classes and censuses. ----------# +pratesize = list() +pratesize[[1]] = list( ed2.rate = "mort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Mortality rate" + , unit.rate = "%/yr" + , col.ed2 = c("purple4","mediumpurple1") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "y" + )#end list +pratesize[[2]] = list( ed2.rate = "ddmort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Density-dependent mort. rate" + , unit.rate = "%/yr" + , col.ed2 = c("slateblue","slateblue1") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "y" + )#end list +pratesize[[3]] = list( ed2.rate = "dimort" + , sta.rate = "mort" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Density-independent mort. rate" + , unit.rate = "%/yr" + , col.ed2 = c("royalblue4","steelblue") + , col.sta = c("grey21" ,"grey42" ) + , indiv = mort.vars + , desc.indiv = mort.labels + , legpos = "topright" + , plog = "y" + )#end list +pratesize[[4]] = list( ed2.rate = "growth" + , sta.rate = "growth" + , sizetoo = TRUE + , pfttoo = TRUE + , desc.rate = "Growth rate" + , unit.rate = "%/yr" + , col.ed2 = c("saddlebrown","darkgoldenrod2") + , col.sta = c("grey21" ,"grey42" ) + , indiv = growth.vars + , desc.indiv = growth.labels + , legpos = "topright" + , plog = "y" + )#end list +#------------------------------------------------------------------------------------------# + + + + + + +#----- XYZ plots, to explore the parameter space. -----------------------------------------# +xyzvar = list() +xyzvar$xvar = list( list( vname = "lai" + , desc = "Leaf area index" + , unit = "m2/m2" + , add = 0. + , mult = 1. + , leg = "right" + , log = FALSE + )#end list + , list( vname = "ba" + , desc = "Basal area" + , unit = "cm2/m2" + , add = 0. + , mult = 1. + , leg = "right" + , log = FALSE + )#end list + , list( vname = "agb" + , desc = "Above-ground biomass" + , unit = "kgC/m2" + , add = 0. + , mult = 1. + , leg = "right" + , log = FALSE + )#end list + )#end list +xyzvar$yvar = list( list( vname = "recr" + , desc = "Recruitment rate" + , key = "Recruitment" + , unit = "%pop/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = FALSE + )#end list + , list( vname = "mort" + , desc = "Mortality rate" + , key = "Mortality" + , unit = "%pop/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + , list( vname = "ddmort" + , desc = "Density-dependent mortality rate" + , key = "DD Mort." + , unit = "%pop/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + , list( vname = "dimort" + , desc = "Density-independent mortality rate" + , key = "DI Mort." + , unit = "%pop/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + , list( vname = "growdbh" + , desc = "Growth rate (DBH)" + , key = "Growth" + , unit = "%DBH/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + , list( vname = "growagb" + , desc = "Growth rate (AGB)" + , key = "Growth" + , unit = "%AGB/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + , list( vname = "growba" + , desc = "Growth rate (BA)" + , key = "Growth" + , unit = "%BA/yr" + , add = 0. + , mult = 100. + , leg = "top" + , log = TRUE + , sizetoo = TRUE + )#end list + )#end list +xyzvar$zvar = list( list( vname = "rshort" + , desc = "Mean shortwave radiation" + , unit = "W/m2" + , add = 0. + , mult = 1. + , col.scheme = "muitas" + , log = FALSE + )#end list + , list( vname = "fs.open" + , desc = "Minimum water stress scale" + , unit = "--" + , add = 0. + , mult = 1. + , col.scheme = "imuitas" + , log = FALSE + )#end list + , list( vname = "paw" + , desc = "Minimum available water" + , unit = "%" + , add = 0. + , mult = 100. + , col.scheme = "imuitas" + , log = FALSE + )#end list + , list( vname = "smpot" + , desc = "Maximum matric potential" + , unit = "MPa" + , add = 0. + , mult = 1. + , col.scheme = "muitas" + , log = FALSE + )#end list + , list( vname = "atm.vpd" + , desc = "Above-canopy VPD" + , unit = "hPa" + , add = 0. + , mult = 0.01 + , col.scheme = "muitas" + , log = FALSE + )#end list + , list( vname = "leaf.vpd" + , desc = "Leaf-level VPD" + , unit = "hPa" + , add = 0. + , mult = 0.01 + , col.scheme = "muitas" + , log = FALSE + )#end list + )#end if + + +#----- Load some packages. ----------------------------------------------------------------# +isok = require(hdf5 ) +isok = require(chron ) +isok = require(scatterplot3d) +isok = require(lattice ) +isok = require(maps ) +isok = require(mapdata ) +isok = require(akima ) +isok = require(Hmisc ) +isok = require(sn ) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# SHADY BUSINESS... We must unlock grav from package boot and replace by our good # +# old value from rconstants.r. # +#------------------------------------------------------------------------------------------# +envir = as.environment("package:survival") +unlockBinding("tobin",envir) +#------------------------------------------------------------------------------------------# + + +#----- In case there is some graphic still opened. ----------------------------------------# +graphics.off() +#------------------------------------------------------------------------------------------# + + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length(outform) +#------------------------------------------------------------------------------------------# + + +#----- Set how many variables we will compare. --------------------------------------------# +npratesize = length(pratesize ) +npratets = length(pratets ) +#------------------------------------------------------------------------------------------# + + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +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,"colourmap.r" ,sep="/")) +source(paste(srcdir,"cloudy.r" ,sep="/")) +source(paste(srcdir,"demography.rates.r",sep="/")) +source(paste(srcdir,"epolygon.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,"numutils.r" ,sep="/")) +source(paste(srcdir,"plotsize.r" ,sep="/")) +source(paste(srcdir,"pretty.box.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,"skewnorm.stats.r" ,sep="/")) +source(paste(srcdir,"soilutils.r" ,sep="/")) +source(paste(srcdir,"sombreado.r" ,sep="/")) +source(paste(srcdir,"southammap.r" ,sep="/")) +source(paste(srcdir,"thermlib.r" ,sep="/")) +source(paste(srcdir,"timeutils.r" ,sep="/")) +#----- These should be called after the others. -------------------------------------------# +source(paste(srcdir,"pft.coms.r" ,sep="/")) +#------------------------------------------------------------------------------------------# + + + +#----- Load census data. ------------------------------------------------------------------# +census.file = paste(srcdir,"LBA_MIP.census_summ.RData",sep="/") +load(file=census.file) +#------------------------------------------------------------------------------------------# + + + + +#------------------------------------------------------------------------------------------# +# Types of variables to use to determine mortality, growth, and recruitment. # +#------------------------------------------------------------------------------------------# +nrecr.vars = length(recr.vars ) +nmort.vars = length(mort.vars ) +ngrowth.vars = length(growth.vars) +#------------------------------------------------------------------------------------------# + + + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +wide.size = size +wide.size$width = 1.33 * size$width +#------------------------------------------------------------------------------------------# + + + +#---- Create the main output directory in case there is none. -----------------------------# +if (! file.exists(outroot)) dir.create(outroot) +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Big place loop starts here... # +#------------------------------------------------------------------------------------------# +for (place in myplaces){ + + #----- Retrieve default information about this place and set up some variables. --------# + thispoi = locations(where=place,here=there,yearbeg=yearbeg,yearend=yearend + ,monthbeg=monthbeg) + inpref = thispoi$pathin + outmain = paste(outroot,place,sep="/") + outpref = paste(outmain,"census",sep="/") + lieu = thispoi$lieu + iata = thispoi$iata + suffix = thispoi$iata + yeara = thispoi$yeara + yearz = thispoi$yearz + meszz = thispoi$monz + #---------------------------------------------------------------------------------------# + + + + + #----- Find the census observations for this particular site. --------------------------# + if (iata == "mao" | iata == "bdf"){ + census.name = "census.m34" + }else if(iata == "stm" | iata == "s66"){ + census.name = "census.s67" + }else if(iata == "rao"){ + census.name = "census.pdg" + }else if(iata == "jpr"){ + census.name = "census.fns" + }else if(iata == "btr"){ + census.name = "census.s77" + }else{ + census.name = paste("census.",iata,sep="") + }#end if + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Reset the soil flag. # + #---------------------------------------------------------------------------------------# + read.soil = TRUE + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # We only run this part of the code if there are observations to compare with the # + # model. # + #---------------------------------------------------------------------------------------# + if (census.name %in% ls()){ + + #----- Check that the directories exist. --------------------------------------------# + if (! file.exists(outmain)) dir.create(outmain) + if (! file.exists(outpref)) dir.create(outpref) + #------------------------------------------------------------------------------------# + + + #----- Initialise the parameter space structure. ------------------------------------# + pspace = list() + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Load the census data, from the monthly means. # + #------------------------------------------------------------------------------------# + sta = get(census.name) + n.census = length(sta$when) + n.dbh = length(sta$dbh.breaks)-1 + x.dbh = c(10,sta$dbh.breaks[seq(from=2,to=n.dbh,by=1)]) + dbh.names = dimnames(sta$mort.size$n$median)[[2]] + year4 = numyears(sta$when) + dyear = c(NA,diff(year4)) + census.desc = paste(year4-c(NA,diff(year4)),year4,sep="-") + + + #------------------------------------------------------------------------------------# + # Loop over all months to grab all the census data. # + #------------------------------------------------------------------------------------# + census.idx = NULL + for (y in 2:n.census){ + #----- Find the first and last time to be averaged for this census. --------------# + ts.montha = ( nummonths(sta$when[y-1]) %% 12 ) + ts.yeara = numyears (sta$when[y-1]) + ts.monthz = ( ( (nummonths(sta$when[y]) - 1) %% 12 ) + + 12 * as.integer(nummonths(sta$when[y]) == 1) ) + ts.yearz = numyears (sta$when[y]) - as.integer(ts.monthz == 12) + n.inter = (ts.yearz-ts.yeara-1)*12 + ts.monthz + (12 - ts.montha + 1) + #---------------------------------------------------------------------------------# + census.idx = c(census.idx,rep(y,times=n.inter)) + }#end for + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Find out how many pseudo-census cycles we can repeat. Notice that it is your # + # responsibility to make sure that met driver forcing and census cycles are # + # synchronised, this script will not check it for you. # + #------------------------------------------------------------------------------------# + act.census.yeara = numyears(sta$when[2]) + act.census.yearz = numyears(sta$when[n.census]) + act.census.year = numyears(sta$when) + #------------------------------------------------------------------------------------# + + ncyc = metcycz - metcyca + 1 + if (various.cycles){ + nfullcyc = 1 + floor( (act.census.yeara - 1 - yeara ) / ncyc ) + }else{ + nfullcyc = 1 + }#end if + i1stfull = act.census.yeara - (nfullcyc - 1) * ncyc + n.months = length(census.idx) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Make the vector wit the environmental, plot-level, and size-level dimensions. # + #------------------------------------------------------------------------------------# + dim.envr = c( n.months,nfullcyc) + dim.plot = c(npft+1, n.months,nfullcyc) + dim.size = c(npft+1,n.dbh,n.months,nfullcyc) + #------------------------------------------------------------------------------------# + + + #----- Initialise all the structures for which we will compare. ---------------------# + ts.n.plot = array( 0., dim = dim.plot) + ts.agb.plot = array( NA, dim = dim.plot) + ts.ba.plot = array( NA, dim = dim.plot) + ts.lai.plot = array( NA, dim = dim.plot) + ts.n.size = array( 0., dim = dim.size) + ts.agb.size = array( NA, dim = dim.size) + ts.ba.size = array( NA, dim = dim.size) + ts.lai.size = array( NA, dim = dim.size) + #----- Recruitment. -----------------------------------------------------------------# + ts.recr.plot = list() + for (v in 1:nrecr.vars){ + ts.recr.plot [[recr.vars[v]]] = array( NA, dim = dim.plot) + }#end for + #----- Mortality. -------------------------------------------------------------------# + ts.mort.plot = list() + ts.ddmort.plot = list() + ts.dimort.plot = list() + ts.mort.size = list() + ts.ddmort.size = list() + ts.dimort.size = list() + for (v in 1:nmort.vars){ + ts.mort.plot [[mort.vars[v]]] = array( NA, dim = dim.plot) + ts.ddmort.plot[[mort.vars[v]]] = array( NA, dim = dim.plot) + ts.dimort.plot[[mort.vars[v]]] = array( NA, dim = dim.plot) + ts.mort.size [[mort.vars[v]]] = array( NA, dim = dim.size) + ts.ddmort.size[[mort.vars[v]]] = array( NA, dim = dim.size) + ts.dimort.size[[mort.vars[v]]] = array( NA, dim = dim.size) + }#end for + #----- Growth. ----------------------------------------------------------------------# + ts.growth.plot = list() + ts.growth.size = list() + for (v in 1:ngrowth.vars){ + ts.growth.plot[[growth.vars[v]]] = array( NA, dim = dim.plot) + ts.growth.size[[growth.vars[v]]] = array( NA, dim = dim.size) + }#end for + #----- Environmental variables. -----------------------------------------------------# + ts.rshort = array( NA, dim = dim.envr) + ts.fs.open = array( NA, dim = dim.envr) + ts.paw = array( NA, dim = dim.envr) + ts.smpot = array( NA, dim = dim.envr) + ts.census.year = array( NA, dim = dim.envr) + ts.census.idx = array( NA, dim = dim.envr) + ts.atm.vpd = array( NA, dim = dim.envr) + ts.leaf.vpd = array( NA, dim = dim.envr) + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Loop over all times, and retrieve the data. # + #------------------------------------------------------------------------------------# + for (u in 1:nfullcyc){ + now.month = nummonths(sta$when[1]) + now.year = i1stfull - dyear[2] + (u-1) * ncyc + year.use = act.census.yeara - dyear[2] + for (m in 1:n.months){ + now.month = (now.month %% 12) + 1 + now.year = now.year + as.integer(now.month == 1) + year.use = year.use + as.integer(now.month == 1) + print (paste("ED-2.1: ",paste(mon2mmm(now.month,cap1=T),now.year,sep="-") + ,"; Census: ",paste(act.census.year[census.idx[m]]))) + + #----- Build the file name. ---------------------------------------------------# + cmonth = sprintf("%2.2i",now.month) + cyear = sprintf("%2.2i",now.year ) + myfile = paste(inpref,"-Q-",cyear,"-",cmonth,"-00-000000-g01.h5",sep="") + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # muse is the m that should be used for agb, basal area, and LAI. # + #------------------------------------------------------------------------------# + if (m == 1){ + muse = 1 + }else{ + if (census.idx[m] != census.idx[m-1]){ + muse = m + }#end if + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Read data if the file exists. # + #------------------------------------------------------------------------------# + if (file.exists(myfile)){ + + #----- Read data and close connection immediately after. -------------------# + #print (paste(" * Reading ",basename(myfile),"...",sep="")) + mymont = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) + #---------------------------------------------------------------------------# + + + #---- Read soil information if it hasn't been read yet. --------------------# + if (read.soil){ + read.soil = FALSE + nzg = mymont$NZG + isoilflg = mymont$ISOILFLG + slz = mymont$SLZ + slxsand = mymont$SLXSAND + slxclay = mymont$SLXCLAY + ntext = mymont$NTEXT.SOIL[nzg] + soil = soil.params(ntext,isoilflg,slxsand,slxclay) + dslz = diff(c(slz,0)) + soil.depth = rev(cumsum(rev(dslz))) + soil.dry = rev(cumsum(rev(soil$soilcp * wdns * dslz))) + soil.poro = rev(cumsum(rev(soil$slmsts * wdns * dslz))) + + + #----- Find the layers we care about. -----------------------------------# + sel = slz < slz.min + if (any(sel)){ + ka = which.max(slz[sel]) + }else{ + ka = 1 + }#end if + kz = nzg + }#end if + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Save the year and the census index. # + #---------------------------------------------------------------------------# + ts.census.year[m,u] = year.use + ts.census.idx [m,u] = census.idx [m] + #---------------------------------------------------------------------------# + + + #---- Read in the site-level area. -----------------------------------------# + areasi = mymont$AREA.SI + npatches = mymont$SIPA.N + #---------------------------------------------------------------------------# + + + #----- Read a few patch-level variables. -----------------------------------# + areapa = mymont$AREA * rep(areasi,times=npatches) + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Read in the soil moisture, and find the equivalent matric potential. # + #---------------------------------------------------------------------------# + soil.water = rev(cumsum(rev(mymont$MMEAN.SOIL.WATER * wdns * dslz))) + soil.moist.avg = soil.water / (wdns * soil.depth) + ts.paw [m,u] = ( ( soil.water[ka] - soil.dry [ka] ) + / ( soil.poro [ka] - soil.dry [ka] ) ) + ts.rshort [m,u] = mymont$MMEAN.RSHORT + ts.fs.open [m,u] = mymont$MMEAN.FS.OPEN + ts.smpot [m,u] = ( - smoist2mpot(smoist=soil.moist.avg[ka],mysoil=soil) + * 0.001 * grav ) + ts.atm.vpd [m,u] = mymont$MMEAN.ATM.VPDEF + ts.leaf.vpd[m,u] = mymont$MMEAN.LEAF.VPDEF + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Read the cohort-level variables. Because empty patchs do exist # + # (deserts), we must check whether there is any cohort to be read. If not, # + # assign NA to all variables. # + #---------------------------------------------------------------------------# + ncohorts = mymont$PACO.N + if (any (ncohorts > 0)){ + #----- Make a cohort-level area. ----------------------------------------# + areaconow = rep(areapa,times=ncohorts) + #------------------------------------------------------------------------# + + + #----- Define the DBH classes. ------------------------------------------# + dbhconow = mymont$DBH + dbhcut = cut(dbhconow,breaks=sta$dbh.breaks) + dbhlevs = levels(dbhcut) + dbhfac = match(dbhcut,dbhlevs) + n.dbh = length(dbhlevs) + #------------------------------------------------------------------------# + + + #------------------------------------------------------------------------# + # Load the other cohort-level variables of interest. # + #------------------------------------------------------------------------# + pftconow = mymont$PFT + nplantconow = mymont$NPLANT + agbconow = mymont$AGB.CO + baconow = mymont$BA.CO + laiconow = mymont$LAI.CO + mortconow = rowSums(mymont$MMEAN.MORT.RATE) + ddmortconow = mymont$MMEAN.MORT.RATE[,2] + dimortconow = mortconow - ddmortconow + recruitconow = mymont$RECRUIT.DBH + censtatusconow = mymont$CENSUS.STATUS + dlndbhdtconow = mymont$DLNDBH.DT + dlnagbdtconow = mymont$DLNAGB.DT + dlnbadtconow = mymont$DLNBA.DT + #------------------------------------------------------------------------# + }else{ + areaconow = NA + dbhconow = NA + pftconow = NA + nplantconow = NA + agbconow = NA + baconow = NA + laiconow = NA + mortconow = NA + ddmortconow = NA + dimortconow = NA + recruitconow = NA + censtatusconow = NA + dlndbhdtconow = NA + dlnagbdtconow = NA + dlnbadtconow = NA + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # The following variables are used to scale "intensive" properties # + # (whatever/plant) to "extensive" (whatever/m2). Sometimes it may be used # + # to build weighted averages. # + #---------------------------------------------------------------------------# + w.nplant = nplantconow * areaconow + w.lai = laiconow * areaconow + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Loop over all PFTs. # + #---------------------------------------------------------------------------# + for (p in 1:(npft+1)){ + #------------------------------------------------------------------------# + # Select the subsample. # + #------------------------------------------------------------------------# + if (all(is.na(pftconow))){ + s.dbh = rep(FALSE,times=length(pftconow)) + s.cs2 = rep(FALSE,times=length(pftconow)) + }else if (p <= npft){ + s.dbh = pftconow == p & censtatusconow > 0 + s.cs2 = pftconow == p & censtatusconow == 2 + }else{ + s.dbh = censtatusconow > 0 + s.cs2 = censtatusconow == 2 + }#end if + #------------------------------------------------------------------------# + + + #------------------------------------------------------------------------# + # Find the AGB, LAI, and BA if this is the first time, otherwise, # + # copy from the first time. This is because an actual census would not # + # have the information. # + #------------------------------------------------------------------------# + if (m == muse && any(s.dbh)){ + ts.n.plot [p,m,u] = sum( w.nplant[s.dbh] ) + ts.agb.plot [p,m,u] = sum( w.nplant[s.dbh] * agbconow[s.dbh] ) + ts.ba.plot [p,m,u] = sum( w.nplant[s.dbh] * baconow [s.dbh] ) + ts.lai.plot [p,m,u] = sum( w.lai [s.dbh] ) + }else{ + ts.n.plot [p,m,u] = ts.n.plot [p,muse,u] + ts.agb.plot [p,m,u] = ts.agb.plot [p,muse,u] + ts.ba.plot [p,m,u] = ts.ba.plot [p,muse,u] + ts.lai.plot [p,m,u] = ts.lai.plot [p,muse,u] + }#end if + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Find the PFT-level mortality rates. # + #------------------------------------------------------------------------# + if (any(s.cs2)){ + + #---- This is the number of survivors. -------------------------------# + survivor = sum( w.nplant [s.cs2] ) + previous = sum( w.nplant [s.cs2] + * exp(mortconow [s.cs2])) + ts.mort.plot$n [p,m,u] = log( previous / survivor ) + + survivor = sum( w.nplant [s.cs2]) + previous = sum( w.nplant [s.cs2] + * exp(dimortconow[s.cs2])) + ts.dimort.plot$n[p,m,u] = log( previous / survivor ) + + survivor = sum( w.nplant [s.cs2]) + previous = sum( w.nplant [s.cs2] + * exp(ddmortconow[s.cs2])) + ts.ddmort.plot$n[p,m,u] = log( previous / survivor ) + #---------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Find the PFT-level recruitment rates. # + #------------------------------------------------------------------------# + if (any(s.dbh) & any(s.cs2)){ + #---- This is the number of survivors. -------------------------------# + population = sum(w.nplant[s.dbh]) + established = sum(w.nplant[s.cs2]) + ts.recr.plot$n [p,m,u] = log( population / established) / 12.0 + }#end if + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Growth rates are found only for established cohorts. # + #------------------------------------------------------------------------# + if (any(s.cs2)){ + #----- Estimate the median of this population. -----------------------# + dlndbhdt = dlndbhdtconow [s.cs2] + dlnagbdt = dlnagbdtconow [s.cs2] + dlnbadt = dlnbadtconow [s.cs2] + wgt = w.nplant [s.cs2] + median.dlndbhdt = weighted.quantile( x = dlndbhdtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + median.dlnagbdt = weighted.quantile( x = dlnagbdtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + median.dlnbadt = weighted.quantile( x = dlnbadtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + #---------------------------------------------------------------------# + + #---------------------------------------------------------------------# + # Copy the results to the arrays. # + #---------------------------------------------------------------------# + ts.growth.plot$dbh[p,m,u] = median.dlndbhdt$q + ts.growth.plot$agb[p,m,u] = median.dlnagbdt$q + ts.growth.plot$ba [p,m,u] = median.dlnbadt$q + #---------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------# + # Build the size (DBH) structure arrays. # + #---------------------------------------------------------------------------# + for (d in 1:n.dbh){ + if (all(is.na(dbhfac))){ + this.dbh = rep(FALSE,times=length(dbhfac)) + }else{ + this.dbh = dbhfac == d + }#end if + for (p in 1:(npft+1)){ + #---------------------------------------------------------------------# + # Select the cohorts that will be used here. # + #---------------------------------------------------------------------# + if (p <= npft){ + s.pft = pftconow == p + s.cs2 = s.pft & this.dbh & censtatusconow == 2 + s.dbh = s.pft & this.dbh & censtatusconow > 0 + }else{ + s.cs2 = this.dbh & censtatusconow == 2 + s.dbh = this.dbh & censtatusconow > 0 + }#end if + #---------------------------------------------------------------------# + + + #---------------------------------------------------------------------# + # Find the AGB, LAI, and BA if this is the first time, otherwise, # + # copy from the first time. This is because an actual census would # + # not have the information. # + #---------------------------------------------------------------------# + if (m == muse && any(s.dbh)){ + ts.n.size [p,d,m,u] = sum( w.nplant[s.dbh] ) + ts.agb.size [p,d,m,u] = sum( w.nplant[s.dbh] * agbconow[s.dbh] ) + ts.ba.size [p,d,m,u] = sum( w.nplant[s.dbh] * baconow [s.dbh] ) + ts.lai.size [p,d,m,u] = sum( w.lai [s.dbh] ) + }else{ + ts.n.size [p,d,m,u] = ts.n.size [p,d,muse,u] + ts.agb.size [p,d,m,u] = ts.agb.size [p,d,muse,u] + ts.ba.size [p,d,m,u] = ts.ba.size [p,d,muse,u] + ts.lai.size [p,d,m,u] = ts.lai.size [p,d,muse,u] + }#end if + #---------------------------------------------------------------------# + + if (any(s.cs2)){ + #---- This is the number of survivors and living before. ----------# + survivor = sum( w.nplant [s.cs2] ) + previous = sum( w.nplant [s.cs2] + * exp(mortconow [s.cs2])) + ts.mort.size$n [p,d,m,u] = log( previous / survivor ) + + survivor = sum( w.nplant [s.cs2]) + previous = sum( w.nplant [s.cs2] + * exp(dimortconow [s.cs2])) + ts.dimort.size$n [p,d,m,u] = log( previous / survivor ) + + survivor = sum( w.nplant [s.cs2]) + previous = sum( w.nplant [s.cs2] + * exp(ddmortconow [s.cs2])) + ts.ddmort.size$n [p,d,m,u] = log( previous / survivor ) + }#end if + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Growth rates are found only for established cohorts. # + #---------------------------------------------------------------------# + if (any(s.cs2)){ + #----- Estimate the median of this population. --------------------# + dlndbhdt = dlndbhdtconow [s.cs2] + dlnagbdt = dlnagbdtconow [s.cs2] + dlnbadt = dlnbadtconow [s.cs2] + wgt = w.nplant [s.cs2] + median.dlndbhdt = weighted.quantile( x = dlndbhdtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + median.dlnagbdt = weighted.quantile( x = dlnagbdtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + median.dlnbadt = weighted.quantile( x = dlnbadtconow [s.cs2] + , w = w.nplant [s.cs2] + , qu = 0.50 + )#end + #------------------------------------------------------------------# + + #------------------------------------------------------------------# + # Copy the results to the arrays. # + #------------------------------------------------------------------# + ts.growth.size$dbh[p,d,m,u] = median.dlndbhdt$q + ts.growth.size$agb[p,d,m,u] = median.dlnagbdt$q + ts.growth.size$ba [p,d,m,u] = median.dlnbadt$q + #------------------------------------------------------------------# + }#end if + #---------------------------------------------------------------------# + }#end for PFT + #------------------------------------------------------------------------# + }#end for DBH + #---------------------------------------------------------------------------# + }else{ + print (paste(" * ",basename(myfile)," wasn't found, skipping it..." + ,sep="")) + + }#end if + #------------------------------------------------------------------------------# + }#end for (m in 1:n.months) + #---------------------------------------------------------------------------------# + }#end for (u in 1:nfullcyc) + #====================================================================================# + #====================================================================================# + + + + + #====================================================================================# + #====================================================================================# + # Make the parameter space. # + #------------------------------------------------------------------------------------# + print(paste(" - Creating the parameter space...",sep="")) + #----- Make the point and legend name sequence. ----------------------------------# + yeara = c(qapply(X=ts.census.year,INDEX=census.idx,DIM=1 + ,FUN=min,na.rm=TRUE)) + yearz = c(qapply(X=ts.census.year,INDEX=census.idx,DIM=1 + ,FUN=max,na.rm=TRUE)) + pspace$pch = eft.pch[match(yearz,eft.year)] + pspace$leg.label = paste(sort(unique(yeara[is.finite(yeara)])) + ,sort(unique(yearz[is.finite(yearz)])),sep="-") + pspace$leg.pch = eft.pch[match(sort(unique(yearz[is.finite(yearz)])),eft.year)] + #---------------------------------------------------------------------------------# + + + + #----- Environment variables. ----------------------------------------------------# + pspace$rshort = c(qapply( X = ts.rshort + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$fs.open = c(qapply( X = ts.fs.open + , INDEX = census.idx + , DIM = 1 + , FUN = qu.mean + , p = 0.20 + , na.rm = TRUE + , lower = TRUE + )) + pspace$paw = c(qapply( X = ts.paw + , INDEX = census.idx + , DIM = 1 + , FUN = qu.mean + , p = 0.20 + , na.rm = TRUE + , lower = TRUE + )) + pspace$smpot = c(qapply( X = ts.smpot + , INDEX = census.idx + , DIM = 1 + , FUN = qu.mean + , p = 0.80 + , na.rm = TRUE + , lower = FALSE + )) + pspace$atm.vpd = c(qapply( X = ts.atm.vpd + , INDEX = census.idx + , DIM = 1 + , FUN = qu.mean + , p = 0.80 + , na.rm = TRUE + , lower = FALSE + )) + pspace$leaf.vpd = c(qapply( X = ts.leaf.vpd + , INDEX = census.idx + , DIM = 1 + , FUN = qu.mean + , p = 0.80 + , na.rm = TRUE + , lower = FALSE + )) + #---------------------------------------------------------------------------------# + + + + #----- Plot-level variables. -----------------------------------------------------# + pspace$lai.plot.mean = c(qapply( X = ts.lai.plot [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$ba.plot.mean = c(qapply( X = ts.ba.plot [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$agb.plot.mean = c(qapply( X = ts.agb.plot [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$recr.mean = c(qapply( X = ts.recr.plot$n [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$mort.plot.mean = c(qapply( X = ts.mort.plot$n [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$dimort.plot.mean = c(qapply( X = ts.dimort.plot$n [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$ddmort.plot.mean = c(qapply( X = ts.ddmort.plot$n [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$growdbh.plot.mean = c(qapply( X = ts.growth.plot$dbh[npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$growagb.plot.mean = c(qapply( X = ts.growth.plot$agb[npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + pspace$growba.plot.mean = c(qapply( X = ts.growth.plot$ba [npft+1,,] + , INDEX = census.idx + , DIM = 1 + , FUN = mean + , na.rm = TRUE + )) + #---------------------------------------------------------------------------------# + + + + #----- Size-level variables. -----------------------------------------------------# + pspace$lai.size.mean = matrix(qapply( X = ts.lai.size [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$ba.size.mean = matrix(qapply( X = ts.ba.size [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$agb.size.mean = matrix(qapply( X = ts.agb.size [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$mort.size.mean = matrix(qapply( X = ts.mort.size$n[npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$dimort.size.mean = matrix(qapply( X = ts.dimort.size$n [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$ddmort.size.mean = matrix(qapply( X = ts.ddmort.size$n [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$growdbh.size.mean = matrix(qapply( X = ts.growth.size$dbh[npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$growagb.size.mean = matrix(qapply( X = ts.growth.size$agb[npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + pspace$growba.size.mean = matrix(qapply( X = ts.growth.size$ba [npft+1,,,] + , INDEX = census.idx + , DIM = 2 + , FUN = mean + , na.rm = TRUE + ) + , nrow = n.dbh + , ncol = nfullcyc*(n.census-1) + )#end matrix + #---------------------------------------------------------------------------------# + #====================================================================================# + #====================================================================================# + + + + + + + #====================================================================================# + #====================================================================================# + #------------------------------------------------------------------------------------# + # Remove the 4th. dimension for the means. # + #------------------------------------------------------------------------------------# + print(paste(" - Averaging the census intervals...",sep="")) + ms.recr.plot = list() + for (v in 1:nrecr.vars){ + v.now = recr.vars[v] + ms.recr.plot[[v.now]] = qapply( X = ts.recr.plot[[v.now]] + , DIM = 2 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + + #----- Convert recruitment to the fraction rate. ---------------------------------# + ms.recr.plot [[v.now]] = exp(ms.recr.plot [[v.now]]) - 1. + #---------------------------------------------------------------------------------# + }#end for + ms.mort.plot = list() + ms.mort.size = list() + ms.ddmort.plot = list() + ms.ddmort.size = list() + ms.dimort.plot = list() + ms.dimort.size = list() + for (v in 1:nmort.vars){ + v.now = mort.vars[v] + ms.mort.plot [[v.now]] = qapply( X = ts.mort.plot [[v.now]] + , DIM = 2 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.mort.size [[v.now]] = qapply( X = ts.mort.size [[v.now]] + , DIM = 3 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.ddmort.plot[[v.now]] = qapply( X = ts.ddmort.plot[[v.now]] + , DIM = 2 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.ddmort.size[[v.now]] = qapply( X = ts.ddmort.size[[v.now]] + , DIM = 3 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.dimort.plot[[v.now]] = qapply( X = ts.dimort.plot[[v.now]] + , DIM = 2 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.dimort.size[[v.now]] = qapply( X = ts.dimort.size[[v.now]] + , DIM = 3 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + + #----- Convert mortality to the fraction rate. -----------------------------------# + ms.mort.plot [[v.now]] = 1. - exp(-ms.mort.plot [[v.now]]) + ms.mort.size [[v.now]] = 1. - exp(-ms.mort.size [[v.now]]) + ms.ddmort.plot[[v.now]] = 1. - exp(-ms.ddmort.plot[[v.now]]) + ms.ddmort.size[[v.now]] = 1. - exp(-ms.ddmort.size[[v.now]]) + ms.dimort.plot[[v.now]] = 1. - exp(-ms.dimort.plot[[v.now]]) + ms.dimort.size[[v.now]] = 1. - exp(-ms.dimort.size[[v.now]]) + #---------------------------------------------------------------------------------# + }#end for + ms.growth.plot = list() + ms.growth.size = list() + for (v in 1:ngrowth.vars){ + v.now = growth.vars[v] + ms.growth.plot[[v.now]] = qapply( X = ts.growth.plot[[v.now]] + , DIM = 2 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + ms.growth.size[[v.now]] = qapply( X = ts.growth.size[[v.now]] + , DIM = 3 + , INDEX = census.idx + , FUN = mean + , na.rm = TRUE + )#end apply + }#end for + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Find the average rates for the census period using log-normal. # + #------------------------------------------------------------------------------------# + mypfts = sort(match(unique(names(sta$classes)),pft$name)) + npfts = length(mypfts) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Retrieve the factor, classes and wood density used for the observations. We # + # can't switch the factors between observation and statistics because we use # + # observations to drive the statistics. # + #------------------------------------------------------------------------------------# + print(paste(" - Finding the average rates...",sep="")) + ed2 = list() + ed2$when = sta$when + ed2$taxon = sta$taxon + ed2$classes = sta$classes + nfac = length(ed2$classes) + ed2$wood.dens = sta$wood.dens + ed2$dtime = sta$dtime + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Recruitment rates. Only global values can be found. # + #------------------------------------------------------------------------------------# + for (r in 1:npratets){ + #---------------------------------------------------------------------------------# + # Load the rate information. # + #---------------------------------------------------------------------------------# + this.rate = pratets[[ r]] + ed2.rate = this.rate$ed2.rate + sta.rate = this.rate$sta.rate + sizetoo = this.rate$sizetoo + desc.rate = this.rate$desc.rate + indiv = this.rate$indiv + print(paste(" - Compounding the ",desc.rate," tables..."),sep="") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Load plot-level and size-level data. # + #---------------------------------------------------------------------------------# + ed2.plot = paste(ed2.rate,"plot",sep=".") + sta.plot = paste(sta.rate,"plot",sep=".") + ed2.size = paste(ed2.rate,"size",sep=".") + sta.size = paste(sta.rate,"size",sep=".") + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Find how many individuals to retrieve. # + #---------------------------------------------------------------------------------# + nindiv = length(indiv) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Loop over the different types of individuals. # + #---------------------------------------------------------------------------------# + ed2[[ed2.plot]] = list() + for (v in 1:nindiv){ + #----- Set up the individuals. ------------------------------------------------# + v.now = indiv[v] + yyy = 2:n.census + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Plot-level with all cycles. # + #------------------------------------------------------------------------------# + ms.plot = get(paste("ms",ed2.rate,"plot",sep="."))[[v.now]] + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Create the plot-level structure. Here the median and quantiles have a # + # somewhat different number, based on the number of cycles we run (median # + # amongst each cycle). # + #------------------------------------------------------------------------------# + ed2[[ed2.plot]][[v.now]] = list() + #----- "Borrow" the structure from the sta counterpart. ------------------------# + ed2[[ed2.plot]][[v.now]]$global = NA * sta[[sta.plot]][[v.now]]$global + ed2[[ed2.plot]][[v.now]]$median = NA * sta[[sta.plot]][[v.now]]$median + ed2[[ed2.plot]][[v.now]]$q025 = NA * sta[[sta.plot]][[v.now]]$q025 + ed2[[ed2.plot]][[v.now]]$q975 = NA * sta[[sta.plot]][[v.now]]$q975 + #----- Save the global variables. ---------------------------------------------# + ed2[[ed2.plot]][[v.now]]$global[4,yyy] = apply( X = ms.plot[npft+1,,] + , MARGIN = 1 + , FUN = median + , na.rm = TRUE + )#end apply + ed2[[ed2.plot]][[v.now]]$global[5,yyy] = apply( X = ms.plot[npft+1,,] + , MARGIN = 1 + , FUN = quantile + , probs = 0.025 + , na.rm = TRUE + )#end apply + ed2[[ed2.plot]][[v.now]]$global[6,yyy] = apply( X = ms.plot[npft+1,,] + , MARGIN = 1 + , FUN = quantile + , probs = 0.975 + , na.rm = TRUE + )#end apply + #----- Save the PFT statistics. -----------------------------------------------# + ed2[[ed2.plot]][[v.now]]$median[ ,yyy] = apply( X = ms.plot[mypfts,,] + , MARGIN = c(1,2) + , FUN = median + , na.rm = TRUE + )#end apply + ed2[[ed2.plot]][[v.now]]$q025 [ ,yyy] = apply( X = ms.plot[mypfts,,] + , MARGIN = c(1,2) + , FUN = quantile + , probs = 0.025 + , na.rm = TRUE + )#end apply + ed2[[ed2.plot]][[v.now]]$q975 [ ,yyy] = apply( X = ms.plot[mypfts,,] + , MARGIN = c(1,2) + , FUN = quantile + , probs = 0.975 + , na.rm = TRUE + )#end apply + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Now the size-dependent variables, if this is a size-dependent rate. # + #------------------------------------------------------------------------------# + if (sizetoo){ + #---------------------------------------------------------------------------# + # Plot-level with all cycles. # + #---------------------------------------------------------------------------# + ms.size = get(paste("ms",ed2.rate,"size",sep="."))[[v.now]] + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Create the plot-level structure. Here the median and quantiles have # + # a somewhat different number, based on the number of cycles we run (median # + # amongst each cycle). # + #---------------------------------------------------------------------------# + ed2[[ed2.size]][[v.now]] = list() + #----- "Borrow" the structure from the sta counterpart. --------------------# + ed2[[ed2.size]][[v.now]]$global = NA * sta[[sta.size]][[v.now]]$global + ed2[[ed2.size]][[v.now]]$median = NA * sta[[sta.size]][[v.now]]$median + ed2[[ed2.size]][[v.now]]$q025 = NA * sta[[sta.size]][[v.now]]$q025 + ed2[[ed2.size]][[v.now]]$q975 = NA * sta[[sta.size]][[v.now]]$q975 + #----- Save the global variables. ------------------------------------------# + ed2[[ed2.size]][[v.now]]$global[4,,yyy] = apply( X = ms.size[npft+1,,,] + , MARGIN = c(1,2) + , FUN = median + , na.rm = TRUE + )#end apply + ed2[[ed2.size]][[v.now]]$global[5,,yyy] = apply( X = ms.size[npft+1,,,] + , MARGIN = c(1,2) + , FUN = quantile + , probs = 0.025 + , na.rm = TRUE + )#end apply + ed2[[ed2.size]][[v.now]]$global[6,,yyy] = apply( X = ms.size[npft+1,,,] + , MARGIN = c(1,2) + , FUN = quantile + , probs = 0.975 + , na.rm = TRUE + )#end apply + #----- Save the PFT statistics. --------------------------------------------# + ed2[[ed2.size]][[v.now]]$median[ ,,yyy] = apply( X = ms.size[mypfts,,,] + , MARGIN = c(1,2,3) + , FUN = median + , na.rm = TRUE + )#end apply + ed2[[ed2.size]][[v.now]]$q025 [ ,,yyy] = apply( X = ms.size[mypfts,,,] + , MARGIN = c(1,2,3) + , FUN = quantile + , probs = 0.025 + , na.rm = TRUE + )#end apply + ed2[[ed2.size]][[v.now]]$q975 [ ,,yyy] = apply( X = ms.size[mypfts,,,] + , MARGIN = c(1,2,3) + , FUN = quantile + , probs = 0.975 + , na.rm = TRUE + )#end apply + #---------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Make the directories. # + #------------------------------------------------------------------------------------# + outplot = paste(outpref,"census_plot" ,sep="/") + outsize = paste(outpref,"census_size" ,sep="/") + if (! file.exists(outplot)) dir.create(outplot) + if (! file.exists(outsize)) dir.create(outsize) + #------------------------------------------------------------------------------------# + + + + + + + + + + #====================================================================================# + #====================================================================================# + # 6. Plot rates as function of size. # + #====================================================================================# + #====================================================================================# + for (n in 1:npratesize){ + this.plot = pratesize[[n]] + desc.rate = this.plot$desc.rate + unit.rate = this.plot$unit.rate + col.ed2 = this.plot$col.ed2 + col.sta = this.plot$col.sta + indiv = this.plot$indiv + desc.indiv = this.plot$desc.indiv + legpos = this.plot$legpos + plog = this.plot$plog + ylog = length(grep("y",plog)) > 0 + + nindiv = length(indiv) + + + + #----- Create a directory for this type of plot. ---------------------------------# + outrate = paste(outsize,ed2.rate,sep="/") + if (! file.exists(outrate)) dir.create(outrate) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all possible types of population count. # + #---------------------------------------------------------------------------------# + for (i in 1:nindiv){ + print(paste(" - Size level: ",desc.indiv[i],"...")) + + + #----- Build the rate name. ---------------------------------------------------# + print(paste(" + Plotting size-dependent ",desc.rate,"...",sep="")) + ed2.rate = paste(this.plot$ed2.rate,"size",sep=".") + sta.rate = paste(this.plot$sta.rate,"size",sep=".") + #------------------------------------------------------------------------------# + + + + #----- Create path for this individual. ---------------------------------------# + outindiv = paste(outrate,indiv[i],sep="/") + if (! file.exists(outindiv)) dir.create(outindiv) + #------------------------------------------------------------------------------# + + + #----- Load the modelled rates. -----------------------------------------------# + sta.mod = sta[[sta.rate]][[indiv[i]]]$global + sta.median = 100. * sta.mod[4,,] + sta.q025 = 100. * sta.mod[5,,] + sta.q975 = 100. * sta.mod[6,,] + ed2.mod = ed2[[ed2.rate]][[indiv[i]]]$global + ed2.median = 100. * ed2.mod[4,,] + ed2.q025 = 100. * ed2.mod[5,,] + ed2.q975 = 100. * ed2.mod[6,,] + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Find the DBH for x scale. # + #------------------------------------------------------------------------------# + xlimit = range(x.dbh) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Define a nice configuration for the multiple panels. # + #------------------------------------------------------------------------------# + lo.box = pretty.box(n=n.census-1,horizontal=TRUE) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Loop over all formats. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open the file or the plot window. -----------------------------------# + fichier = paste(outindiv,"/yrsize-",ed2.rate,"-",indiv[i],".",outform[o] + ,sep="") + if(outform[o] == "x11"){ + X11(width=wide.size$width,height=wide.size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=wide.size$width*depth + ,height=wide.size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=wide.size$width,height=wide.size$height + ,pointsize=ptsz,paper=wide.size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=wide.size$width,height=wide.size$height,pointsize=ptsz + ,paper=wide.size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Split the window into several smaller windows. # + #---------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + par(oma = c(2,2,3,0)) + layout(mat=lo.box$mat) + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Find the plot limit for the y scale. # + #---------------------------------------------------------------------------# + yuse = c(sta.q025,sta.q975,ed2.q025,ed2.q975) + if (ylog) yuse = log(yuse) + ylimit = range(yuse,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]) * 0.25) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.25) + }else{ + ylimit[2] = ylimit[2] + 0.25 * (ylimit[2] - ylimit[1]) + }#end if + if (ylog) ylimit = exp(ylimit) + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Loop over all years. # + #---------------------------------------------------------------------------# + for (y in 2:n.census){ + k = y - 1 + left = (k %% lo.box$ncol) == 1 + right = (k %% lo.box$ncol) == 0 + top = k <= lo.box$ncol + bottom = k > (lo.box$nrow - 1) * lo.box$ncol + mar.now = c(3 + 2 * bottom,2 + 2 * left,2 + 2 * top,2 * right) + 0.1 + if (bottom) xaxt="s" else xaxt="n" + if (left) yaxt="s" else yaxt="n" + + + + #------------------------------------------------------------------------# + # 95% Confidence Interval. # + #------------------------------------------------------------------------# + size.poly = list() + size.poly$x = c(size.poly$x,x.dbh ,rev(x.dbh) ,NA + ,size.poly$x,x.dbh ,rev(x.dbh) ,NA) + size.poly$y = c(size.poly$y,sta.q025[,y],rev(sta.q975[,y]),NA + ,size.poly$y,ed2.q025[,y],rev(ed2.q975[,y]),NA) + #------------------------------------------------------------------------# + + + + #----- Set up the title for each plot. ----------------------------------# + lesub = paste("Census period: ",census.desc[y],sep="") + #------------------------------------------------------------------------# + + + #------------------------------------------------------------------------# + # Go on and plot stuff. # + #------------------------------------------------------------------------# + #----- Plotting window and grid. ----------------------------------------# + par(mar=mar.now) + plot.new() + plot.window(xlim=xlimit,ylim=ylimit,xaxt=xaxt,yaxt,yaxt,log=plog) + box() + title(main=lesub) + if (plotgrid) grid(col="gray83",lty="solid") + #----- Plot the taxon rate with confidence interval. --------------------# + epolygon(x=size.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) + ,density=40,lty="solid",lwd=1.0) + lines(x=x.dbh,y=sta.median[,y],type="o",col=col.sta[1],pch=16,lwd=2.0) + lines(x=x.dbh,y=ed2.median[,y],type="o",col=col.ed2[1],pch=16,lwd=2.0) + #----- Plot legend. -----------------------------------------------------# + if (top && right){ + legend ( x = legpos + , inset = 0.01 + , legend = c("Census","ED-2.2") + , fill = c(col.sta[2],col.ed2[2]) + , border = c(col.sta[2],col.ed2[2]) + , col = c(col.sta[1],col.ed2[1]) + , lwd = 2.0 + , pt.cex = 1.0 + , angle = c(-45,45) + , density = c( 40,40) + , bg = "white" + , ncol = 2 + , title = "(Shaded - 95% C.I.)" + , cex = 1.0 + )#end legend + }#end if + #------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Make the title and axis labels. # + #---------------------------------------------------------------------------# + letitre = paste("Size-dependent ",desc.rate,"\n",lieu,sep="") + ley = paste(desc.rate," [% ",desc.indiv[i],"/yr]",sep="") + lex = "Minimum DBH for the class [cm]" + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Plot the global title. # + #---------------------------------------------------------------------------# + mtext(text=lex ,side=1,outer=TRUE) + mtext(text=ley ,side=2,outer=TRUE) + mtext(text=letitre,side=3,outer=TRUE,cex=0.8,font=2) + par(par.orig) + #---------------------------------------------------------------------------# + + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + + }#end for + #------------------------------------------------------------------------------# + + }#end for (i in 1:nindiv) + #---------------------------------------------------------------------------------# + }#end for + #====================================================================================# + #====================================================================================# + + + + + + #====================================================================================# + #====================================================================================# + # 7. Plot the time series of the rates (by DBH class if applicable). # + #====================================================================================# + #====================================================================================# + for (n in 1:npratets){ + this.plot = pratets[[n]] + sizetoo = this.plot$sizetoo + desc.rate = this.plot$desc.rate + unit.rate = this.plot$unit.rate + col.ed2 = this.plot$col.ed2 + col.sta = this.plot$col.sta + indiv = this.plot$indiv + desc.indiv = this.plot$desc.indiv + colnow = this.plot$colour + legpos = this.plot$legpos + plog = this.plot$plog + ylog = length(grep("y",plog)) > 0 + + nindiv = length(indiv) + + print(paste(" + Plotting time series of ",desc.rate,"...",sep="")) + #---------------------------------------------------------------------------------# + # Loop over all possible types of population count. # + #---------------------------------------------------------------------------------# + for (i in 1:nindiv){ + #==============================================================================# + #==============================================================================# + # PLOT-LEVEL rates. # + #------------------------------------------------------------------------------# + print(paste(" - Plot level: ",desc.indiv[i],"...")) + ed2.rate = paste(this.plot$ed2.rate,"plot",sep=".") + sta.rate = paste(this.plot$sta.rate,"plot",sep=".") + + + #----- Create a directory for this type of plot. ------------------------------# + outrate = paste(outplot,ed2.rate,sep="/") + if (! file.exists(outrate)) dir.create(outrate) + #------------------------------------------------------------------------------# + + + #----- Create path for this individual. ---------------------------------------# + outindiv = paste(outrate,indiv[i],sep="/") + if (! file.exists(outindiv)) dir.create(outindiv) + #------------------------------------------------------------------------------# + + + #----- Load the modelled rates. -----------------------------------------------# + sta.mod = sta[[sta.rate]][[indiv[i]]]$global + sta.median = 100. * sta.mod[4,2:n.census] + sta.q025 = 100. * sta.mod[5,2:n.census] + sta.q975 = 100. * sta.mod[6,2:n.census] + ed2.mod = ed2[[ed2.rate]][[indiv[i]]]$global + ed2.median = 100. * ed2.mod[4,2:n.census] + ed2.q025 = 100. * ed2.mod[5,2:n.census] + ed2.q975 = 100. * ed2.mod[6,2:n.census] + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Find the DBH for x scale. # + #------------------------------------------------------------------------------# + x.years = year4[2:n.census] + xlimit = range(x.years) + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Make the polygons. # + #------------------------------------------------------------------------------# + plot.poly = list() + plot.poly$x = c(x.years ,rev(x.years) ,NA,x.years ,rev(x.years) ) + plot.poly$y = c(sta.q025,rev(sta.q975),NA,ed2.q025,rev(ed2.q975)) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Find the plot limit for the y scale. # + #------------------------------------------------------------------------------# + yuse = c(sta.q025,sta.q975,ed2.q025,ed2.q975) + if (ylog) yuse = log(yuse) + ylimit = range(yuse[is.finite(yuse)],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]) * 0.40) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.40) + }else{ + ylimit[2] = ylimit[2] + 0.40 * (ylimit[2] - ylimit[1]) + }#end if + if (ylog) ylimit = exp(ylimit) + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Loop over all formats, and make the plots. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open the file or the plot window. -----------------------------------# + fichier = paste(outindiv,"/tseries-",ed2.rate,"-",indiv[i],"." + ,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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Make the title and axis labels. # + #---------------------------------------------------------------------------# + letitre = paste(desc.rate," - ",lieu,sep="") + ley = paste(desc.rate," [% ",desc.indiv[i],"/yr]",sep="") + lex = "Census year" + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Go on and plot stuff. # + #---------------------------------------------------------------------------# + #----- Plotting window and grid. -------------------------------------------# + plot(x=x.years,y=sta.median,xlim=xlimit,ylim=ylimit,type="n",main=letitre + ,xlab=lex,ylab=ley,log=plog,cex.main=0.7) + if (plotgrid) grid(col="gray83",lty="solid") + #----- Plot the taxon rate with confidence interval. -----------------------# + epolygon(x=plot.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) + ,density=40,lty="solid",lwd=1.0) + lines(x=x.years,y=sta.median,type="o",col=col.sta[1],pch=16,lwd=2.0) + lines(x=x.years,y=ed2.median,type="o",col=col.ed2[1],pch=16,lwd=2.0) + #----- Plot legend. --------------------------------------------------------# + legend ( x = legpos + , inset = 0.01 + , legend = c("Census","ED-2.2") + , fill = c(col.sta[2],col.ed2[2]) + , border = c(col.sta[2],col.ed2[2]) + , col = c(col.sta[1],col.ed2[1]) + , lwd = 2.0 + , pt.cex = 1.0 + , angle = c(-45,45) + , density = c( 40,40) + , bg = "white" + , ncol = 2 + , title = "(Shaded - 95% C.I.)" + , cex = 1.0 + )#end legend + #---------------------------------------------------------------------------# + + + #----- Close the device. ---------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------# + + + + + #==============================================================================# + #==============================================================================# + # DBH-LEVEL rates. # + #------------------------------------------------------------------------------# + if (sizetoo){ + print(paste(" - DBH classes: ",desc.indiv[i],"...")) + ed2.rate = paste(this.plot$ed2.rate,"size",sep=".") + sta.rate = paste(this.plot$sta.rate,"size",sep=".") + + + #----- Create a directory for this type of plot. ---------------------------# + outrate = paste(outsize,ed2.rate,sep="/") + if (! file.exists(outrate)) dir.create(outrate) + #---------------------------------------------------------------------------# + + + #----- Create path for this individual. ------------------------------------# + outindiv = paste(outrate,indiv[i],sep="/") + if (! file.exists(outindiv)) dir.create(outindiv) + #---------------------------------------------------------------------------# + + + #----- Load the modelled rates. --------------------------------------------# + sta.mod = sta[[sta.rate]][[indiv[i]]]$global + sta.median = 100. * sta.mod[4,,2:n.census] + sta.q025 = 100. * sta.mod[5,,2:n.census] + sta.q975 = 100. * sta.mod[6,,2:n.census] + ed2.mod = ed2[[ed2.rate]][[indiv[i]]]$global + ed2.median = 100. * ed2.mod[4,,2:n.census] + ed2.q025 = 100. * ed2.mod[5,,2:n.census] + ed2.q975 = 100. * ed2.mod[6,,2:n.census] + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Find the DBH for x scale. # + #---------------------------------------------------------------------------# + x.years = year4[2:n.census] + xlimit = range(x.years) + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Define a nice configuration for the multiple panels. # + #---------------------------------------------------------------------------# + lo.box = pretty.box(n=n.dbh,horizontal=TRUE) + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Loop over all formats, and make the plots. # + #---------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open the file or the plot window. --------------------------------# + fichier = paste(outindiv,"/tseries-",ed2.rate,"-",indiv[i],".",outform[o] + ,sep="") + if(outform[o] == "x11"){ + X11(width=wide.size$width,height=wide.size$height,pointsize=ptsz) + }else if(outform[o] == "png"){ + png(filename=fichier,width=wide.size$width*depth + ,height=wide.size$height*depth,pointsize=ptsz,res=depth) + }else if(outform[o] == "eps"){ + postscript(file=fichier,width=wide.size$width,height=wide.size$height + ,pointsize=ptsz,paper=wide.size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=wide.size$width,height=wide.size$height,pointsize=ptsz + ,paper=wide.size$paper) + }#end if + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Split the window into several smaller windows. # + #------------------------------------------------------------------------# + par.orig = par(no.readonly = TRUE) + par(oma = c(2,2,3,0)) + layout(mat=lo.box$mat) + #------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------# + # Loop over all DBH classes. # + #------------------------------------------------------------------------# + for (d in 1:n.dbh){ + left = (d %% lo.box$ncol) == 1 + right = (d %% lo.box$ncol) == 0 + top = d <= lo.box$ncol + bottom = d > (lo.box$nrow - 1) * lo.box$ncol + + + #---------------------------------------------------------------------# + # Find the plot limit for the y scale. # + #---------------------------------------------------------------------# + yuse = c(ed2.q025[d,],ed2.q975[d,],sta.q025[d,],sta.q975[d,]) + if (ylog) yuse = log(yuse) + ylimit = range(yuse[is.finite(yuse)],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]) * 0.40) + ylimit[2] = ylimit[2] * ( 1. + sign(ylimit[2]) * 0.40) + }else{ + ylimit[2] = ylimit[2] + 0.40 * (ylimit[2] - ylimit[1]) + }#end if + if (ylog) ylimit = exp(ylimit) + #---------------------------------------------------------------------# + + + + #---------------------------------------------------------------------# + # Make the polygons. # + #---------------------------------------------------------------------# + size.poly = list() + size.poly$x = c(x.years ,rev(x.years) ,NA + ,x.years ,rev(x.years) ) + size.poly$y = c(sta.q025[d,],rev(sta.q975[d,]),NA + ,ed2.q025[d,],rev(ed2.q975[d,]) ) + #---------------------------------------------------------------------# + + + + #----- Set up the title and axes labels. -----------------------------# + lesub = paste("DBH class:",dbh.names[d],sep="") + #---------------------------------------------------------------------# + + + #----- Plot the box plot. --------------------------------------------# + par(mar=c(2,2,4,1)+0.1) + #----- Plotting window and grid. -------------------------------------# + plot(x=x.years,y=ed2.median[d,],xlim=xlimit,ylim=ylimit,type="n" + ,main=lesub,xlab="",ylab="",log=plog) + if (plotgrid) grid(col="grey83",lty="solid") + #----- Plot the taxon rate with confidence interval. -----------------# + epolygon(x=size.poly,col=c(col.sta[2],col.ed2[2]),angle=c(-45,45) + ,density=40,lty="solid",lwd=1.0) + lines(x=x.years,y=sta.median[d,],type="o",pch=16,lwd=2.0 + ,col=col.sta[1]) + lines(x=x.years,y=ed2.median[d,],type="o",pch=16,lwd=2.0 + ,col=col.ed2[1]) + #----- Plot legend. --------------------------------------------------# + if (top && right){ + legend ( x = legpos + , inset = 0.01 + , legend = c("Census","ED-2.2") + , fill = c(col.sta[2],col.ed2[2]) + , border = c(col.sta[2],col.ed2[2]) + , col = c(col.sta[1],col.ed2[1]) + , lwd = 2.0 + , pt.cex = 1.0 + , angle = c(-45,45) + , density = c( 40,40) + , bg = "white" + , ncol = 2 + , title = "(Shaded - 95% C.I.)" + , cex = 1.0 + )#end legend + }#end if + #---------------------------------------------------------------------# + }#end for (d in 1:n.dbh) + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Make the title and axis labels. # + #------------------------------------------------------------------------# + letitre = paste(desc.rate,": ",lieu,sep="") + ley = paste(desc.rate," [% ",desc.indiv[i],"]",sep="") + lex = "Census" + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Split the plotting window. # + #------------------------------------------------------------------------# + mtext(text=lex ,side=1,outer=TRUE) + mtext(text=ley ,side=2,outer=TRUE) + mtext(text=letitre,side=3,outer=TRUE,cex=0.8,font=2) + par(par.orig) + #------------------------------------------------------------------------# + + + + #----- Close the device. ------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #====================================================================================# + #====================================================================================# + }#end if (census.name %in% ls()) + #=======================================================================================# + #=======================================================================================# + + + + + #=======================================================================================# + #=======================================================================================# + # Plot the monthly mean variables as functions of other 2 environment variables. # + #---------------------------------------------------------------------------------------# + print(paste(" + Plotting parameter space...",sep="")) + + + #----- Sizes. --------------------------------------------------------------------------# + nzvar = length(xyzvar$zvar) + nxvar = length(xyzvar$xvar) + nyvar = length(xyzvar$yvar) + #---------------------------------------------------------------------------------------# + + + #----- Create the directories. ---------------------------------------------------------# + outxyzp = paste(outpref,"xyzplot",sep="/") + if (! file.exists(outxyzp )) dir.create(outxyzp ) + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Loop over all explanatory variables that go to the Y axis. # + #---------------------------------------------------------------------------------------# + for (y in 1:nyvar){ + #----- Load Y settings. -------------------------------------------------------------# + this.y = xyzvar$yvar[[y]] + yvname = this.y$vname + ydesc = this.y$desc + yunit = this.y$unit + yadd = this.y$add + ymult = this.y$mult + yleg = this.y$leg + ylog = this.y$log + sizetoo = this.y$sizetoo + print(paste(" * Y: ",ydesc,"...")) + #------------------------------------------------------------------------------------# + + + + #----- Create the directories. ------------------------------------------------------# + outyvar = paste(outxyzp ,yvname ,sep="/") + if (! file.exists(outyvar )) dir.create(outyvar ) + #------------------------------------------------------------------------------------# + + + + #----- Load the y variable. Expand the edges of the y axis to fit a legend. --------# + if (sizetoo){ + yplot.name = paste(yvname,"plot","mean",sep=".") + ysize.name = paste(yvname,"size","mean",sep=".") + }else{ + yplot.name = paste(yvname,"mean",sep=".") + ysize.name = paste(yvname,"mean",sep=".") + }#end if + yvar.plot = ymult * ( pspace[[yplot.name]] + yadd ) + yvar.size = ymult * ( pspace[[ysize.name]] + yadd ) + ley = paste(ydesc," [",yunit,"]",sep="") + + sel = is.finite(yvar.plot) & ( yvar.plot > 0 | (! ylog)) + ylimit.plot = range(yvar.plot[sel],na.rm=TRUE) + if (ylog) ylimit.plot = log(ylimit.plot) + ylimit.plot[2] = ylimit.plot[2] + scalleg * diff(ylimit.plot) + if (ylog) ylimit.plot = exp(ylimit.plot) + + if (sizetoo){ + ylimit.size = matrix(nrow=n.dbh,ncol=2) + for (d in 1:n.dbh){ + sel = ( is.finite(yvar.size[d,]) + & ( yvar.size[d,] > 0 | (! ylog)) ) + ylimit.size[d,] = range(yvar.size[d,sel],na.rm=TRUE) + if (ylog) ylimit.size[d,] = log(ylimit.size[d,]) + ylimit.size[d,2] = ( ylimit.size[d,2] + + scalleg * diff(ylimit.size[d,]) ) + if (ylog) ylimit.size[d,] = exp(ylimit.size[d,]) + }#end for + }else{ + ylimit.size = ylimit.plot + }#end if + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Loop over all explanatory variables that go to the X axis. # + #------------------------------------------------------------------------------------# + for (x in 1:nxvar){ + #----- Load X settings. ----------------------------------------------------------# + this.x = xyzvar$xvar[[x]] + xvname = this.x$vname + xdesc = this.x$desc + xunit = this.x$unit + xadd = this.x$add + xmult = this.x$mult + xleg = this.x$leg + xlog = this.x$log + #---------------------------------------------------------------------------------# + + + + #----- Load the x variable. ------------------------------------------------------# + xplot.name = paste(xvname,"plot","mean",sep=".") + xsize.name = paste(xvname,"size","mean",sep=".") + xvar.plot = xmult * ( pspace[[xplot.name]] + xadd ) + xvar.size = xmult * ( pspace[[xsize.name]] + xadd ) + lex = paste(xdesc," [",xunit,"]",sep="") + + sel = is.finite(xvar.plot) & ( xvar.plot > 0 | (! xlog)) + xlimit.plot = range(xvar.plot[sel],na.rm=TRUE) + xlimit.size = matrix(nrow=n.dbh,ncol=2) + for (d in 1:n.dbh){ + sel = is.finite(xvar.size[d,]) & ( xvar.size[d,] > 0 | (! xlog) ) + xlimit.size[d,] = range(xvar.size[d,sel],na.rm=TRUE) + }#end for + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Make the log scale, and find the position for the legend. # + #---------------------------------------------------------------------------------# + plog = "" + if (xlog) plog=paste(plog,"x",sep="") + if (ylog) plog=paste(plog,"y",sep="") + leg.pos = paste(yleg,xleg,sep="") + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all colour variables. # + #---------------------------------------------------------------------------------# + for (z in 1:nzvar){ + #----- Load Z settings. -------------------------------------------------------# + this.z = xyzvar$zvar[[z]] + zvname = this.z$vname + zdesc = this.z$desc + zkey = this.z$key + zunit = this.z$unit + zadd = this.z$add + zmult = this.z$mult + zcscheme = get(this.z$col.scheme) + zlog = this.z$log + print(paste(" ~ X:",xdesc," Z: ",zdesc,"...")) + #------------------------------------------------------------------------------# + + + + #----- Annotation for the colour map ("Z" axis). ------------------------------# + zvar = zmult * ( pspace[[zvname]] + zadd ) + lez = paste(zkey,"\n [",zunit,"]",sep="") + #------------------------------------------------------------------------------# + + + + #----- Find the range for the scale. ------------------------------------------# + sel = is.finite(zvar) & ( zvar > 0 | (! zlog) ) + zlimit = range(zvar[sel],na.rm=TRUE) + #------------------------------------------------------------------------------# + + + #----- Title. -----------------------------------------------------------------# + letitre.plot = paste(lieu,paste(zdesc,"Plot level",sep=" - "),sep="\n") + letitre.size = paste(lieu,paste(zdesc," - DBH Class:",dbh.names,sep="") + ,sep="\n") + #------------------------------------------------------------------------------# + + + + #----- Attribute symbols according to the year. -------------------------------# + this.pch = pspace$pch + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Make the list of commands for plot.axes. # + #------------------------------------------------------------------------------# + plot.axes = list() + plot.axes[[1]] = list( x.axis = list(side=1) + , y.axis = list(side=2) + , grid = list(col="grey62",lty="solid") + , legend = list( x = leg.pos + , inset = 0.01 + , legend = pspace$leg.label + , col = "black" + , bg = "white" + , pch = pspace$leg.pch + , title = "Census" + , ncol = 2 + , pt.cex = 1./0.9 + , cex = 0.9 + )#end legend + )#end list + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Plot the plot-level. # + #------------------------------------------------------------------------------# + print(paste(" > Plot-level...")) + for (o in 1:nout){ + #----- Open the file. ------------------------------------------------------# + fichier = paste(outyvar,"/plot_x_",xvname,"_y_",yvname + ,"_z_",zvname,".",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + + #----- Plot the parameter space. -------------------------------------------# + colourmap(x=xvar.plot,y=yvar.plot,z=zvar + ,xlim=xlimit.plot,ylim=ylimit.plot,zlim=zlimit + ,colour.palette=zcscheme,cex=1.6,pch=this.pch,lwd=3,log=plog + ,plot.title=title(main=letitre.plot,xlab=lex,ylab=ley + ,cex.main=cex.main) + ,key.title=title(main=lez,cex.main=0.8),key.log=zlog + ,plot.axes=plot.axes + )#end colourmap + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Close the device. # + #---------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------# + # Plot the parameter space for the dbh classes if it is supposed to do so. # + #------------------------------------------------------------------------------# + if (sizetoo){ + + #---------------------------------------------------------------------------# + # Loop over DBH classes. # + #---------------------------------------------------------------------------# + for (d in 1:n.dbh){ + print(paste(" > DBH class: ",dbh.names[d],"...")) + + #------------------------------------------------------------------------# + # Make the label. # + #------------------------------------------------------------------------# + if (d == 1){ + dbh.low = sprintf("%3.3i",0) + }else{ + dbh.low = sprintf("%3.3i",sta$dbh.breaks[ d]) + }#end if + if (d == n.dbh){ + dbh.high = "Inf" + }else{ + dbh.high = sprintf("%3.3i",sta$dbh.breaks[d+1]) + }#end if + dbh.label = paste(dbh.low,dbh.high,sep="-") + #------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------# + # Plot the bar plot. # + #------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Open the file. ------------------------------------------------# + fichier = paste(outyvar,"/size",dbh.label,"_x_",xvname + ,"_y_",yvname,"_z_",zvname,".",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }#end if + #---------------------------------------------------------------------# + + + + #----- Plot the parameter space. -------------------------------------# + colourmap(x=xvar.size[d,],y=yvar.size[d,],z=zvar + ,xlim=xlimit.size[d,],ylim=ylimit.size[d,],zlim=zlimit + ,colour.palette=muitas,cex=1.6,pch=this.pch,lwd=3,log=plog + ,plot.title=title(main=letitre.size[d],cex.main=cex.main + ,xlab=lex,ylab=ley) + ,key.title=title(main=lez,cex.main=0.8),key.log=zlog + ,plot.axes=plot.axes + )#end colourmap + #---------------------------------------------------------------------# + + + #---------------------------------------------------------------------# + # Close the device. # + #---------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------# + + }#end for + #---------------------------------------------------------------------------------# + + + + }#end for + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# +}#end for places +#------------------------------------------------------------------------------------------# + +#q("no") diff --git a/ED/Template/Template/plot_daily.r b/ED/Template/Template/plot_daily.r index e6f6cd4d4..c1b0da3da 100644 --- a/ED/Template/Template/plot_daily.r +++ b/ED/Template/Template/plot_daily.r @@ -9,10 +9,11 @@ yearend = thisyearz # Maximum year to consider region = "thispoly" # Region name. myplaces = c("thispoly") sasday = 15 -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing byeold = TRUE # Remove old files of the given format? @@ -636,7 +637,10 @@ for (l in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if ylimit = range(thisvar[,selpft],na.rm=TRUE) letitre = paste(description,p$lieu,sep=" - ") @@ -775,7 +779,10 @@ for (l in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if #----- Define the labels and colours. --------------------------------------# @@ -854,7 +861,10 @@ for (l in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(theme," - ",p$lieu, diff --git a/ED/Template/Template/plot_eval_ed.r b/ED/Template/Template/plot_eval_ed.r new file mode 100644 index 000000000..b1c838f38 --- /dev/null +++ b/ED/Template/Template/plot_eval_ed.r @@ -0,0 +1,975 @@ +rm(list=ls()) + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# Here is the user defined variable section. # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/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.short = c(2,5,8,11) +sasmonth.long = 5 +nyears.long = 25 +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing + +byeold = TRUE # Remove old files of the given format? + +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? + +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # inset distance between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.20 +cex.main = 0.8 # Scale coefficient for the title + +hourblock.len = 3 # Length of the time blocks, in hours +#------------------------------------------------------------------------------------------# + +reload.data = TRUE # Reload data? +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# NO NEED TO CHANGE ANYTHING BEYOND THIS POINT UNLESS YOU ARE DEVELOPING THE CODE... # +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Eddy flux comparisons. # +#------------------------------------------------------------------------------------------# +compvar = list() +compvar[[ 1]] = list( vnam = "hflxca" + , desc = "Sensible heat flux" + , unit = "[W/m2]" + , col.obser = c("gray42","gray21") + , col.model = c("orange1","chocolate4") + , leg.corner = "topleft" + )#end list +compvar[[ 2]] = list( vnam = "wflxca" + , desc = "Water vapour flux" + , unit = "[kg/m2/day]" + , col.obser = c("gray42","gray21") + , col.model = c("deepskyblue","royalblue4") + , leg.corner = "topleft" + )#end list +compvar[[ 3]] = list( vnam = "cflxca" + , desc = "Carbon dioxide flux" + , unit = "[umol/m2/s]" + , col.obser = c("gray42","gray21") + , col.model = c("chartreuse2","darkgreen") + , leg.corner = "bottomright" + )#end list +compvar[[ 4]] = list( vnam = "cflxst" + , desc = "Carbon dioxide storage" + , unit = "[umol/m2/s]" + , col.obser = c("gray42","gray21") + , col.model = c("lightgoldenrod3","darkorange1") + , leg.corner = "topleft" + )#end list +compvar[[ 5]] = list( vnam = "gpp" + , desc = "Gross primary productivity" + , unit = "[kgC/m2/yr]" + , col.obser = c("gray42","gray21") + , col.model = c("green3","darkgreen") + , leg.corner = "topleft" + )#end list +compvar[[ 6]] = list( vnam = "reco" + , desc = "Ecosystem respiration" + , unit = "[kgC/m2/yr]" + , col.obser = c("gray42","gray21") + , col.model = c("yellow3","peru") + , leg.corner = "topleft" + )#end list +compvar[[ 7]] = list( vnam = "nep" + , desc = "Net ecosystem productivity" + , unit = "[kgC/m2/yr]" + , col.obser = c("gray42","gray21") + , col.model = c("olivedrab2","darkolivegreen4") + , leg.corner = "topleft" + )#end list +compvar[[ 8]] = list( vnam = "nee" + , desc = "Net ecosystem exchange" + , unit = "[umol/m2/s]" + , col.obser = c("gray42","gray21") + , col.model = c("chartreuse","chartreuse4") + , leg.corner = "bottomright" + )#end list +compvar[[ 9]] = list( vnam = "ustar" + , desc = "Friction velocity" + , unit = "[m/s]" + , col.obser = c("gray42","gray21") + , col.model = c("mediumpurple1","purple4") + , leg.corner = "topleft" + )#end list +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Plot-level comparisons. # +#------------------------------------------------------------------------------------------# +plotvar = list() +plotvar[[ 1]] = list( vnam.ed = "recr" + , vnam.obs = "recr" + , desc = "Recruitment rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "chartreuse4" + , leg.corner = "topleft" + , plog = TRUE + )#end list +plotvar[[ 2]] = list( vnam.ed = "mort.plot" + , vnam.obs = "mort.plot" + , desc = "Total mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "purple4" + , leg.corner = "topleft" + , plog = TRUE + )#end list +plotvar[[ 3]] = list( vnam.ed = "ddmort.plot" + , vnam.obs = "mort.plot" + , desc = "Density dependent mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "mediumpurple1" + , leg.corner = "topleft" + , plog = TRUE + )#end list +plotvar[[ 4]] = list( vnam.ed = "dimort.plot" + , vnam.obs = "mort.plot" + , desc = "Density independent mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "mediumpurple1" + , leg.corner = "topleft" + , plog = TRUE + )#end list +plotvar[[ 5]] = list( vnam.ed = "growth.plot" + , vnam.obs = "growth.plot" + , desc = "Growth rate" + , unit = "[%DBH/yr]" + , col.obser = c("gray42","gray21") + , col.model = "royalblue4" + , leg.corner = "topleft" + , plog = TRUE + )#end list +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Plot-level comparisons. # +#------------------------------------------------------------------------------------------# +sizevar = list() +sizevar[[ 1]] = list( vnam.ed = "mort.size" + , vnam.obs = "mort.size" + , desc = "Total mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "purple4" + , leg.corner = "topleft" + , plog = TRUE + )#end list +sizevar[[ 2]] = list( vnam.ed = "ddmort.size" + , vnam.obs = "mort.size" + , desc = "Density dependent mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "mediumpurple1" + , leg.corner = "topleft" + , plog = TRUE + )#end list +sizevar[[ 3]] = list( vnam.ed = "dimort.size" + , vnam.obs = "mort.size" + , desc = "Density independent mortality rate" + , unit = "[%pop/yr]" + , col.obser = c("gray42","gray21") + , col.model = "mediumpurple1" + , leg.corner = "topleft" + , plog = TRUE + )#end list +sizevar[[ 4]] = list( vnam.ed = "growth.size" + , vnam.obs = "growth.size" + , desc = "Growth rate" + , unit = "[%DBH/yr]" + , col.obser = c("gray42","gray21") + , col.model = "royalblue4" + , leg.corner = "topleft" + , plog = TRUE + )#end list +#------------------------------------------------------------------------------------------# + + +#----- Load some packages. ----------------------------------------------------------------# +library(hdf5) +library(chron) +library(scatterplot3d) +library(lattice) +library(maps) +library(mapdata) +library(akima) +library(Hmisc) +library(sn) +#------------------------------------------------------------------------------------------# + + +#----- In case there is some graphic still opened. ----------------------------------------# +graphics.off() +#------------------------------------------------------------------------------------------# + + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length(outform) +#------------------------------------------------------------------------------------------# + + +#----- Set how many variables we will compare. --------------------------------------------# +ncompvar = length(compvar) +nplotvar = length(plotvar) +nsizevar = length(sizevar) +#------------------------------------------------------------------------------------------# + + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +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,"epolygon.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,"skewnorm.stats.r" ,sep="/")) +source(paste(srcdir,"soilutils.r" ,sep="/")) +source(paste(srcdir,"sombreado.r" ,sep="/")) +source(paste(srcdir,"southammap.r" ,sep="/")) +source(paste(srcdir,"thermlib.r" ,sep="/")) +source(paste(srcdir,"timeutils.r" ,sep="/")) +source(paste(srcdir,"zen.r" ,sep="/")) +#----- These should be called after the others. -------------------------------------------# +source(paste(srcdir,"pft.coms.r" ,sep="/")) +#------------------------------------------------------------------------------------------# + + + +#----- Load observations. -----------------------------------------------------------------# +obser.file = paste(srcdir,"LBA_MIP.nogapfill.RData",sep="/") +load(file=obser.file) +#------------------------------------------------------------------------------------------# + + + +#----- Load census data. ------------------------------------------------------------------# +census.file = paste(srcdir,"LBA_MIP.census_summ.RData",sep="/") +load(file=census.file) +#------------------------------------------------------------------------------------------# + + + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +#------------------------------------------------------------------------------------------# + + + +#---- Create the main output directory in case there is none. -----------------------------# +if (! file.exists(outroot)) dir.create(outroot) +#------------------------------------------------------------------------------------------# + + +#------------------------------------------------------------------------------------------# +# Big place loop starts here... # +#------------------------------------------------------------------------------------------# +for (place in myplaces){ + + #----- Retrieve default information about this place and set up some variables. --------# + thispoi = locations(where=place,here=there,yearbeg=yearbeg,yearend=yearend + ,monthbeg=monthbeg) + inpref = thispoi$pathin + outmain = paste(outroot,place,sep="/") + outpref = paste(outmain,"eval_ed",sep="/") + lieu = thispoi$lieu + lon = thispoi$lon + lat = thispoi$lat + iata = thispoi$iata + suffix = thispoi$iata + yeara = thispoi$yeara + yearz = thispoi$yearz + meszz = thispoi$monz + + + #----- Find the observations for this particular site. ---------------------------------# + if (iata == "mao" | iata == "bdf"){ + obs.name = "obs.m34" + }else if(iata == "stm"){ + obs.name = "obs.s67" + }else if(iata == "rao"){ + obs.name = "obs.pdg" + }else if(iata == "jpr"){ + obs.name = "obs.fns" + }else if(iata == "btr"){ + obs.name = "obs.s77" + }else{ + obs.name = paste("obs.",iata,sep="") + }#end if + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # We only run this part of the code if there are observations to compare with the # + # model. # + #---------------------------------------------------------------------------------------# + if (obs.name %in% ls()){ + + + #----- Print a banner to entretain the user. ----------------------------------------# + print(paste(" + Evaluating model for ",lieu,"...",sep="")) + + #----- Get the observed variables. --------------------------------------------------# + obser = get(obs.name) + ntimes = length(obser$when) + obser = alltimes(datin=obser,lon=lon,lat=lat,ed21=TRUE,zeronight=FALSE + ,meanval=TRUE,imetavg=1,nmean=12,na.rm=TRUE) + obser$hr.idx = period.day(obser$when,dtblock=hourblock.len) + obser$yr.idx = season(obser$when,add.year=FALSE) + #----- Convert the NEE back to umol/m2/s, normal units for eddy flux. ---------------# + obser$nee = obser$nee * kgCyr.2.umols + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Make the RData file name, then we check whether we must read the files again # + # or use the stored RData. # + #------------------------------------------------------------------------------------# + path.data = paste(here,place,"rdata_hour",sep="/") + if (! file.exists(path.data)) dir.create(path.data) + ed22.rdata = paste(path.data,paste(place,"RData",sep="."),sep="/") + if (reload.data && file.exists(ed22.rdata)){ + #----- Load the modelled dataset. ------------------------------------------------# + print(paste(" - Loading previous session...",sep="")) + load(ed22.rdata) + if ((! "eddy.complete" %in% ls()) && "complete" %in% ls()) eddy.complete = complete + if ((! "eddy.tresume" %in% ls()) && "tresume" %in% ls()) eddy.tresume = tresume + }else{ + print(paste(" - Starting new session...",sep="")) + eddy.tresume = 1 + eddy.complete = FALSE + }#end if + + if (! eddy.complete){ + #----- Initialise the model structure. -------------------------------------------# + if (eddy.tresume == 1){ + model = list() + model$when = obser$when + model$hr.idx = period.day(model$when,dtblock=hourblock.len) + model$yr.idx = season(model$when,add.year=FALSE) + empty = rep(NA,times=ntimes) + model$atm.tmp = empty + model$atm.shv = empty + model$atm.prss = empty + model$rain = empty + model$atm.co2 = empty + model$atm.vels = empty + model$rshort = empty + model$rlong = empty + model$par = empty + model$hflxca = empty + model$wflxca = empty + model$cflxca = empty + model$cflxst = empty + model$gpp = empty + model$reco = empty + model$nep = empty + model$nee = empty + model$ustar = empty + }#end if + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Load data for all times. # + #---------------------------------------------------------------------------------# + last.cday = "00" + last.cmonth = sprintf("%4.4i",numyears (model$when[eddy.tresume])) + last.cyear = sprintf("%4.4i",numyears (model$when[eddy.tresume])) + print(paste(" - Reading in files...",sep="")) + for (tt in eddy.tresume:ntimes){ + cyear = sprintf("%4.4i",numyears (model$when[tt])) + cmonth = sprintf("%2.2i",nummonths(model$when[tt])) + cday = sprintf("%2.2i",numdays (model$when[tt])) + chour = sprintf("%2.2i",hours (model$when[tt])) + cminu = sprintf("%2.2i",minutes (model$when[tt])) + myfile = paste(inpref,"-I-",cyear,"-",cmonth,"-",cday,"-",chour,cminu + ,"00-g01.h5",sep="") + if (last.cday != cday) print(paste(" * ",basename(myfile),"...",sep="")) + last.cday = cday + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Read the data in case the file exists. In case it doesn't, save what # + # has been already read and quit. # + #------------------------------------------------------------------------------# + if (! file.exists(myfile)){ + eddy.complete = FALSE + eddy.tresume = tt + print(paste(" - Simulation not ready yet. Saving partial ED-2.2 data to " + ,basename(ed22.rdata),"...",sep="")) + save( list = c("model","eddy.complete","eddy.tresume") + , file = ed22.rdata) + print("Quitting") + q("no") + }else{ + myinst = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) + }#end if + #------------------------------------------------------------------------------# + model$atm.tmp [tt] = myinst$AVG.ATM.TMP - t00 + model$atm.shv [tt] = myinst$AVG.ATM.SHV * 1000. + model$atm.prss [tt] = myinst$AVG.ATM.PRSS * 0.01 + model$rain [tt] = myinst$AVG.PCPG * hr.sec + model$atm.co2 [tt] = myinst$AVG.ATM.CO2 + model$atm.vels [tt] = myinst$AVG.VELS + model$rshort [tt] = myinst$AVG.RSHORT + model$rlong [tt] = myinst$AVG.RLONG + model$par [tt] = ( ( myinst$AVG.PAR.BEAM + myinst$AVG.PAR.DIFF ) + * Watts.2.Ein * 1.e6) + model$hflxca [tt] = - myinst$AVG.SENSIBLE.AC + model$wflxca [tt] = - myinst$AVG.VAPOR.AC * day.sec + model$cflxca [tt] = - myinst$AVG.CARBON.AC + model$cflxst [tt] = + myinst$AVG.CARBON.ST + model$gpp [tt] = myinst$AVG.GPP * umols.2.kgCyr + model$reco [tt] = ( ( myinst$AVG.PLANT.RESP + myinst$AVG.HTROPH.RESP ) + * umols.2.kgCyr ) + model$nep [tt] = model$gpp[tt] - model$reco[tt] + model$nee [tt] = - model$nep[tt] * kgCyr.2.umols + model$ustar [tt] = myinst$AVG.USTAR + + if (tt == ntimes){ + eddy.complete = TRUE + eddy.tresume = ntimes+1 + print(paste(" - Saving full ED-2.2 data to ",basename(ed22.rdata) + ,"...",sep="")) + save( list = c("model","eddy.complete","eddy.tresume") + , file = ed22.rdata) + }else if (last.cyear != cyear){ + eddy.complete = FALSE + eddy.tresume = tt+1 + print(paste(" - Saving partial ED-2.2 data to ",basename(ed22.rdata) + ,"...",sep="")) + save( list = c("model","eddy.complete","eddy.tresume") + , file = ed22.rdata) + print("Quitting") + q("no") + }#end if + + last.cyear = cyear + }#end for + #---------------------------------------------------------------------------------# + }#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) + outboxmain = paste(outpref,"boxplot",sep="/") + outpdfmain = paste(outpref,"pdfplot",sep="/") + outlight = paste(outpref,"light" ,sep="/") + if (! file.exists(outboxmain)) dir.create(outboxmain) + if (! file.exists(outpdfmain)) dir.create(outpdfmain) + if (! file.exists(outlight )) dir.create(outlight) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Find out how many diel and seasonal blocks to create. # + #------------------------------------------------------------------------------------# + myseasons = sort(unique(obser$yr.idx)) + nseasons = length(myseasons) + ss.name = paste(sprintf("%2.2i",myseasons),season.list[myseasons],sep="-") + ss.title = season.full[myseasons] + mydiel = sort(unique(obser$hr.idx)) + ndiel = length(mydiel) + hr.end = seq(from=hourblock.len,to=day.hr,by=hourblock.len) %% day.hr + hr.beg = (hr.end - hourblock.len + 1) %% day.hr + diel.list = paste(sprintf("%2.2i",hr.beg),sprintf("%2.2i",hr.end),sep="-") + dl.name = diel.list[mydiel] + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Compare the light response curve. # + #------------------------------------------------------------------------------------# + print(paste(" - Comparing the light response curve...",sep="")) + for (s in 1:nseasons){ + #---------------------------------------------------------------------------------# + # Select the data points for which we have observations, then fit the light # + # response curve to both observed and modelled GPP. # + #---------------------------------------------------------------------------------# + sel = ( obser$yr.idx == myseasons[s] & is.finite(obser$gpp) + & (is.finite(obser$rshort) & obser$daytime) ) + + #---------------------------------------------------------------------------------# + # Observations. # + #---------------------------------------------------------------------------------# + #----- Select and sort the data. -------------------------------------------------# + obser.data = data.frame( par = obser$par[sel] + , gpp = obser$gpp[sel] * kgCyr.2.umols) + o = order(obser.data$par) + obser.data = obser.data[o,] + #----- Give more weight to light-limited side. -----------------------------------# + obser.wgts = 1.0 / (( obser.data$par * 0.002 + 3.0) ) + #----- Fit the observations. -----------------------------------------------------# + obser.fit = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) + , data = obser.data + , weights = obser.wgts + , start = list(a1 = 1., a2 = -40., a3 = 500.) ) + #----- Find the light-response curve. --------------------------------------------# + obser.pred = predict(obser.fit) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Model results. # + #-----name----------------------------------------------------------------------------# + #----- Select and sort the data. -------------------------------------------------# + model.data = data.frame( par = model$par[sel] + , gpp = model$gpp[sel] * kgCyr.2.umols) + o = order(model.data$par) + model.data = model.data[o,] + #----- Give more weight to light-limited side. -----------------------------------# + model.wgts = 1.0 / (( model.data$par * 0.002 + 3.0) ) + #----- Fit the modelled results. -------------------------------------------------# + model.fit = nls( formula = gpp ~ a1 + a2 * par / (a3 + par) + , data = model.data + , weights = model.wgts + , start = list(a1 = 1., a2 = -40., a3 = 500.) ) + #----- Find the light-response curve. --------------------------------------------# + model.pred = predict(model.fit) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Find the X and Y limits. # + #---------------------------------------------------------------------------------# + xlimit = range(c(obser.data$par,model.data$par)) + ylimit = range(c(obser.data$gpp,model.data$gpp)) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Plot the predicted curves and scatter plot. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------------------# + fichier = paste(outlight,"/gpp_light","-",ss.name[s],"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Set up the title and axes labels. # + #------------------------------------------------------------------------------# + letitre = paste(lieu,"\n Polygon-level light response curve - " + ,ss.title[s],sep="") + lex = paste("Photosynthetically Active Radiation [umol/m2/s]") + ley = paste("Gross Primary Productivity [umol/m2/s]") + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Open an empty plotting area. # + #------------------------------------------------------------------------------# + plot(x=obser.data$par,y=obser.data$gpp,type="n",main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main,ylim=ylimit) + grid(col="gray76",lty="solid") + #----- Add the observations. --------------------------------------------------# + points(x=obser.data$par,y=obser.data$gpp,pch=16,col="gray50") + points(x=model.data$par,y=model.data$gpp,pch=16,col="chartreuse") + #----- Add the density functions. ---------------------------------------------# + lines(x=obser.data$par,y=obser.pred,lwd=3.0,col="gray21") + lines(x=model.data$par,y=model.pred,lwd=3.0,col="chartreuse4") + #----- Add the legend. --------------------------------------------------------# + legend( x = "topleft" + , inset = 0.01 + , legend = c("Observation","Fit - Observation","Model","Fit - Model") + , pch = c(16,NA,16,NA) + , lwd = c(NA, 3,NA, 3) + , col = c("gray50","gray21","chartreuse","chartreuse4") + , bg = "white" + , cex = 1.0) + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Close the plotting device. # + #------------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Loop over all variables, and hours blocks, and all seasons to determine the # + # distribution of the data. # + #------------------------------------------------------------------------------------# + print(paste(" - Comparing season and diurnal distributions...",sep="")) + for (cc in 1:ncompvar){ + + this.comp = compvar[[cc]] + this.vnam = this.comp$vnam + this.desc = this.comp$desc + this.unit = this.comp$unit + col.obser = this.comp$col.obser + col.model = this.comp$col.model + leg.corner = this.comp$leg.corner + + print(paste(" * ",this.desc,"...",sep="")) + this.obser = obser[[this.vnam]] + this.model = model[[this.vnam]] + + + #---------------------------------------------------------------------------------# + # Check whether the variable directories exist. If not, create them. # + #---------------------------------------------------------------------------------# + outboxvar = paste(outboxmain,this.vnam,sep="/") + outpdfvar = paste(outpdfmain,this.vnam,sep="/") + if (! file.exists(outboxvar)) dir.create(outboxvar) + if (! file.exists(outpdfvar)) dir.create(outpdfvar) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Season block. # + #---------------------------------------------------------------------------------# + for (s in 1:nseasons){ + print(paste(" # Season: ",ss.name[s],"...",sep="")) + bp.list = list() + #----- These lists will contain the data for the box plot. --------------------# + ylimit.bp = NULL + #------------------------------------------------------------------------------# + # Diel block. # + #------------------------------------------------------------------------------# + for (d in 1:(ndiel+3)){ + #---------------------------------------------------------------------------# + # Select the period of the day to plot. # + #---------------------------------------------------------------------------# + if (d <= ndiel){ + print(paste(" ~ Hour: ",dl.name[d]," UTC...",sep="")) + sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] + & obser$hr.idx == mydiel [d] ) + diel.label = paste("hr",dl.name[d],sep="_") + diel.desc = paste("Hours: ",dl.name[d]," UTC",sep="") + }else if (d == ndiel+1){ + print(paste(" ~ Night time...",sep="")) + sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] + & (is.finite(obser$rshort) & obser$nighttime ) ) + diel.label = paste("night") + diel.desc = paste("Nighttime",sep="") + }else if (d == ndiel+2){ + print(paste(" ~ Sunrise/sunset time...",sep="")) + sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] + & (is.finite(obser$rshort) & obser$riseset ) ) + diel.label = paste("riseset") + diel.desc = paste("Sunrise/sunset time",sep="") + }else if (d == ndiel+3){ + print(paste(" ~ Day time...",sep="")) + sel = ( is.finite(this.obser) & obser$yr.idx == myseasons[s] + & (is.finite(obser$rshort) & obser$highsun ) ) + diel.label = paste("day") + diel.desc = paste("Daytime",sep="") + }#end if + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Find the skewed normal distribution of the observed quantities. # + #---------------------------------------------------------------------------# + if (any(sel)){ + #------------------------------------------------------------------------# + # Append the data to the box plot lists, except if this is day time # + # or night time plot. # + #------------------------------------------------------------------------# + if (d <= ndiel){ + o.bp.name = paste("Obs.",dl.name[d],sep=" ") + m.bp.name = paste("ED22",dl.name[d],sep=" ") + bp.list[[o.bp.name]] = this.obser[sel] + bp.list[[m.bp.name]] = this.model[sel] + }#end if + #------------------------------------------------------------------------# + + + + #----- Find and plot the distribution function for this hour. -----------# + if (sd(this.obser[sel]) >= 1.e-6){ + #---------------------------------------------------------------------# + # Skewed-Gaussian statistics. # + #---------------------------------------------------------------------# + o.location = sn.location(this.obser[sel],na.rm=TRUE) + o.scale = sn.scale (this.obser[sel],na.rm=TRUE) + o.shape = sn.shape (this.obser[sel],na.rm=TRUE) + m.location = sn.location(this.model[sel],na.rm=TRUE) + m.scale = sn.scale (this.model[sel],na.rm=TRUE) + m.shape = sn.shape (this.model[sel],na.rm=TRUE) + #---------------------------------------------------------------------# + + + #---------------------------------------------------------------------# + # Find the range of observations/modelled variables. # + #---------------------------------------------------------------------# + qlimit = range(c(this.obser[sel],this.model[sel])) + quant = seq(from=qlimit[1],to=qlimit[2],length.out=1000) + dfunc.obser = dsn(x=quant,dp=c(o.location,o.scale,o.shape)) + dfunc.model = dsn(x=quant,dp=c(m.location,m.scale,m.shape)) + xbreaks = pretty(qlimit,n=20) + freq.obser = hist(this.obser[sel],breaks=xbreaks,plot=FALSE)$density + freq.model = hist(this.model[sel],breaks=xbreaks,plot=FALSE)$density + ylimit = range(c(dfunc.obser,dfunc.model,freq.obser,freq.model)) + 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 + #---------------------------------------------------------------------# + + + #---------------------------------------------------------------------# + # Plot the predicted curves and histograms. # + #---------------------------------------------------------------------# + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------# + fichier = paste(outpdfvar,"/histcomp_",this.vnam,"-",ss.name[s] + ,"-",diel.label,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }#end if + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Set up the title and axes labels. # + #------------------------------------------------------------------# + letitre = paste(lieu,"\n",this.desc," - ",ss.title[s] + ," - ",diel.desc,sep="") + lex = paste(this.desc,this.unit,sep=" ") + ley = "Density function [ ]" + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Open an empty plotting area. # + #------------------------------------------------------------------# + plot(x=quant,y=dfunc.obser,type="n",main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main,ylim=ylimit) + grid(col="gray76",lty="solid") + #----- Add the histograms. ----------------------------------------# + hist(this.obser[sel],breaks=xbreaks,freq=FALSE,col=col.obser[1] + ,angle=-45,density=12,add=TRUE) + hist(this.model[sel],breaks=xbreaks,freq=FALSE,col=col.model[1] + ,angle=45,density=12,add=TRUE) + #----- Add the density functions. ---------------------------------# + lines(x=quant,y=dfunc.obser,lwd=3.0,col=col.obser[2]) + lines(x=quant,y=dfunc.model,lwd=3.0,col=col.model[2]) + #----- Add the legend. --------------------------------------------# + legend(x="topleft",inset=0.01,legend=c("Observation","Model") + ,fill =c(col.obser[2],col.model[2]) + ,border=c(col.obser[2],col.model[2]) + ,angle=c(-45,45),density=30 + ,lwd=2.0,col=c(col.obser[2],col.model[2]),bg="white" + ,cex=1.0) + #------------------------------------------------------------------# + + + + #------------------------------------------------------------------# + # Close the plotting device. # + #------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------# + }#end if + #---------------------------------------------------------------------------# + + }#end for + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Make the box plot comparing observations with model. # + #------------------------------------------------------------------------------# + if (length(bp.list) > 0){ + for (o in 1:nout){ + #----- Make the file name. ----------------------------------------------# + fichier = paste(outboxvar,"/bpcomp_",this.vnam,"-",ss.name[s],"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) + }#end if + #------------------------------------------------------------------------# + + + #----- Set up some plot defaults. ---------------------------------------# + xlimit = c(0,2*ndiel) + ylimit = range(bp.list) + 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 + bpcolour = rep(c(col.obser[1],col.model[1]),times=ndiel) + xat = seq(from=1.5,to=2*ndiel-0.5,by=2) + xgrid = seq(from=0.5,to=2*ndiel+0.5,by=2) + #------------------------------------------------------------------------# + + + + #----- Set up the title and axes labels. --------------------------------# + letitre = paste(lieu,"\n",this.desc," - ",ss.title[s],sep="") + lex = paste(hourblock.len,"-hour period [UTC]",sep="") + ley = paste(this.desc,this.unit,sep=" ") + #------------------------------------------------------------------------# + + + + + #----- Plot the box plot. -----------------------------------------------# + plot(x=xlimit,y=ylimit,type="n",main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main,xaxt="n") + axis(side=1,at=xat,labels=dl.name) + abline(h=axTicks(side=2),v=xgrid,col="gray66",lty="solid") + boxplot(x=bp.list,col=bpcolour,notch=TRUE,add=TRUE,show.names=FALSE) + legend(x=leg.corner,inset=0.01,legend=c("Observation","Model"),bg="white" + ,fill=c(col.obser[1],col.model[1])) + #------------------------------------------------------------------------# + + #------------------------------------------------------------------------# + # Close the plot device. # + #------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------------# + }#end if (length(bp.list) > 0) + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + }#end if (obs.name %in% ls()) + #---------------------------------------------------------------------------------------# + + dum = write(x = "Finished",file=paste(here,place,"eval_load_complete.txt",sep="/")) +}#end for places +#------------------------------------------------------------------------------------------# + +#q("no") diff --git a/ED/Template/Template/plot_fast.r b/ED/Template/Template/plot_fast.r index 717956967..97c0f7411 100644 --- a/ED/Template/Template/plot_fast.r +++ b/ED/Template/Template/plot_fast.r @@ -20,10 +20,11 @@ secoend = 0 region = "thispoly" # Region name. myplaces = c("thispoly") -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing ptype = "l" # Type of plot ptyped = "p" # Type of plot @@ -543,7 +544,10 @@ for (l in 1:nplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(theme," - ",p$lieu, diff --git a/ED/Template/Template/plot_monthly.r b/ED/Template/Template/plot_monthly.r index ee32f5353..c5f2e064e 100644 --- a/ED/Template/Template/plot_monthly.r +++ b/ED/Template/Template/plot_monthly.r @@ -10,10 +10,11 @@ myplaces = c("thispoly") sasmonth.short = c(2,5,8,11) sasmonth.long = 5 nyears.long = 25 -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing byeold = TRUE # Remove old files of the given format? @@ -37,6 +38,7 @@ inset = 0.01 # inset distance between legend and edge of plot legbg = "white" # Legend background colour. scalleg = 0.20 cex.main = 0.8 # Scale coefficient for the title +slz.min = -5.0 # Find the deepest depth that trees access water. theta = 315. # Azimuth for perspective projection phi = 30. # Vertical angle for perspective projection @@ -105,7 +107,7 @@ source(paste(srcdir,"pft.coms.r" ,sep="/")) #----- Load observations. -----------------------------------------------------------------# -obsrfile = paste(srcdir,"LBA_MIP.v6.RData",sep="/") +obsrfile = paste(srcdir,"LBA_MIP.v8.RData",sep="/") load(file=obsrfile) #----- Define plot window size ------------------------------------------------------------# @@ -160,53 +162,83 @@ 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+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)) + 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)) + cbalightpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + cbamoistpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + cbarelpftdbh = 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)) + mortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + agemortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + ncbmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + tfallmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + coldmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + distmortpftdbh = array(data=0.,dim=c(totmon,ndbh+1,npft)) + growthpftdbh = 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) - 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) + 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) + cbalightpft = matrix(data=0,nrow=totmon,ncol=npft+1) + cbamoistpft = matrix(data=0,nrow=totmon,ncol=npft+1) + cbarelpft = matrix(data=0,nrow=totmon,ncol=npft+1) + ldroppft = matrix(data=0,nrow=totmon,ncol=npft+1) + fsopft = 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) + mortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + agemortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + ncbmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + tfallmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + coldmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + distmortpft = matrix(data=0,nrow=totmon,ncol=npft+1) + recrpft = matrix(data=0,nrow=totmon,ncol=npft+1) + growthpft = matrix(data=0,nrow=totmon,ncol=npft+1) + censusnplantpft = matrix(data=0,nrow=totmon,ncol=npft+1) + censuslaipft = matrix(data=0,nrow=totmon,ncol=npft+1) + censuswaipft = matrix(data=0,nrow=totmon,ncol=npft+1) + censustaipft = matrix(data=0,nrow=totmon,ncol=npft+1) + censusagbpft = matrix(data=0,nrow=totmon,ncol=npft+1) + censusbapft = 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)) #----- Polygon level vectors. ----------------------------------------------------------# + fast.soil.c = NULL + slow.soil.c = NULL + struct.soil.c = NULL gpp = NULL npp = NULL plresp = NULL @@ -214,9 +246,14 @@ for (place in myplaces){ root.resp = NULL growth.resp = NULL hetresp = NULL + cwdresp = NULL + reco = NULL mco = NULL npp = NULL cba = NULL + cbalight = NULL + cbamoist = NULL + cbarel = NULL ldrop = NULL nep = NULL nee = NULL @@ -236,6 +273,9 @@ for (place in myplaces){ wood.temp = NULL atm.shv = NULL can.shv = NULL + atm.vpd = NULL + can.vpd = NULL + leaf.vpd = NULL can.co2 = NULL hflxca = NULL qwflxca = NULL @@ -270,6 +310,8 @@ for (place in myplaces){ albedo.beam = NULL albedo.diff = NULL rlong.albedo = NULL + paw = NULL + smpot = NULL npat.global = NULL ncoh.global = NULL mmsqu.gpp = NULL @@ -278,6 +320,8 @@ for (place in myplaces){ mmsqu.root.resp = NULL mmsqu.plresp = NULL mmsqu.hetresp = NULL + mmsqu.cwdresp = NULL + mmsqu.reco = NULL mmsqu.cflxca = NULL mmsqu.cflxst = NULL mmsqu.hflxca = NULL @@ -291,6 +335,7 @@ for (place in myplaces){ mmsqu.wflxgc = NULL mmsqu.evap = NULL mmsqu.transp = NULL + water.deficit = NULL #----- Cohort level lists. -------------------------------------------------------------# lightco = list() @@ -301,11 +346,12 @@ for (place in myplaces){ gpplco = list() respco = list() nppco = list() - cbrbarco = list() - cbalco = list() + cbaco = list() + cbarelco = list() + cbalightco = list() + cbamoistco = list() mcostco = list() ldropco = list() - ncbmortco = list() agbco = list() fsoco = list() nplantco = list() @@ -326,6 +372,14 @@ for (place in myplaces){ brootco = list() bswoodco = list() bstoreco = list() + growthco = list() + mortco = list() + agemortco = list() + ncbmortco = list() + tfallmortco = list() + coldmortco = list() + distmortco = list() + recruitco = list() n = 0 m = 0 @@ -382,6 +436,9 @@ for (place in myplaces){ #----- Loop over months. -----------------------------------------------------------# for (month in firstmonth:lastmonth){ m = m + 1 + + #----- Find out the previous month. ---------------------------------------------# + lastmonth = 12 * (month == 1) + month - 1 #----- Build the month and year vector. -----------------------------------------# monnum = c(monnum,month) @@ -427,6 +484,23 @@ for (place in myplaces){ ntext = mymont$NTEXT.SOIL[nzg] soil.prop = soil.params(ntext,isoilflg,slxsand,slxclay) + dslz = diff(c(slz,0)) + soil.depth = rev(cumsum(rev(dslz))) + soil.dry = rev(cumsum(rev(soil.prop$soilcp * wdns * dslz))) + soil.poro = rev(cumsum(rev(soil.prop$slmsts * wdns * dslz))) + + + #----- Find the layers we care about. ----------------------------------------# + sel = slz < slz.min + if (any(sel)){ + ka = which.max(slz[sel]) + }else{ + ka = 1 + }#end if + kz = nzg + #-----------------------------------------------------------------------------# + + #----- Mean diurnal cycle. ---------------------------------------------------# dcycmean = list() @@ -437,8 +511,10 @@ for (place in myplaces){ 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$cwdresp = 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$reco = 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) @@ -460,6 +536,9 @@ for (place in myplaces){ dcycmean$atm.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$can.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$gnd.shv = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$atm.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$can.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) + dcycmean$leaf.vpd = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$atm.co2 = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$can.co2 = matrix(data=0,nrow=totmon,ncol=ndcycle) dcycmean$atm.prss = matrix(data=0,nrow=totmon,ncol=ndcycle) @@ -487,8 +566,10 @@ for (place in myplaces){ 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$cwdresp = 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$reco = 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) @@ -523,9 +604,12 @@ for (place in myplaces){ root.resp = c(root.resp , mymont$MMEAN.ROOT.RESP ) growth.resp = c(growth.resp , mymont$MMEAN.GROWTH.RESP ) hetresp = c(hetresp , mymont$MMEAN.RH ) + cwdresp = c(cwdresp , mymont$MMEAN.CWD.RH ) nep = c(nep , mymont$MMEAN.NEP ) nee = c(nee , - mymont$MMEAN.CARBON.AC + mymont$MMEAN.CARBON.ST ) + reco = c(reco , mymont$MMEAN.PLRESP + + mymont$MMEAN.RH ) cflxca = c(cflxca , - mymont$MMEAN.CARBON.AC ) cflxst = c(cflxst , mymont$MMEAN.CARBON.ST ) hflxca = c(hflxca , - mymont$MMEAN.SENSIBLE.AC ) @@ -546,6 +630,7 @@ for (place in myplaces){ 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.cwdresp = c(mmsqu.cwdresp , mymont$MMSQU.CWD.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 ) @@ -575,16 +660,19 @@ for (place in myplaces){ 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 ) + atm.vpd = c(atm.vpd ,mymont$MMEAN.ATM.VPDEF * 0.01 ) 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 ) + can.vpd = c(can.vpd ,mymont$MMEAN.CAN.VPDEF * 0.01 ) gnd.temp = c(gnd.temp ,mymont$MMEAN.GND.TEMP - t00 ) gnd.shv = c(gnd.shv ,mymont$MMEAN.GND.SHV * kg2g ) leaf.temp = c(leaf.temp ,mymont$MMEAN.LEAF.TEMP - t00 ) + leaf.vpd = c(leaf.vpd ,mymont$MMEAN.LEAF.VPDEF * 0.01 ) wood.temp = c(wood.temp ,mymont$MMEAN.WOOD.TEMP - t00 ) rain = c(rain ,mymont$MMEAN.PCPG*ddd * day.sec ) @@ -603,6 +691,17 @@ for (place in myplaces){ #--------------------------------------------------------------------------------# + #----- Find averaged soil properties. -------------------------------------------# + swater.now = rev(cumsum(rev(mymont$MMEAN.SOIL.WATER * wdns * dslz))) + smoist.avg = swater.now / (wdns * soil.depth) + paw.now = 100. * ( ( swater.now[ka] - soil.dry [ka] ) + / ( soil.poro [ka] - soil.dry [ka] ) ) + smpot.now = ( - smoist2mpot(smoist=smoist.avg[ka],mysoil=soil.prop) + * 0.001 * grav ) + paw = c( paw, paw.now ) + smpot = c( smpot, smpot.now ) + #--------------------------------------------------------------------------------# + #------ Read in soil properties. ------------------------------------------------# soil.temp [m,] = mymont$MMEAN.SOIL.TEMP - t00 @@ -633,8 +732,10 @@ for (place in myplaces){ dcycmean$leaf.resp [m,] = mymont$QMEAN.LEAF.RESP dcycmean$root.resp [m,] = mymont$QMEAN.ROOT.RESP dcycmean$hetresp [m,] = mymont$QMEAN.RH + dcycmean$cwdresp [m,] = mymont$QMEAN.CWD.RH dcycmean$nep [m,] = mymont$QMEAN.NEP dcycmean$nee [m,] = - mymont$QMEAN.CARBON.AC + mymont$QMEAN.CARBON.ST + dcycmean$reco [m,] = mymont$QMEAN.PLRESP + mymont$QMEAN.RH dcycmean$cflxca [m,] = - mymont$QMEAN.CARBON.AC dcycmean$cflxst [m,] = - mymont$QMEAN.CARBON.ST dcycmean$hflxca [m,] = - mymont$QMEAN.SENSIBLE.AC @@ -659,6 +760,9 @@ for (place in myplaces){ dcycmean$atm.shv [m,] = mymont$QMEAN.ATM.SHV * kg2g dcycmean$can.shv [m,] = mymont$QMEAN.CAN.SHV * kg2g dcycmean$gnd.shv [m,] = mymont$QMEAN.GND.SHV * kg2g + dcycmean$atm.vpd [m,] = mymont$QMEAN.ATM.VPDEF * 0.01 + dcycmean$can.vpd [m,] = mymont$QMEAN.CAN.VPDEF * 0.01 + dcycmean$leaf.vpd [m,] = mymont$QMEAN.LEAF.VPDEF * 0.01 dcycmean$atm.co2 [m,] = mymont$QMEAN.ATM.CO2 dcycmean$can.co2 [m,] = mymont$QMEAN.CAN.CO2 dcycmean$atm.vels [m,] = mymont$QMEAN.ATM.VELS @@ -684,6 +788,7 @@ for (place in myplaces){ dcycmsqu$leaf.resp [m,] = mymont$QMSQU.LEAF.RESP dcycmsqu$root.resp [m,] = mymont$QMSQU.ROOT.RESP dcycmsqu$hetresp [m,] = mymont$QMSQU.RH + dcycmsqu$cwdresp [m,] = mymont$QMSQU.CWD.RH dcycmsqu$nep [m,] = mymont$QMSQU.NEP dcycmsqu$cflxca [m,] = mymont$QMSQU.CARBON.AC dcycmsqu$cflxst [m,] = mymont$QMSQU.CARBON.ST @@ -715,6 +820,22 @@ for (place in myplaces){ #--------------------------------------------------------------------------------# + #--------------------------------------------------------------------------------# + # Get the soil carbon. # + #--------------------------------------------------------------------------------# + fast.soil.c = c(fast.soil.c ,sum(mymont$FAST.SOIL.C * areapa)) + slow.soil.c = c(slow.soil.c ,sum(mymont$SLOW.SOIL.C * areapa)) + struct.soil.c = c(struct.soil.c,sum(mymont$STRUCTURAL.SOIL.C * areapa)) + #--------------------------------------------------------------------------------# + + + #--------------------------------------------------------------------------------# + # Get the water deficit. # + #--------------------------------------------------------------------------------# + water.deficit = c(water.deficit,sum(mymont$AVG.MONTHLY.WATERDEF * areapa)) + #--------------------------------------------------------------------------------# + + #--------------------------------------------------------------------------------# # If this is a biomass initialisation, or a run with anthropogenic # # disturbance, we must jitter the age so we can distinguish the patches. # @@ -772,12 +893,13 @@ for (place in myplaces){ + mymont$MMEAN.GROWTH.RESP.CO + mymont$MMEAN.STORAGE.RESP.CO + mymont$MMEAN.VLEAF.RESP.CO ) nppconow = gppconow-respconow - cbalconow = mymont$MMEAN.CB + cbaconow = mymont$MMEAN.CB + cbalightconow = mymont$CB.LIGHTMAX[,lastmonth] + cbamoistconow = mymont$CB.MOISTMAX[,lastmonth] + cbarelconow = mymont$CBR.BAR 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 lightbeamconow = mymont$MMEAN.LIGHT.LEVEL.BEAM @@ -788,7 +910,7 @@ for (place in myplaces){ bdeadconow = mymont$BDEAD bleafconow = mymont$BLEAF brootconow = mymont$BROOT - bswoodconow = mymont$BSAPWOOD + bswoodconow = mymont$BSAPWOODA+mymont$BSAPWOODB bstoreconow = mymont$BSTORAGE @@ -798,6 +920,16 @@ for (place in myplaces){ gpplconow = gppconow gpplconow [sel] = nplantconow[sel] * gppconow[sel] / laiconow[sel] gpplconow [!sel] = 0. + + + mortconow = rowSums(mymont$MMEAN.MORT.RATE) + agemortconow = mymont$MMEAN.MORT.RATE[,1] + ncbmortconow = mymont$MMEAN.MORT.RATE[,2] + tfallmortconow = mymont$MMEAN.MORT.RATE[,3] + coldmortconow = mymont$MMEAN.MORT.RATE[,4] + distmortconow = mymont$MMEAN.MORT.RATE[,5] + recruitconow = mymont$RECRUIT.DBH + growthconow = 100. * mymont$DLNDBH.DT #-----------------------------------------------------------------------------# }else{ #----- Make everything NA. ---------------------------------------------------# @@ -831,27 +963,48 @@ for (place in myplaces){ leafrespconow = NA rootrespconow = NA growthrespconow = NA - respconow = NA - nppconow = NA - cbalconow = NA - mcostconow = NA - ldropconow = NA - cbrbarconow = NA - ncbmortconow = NA - fsoconow = NA - lightconow = NA - lightbeamconow = NA - lightdiffconow = NA - parlconow = NA - demandconow = NA - supplyconow = NA - baliveconow = NA - bdeadconow = NA - bleafconow = NA - brootconow = NA - bswoodconow = NA - bstoreconow = NA + respconow = NA + nppconow = NA + cbaconow = NA + cbalightconow = NA + cbamoistconow = NA + mcostconow = NA + ldropconow = NA + cbarelconow = NA + fsoconow = NA + lightconow = NA + lightbeamconow = NA + lightdiffconow = NA + parlconow = NA + demandconow = NA + supplyconow = NA + baliveconow = NA + bdeadconow = NA + bleafconow = NA + brootconow = NA + bswoodconow = NA + bstoreconow = NA + mortconow = NA + agemortconow = NA + ncbmortconow = NA + tfallmortconow = NA + coldmortconow = NA + distmortconow = NA + recruitconow = NA + growthconow = NA }#end if + #--------------------------------------------------------------------------------# + + + #--------------------------------------------------------------------------------# + # The following two variables are used to scale "intensive" properties # + # (whatever/plant) to "extensive" (whatever/m2). Sometimes they may be used to # + # build weighted averages. # + #--------------------------------------------------------------------------------# + w.nplant = nplantconow * areaconow + w.lai = laiconow * areaconow + #--------------------------------------------------------------------------------# + #----- Define some classes that can be defined even when no cohorts exist. ------# agebks = c(-Inf,seq(from=dage,to=(nage-1)*dage,by=dage),Inf) @@ -859,6 +1012,7 @@ for (place in myplaces){ agepafac = match(agepacut,agelevs) areapaage = tapply(X=areapa,INDEX=agepafac,sum,na.rm=TRUE) areaage = areapaage[as.character(agefac)] + #--------------------------------------------------------------------------------# @@ -866,72 +1020,50 @@ for (place in myplaces){ # Build the PFT arrays. # #--------------------------------------------------------------------------------# for (p in 1:npft){ - if (all(is.na(pftconow))){ - sel = rep(FALSE,times=length(pftconow)) - }else{ - sel = pftconow == p - }#end if - if (any(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])) - } - } + if (all(is.na(pftconow))){ + sel = rep(FALSE,times=length(pftconow)) + }else{ + sel = pftconow == p + }#end if + if (any(sel)){ + + #----- "Extensive" variables, add them. -----------------------------------# + nplantpft [m,p] = sum(nplantconow[sel] * areaconow[sel]) + laipft [m,p] = sum(laiconow [sel] * areaconow[sel]) + waipft [m,p] = sum(waiconow [sel] * areaconow[sel]) + taipft [m,p] = sum(taiconow [sel] * areaconow[sel]) + #--------------------------------------------------------------------------# + + #----- "Intensive" variables, use nplant or LAI to make them extensive. ---# + basareapft [m,p] = sum( w.nplant[sel] * baconow [sel] ) + agbpft [m,p] = sum( w.nplant[sel] * agbconow [sel] ) + bseedspft [m,p] = sum( w.nplant[sel] * bseedsconow [sel] ) + gpppft [m,p] = sum( w.nplant[sel] * gppconow [sel] ) + npppft [m,p] = sum( w.nplant[sel] * nppconow [sel] ) + mcopft [m,p] = sum( w.nplant[sel] * mcostconow [sel] ) + cbapft [m,p] = sum( w.nplant[sel] * cbaconow [sel] ) + cbalightpft [m,p] = sum( w.nplant[sel] * cbalightconow [sel] ) + cbamoistpft [m,p] = sum( w.nplant[sel] * cbamoistconow [sel] ) + ldroppft [m,p] = sum( w.nplant[sel] * ldropconow [sel] ) + balivepft [m,p] = sum( w.nplant[sel] * baliveconow [sel] ) + bdeadpft [m,p] = sum( w.nplant[sel] * bdeadconow [sel] ) + bleafpft [m,p] = sum( w.nplant[sel] * bleafconow [sel] ) + brootpft [m,p] = sum( w.nplant[sel] * brootconow [sel] ) + bswoodpft [m,p] = sum( w.nplant[sel] * bswoodconow [sel] ) + bstorepft [m,p] = sum( w.nplant[sel] * bstoreconow [sel] ) + leafresppft [m,p] = sum( w.nplant[sel] * leafrespconow [sel] ) + rootresppft [m,p] = sum( w.nplant[sel] * rootrespconow [sel] ) + growthresppft[m,p] = sum( w.nplant[sel] * growthrespconow[sel] ) + + #----- Fso is added here, but it will be scaled back to intensive. --------# + fsopft [m,p] = sum( w.lai [sel] * fsoconow [sel] ) + #--------------------------------------------------------------------------# + + #----- cbarel is added here, but it will be scaled back to intensive. -----# + cbarelpft [m,p] = sum( w.nplant[sel] * cbarelconow [sel] ) + #--------------------------------------------------------------------------# + }#end if (any(sel)) + }#end for (p in 1:npft) #------ Find the total. ---------------------------------------------------------# nplantpft [m,npft+1] = sum(nplantpft [m,1:npft],na.rm=TRUE) laipft [m,npft+1] = sum(laipft [m,1:npft],na.rm=TRUE) @@ -957,211 +1089,487 @@ for (place in myplaces){ #--------------------------------------------------------------------------------# + #----- Find the average Fsopen for each PFT. -------------------------------------# + for (p in 1:npft){ + if (laipft[m,p] != 0){ + fsopft[m,p] = fsopft[m,p] / laipft[m,p] + }#end if + }#end for + if (laipft[m,npft+1] != 0){ + fsopft[m,npft+1] = sum(fsopft[m,1:npft] * laipft[m,1:npft]) / laipft[m,npft+1] + }#end for + #---------------------------------------------------------------------------------# - #--------------------------------------------------------------------------------# - # Build the LU arrays. # - #--------------------------------------------------------------------------------# - for (l in 1:nlu){ - selpa = lupa == l - if (all(is.na(luconow))){ - sel = rep(FALSE,times=length(luconow)) - }else{ - sel = luconow == l - }#end if - if (any(sel)){ - lailu [m,l] = lailu [m,l] + sum(laiconow [sel] * areaconow[sel]) - basarealu[m,l] = basarealu [m,l] + - sum(nplantconow[sel] * baconow [sel] * areaconow[sel]) - agblu [m,l] = agblu [m,l] + - sum(nplantconow[sel] * agbconow [sel] * areaconow[sel]) - gpplu [m,l] = gpplu [m,l] + - sum(nplantconow[sel] * gppconow [sel] * areaconow[sel]) - npplu [m,l] = npplu [m,l] + - sum(nplantconow[sel] * nppconow [sel] * areaconow[sel]) - }#end if - arealu [m,l] = arealu [m,l] + sum(areapa[selpa]) - }#end for - #------ Find the total. ---------------------------------------------------------# - lailu [m,nlu+1] = sum(lailu [m,1:nlu], na.rm=TRUE) - basarealu[m,nlu+1] = sum(basarealu[m,1:nlu], na.rm=TRUE) - agblu [m,nlu+1] = sum(agblu [m,1:nlu], na.rm=TRUE) - gpplu [m,nlu+1] = sum(gpplu [m,1:nlu], na.rm=TRUE) - npplu [m,nlu+1] = sum(npplu [m,1:nlu], na.rm=TRUE) - arealu [m,nlu+1] = sum(arealu [m,1:nlu], na.rm=TRUE) - #--------------------------------------------------------------------------------# + #----- Find the average Fsopen for each PFT. -------------------------------------# + for (p in 1:npft){ + if (nplantpft[m,p] != 0){ + cbarelpft[m,p] = cbarelpft[m,p] / nplantpft[m,p] + }#end if + }#end for + if (nplantpft[m,npft+1] != 0){ + cbarelpft[m,npft+1] = ( sum(cbarelpft[m,1:npft] * nplantpft[m,1:npft]) + / nplantpft[m,npft+1] ) + }#end for + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Find the growth, mortality, and recruitment rates for each PFT, and the # + # global rates. We only use the cohorts that were flagged as 1 or 2 (which means # + # that their DBH is greater than 10 cm). # + #---------------------------------------------------------------------------------# + for (p in 1:npft){ + if (all(is.na(pftconow))){ + sel.hgt = rep(FALSE,times=length(pftconow)) + sel.dbh = rep(FALSE,times=length(pftconow)) + sel.re2 = rep(FALSE,times=length(pftconow)) + }else{ + sel.hgt = pftconow == p & heightconow > 1.5 + sel.dbh = pftconow == p & recruitconow > 0 + sel.re2 = pftconow == p & recruitconow == 2 + }#end if + #------------------------------------------------------------------------------# + #----- Census LAI, WAI, and TAI neglect plants shorter than 1.5m. -------------# + if (any(sel.hgt)){ + censuslaipft [m,p] = sum(laiconow[sel.hgt] * areaconow[sel.hgt]) + censuswaipft [m,p] = sum(waiconow[sel.hgt] * areaconow[sel.hgt]) + censustaipft [m,p] = sum(taiconow[sel.hgt] * areaconow[sel.hgt]) + }#end if + #------------------------------------------------------------------------------# - #--------------------------------------------------------------------------------# - # Build the size (DBH) structure arrays. # - #--------------------------------------------------------------------------------# - for (d in 1:ndbh){ - if (all(is.na(dbhfac))){ - seldbh = rep(FALSE,times=length(dbhfac)) - }else{ - seldbh = dbhfac == d - }#end if - for (p in 1:npft){ - 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]) - 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]) - #-----------------------------------------------------------------------------# + #----- Census AGB and Basal area ignore plants whose DBH is less than 10cm. ---# + if (any(sel.dbh)){ + censusbapft [m,p] = sum( w.nplant[sel.dbh] * baconow [sel.dbh] ) + censusagbpft[m,p] = sum( w.nplant[sel.dbh] * agbconow [sel.dbh] ) + }#end if + #------------------------------------------------------------------------------# - #----- 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 - #-----------------------------------------------------------------------------# + #------------------------------------------------------------------------------# + # Find the PFT-level mortality rates. # + #------------------------------------------------------------------------------# + if (any(sel.re2)){ + #---- This is the number of survivors. -------------------------------------# + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(mortconow[sel.re2]) ) + mortpft[m,p] = 100. * log( previous / survivor ) + + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(agemortconow[sel.re2]) ) + agemortpft[m,p] = 100. * log( previous / survivor ) + + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(ncbmortconow[sel.re2]) ) + ncbmortpft[m,p] = 100. * log( previous / survivor ) + + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(tfallmortconow[sel.re2]) ) + tfallmortpft[m,p] = 100. * log( previous / survivor ) + + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(coldmortconow[sel.re2]) ) + coldmortpft[m,p] = 100. * log( previous / survivor ) + + survivor = sum(w.nplant[sel.re2]) + previous = sum(w.nplant[sel.re2] * exp(distmortconow[sel.re2]) ) + distmortpft[m,p] = 100. * log( previous / survivor ) + }#end if + if (any(sel.dbh) & any(sel.re2)){ + #---- This is the number of survivors. -------------------------------------# + population = sum(w.nplant[sel.dbh]) + established = sum(w.nplant[sel.re2]) + recrpft[m,p] = 100. * log( population / established) / 12.0 + }#end if + #------------------------------------------------------------------------------# - #-----------------------------------------------------------------------------# - # 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 - 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 - #--------------------------------------------------------------------------------# + #------------------------------------------------------------------------------# + # Growth rates are found only for established cohorts. # + #------------------------------------------------------------------------------# + if (any(sel.re2)){ + censusnplantpft [m,p] = sum( w.nplant[sel.re2] ) + growthpft[m,p] = sum( w.nplant[sel.re2] * growthconow [sel.re2] ) + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# - #--------------------------------------------------------------------------------# - # Build the derived variables. # - #--------------------------------------------------------------------------------# - 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]) ) - #--------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# + # Find the total or the mean amongst all PFTs. # + #---------------------------------------------------------------------------------# + #----- "Extensive" properties, just add them up. ---------------------------------# + censusnplantpft [m,npft+1] = sum(censusnplantpft [m,1:npft],na.rm=TRUE) + censuslaipft [m,npft+1] = sum(censuslaipft [m,1:npft],na.rm=TRUE) + censuswaipft [m,npft+1] = sum(censuswaipft [m,1:npft],na.rm=TRUE) + censustaipft [m,npft+1] = sum(censustaipft [m,1:npft],na.rm=TRUE) + censusagbpft [m,npft+1] = sum(censusagbpft [m,1:npft],na.rm=TRUE) + censusbapft [m,npft+1] = sum(censusbapft [m,1:npft],na.rm=TRUE) + #----- Growth rates are averaged, not added. -------------------------------------# + if (censusnplantpft[m,npft+1] > 0.){ + growthpft[m,npft+1] = ( sum(growthpft[m,1:npft] * censusnplantpft[m,1:npft]) + / censusnplantpft[m,npft+1] ) + }#end if + #---------------------------------------------------------------------------------# + # Mortality and recruitment rates are done by looking at the entire # + # population rather than averaged. # + #---------------------------------------------------------------------------------# + if (all(is.na(pftconow))){ + sel.dbh = rep(FALSE,times=length(pftconow)) + sel.re2 = rep(FALSE,times=length(pftconow)) + }else{ + sel.dbh = recruitconow > 0 + sel.re2 = recruitconow == 2 + }#end if + + #----- w.nplant will convert intensive variables into extensive. -----------------# + w.nplant = nplantconow * areaconow + #---------------------------------------------------------------------------------# + if (any(sel.re2)){ + #---- This is the number of survivors. ----------------------------------------# + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(mortconow[sel.re2])) + mortpft[m,npft+1] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(agemortconow[sel.re2])) + agemortpft [m,npft+1] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(ncbmortconow[sel.re2])) + ncbmortpft [m,npft+1] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(tfallmortconow[sel.re2])) + tfallmortpft[m,npft+1] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(coldmortconow[sel.re2])) + coldmortpft [m,npft+1] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel.re2] ) + previous = sum( w.nplant[sel.re2] * exp(distmortconow[sel.re2])) + distmortpft [m,npft+1] = 100. * log( previous / survivor ) + }#end if + + if (any(sel.dbh) & any(sel.re2)){ + #---- This is the number of survivors. ----------------------------------------# + population = sum( w.nplant[sel.dbh] ) + established = sum( w.nplant[sel.re2] ) + recrpft[m,npft+1] = 100. * log( population / established ) / 12.0 + }#end if + #---------------------------------------------------------------------------------# + + + + + + + #---------------------------------------------------------------------------------# + # Build the LU arrays. # + #---------------------------------------------------------------------------------# + for (l in 1:nlu){ + selpa = lupa == l + if (all(is.na(luconow))){ + sel = rep(FALSE,times=length(luconow)) + }else{ + sel = luconow == l + }#end if + + if (any(sel)){ + lailu [m,l] = sum( laiconow[sel] * areaconow[sel] ) + basarealu[m,l] = sum( w.nplant[sel] * baconow [sel] ) + agblu [m,l] = sum( w.nplant[sel] * agbconow [sel] ) + gpplu [m,l] = sum( w.nplant[sel] * gppconow [sel] ) + npplu [m,l] = sum( w.nplant[sel] * nppconow [sel] ) + }#end if + arealu [m,l] = arealu [m,l] + sum(areapa[selpa]) + }#end for + #------ Find the total. ----------------------------------------------------------# + lailu [m,nlu+1] = sum(lailu [m,1:nlu], na.rm=TRUE) + basarealu[m,nlu+1] = sum(basarealu[m,1:nlu], na.rm=TRUE) + agblu [m,nlu+1] = sum(agblu [m,1:nlu], na.rm=TRUE) + gpplu [m,nlu+1] = sum(gpplu [m,1:nlu], na.rm=TRUE) + npplu [m,nlu+1] = sum(npplu [m,1:nlu], na.rm=TRUE) + arealu [m,nlu+1] = sum(arealu [m,1:nlu], na.rm=TRUE) + #---------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------# + # Build the size (DBH) structure arrays. # + #---------------------------------------------------------------------------------# + for (d in 1:ndbh){ + if (all(is.na(dbhfac))){ + seldbh = rep(FALSE,times=length(dbhfac)) + }else{ + seldbh = dbhfac == d + }#end if + for (p in 1:npft){ + selpft = pftconow == p + sel = selpft & seldbh + if (any(sel)){ + #----- Extensive properties. --------------------------------------------# + laipftdbh [m,d,p] = sum( laiconow [sel] * areaconow [sel] ) + waipftdbh [m,d,p] = sum( waiconow [sel] * areaconow [sel] ) + taipftdbh [m,d,p] = sum( taiconow [sel] * areaconow [sel] ) + nplantpftdbh [m,d,p] = sum( nplantconow [sel] * areaconow [sel] ) + demandpftdbh [m,d,p] = sum( demandconow [sel] * areaconow [sel] ) + supplypftdbh [m,d,p] = sum( supplyconow [sel] * areaconow [sel] ) + #----- Intensive properties, use nplant to make them extensive. ---------# + agbpftdbh [m,d,p] = sum( w.nplant [sel] * agbconow [sel] ) + gpppftdbh [m,d,p] = sum( w.nplant [sel] * gppconow [sel] ) + npppftdbh [m,d,p] = sum( w.nplant [sel] * nppconow [sel] ) + mcopftdbh [m,d,p] = sum( w.nplant [sel] * mcostconow [sel] ) + cbapftdbh [m,d,p] = sum( w.nplant [sel] * cbaconow [sel] ) + cbalightpftdbh [m,d,p] = sum( w.nplant [sel] * cbalightconow [sel] ) + cbamoistpftdbh [m,d,p] = sum( w.nplant [sel] * cbamoistconow [sel] ) + ldrpftdbh [m,d,p] = sum( w.nplant [sel] * ldropconow [sel] ) + #----- FSO, use LAI to scale them, we will normalise outside the loop. --# + fsopftdbh [m,d,p] = sum( laiconow [sel] * fsoconow [sel] ) + #----- CBAREL, like FSO, but we use nplant to scale them. ---------------# + cbarelpftdbh [m,d,p] = sum( nplantconow [sel] * cbarelconow [sel] ) + #------------------------------------------------------------------------# + }#end if + + #---------------------------------------------------------------------------# + # For mortality and growth, we keep deleting the tiny guys because they # + # skew the rates quite significantly. # + #---------------------------------------------------------------------------# + sel = sel & recruitconow == 2 + if (any(sel)){ + growthpftdbh [m,d,p] = sum( w.nplant [sel] * growthconow [sel] ) + + #---- This is the number of survivors and living before. ----------------# + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) + mortpftdbh[m,d,p] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) + agemortpftdbh [m,d,p] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) + ncbmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) + tfallmortpftdbh[m,d,p] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) + coldmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) + distmortpftdbh [m,d,p] = 100. * log( previous / survivor ) + }#end if + #---------------------------------------------------------------------------# + }#end for PFT + #------------------------------------------------------------------------------# + }#end for DBH + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Either sum or normalise variables. # + #---------------------------------------------------------------------------------# + 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){ + #---------------------------------------------------------------------------# + # FSopen is scaled by LAI. # + #---------------------------------------------------------------------------# + if (laipftdbh[m,d,p] != 0){ + fsopftdbh[m,d,p] = fsopftdbh[m,d,p] / laipftdbh[m,d,p] + }#end if + }#end for + 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 + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Find the average relative carbon balance for each DBH class and amongst # + # all classes. # + #------------------------------------------------------------------------------# + for (d in 1:ndbh){ + #---------------------------------------------------------------------------# + # CBAREL is scaled by Nplant. # + #---------------------------------------------------------------------------# + if (nplantpftdbh[m,d,p] != 0){ + cbarelpftdbh[m,d,p] = cbarelpftdbh[m,d,p] / nplantpftdbh[m,d,p] + }#end if + }#end for + if (nplantpftdbh[m,ndbh+1,p] != 0){ + cbarelpftdbh[m,ndbh+1,p] = ( sum( cbarelpftdbh[m,1:ndbh,p] + * nplantpftdbh[m,1:ndbh,p] ) + / nplantpftdbh[m,ndbh+1,p] ) + }#end for + #------------------------------------------------------------------------------# + + + for (d in 2:ndbh){ + #---------------------------------------------------------------------------# + # Growth rate is scaled by NPlant. # + #---------------------------------------------------------------------------# + nplant.use = 0. + if (nplantpftdbh[m,d,p] != 0){ + nplant.use = nplant.use + nplantpftdbh[m,d,p] + growthpftdbh[m,d,p] = growthpftdbh[m,d,p] / nplantpftdbh[m,d,p] + }#end if + }#end for + if (nplant.use != 0){ + growthpftdbh[m,ndbh+1,p] = ( sum( growthpftdbh[m,2:ndbh,p] + * nplantpftdbh[m,2:ndbh,p] ) + / nplant.use ) + }#end for + #------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------# + # Find the mortality amongst all DBH classes for this PFT. This will # + # include the small cohorts too. # + #------------------------------------------------------------------------------# + if (all(is.na(pftconow))){ + sel = rep(FALSE,times=length(pftconow)) + }else{ + sel = pftconow == p & recruitconow == 2 + }#end if + #---- This is the number of survivors and living before. ----------------------# + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(mortconow[sel]) ) + mortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(agemortconow[sel]) ) + agemortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(ncbmortconow[sel]) ) + ncbmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(tfallmortconow[sel]) ) + tfallmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(coldmortconow[sel]) ) + coldmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + + survivor = sum( w.nplant[sel] ) + previous = sum( w.nplant[sel] * exp(distmortconow[sel]) ) + distmortpftdbh[m,ndbh+1,p] = 100. * log( previous / survivor) + }#end for + #---------------------------------------------------------------------------------# - #--------------------------------------------------------------------------------# - # Build the cohort-level lists if this is the right month. # - #--------------------------------------------------------------------------------# - if (month %in% sasmonth){ - cyear = substring(10000 + year,2,5) - cmonth = substring(100+month,2,3) - labwhen = paste("y",cyear,"m",cmonth,sep="") - #----- Binding the current cohorts. ------------------------------------------# - lightco [[labwhen]] = lightconow - lightbeamco [[labwhen]] = lightbeamconow - lightdiffco [[labwhen]] = lightdiffconow - parlco [[labwhen]] = parlconow - gppco [[labwhen]] = gppconow - gpplco [[labwhen]] = gpplconow - respco [[labwhen]] = respconow - nppco [[labwhen]] = nppconow - cbrbarco [[labwhen]] = cbrbarconow - cbalco [[labwhen]] = cbalconow - mcostco [[labwhen]] = mcostconow - ncbmortco [[labwhen]] = ncbmortconow - agbco [[labwhen]] = agbconow - fsoco [[labwhen]] = fsoconow - nplantco [[labwhen]] = nplantconow * areaconow - heightco [[labwhen]] = heightconow - baco [[labwhen]] = nplantconow * baconow * areaconow - pftco [[labwhen]] = pftconow - dbhco [[labwhen]] = dbhconow - laico [[labwhen]] = laiconow - waico [[labwhen]] = waiconow - taico [[labwhen]] = taiconow - ageco [[labwhen]] = ageconow - areaco [[labwhen]] = areaconow - demandco [[labwhen]] = demandconow - supplyco [[labwhen]] = supplyconow - baliveco [[labwhen]] = baliveconow - bdeadco [[labwhen]] = bdeadconow - bleafco [[labwhen]] = bleafconow - brootco [[labwhen]] = brootconow - bswoodco [[labwhen]] = bswoodconow - bstoreco [[labwhen]] = bstoreconow - } #end if month=sasmonth - #--------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Build the derived variables. # + #---------------------------------------------------------------------------------# + 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]) ) + #---------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------# + # Build the cohort-level lists if this is the right month. # + #---------------------------------------------------------------------------------# + if (month %in% sasmonth){ + cyear = substring(10000 + year,2,5) + cmonth = substring(100+month,2,3) + labwhen = paste("y",cyear,"m",cmonth,sep="") + #----- Binding the current cohorts. -------------------------------------------# + lightco [[labwhen]] = lightconow + lightbeamco [[labwhen]] = lightbeamconow + lightdiffco [[labwhen]] = lightdiffconow + parlco [[labwhen]] = parlconow + gppco [[labwhen]] = gppconow + gpplco [[labwhen]] = gpplconow + respco [[labwhen]] = respconow + nppco [[labwhen]] = nppconow + cbaco [[labwhen]] = cbaconow + cbalightco [[labwhen]] = cbalightconow + cbamoistco [[labwhen]] = cbamoistconow + cbarelco [[labwhen]] = cbarelconow + mcostco [[labwhen]] = mcostconow + agbco [[labwhen]] = agbconow + fsoco [[labwhen]] = fsoconow + nplantco [[labwhen]] = nplantconow * areaconow + heightco [[labwhen]] = heightconow + baco [[labwhen]] = nplantconow * baconow * areaconow + pftco [[labwhen]] = pftconow + dbhco [[labwhen]] = dbhconow + laico [[labwhen]] = laiconow + waico [[labwhen]] = waiconow + taico [[labwhen]] = taiconow + ageco [[labwhen]] = ageconow + areaco [[labwhen]] = areaconow + demandco [[labwhen]] = demandconow + supplyco [[labwhen]] = supplyconow + baliveco [[labwhen]] = baliveconow + bdeadco [[labwhen]] = bdeadconow + bleafco [[labwhen]] = bleafconow + brootco [[labwhen]] = brootconow + bswoodco [[labwhen]] = bswoodconow + bstoreco [[labwhen]] = bstoreconow + growthco [[labwhen]] = growthconow + mortco [[labwhen]] = mortconow + agemortco [[labwhen]] = agemortconow + ncbmortco [[labwhen]] = ncbmortconow + tfallmortco [[labwhen]] = tfallmortconow + coldmortco [[labwhen]] = coldmortconow + distmortco [[labwhen]] = distmortconow + recruitco [[labwhen]] = recruitconow + } #end if month=sasmonth + #---------------------------------------------------------------------------------# }# end for, month }#end for, year @@ -1189,9 +1597,11 @@ for (place in myplaces){ 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$cwdresp = tapply(X=cwdresp ,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$reco = tapply(X=reco ,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) @@ -1223,6 +1633,7 @@ for (place in myplaces){ 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$cwdresp = tapply(X=mmsqu.cwdresp ,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) @@ -1257,6 +1668,7 @@ for (place in myplaces){ 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$cwdresp = sqrt(mont12sq$cwdresp - mont12mn$cwdresp^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 @@ -1280,6 +1692,7 @@ for (place in myplaces){ 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$cwdresp [!is.finite(mont12mn$cwdresp )] = 0. mont12sd$cflxca [!is.finite(mont12mn$cflxca )] = 0. mont12sd$cflxst [!is.finite(mont12mn$cflxst )] = 0. mont12sd$hflxca [!is.finite(mont12mn$hflxca )] = 0. @@ -1294,11 +1707,12 @@ for (place in myplaces){ mont12sd$evap [!is.finite(mont12mn$evap )] = 0. mont12sd$transp [!is.finite(mont12mn$transp )] = 0. #---------------------------------------------------------------------------------------# - # Estimate the standard deviation of NPP, NEP, and NEE. # + # Estimate the standard deviation of NPP, NEP, NEE, and REco. # #---------------------------------------------------------------------------------------# - 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) + 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 ) + mont12sd$reco = sqrt(mont12sd$plresp^2 + mont12sd$hetresp^2 ) #---------------------------------------------------------------------------------------# @@ -1314,8 +1728,10 @@ for (place in myplaces){ dcyc12mn$leaf.resp =qapply(X=dcycmean$leaf.resp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$root.resp =qapply(X=dcycmean$root.resp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$hetresp =qapply(X=dcycmean$hetresp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$cwdresp =qapply(X=dcycmean$cwdresp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$nep =qapply(X=dcycmean$nep ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$nee =qapply(X=dcycmean$nee ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$reco =qapply(X=dcycmean$reco ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$cflxca =qapply(X=dcycmean$cflxca ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$cflxst =qapply(X=dcycmean$cflxst ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$hflxca =qapply(X=dcycmean$hflxca ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) @@ -1337,6 +1753,9 @@ for (place in myplaces){ dcyc12mn$atm.shv =qapply(X=dcycmean$atm.shv ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$can.shv =qapply(X=dcycmean$can.shv ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$gnd.shv =qapply(X=dcycmean$gnd.shv ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$atm.vpd =qapply(X=dcycmean$atm.vpd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$can.vpd =qapply(X=dcycmean$can.vpd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12mn$leaf.vpd =qapply(X=dcycmean$leaf.vpd ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$atm.co2 =qapply(X=dcycmean$atm.co2 ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$can.co2 =qapply(X=dcycmean$can.co2 ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12mn$atm.prss =qapply(X=dcycmean$atm.prss ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) @@ -1365,6 +1784,7 @@ for (place in myplaces){ dcyc12sq$leaf.resp = qapply(X=dcycmsqu$leaf.resp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$root.resp = qapply(X=dcycmsqu$root.resp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$hetresp = qapply(X=dcycmsqu$hetresp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) + dcyc12sq$cwdresp = qapply(X=dcycmsqu$cwdresp ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$nep = qapply(X=dcycmsqu$nep ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$cflxca = qapply(X=dcycmsqu$cflxca ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) dcyc12sq$cflxst = qapply(X=dcycmsqu$cflxst ,INDEX=mfac,DIM=1,FUN=mean,na.rm=T) @@ -1400,6 +1820,7 @@ for (place in myplaces){ 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$cwdresp = sqrt(dcyc12sq$cwdresp -dcyc12mn$cwdresp^2 )*srnorm1 dcyc12sd$nep = sqrt(dcyc12sq$nep -dcyc12mn$nep^2 )*srnorm1 dcyc12sd$cflxca = sqrt(dcyc12sq$cflxca -dcyc12mn$cflxca^2 )*srnorm1 dcyc12sd$cflxst = sqrt(dcyc12sq$cflxst -dcyc12mn$cflxst^2 )*srnorm1 @@ -1423,6 +1844,7 @@ for (place in myplaces){ 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$cwdresp [!is.finite(dcyc12sd$cwdresp )] = 0. dcyc12sd$nep [!is.finite(dcyc12sd$nep )] = 0. dcyc12sd$cflxca [!is.finite(dcyc12sd$cflxca )] = 0. dcyc12sd$cflxst [!is.finite(dcyc12sd$cflxst )] = 0. @@ -1439,8 +1861,9 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# # Estimate NPP and NEE standard deviation. # #---------------------------------------------------------------------------------------# - dcyc12sd$npp = sqrt(dcyc12sd$gpp^2 + dcyc12sd$plresp^2) - dcyc12sd$nee = sqrt(dcyc12sd$cflxca^2 + dcyc12sd$cflxst^2) + dcyc12sd$npp = sqrt(dcyc12sd$gpp^2 + dcyc12sd$plresp^2 ) + dcyc12sd$nee = sqrt(dcyc12sd$cflxca^2 + dcyc12sd$cflxst^2 ) + dcyc12sd$reco = sqrt(dcyc12sd$plresp^2 + dcyc12sd$hetresp^2) #---------------------------------------------------------------------------------------# @@ -1463,7 +1886,6 @@ for (place in myplaces){ demandpftdbh [empty] = NA supplypftdbh [empty] = NA nplantpftdbh [empty] = NA - ncbmortpftdbh [empty] = NA #---------------------------------------------------------------------------------------# @@ -1545,7 +1967,6 @@ for (place in myplaces){ - #---------------------------------------------------------------------------------------# # Time series by PFT. # #---------------------------------------------------------------------------------------# @@ -1587,7 +2008,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if @@ -1630,7 +2054,7 @@ for (place in myplaces){ 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) + ,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){ @@ -1752,7 +2176,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(description,pft$name[p],lieu,sep=" - ") @@ -1791,285 +2218,118 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# - # Time series by LU. # + # Plot the comparison between observations and model. # #---------------------------------------------------------------------------------------# - for (v in 1:ntslu){ - thistslu = tslu[[v]] - vnam = thistslu$vnam - description = thistslu$desc - unit = thistslu$unit - plog = thistslu$plog - plotit = thistslu$plt + print(paste(" + Comparisons of time series (model vs. observations)...")) + for (cc in 1:ncompemean){ - #----- Check whether the user wants to have this variable plotted. ------------------# - if (plotit && any(sellu)){ + #----- Retrieve variable information from the list. ---------------------------------# + compnow = compemean[[cc]] + vname = compnow$vnam + description = compnow$desc + unit = compnow$unit + lcolours = compnow$colour + llwd = compnow$lwd + llwd = compnow$lwd + ltype = compnow$type + plog = compnow$plog + legpos = compnow$legpos + plotit = compnow$plt - #---------------------------------------------------------------------------------# - # Check whether the time series directory exists. If not, create it. # - #---------------------------------------------------------------------------------# - outdir = paste(outpref,"tslu",sep="/") - 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){ - 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 - - - #------------------------------------------------------------------------------# - # 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=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 (n in 1:(nlu+1)){ - if (sellu[n]){ - lines(thismonth,thisvar[,n],type="l",col=lucols[n],lwd=lwidth) - }#end if - }#end for - legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) - - if (outform[o] == "x11"){ - locator(n=1) - dev.off() - }else{ - dev.off() - }#end if - } #end for outform - }#end if (tseragbpft) - } #end for tseries - #---------------------------------------------------------------------------------------# + #----- Check whether there are observations for this particular site. ---------------# + if (iata == "mao" | iata == "bdf"){ + obsnow = "obs.m34" + }else if(iata == "stm"){ + obsnow = "obs.s67" + }else if(iata == "rao"){ + obsnow = "obs.pdg" + }else if(iata == "jpr"){ + obsnow = "obs.fns" + }else if(iata == "btr"){ + obsnow = "obs.s77" + }else{ + obsnow = paste("obs.",iata,sep="") + }#end if + #------------------------------------------------------------------------------------# + # Last check to see if we should plot it or not. # + #------------------------------------------------------------------------------------# + plotit = plotit && obsnow %in% ls() + if (plotit){ + thisobs = get(obsnow) + obswhen = thisobs$tomonth + sel = thismonth >= min(obswhen) & thismonth <= max(obswhen) + plotit = any(sel) + }#end if + #------------------------------------------------------------------------------------# - #---------------------------------------------------------------------------------------# - # Plot disturbance rate by disturbance transition. # - #---------------------------------------------------------------------------------------# - if (tserdist && any(seldist)){ - print (paste(" + Disturbance rate time series for all disturbances...")) - for (o in 1:nout){ - fichier = paste(outpref,"/disturb-",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 + #------------------------------------------------------------------------------------# + # Enter here only if there is any overlap of time between observations and # + # model. # + #------------------------------------------------------------------------------------# + if (plotit){ #---------------------------------------------------------------------------------# - # 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. # + # Copy the observations to a scratch variable. # #---------------------------------------------------------------------------------# - ylimit = NULL - for (jlu in 1:nlu){ - for (ilu in 1:nlu){ - if (seldist[ilu,jlu]) ylimit = range(c(ylimit,dist[,ilu,jlu]),na.rm=TRUE) - }#end for - }#end for - 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])) + mnvar = paste("emean",vname,sep=".") + obsmean = thisobs[[mnvar]] #---------------------------------------------------------------------------------# - 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=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 - n = 0 - for (jlu in 1:nlu){ - for (ilu in 1:nlu){ - n = n + 1 - if (seldist[ilu,jlu]){ - cols = c(cols,distcols[n]) - legs = c(legs,distnames[n]) - lines(thismonth,dist[,ilu,jlu],type="l",col=distcols[n],lwd=lwidth) - }#end if - }#end for - }#end for - legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) - - if (outform[o] == "x11"){ - locator(n=1) - dev.off() - }else{ - dev.off() - }#end if - } #end for outform - }#end if - #---------------------------------------------------------------------------------------# - - - - - #---------------------------------------------------------------------------------------# - # Plot the time series diagrams showing months and years. # - #---------------------------------------------------------------------------------------# - print(paste(" * Plot some time series figures...")) - for (hh in 1:ntser){ - #----- Retrieve variable information from the list. ---------------------------------# - tsernow = tser[[hh]] - vnames = tsernow$vnam - description = tsernow$desc - lcolours = tsernow$colour - llwd = tsernow$lwd - ltype = tsernow$type - plog = tsernow$plog - prefix = tsernow$prefix - theme = tsernow$theme - unit = tsernow$unit - legpos = tsernow$legpos - plotit = tsernow$plt - - if (plotit){ #---------------------------------------------------------------------------------# # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# - outdir = paste(outpref,"tseries",sep="/") + outdir = paste(outpref,"compemean",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" +",theme,"time series for several variables...")) + print (paste(" - ",description,"comparison...")) + #---------------------------------------------------------------------------------# + #----- Define the number of layers. ----------------------------------------------# - nlayers = length(vnames) - #---------------------------------------------------------------------------------# + thiswhen = thismonth [sel] + thismean = get(vname)[sel] + #---------------------------------------------------------------------------------# - #---------------------------------------------------------------------------------# - # 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 (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) + #----- Find the plot range. ------------------------------------------------------# + ylimit = range(c(thismean,obsmean),na.rm=TRUE) + #----- Expand the upper range in so the legend doesn't hide things. --------------# + 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] }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 #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# + # Find the nice scale for time. # + #---------------------------------------------------------------------------------# + whenplote = pretty.time(obswhen,n=8) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # #---------------------------------------------------------------------------------# - print (paste(" > ",theme," time series ...",sep="")) #----- Loop over formats. --------------------------------------------------------# for (o in 1:nout){ - fichier = paste(outdir,"/",prefix,"-",suffix,".",outform[o],sep="") + fichier = paste(outdir,"/",vname,".",outform[o],sep="") if(outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -2077,34 +2337,27 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if #----- Load variable ----------------------------------------------------------# - thisvar = get(vnames[1]) - - 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=xylog,xaxt="n" + letitre = paste(description," - ",lieu,"\n","Monthly mean",sep="") + plot(x=thiswhen,y=thismean,type="n",main=letitre,xlab="Time" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" ,cex.main=cex.main) - 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 + axis(side=1,at=whenplote$levels,labels=whenplote$labels,padj=whenplote$padj) + if (plotgrid){ + abline(v=whenplote$levels,h=axTicks(side=2),col="gray52",lty="solid") }#end if - if (plotgrid){ - 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,cex=0.8) + points(x=thiswhen,y=thismean,col=lcolours[1],lwd=llwd[1],type=ltype + ,pch=16,cex=1.0) + points(x=obswhen,y=obsmean ,col=lcolours[2],lwd=llwd[2],type=ltype + ,pch=16,cex=1.0) + legend(x=legpos,inset=0.01,legend=c("Model","Observation") + ,col=lcolours,lwd=llwd,cex=1.0,pch=16) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -2113,51 +2366,127 @@ for (place in myplaces){ }#end if } #end for outform }#end if plotit - }#end for ntser + }#end for ncompare #---------------------------------------------------------------------------------------# #---------------------------------------------------------------------------------------# - # Plot the climatology of the mean diurnal cycle. # + # Plot the comparison between observations and model. # #---------------------------------------------------------------------------------------# - print(paste(" * Plot some climatology of diurnal cycle...")) - for (hh in 1:nclim){ + print(paste(" + Comparisons of monthly means (model vs. observations)...")) + for (cc in 1:ncompmmean){ #----- Retrieve variable information from the list. ---------------------------------# - climnow = clim[[hh]] - vnames = climnow$vnam - description = climnow$desc - lcolours = climnow$colour - llwd = climnow$lwd - ltype = climnow$type - plog = climnow$plog - prefix = climnow$prefix - theme = climnow$theme - unit = climnow$unit - legpos = climnow$legpos - plotit = climnow$plt - + compnow = compmmean[[cc]] + vname = compnow$vnam + description = compnow$desc + unit = compnow$unit + plotsd = compnow$plotsd + lcolours = compnow$colour + errcolours = compnow$errcol + angle = compnow$angle + dens = compnow$dens + llwd = compnow$lwd + shwd = compnow$shwd + llwd = compnow$lwd + ltype = compnow$type + plog = compnow$plog + legpos = compnow$legpos + plotit = compnow$plt + + #----- Check whether there are observations for this particular site. ---------------# + if (iata == "mao" | iata == "bdf"){ + obsnow = "obs.m34" + }else if(iata == "stm"){ + obsnow = "obs.s67" + }else if(iata == "rao"){ + obsnow = "obs.pdg" + }else if(iata == "jpr"){ + obsnow = "obs.fns" + }else if(iata == "btr"){ + obsnow = "obs.s77" + }else{ + obsnow = paste("obs.",iata,sep="") + }#end if + + plotit = plotit && obsnow %in% ls() + + + + + if (plotit){ + #---------------------------------------------------------------------------------# + # Copy the observations to a scratch variable. # + #---------------------------------------------------------------------------------# + thisobs = get(obsnow) + mnvar = paste("mmean",vname,sep=".") + sdvar = paste("msdev",vname,sep=".") + obsmean = thisobs[[mnvar]] + obssdev = thisobs[[sdvar]] + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Some observations do not have enough measurements to make a full year. If # + # this is the case, then we must split the observations into smaller intervals so # + # the polygon works. In case no observation is available, make the vectors NULL # + # so we will not plot observations at all. # + #---------------------------------------------------------------------------------# + if (all(is.na(obsmean+obssdev))){ + obs.x = NULL + obs.ylow = NULL + obs.yhigh = NULL + }else{ + #------ Find the periods with continous data. ---------------------------------# + ok = is.finite(obsmean+obssdev) + obs.x = montmont[ok] + obs.ylow = obsmean [ok] - obssdev[ok] + obs.yhigh = obsmean [ok] + obssdev[ok] + #------------------------------------------------------------------------------# + }#end if + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# - outdir = paste(outpref,"climdcyc",sep="/") + outdir = paste(outpref,"compmmean",sep="/") if (! file.exists(outdir)) dir.create(outdir) - outtheme = paste(outdir,prefix,sep="/") - if (! file.exists(outtheme)) dir.create(outtheme) - print (paste(" +",description,"diurnal cycle for several variables...")) + print (paste(" - ",description,"comparison...")) + #---------------------------------------------------------------------------------# - #----- Define the number of layers. ----------------------------------------------# - nlayers = length(vnames) - ylimit = NULL - for (l in 1:nlayers){ - thisvar = dcyc12mn[[vnames[l]]] - ylimit = range(c(ylimit,thisvar),na.rm=TRUE) - }#end for + + #---------------------------------------------------------------------------------# + # Define the number of layers. Some variables have no standard deviation in # + # the model, so Make them 0 if this is the case. # + #---------------------------------------------------------------------------------# + thismean = mont12mn[[vname]] + thissdev = mont12sd[[vname]] + if (length(mont12sd[[vname]]) == 0){ + thissdev = 0. * thismean + }else{ + thissdev = mont12sd[[vname]] + }#end if + mod.x = montmont + mod.ylow = thismean - thissdev + mod.yhigh = thismean + thissdev + #---------------------------------------------------------------------------------# + + + + #----- Find the plot range. ------------------------------------------------------# + if (plotsd){ + ylimit = range(c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh),na.rm=TRUE) + }else{ + ylimit = range(c(thismean,obsmean),na.rm=TRUE) + }#end if + #----- Expand the upper range in so the legend doesn't hide things. --------------# if (ylimit[1] == ylimit[2] & ylimit[1] == 0){ ylimit[1] = -1 ylimit[2] = 1 @@ -2171,63 +2500,70 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# - # Loop over all months. # + # Check if the directory exists. If not, create it. # #---------------------------------------------------------------------------------# - for (pmon in 1:12){ - cmon = substring(100+pmon,2,3) - namemon = mlist[pmon] - - #------------------------------------------------------------------------------# - # Check if the directory exists. If not, create it. # - #------------------------------------------------------------------------------# - print (paste(" > ",theme," time series - ",namemon,"...",sep="")) - - #----- Loop over formats. -----------------------------------------------------# - for (o in 1:nout){ - fichier = paste(outtheme,"/",prefix,"-",cmon,"-",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 - - #----- Load variable -------------------------------------------------------# - thisvar = dcyc12mn[[vnames[1]]] - thisvar = cbind(thisvar[,ndcycle],thisvar) - letitre = paste(theme," - ",lieu,"\n" - ,"Mean diurnal cycle - ",namemon,sep="") + #----- Loop over formats. --------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outdir,"/",vname,".",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if - plot(x=thisday,y=thisvar[pmon,],type="n",main=letitre,xlab="Time" - ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" - ,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="gray52",lty="solid") - }#end if - for (l in 1:nlayers){ - thisvar = dcyc12mn[[vnames[l]]] - thisvar = cbind(thisvar[,ndcycle],thisvar) - points(x=thisday,y=thisvar[pmon,],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) - if (outform[o] == "x11"){ - locator(n=1) - dev.off() + #----- Load variable ----------------------------------------------------------# + letitre = paste(description," - ",lieu,"\n","Monthly mean",sep="") + plot(x=montmont,y=thismean,type="n",main=letitre,xlab="Time" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + ,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="gray52",lty="solid") + }#end if + if (plotsd){ + if (is.null(obs.x)){ + err.x = c(mod.x,rev(mod.x)) + err.y = c(mod.ylow,rev(mod.yhigh)) + polygon(x=err.x,y=err.y,col=errcolours[1],angle=angle[1],density=dens[1] + ,lty="solid",lwd=shwd[1]) }else{ - dev.off() + err.x = c(mod.x,rev(mod.x),NA,obs.x,rev(obs.x)) + err.y = c(mod.ylow,rev(mod.yhigh),NA,obs.ylow,rev(obs.yhigh)) + polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens + ,lty="solid",lwd=shwd) }#end if - } #end for outform - }#end for pmon + }#end if + points(x=montmont,y=thismean,col=lcolours[1],lwd=llwd[1],type=ltype + ,pch=16,cex=1.0) + points(x=montmont,y=obsmean ,col=lcolours[2],lwd=llwd[2],type=ltype + ,pch=16,cex=1.0) + if (plotsd){ + legend(x=legpos,inset=0.05,legend=c("Model","Observation") + ,fill=errcolours,angle=angle,density=dens,lwd=llwd,col=lcolours + ,bg="white",title="Shaded areas = 1 SD",cex=1.0,pch=16) + }else{ + legend(x=legpos,inset=0.05,legend=c("Model","Observation") + ,col=lcolours,lwd=llwd,cex=1.0,pch=16) + }#end if + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform }#end if plotit - }#end for ntser + }#end for ncompare #---------------------------------------------------------------------------------------# @@ -2288,6 +2624,20 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Some observations do not have enough measurements to make a full year. If # + # this is the case, then we must split the observations into smaller intervals so # + # the polygon works. In case no observation is available, make the vectors NULL # + # so we will not plot observations at all. # + #---------------------------------------------------------------------------------# + obs.ylow = obsmean - obssdev + obs.yhigh = obsmean + obssdev + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# @@ -2300,33 +2650,28 @@ for (place in myplaces){ - #----- 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. # + # Define the number of layers. Some variables have no standard deviation in # + # the model, so Make them 0 if this is the case. We also append the last hour # + # before the first one so 00 UTC appears in the left. # #---------------------------------------------------------------------------------# - if (length(thissdev) == 0){ + thismean = dcyc12mn[[vname]] + thismean = cbind(thismean[,ndcycle],thismean) + if (length(dcyc12sd[[vname]]) == 0){ thissdev = 0. * thismean + }else{ + thissdev = dcyc12sd[[vname]] + thissdev = cbind(thissdev[,ndcycle],thissdev) }#end if - #---------------------------------------------------------------------------------# - - - #----- Append the last hour before the first one. --------------------------------# - thismean = cbind(thismean[,ndcycle],thismean) - thissdev = cbind(thissdev[,ndcycle],thissdev) + mod.ylow = thismean - thissdev + mod.yhigh = thismean + thissdev #---------------------------------------------------------------------------------# #----- Find the plot range. ------------------------------------------------------# if (plotsd){ - ylimit = range(c(thismean + thissdev ,thismean - thissdev - ,obsmean + obssdev ,obsmean - obssdev ),na.rm=TRUE) + ylimit = range(c(mod.ylow,mod.yhigh,obs.ylow,obs.yhigh),na.rm=TRUE) }else{ ylimit = range(c(thismean,obsmean),na.rm=TRUE) }#end if @@ -2356,7 +2701,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if #----- Load variable -------------------------------------------------------# @@ -2370,14 +2718,34 @@ for (place in myplaces){ 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)) - err.y = c(thismean[pmon,] + thissdev[pmon,] - ,rev(thismean[pmon,]) - rev(thissdev[pmon,]) - ,NA - ,obsmean[pmon,] + obssdev[pmon,] - ,rev(obsmean[pmon,]) - rev(obssdev[pmon,])) - polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens - ,lty="solid",lwd=shwd) + mod.x.now = thisday + mod.ylow.now = mod.ylow [pmon,] + mod.yhigh.now = mod.yhigh[pmon,] + #------ Find the periods with continous data. ---------------------------# + ok = is.finite(obs.ylow[pmon,]) & is.finite(obs.yhigh[pmon,]) + if (any(ok)){ + obs.x.now = thisday [ok] + obs.ylow.now = obs.ylow [pmon,ok] + obs.yhigh.now = obs.yhigh[pmon,ok] + }else{ + obs.x.now = NULL + obs.ylow.now = NULL + obs.yhigh.now = NULL + }#end if + #------------------------------------------------------------------------# + + if (is.null(obs.x.now)){ + err.x = c(mod.x.now,rev(mod.x.now)) + err.y = c(mod.ylow.now,rev(mod.yhigh.now)) + polygon(x=err.x,y=err.y,col=errcolours[1],angle=angle[1] + ,density=dens[1],lty="solid",lwd=shwd[1]) + }else{ + err.x = c(mod.x.now,rev(mod.x.now),NA,obs.x.now,rev(obs.x.now)) + err.y = c(mod.ylow.now,rev(mod.yhigh.now),NA + ,obs.ylow.now,rev(obs.yhigh.now)) + polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens + ,lty="solid",lwd=shwd) + }#end if }#end if points(x=thisday,y=thismean[pmon,],col=lcolours[1] ,lwd=llwd[1],type=ltype,pch=16,cex=1.0) @@ -2407,108 +2775,278 @@ for (place in myplaces){ #---------------------------------------------------------------------------------------# - # Plot the comparison between observations and model. # + # Time series by LU. # #---------------------------------------------------------------------------------------# - print(paste(" + Comparisons of monthly means (model vs. observations)...")) - for (cc in 1:ncompmmean){ - - #----- Retrieve variable information from the list. ---------------------------------# - compnow = compmmean[[cc]] - vname = compnow$vnam - description = compnow$desc - unit = compnow$unit - plotsd = compnow$plotsd - lcolours = compnow$colour - errcolours = compnow$errcol - angle = compnow$angle - dens = compnow$dens - llwd = compnow$lwd - shwd = compnow$shwd - llwd = compnow$lwd - ltype = compnow$type - plog = compnow$plog - legpos = compnow$legpos - plotit = compnow$plt + for (v in 1:ntslu){ + thistslu = tslu[[v]] + vnam = thistslu$vnam + description = thistslu$desc + unit = thistslu$unit + plog = thistslu$plog + plotit = thistslu$plt - #----- Check whether there are observations for this particular site. ---------------# - if (iata == "mao" | iata == "bdf"){ - obsnow = "obs.m34" - }else if(iata == "stm"){ - obsnow = "obs.s67" - }else if(iata == "rao"){ - obsnow = "obs.pdg" - }else if(iata == "jpr"){ - obsnow = "obs.fns" - }else if(iata == "btr"){ - obsnow = "obs.s77" - }else{ - obsnow = paste("obs.",iata,sep="") - }#end if + #----- Check whether the user wants to have this variable plotted. ------------------# + if (plotit && any(sellu)){ - plotit = plotit && obsnow %in% ls() + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"tslu",sep="/") + 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){ + 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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$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. # + #------------------------------------------------------------------------------# + 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=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 (n in 1:(nlu+1)){ + if (sellu[n]){ + lines(thismonth,thisvar[,n],type="l",col=lucols[n],lwd=lwidth) + }#end if + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end if (tseragbpft) + } #end for tseries + #---------------------------------------------------------------------------------------# + + + + + + #---------------------------------------------------------------------------------------# + # Plot disturbance rate by disturbance transition. # + #---------------------------------------------------------------------------------------# + if (tserdist && any(seldist)){ + print (paste(" + Disturbance rate time series for all disturbances...")) + for (o in 1:nout){ + fichier = paste(outpref,"/disturb-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if - if (plotit){ #---------------------------------------------------------------------------------# - # Copy the observations to a scratch variable. # + # 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. # #---------------------------------------------------------------------------------# - thisobs = get(obsnow) - mnvar = paste("mmean",vname,sep=".") - sdvar = paste("msdev",vname,sep=".") - obsmean = thisobs[[mnvar]] - obssdev = thisobs[[sdvar]] + ylimit = NULL + for (jlu in 1:nlu){ + for (ilu in 1:nlu){ + if (seldist[ilu,jlu]) ylimit = range(c(ylimit,dist[,ilu,jlu]),na.rm=TRUE) + }#end for + }#end for + 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])) #---------------------------------------------------------------------------------# + 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=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 + n = 0 + for (jlu in 1:nlu){ + for (ilu in 1:nlu){ + n = n + 1 + if (seldist[ilu,jlu]){ + cols = c(cols,distcols[n]) + legs = c(legs,distnames[n]) + lines(thismonth,dist[,ilu,jlu],type="l",col=distcols[n],lwd=lwidth) + }#end if + }#end for + }#end for + legend(x=legwhere,inset=inset,bg=legbg,legend=legs,col=cols,lwd=lwidth) + + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end if + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Plot the time series diagrams showing months and years. # + #---------------------------------------------------------------------------------------# + print(paste(" * Plot some time series figures...")) + for (hh in 1:ntser){ + #----- Retrieve variable information from the list. ---------------------------------# + tsernow = tser[[hh]] + vnames = tsernow$vnam + description = tsernow$desc + lcolours = tsernow$colour + llwd = tsernow$lwd + ltype = tsernow$type + plog = tsernow$plog + prefix = tsernow$prefix + theme = tsernow$theme + unit = tsernow$unit + legpos = tsernow$legpos + plotit = tsernow$plt + + if (plotit){ #---------------------------------------------------------------------------------# # Check whether the time series directory exists. If not, create it. # #---------------------------------------------------------------------------------# - outdir = paste(outpref,"compmmean",sep="/") + outdir = paste(outpref,"tseries",sep="/") if (! file.exists(outdir)) dir.create(outdir) - print (paste(" - ",description,"comparison...")) - #---------------------------------------------------------------------------------# - + print (paste(" +",theme,"time series for several variables...")) #----- 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 - #---------------------------------------------------------------------------------# + nlayers = length(vnames) + #---------------------------------------------------------------------------------# - #----- Find the plot range. ------------------------------------------------------# - if (plotsd){ - ylimit = range(c(thismean + thissdev ,thismean - thissdev - ,obsmean + obssdev ,obsmean - obssdev ),na.rm=TRUE) - }else{ - ylimit = range(c(thismean,obsmean),na.rm=TRUE) - }#end if - #----- Expand the upper range in so the legend doesn't hide things. --------------# - 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] + #---------------------------------------------------------------------------------# + # 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 (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 #---------------------------------------------------------------------------------# @@ -2517,10 +3055,11 @@ for (place in myplaces){ #---------------------------------------------------------------------------------# # Check if the directory exists. If not, create it. # #---------------------------------------------------------------------------------# + print (paste(" > ",theme," time series ...",sep="")) #----- Loop over formats. --------------------------------------------------------# for (o in 1:nout){ - fichier = paste(outdir,"/",vname,".",outform[o],sep="") + fichier = paste(outdir,"/",prefix,"-",suffix,".",outform[o],sep="") if(outform[o] == "x11"){ X11(width=size$width,height=size$height,pointsize=ptsz) }else if(outform[o] == "png"){ @@ -2528,37 +3067,37 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if #----- Load variable ----------------------------------------------------------# - letitre = paste(description," - ",lieu,"\n","Monthly mean",sep="") - plot(x=montmont,y=thismean,type="n",main=letitre,xlab="Time" - ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + thisvar = get(vnames[1]) + + 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=xylog,xaxt="n" ,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="gray52",lty="solid") - }#end if - if (plotsd){ - err.x = c(montmont,rev(montmont),NA,montmont,rev(montmont)) - err.y = c(thismean + thissdev,rev(thismean) - rev(thissdev),NA - ,obsmean + obssdev ,rev(obsmean ) - rev(obssdev ) ) - polygon(x=err.x,y=err.y,col=errcolours,angle=angle,density=dens - ,lty="solid",lwd=shwd) + 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 - points(x=montmont,y=thismean,col=lcolours[1],lwd=llwd[1],type=ltype - ,pch=16,cex=1.0) - points(x=montmont,y=obsmean ,col=lcolours[2],lwd=llwd[2],type=ltype - ,pch=16,cex=1.0) - if (plotsd){ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") - ,fill=errcolours,angle=angle,density=dens,lwd=llwd,col=lcolours - ,bg="white",title="Shaded areas = 1 SD",cex=1.0,pch=16) - }else{ - legend(x=legpos,inset=0.05,legend=c("Model","Observation") - ,col=lcolours,lwd=llwd,cex=1.0,pch=16) + if (plotgrid){ + 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,cex=0.8) if (outform[o] == "x11"){ locator(n=1) dev.off() @@ -2567,7 +3106,124 @@ for (place in myplaces){ }#end if } #end for outform }#end if plotit - }#end for ncompare + }#end for ntser + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# + # Plot the climatology of the mean diurnal cycle. # + #---------------------------------------------------------------------------------------# + print(paste(" * Plot some climatology of diurnal cycle...")) + for (hh in 1:nclim){ + + #----- Retrieve variable information from the list. ---------------------------------# + climnow = clim[[hh]] + vnames = climnow$vnam + description = climnow$desc + lcolours = climnow$colour + llwd = climnow$lwd + ltype = climnow$type + plog = climnow$plog + prefix = climnow$prefix + theme = climnow$theme + unit = climnow$unit + legpos = climnow$legpos + plotit = climnow$plt + + if (plotit){ + + #---------------------------------------------------------------------------------# + # Check whether the time series directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + outdir = paste(outpref,"climdcyc",sep="/") + if (! file.exists(outdir)) dir.create(outdir) + outtheme = paste(outdir,prefix,sep="/") + if (! file.exists(outtheme)) dir.create(outtheme) + print (paste(" +",description,"diurnal cycle for several variables...")) + + + #----- Define the number of layers. ----------------------------------------------# + nlayers = length(vnames) + ylimit = NULL + for (l in 1:nlayers){ + thisvar = dcyc12mn[[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] + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Loop over all months. # + #---------------------------------------------------------------------------------# + for (pmon in 1:12){ + cmon = substring(100+pmon,2,3) + namemon = mlist[pmon] + + #------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #------------------------------------------------------------------------------# + print (paste(" > ",theme," time series - ",namemon,"...",sep="")) + + #----- Loop over formats. -----------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outtheme,"/",prefix,"-",cmon,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + #----- Load variable -------------------------------------------------------# + thisvar = dcyc12mn[[vnames[1]]] + thisvar = cbind(thisvar[,ndcycle],thisvar) + + letitre = paste(theme," - ",lieu,"\n" + ,"Mean diurnal cycle - ",namemon,sep="") + + plot(x=thisday,y=thisvar[pmon,],type="n",main=letitre,xlab="Time" + ,ylim=ylimit,ylab=paste("[",unit,"]",sep=""),log=plog,xaxt="n" + ,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="gray52",lty="solid") + }#end if + for (l in 1:nlayers){ + thisvar = dcyc12mn[[vnames[l]]] + thisvar = cbind(thisvar[,ndcycle],thisvar) + points(x=thisday,y=thisvar[pmon,],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) + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + } #end for outform + }#end for pmon + }#end if plotit + }#end for ntser #---------------------------------------------------------------------------------------# @@ -2648,7 +3304,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(description," - ",lieu,sep="") @@ -2756,7 +3415,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(description," - ",lieu,sep="") @@ -2877,7 +3539,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(description," - ",lieu,sep="") @@ -2971,7 +3636,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste("Mean diurnal cycle \n ",description," - ",lieu,sep="") @@ -3035,7 +3703,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if ylimit = range(thisvar, na.rm=TRUE) if (ylimit[1] == ylimit[2] && ylimit[1] == 0){ @@ -3063,6 +3734,162 @@ for (place in myplaces){ + + #---------------------------------------------------------------------------------------# + # Bar plot by DBH class. # + #---------------------------------------------------------------------------------------# + print(paste(" + Bar plot by DBH classes...")) + monbplot = which(nummonths(thismonth) %in% sasmonth) + nmonbplot = length(monbplot) + pftuse = which(apply(X=nplantpftdbh,MARGIN=3,FUN=sum,na.rm=TRUE) > 0.) + npftuse = length(pftuse) + pftname.use = pft$name [pftuse] + pftcol.use = pft$colour[pftuse] + for (v in 1:nbarplotdbh){ + #----- Load settings for this variable.----------------------------------------------# + thisbar = barplotdbh[[v]] + vnam = thisbar$vnam + description = thisbar$desc + unit = thisbar$unit + stacked = thisbar$stack + plotit = thisbar$plt + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Check whether to plot this + #------------------------------------------------------------------------------------# + if (plotit){ + print (paste(" - ",description,"...")) + + + #---------------------------------------------------------------------------------# + # Retrieve the variable, and keep only the part that is usable. # + #---------------------------------------------------------------------------------# + thisvnam = get(vnam)[monbplot,,] + thisvnam = thisvnam [,,pftuse] + thisvnam = thisvnam [,-(ndbh+1),] + + thisvnam[is.na(thisvnam)] = 0. + thiswhen = thismonth[monbplot] + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Find the limits for the plots. We use the same axis so it is easier to # + # compare different times. # + #---------------------------------------------------------------------------------# + if (stacked){ + ylimit = c(0,max(apply(X=thisvnam,MARGIN=c(1,2),FUN=sum,na.rm=TRUE))) + }else{ + ylimit = range(x=thisvnam,na.rm=TRUE) + }#end if + #----- Expand the upper range in so the legend doesn't hide things. --------------# + 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] + }else{ + ylimit[2] = ylimit[2] + scalleg * (ylimit[2] - ylimit[1]) + }#end if + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Check if the directory exists. If not, create it. # + #---------------------------------------------------------------------------------# + barplotdir = paste(outpref,"barplotdbh",sep="/") + if (! file.exists(barplotdir)) dir.create(barplotdir) + outdir = paste(barplotdir,vnam,sep="/") + if (! file.exists(outdir)) dir.create(outdir) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Loop over all possible months. # + #---------------------------------------------------------------------------------# + for (m in 1:nmonbplot){ + + #----- Find which year we are plotting. ---------------------------------------# + cmonth = sprintf("%2.2i",(nummonths(thiswhen[m]))) + cyear = sprintf("%4.4i",(numyears(thiswhen[m]))) + mm = as.numeric(cmonth) + yy = as.numeric(cyear) + whentitle = paste(mon2mmm(mm,cap1=TRUE),cyear,sep="-") + #------------------------------------------------------------------------------# + + + #----- Loop over output formats. ----------------------------------------------# + for (o in 1:nout){ + #------ Open the plot. -----------------------------------------------------# + fichier = paste(outdir,"/",vnam,"-",cyear,"-",cmonth,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + #---------------------------------------------------------------------------# + + + #------ Set up the title and axis labels. ----------------------------------# + letitre = paste(lieu,"\n",description," - Time : ",whentitle,sep="") + lexlab = "DBH Classes" + leylab = paste(description," [",unit,"]",sep="") + #---------------------------------------------------------------------------# + + + #----- Plot all monthly means together. ------------------------------------# + barplot(height=t(thisvnam[m,,]),names.arg=dbhnames[1:ndbh],width=1.0 + ,main=letitre,xlab=lexlab,ylab=leylab,ylim=ylimit,legend.text=FALSE + ,beside=(! stacked),col=pftcol.use + ,border="gray23",xpd=FALSE,cex.main=cex.main) + if (plotgrid & (! stacked)){ + xgrid=0.5+(1:ndbh)*(1+npftuse) + abline(v=xgrid,col="gray46",lty="solid") + }#end if + box() + legend(x="topleft",inset=0.01,legend=pftname.use,fill=pftcol.use + ,ncol=1,title="PFT",cex=1.0,bg="white") + #---------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------# + # Close the device. # + #---------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + } #end for outform + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + + #---------------------------------------------------------------------------------------# # Plot the 3-D size and age structure of light level. # #---------------------------------------------------------------------------------------# @@ -3182,7 +4009,11 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) }#end if stcol = pft$colour[pftww] diff --git a/ED/Template/Template/plot_photo.r b/ED/Template/Template/plot_photo.r index 66c8e14a0..478605d6c 100644 --- a/ED/Template/Template/plot_photo.r +++ b/ED/Template/Template/plot_photo.r @@ -15,10 +15,11 @@ whenz = c("thismonthz/thisdatez/thisyearz","thishourz:thisminuz:00") ptype = "l" # Type of plot ptyped = "p" # Type of plot -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing cex.main = 0.8 # Scale coefficient for the title @@ -590,7 +591,11 @@ for (place in myplaces){ ,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) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) }#end if letitre = paste(theme," - ",thispoi$lieu, diff --git a/ED/Template/Template/plot_rk4.r b/ED/Template/Template/plot_rk4.r index d0c0d0999..691e1947d 100644 --- a/ED/Template/Template/plot_rk4.r +++ b/ED/Template/Template/plot_rk4.r @@ -13,10 +13,11 @@ ptype = "l" # Type of plot ptyped = "p" # Type of plot ptypeb = "o" # Type of plot -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing cex.main = 0.8 # Scale coefficient for the title @@ -700,7 +701,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(theme," - ",thispoi$lieu,"(Patch ",ipa,")", diff --git a/ED/Template/Template/plot_rk4pc.r b/ED/Template/Template/plot_rk4pc.r index 396a52207..e6c826bb5 100644 --- a/ED/Template/Template/plot_rk4pc.r +++ b/ED/Template/Template/plot_rk4pc.r @@ -13,10 +13,11 @@ ptype = "l" # Type of plot ptyped = "p" # Type of plot ptypeb = "o" # Type of plot -outform = "png" # Formats for output file. Supported formats are: +outform = thisoutform # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing byeold = TRUE # Remove old files of the given format? @@ -875,7 +876,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(theme," - ",thispoi$lieu,"(Patch ",ipa,")", @@ -1104,7 +1108,11 @@ for (place in myplaces){ ,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) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz + ,paper=size$paper) }#end if letitre = paste(theme," - ",thispoi$lieu, diff --git a/ED/Template/Template/plot_yearly.r b/ED/Template/Template/plot_yearly.r new file mode 100644 index 000000000..a51d53788 --- /dev/null +++ b/ED/Template/Template/plot_yearly.r @@ -0,0 +1,820 @@ +#----- Here is the user-defined variable section. -----------------------------------------# +here = "thispath" # Current directory. +there = "thatpath" # Directory where analyses/history are +srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. +outroot = "thisoutroot" +monthbeg = thismontha +yearbeg = thisyeara # First year to consider +yearend = thisyearz # Maximum year to consider +season.mona = thisseasonmona +myplaces = c("thispoly") +outform = thisoutform # Formats for output file. Supported formats are: + # - "X11" - for printing on screen + # - "eps" - for postscript printing + # - "png" - for PNG printing + # - "pdf" - for PDF printing + +byeold = TRUE # Remove old files of the given format? + +depth = 96 # PNG resolution, in pixels per inch +paper = "letter" # Paper size, to define the plot shape +ptsz = 14 # Font size. +lwidth = 2.5 # Line width +plotgrid = TRUE # Should I plot the grid in the background? + +sasfixlimits = FALSE # Should I use a fixed scale for size and age-structure + # plots? (FALSE will set a suitable scale for each year) + +ncolsfc = 200 # Target number of colours for filled contour plots. +fcgrid = TRUE # Should I include a grid on the filled contour plots? + +ncolshov = 200 # Target number of colours for Hovmoller diagrams. +hovgrid = TRUE # Should I include a grid on the Hovmoller plots? + +legwhere = "topleft" # Where should I place the legend? +inset = 0.01 # inset distance between legend and edge of plot region. +legbg = "white" # Legend background colour. +scalleg = 0.20 +cex.main = 0.8 # Scale coefficient for the title + +theta = 315. # Azimuth for perspective projection +phi = 30. # Vertical angle for perspective projection +ltheta = -210. # Azimuth angle for light +shade = 0.125 # Shade intensity +expz = 0.5 # Expansion factor for Z axis +gcol = c("lightblue","white") # Colours for the 50's style floor +cexmin = 0.5 # Minimum "head" size of the lollipop +cexmax = 3.0 # Maximum "head" size of the lollipop + +fracexp = 0.40 # Nudging factor for ylimit +ptype = "l" # Type of plot +ptyped = "p" # Type of plot +ptypeb = "o" # Type of plot + + + +#----- Loading some packages. -------------------------------------------------------------# +library(hdf5) +library(chron) +library(scatterplot3d) +library(lattice) +library(maps) +library(mapdata) +library(akima) +library(Hmisc) + +#----- In case there is some graphic still opened. ----------------------------------------# +graphics.off() + +#----- Set how many formats we must output. -----------------------------------------------# +outform = tolower(outform) +nout = length(outform) + +#----- Avoid unecessary and extremely annoying beeps. -------------------------------------# +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,"colourmap.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,"thermlib.r" ,sep="/")) +source(paste(srcdir,"timeutils.r" ,sep="/")) +#----- These should be called after the others. --------------------------------------------# +source(paste(srcdir,"pft.coms.r" ,sep="/")) +source(paste(srcdir,"pyearly_varlist.r" ,sep="/")) + + +#----- Load observations. -----------------------------------------------------------------# +obsrfile = paste(srcdir,"LBA_MIP.v7.RData",sep="/") +load(file=obsrfile) + +#----- Define plot window size ------------------------------------------------------------# +size = plotsize(proje=FALSE,paper=paper) +#------------------------------------------------------------------------------------------# + + + +#---- Create the main output directory in case there is none. -----------------------------# +if (! file.exists(outroot)) dir.create(outroot) +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Big place loop starts here... # +#------------------------------------------------------------------------------------------# +for (place in myplaces){ + + #----- Retrieve default information about this place and set up some variables. --------# + thispoi = locations(where=place,here=there,yearbeg=yearbeg,yearend=yearend + ,monthbeg=monthbeg) + inpref = thispoi$pathin + outmain = paste(outroot,place,sep="/") + outpref = paste(outmain,"yearly",sep="/") + lieu = thispoi$lieu + iata = thispoi$iata + suffix = thispoi$iata + yeara = thispoi$yeara + yearz = thispoi$yearz + meszz = thispoi$monz + + + + #----- Create the directories in case they don't exist. --------------------------------# + if (! file.exists(outmain)) dir.create(outmain) + if (! file.exists(outpref)) dir.create(outpref) + + #----- Print a banner to entretain the user. -------------------------------------------# + print(paste(" + Post-processing output from ",lieu,"...",sep="")) + + + #---------------------------------------------------------------------------------------# + # Flush all variables that will hold the data. # + #---------------------------------------------------------------------------------------# + totmon = (yearz-yeara-1)*12+meszz+(12-monthbeg+1) + #----- Polygon level vectors. ----------------------------------------------------------# + fast.soil.c = rep(NA,times=totmon) + slow.soil.c = rep(NA,times=totmon) + struct.soil.c = rep(NA,times=totmon) + nep = rep(NA,times=totmon) + nee = rep(NA,times=totmon) + gpp = rep(NA,times=totmon) + npp = rep(NA,times=totmon) + plresp = rep(NA,times=totmon) + leaf.resp = rep(NA,times=totmon) + root.resp = rep(NA,times=totmon) + growth.resp = rep(NA,times=totmon) + hetresp = rep(NA,times=totmon) + reco = rep(NA,times=totmon) + mco = rep(NA,times=totmon) + npp = rep(NA,times=totmon) + cba = rep(NA,times=totmon) + ldrop = rep(NA,times=totmon) + cflxca = rep(NA,times=totmon) + cflxst = rep(NA,times=totmon) + evap = rep(NA,times=totmon) + transp = rep(NA,times=totmon) + ustar = rep(NA,times=totmon) + atm.vels = rep(NA,times=totmon) + atm.prss = rep(NA,times=totmon) + atm.temp = rep(NA,times=totmon) + can.prss = rep(NA,times=totmon) + can.temp = rep(NA,times=totmon) + atm.co2 = rep(NA,times=totmon) + can.co2 = rep(NA,times=totmon) + leaf.temp = rep(NA,times=totmon) + wood.temp = rep(NA,times=totmon) + atm.shv = rep(NA,times=totmon) + can.shv = rep(NA,times=totmon) + can.co2 = rep(NA,times=totmon) + hflxca = rep(NA,times=totmon) + qwflxca = rep(NA,times=totmon) + wflxca = rep(NA,times=totmon) + agb = rep(NA,times=totmon) + basarea = rep(NA,times=totmon) + nplant = rep(NA,times=totmon) + lai = rep(NA,times=totmon) + wai = rep(NA,times=totmon) + tai = rep(NA,times=totmon) + rain = rep(NA,times=totmon) + gnd.temp = rep(NA,times=totmon) + gnd.shv = rep(NA,times=totmon) + fs.open = rep(NA,times=totmon) + hflxgc = rep(NA,times=totmon) + hflxlc = rep(NA,times=totmon) + hflxwc = rep(NA,times=totmon) + wflxgc = rep(NA,times=totmon) + wflxlc = rep(NA,times=totmon) + wflxwc = rep(NA,times=totmon) + rshort = rep(NA,times=totmon) + rshort.beam = rep(NA,times=totmon) + rshort.diff = rep(NA,times=totmon) + rlong = rep(NA,times=totmon) + rshort.gnd = rep(NA,times=totmon) + rlong.gnd = rep(NA,times=totmon) + rlongup = rep(NA,times=totmon) + rlong.albedo = rep(NA,times=totmon) + demand = rep(NA,times=totmon) + + n = 0 + tomonth = rep(NA,times=totmon) + + now.month = monthbeg - 1 + 12 * as.integer(monthbeg == 1) + now.year = yeara - as.integer(monthbeg == 1) + + #----- Loop over years. ----------------------------------------------------------------# + for (m in 1:totmon){ + now.month = (now.month %% 12) + 1 + now.year = now.year + as.integer(now.month == 1) + + #----- Build the file name. ---------------------------------------------------------# + cmonth = sprintf("%2.2i",now.month) + cyear = sprintf("%4.4i",now.year ) + ddd = daymax(now.month,now.year) + myfile = paste(inpref,"-Q-",cyear,"-",cmonth,"-00-000000-g01.h5",sep="") + print (paste(" - Reading data from file ",basename(myfile),"...",sep="")) + #------------------------------------------------------------------------------------# + + + + #----- Read data and close connection immediately after. ----------------------------# + mymont = hdf5load(file=myfile,load=FALSE,verbosity=0,tidy=TRUE) + #------------------------------------------------------------------------------------# + + + #----- Build the time. --------------------------------------------------------------# + tomonth [m] = as.numeric(chron(dates=paste(now.month,1,now.year,sep="/") + ,times="0:0:0") ) + #------------------------------------------------------------------------------------# + + + + #----- Load the simple variables. ---------------------------------------------------# + gpp [m] = mymont$MMEAN.GPP + plresp [m] = mymont$MMEAN.PLRESP + leaf.resp [m] = mymont$MMEAN.LEAF.RESP + root.resp [m] = mymont$MMEAN.ROOT.RESP + growth.resp [m] = mymont$MMEAN.GROWTH.RESP + hetresp [m] = mymont$MMEAN.RH + reco [m] = plresp[m] + hetresp[m] + nep [m] = mymont$MMEAN.NEP + nee [m] = ( - mymont$MMEAN.CARBON.AC + mymont$MMEAN.CARBON.ST ) * yr.sec + cflxca [m] = - mymont$MMEAN.CARBON.AC + cflxst [m] = mymont$MMEAN.CARBON.ST + hflxca [m] = - mymont$MMEAN.SENSIBLE.AC + hflxlc [m] = mymont$MMEAN.SENSIBLE.LC + hflxwc [m] = mymont$MMEAN.SENSIBLE.WC + hflxgc [m] = mymont$MMEAN.SENSIBLE.GC + qwflxca [m] = - mymont$MMEAN.VAPOR.AC * alvli(mymont$MMEAN.CAN.TEMP) + wflxca [m] = - mymont$MMEAN.VAPOR.AC * day.sec + wflxlc [m] = mymont$MMEAN.VAPOR.LC * day.sec + wflxwc [m] = mymont$MMEAN.VAPOR.WC * day.sec + wflxgc [m] = mymont$MMEAN.VAPOR.GC * day.sec + evap [m] = mymont$MMEAN.EVAP * day.sec + transp [m] = mymont$MMEAN.TRANSP * day.sec + ustar [m] = mymont$MMEAN.USTAR + atm.vels [m] = mymont$MMEAN.ATM.VELS + atm.prss [m] = mymont$MMEAN.ATM.PRSS * 0.01 + atm.temp [m] = mymont$MMEAN.ATM.TEMP - t00 + atm.shv [m] = mymont$MMEAN.ATM.SHV * kg2g + atm.co2 [m] = mymont$MMEAN.ATM.CO2 + can.prss [m] = mymont$MMEAN.CAN.PRSS * 0.01 + can.temp [m] = mymont$MMEAN.CAN.TEMP - t00 + can.shv [m] = mymont$MMEAN.CAN.SHV * kg2g + can.co2 [m] = mymont$MMEAN.CAN.CO2 + gnd.temp [m] = mymont$MMEAN.GND.TEMP - t00 + gnd.shv [m] = mymont$MMEAN.GND.SHV * kg2g + leaf.temp [m] = mymont$MMEAN.LEAF.TEMP -t00 + wood.temp [m] = mymont$MMEAN.WOOD.TEMP -t00 + rain [m] = mymont$MMEAN.PCPG*ddd * day.sec + fs.open [m] = mymont$MMEAN.FS.OPEN + rshort [m] = mymont$MMEAN.RSHORT + rshort.beam [m] = mymont$MMEAN.RSHORT - mymont$MMEAN.RSHORT.DIFF + rshort.diff [m] = mymont$MMEAN.RSHORT.DIFF + rlong [m] = mymont$MMEAN.RLONG + rshort.gnd [m] = mymont$MMEAN.RSHORT.GND + rlong.gnd [m] = mymont$MMEAN.RLONG.GND + rlongup [m] = mymont$MMEAN.RLONGUP + rlong.albedo [m] = mymont$MMEAN.RLONG.ALBEDO + #------------------------------------------------------------------------------------# + + + #---- Read in the site-level area. --------------------------------------------------# + areasi = mymont$AREA.SI + npatches = mymont$SIPA.N + #------------------------------------------------------------------------------------# + + + #----- Read a few patch-level variables. --------------------------------------------# + areapa = mymont$AREA * rep(areasi,times=npatches) + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # Get the soil carbon. # + #------------------------------------------------------------------------------------# + fast.soil.c [m] = sum(mymont$FAST.SOIL.C * areapa) + slow.soil.c [m] = sum(mymont$SLOW.SOIL.C * areapa) + struct.soil.c [m] = sum(mymont$STRUCTURAL.SOIL.C * areapa) + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Read the cohort-level variables. Because empty patchs do exist (deserts), # + # we must check whether there is any cohort to be read. If not, assign NA to # + # all variables. # + #------------------------------------------------------------------------------------# + ncohorts = mymont$PACO.N + if (any (ncohorts > 0)){ + areaconow = rep(areapa,times=ncohorts) + nplantconow = mymont$NPLANT + baconow = mymont$BA.CO + agbconow = mymont$AGB.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 + cbaconow = mymont$MMEAN.CB + mcostconow = ( mymont$MMEAN.LEAF.MAINTENANCE + + mymont$MMEAN.ROOT.MAINTENANCE ) + ldropconow = mymont$MMEAN.LEAF.DROP.CO + demandconow = mymont$MMEAN.PSI.OPEN * day.sec + + #---------------------------------------------------------------------------------# + }else{ + #----- Make everything NA. -------------------------------------------------------# + areaconow = NA + nplantconow = NA + baconow = NA + agbconow = NA + laiconow = NA + waiconow = NA + taiconow = NA + gppconow = NA + leafrespconow = NA + rootrespconow = NA + growthrespconow = NA + respconow = NA + nppconow = NA + cbaconow = NA + mcostconow = NA + ldropconow = NA + demandconow = NA + }#end if + #------------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------------# + # The following two variables are used to scale "intensive" properties # + # (whatever/plant) to "extensive" (whatever/m2). Sometimes they may be used to # + # build weighted averages. # + #------------------------------------------------------------------------------------# + w.nplant = nplantconow * areaconow + w.lai = laiconow * areaconow + w.wai = laiconow * areaconow + w.tai = laiconow * areaconow + #------------------------------------------------------------------------------------# + + + + + #------------------------------------------------------------------------------------# + # Build the derived variables. # + #------------------------------------------------------------------------------------# + npp [m] = sum( w.nplant * nppconow ) + mco [m] = sum( w.nplant * mcostconow ) + cba [m] = sum( w.nplant * cbaconow ) + nplant [m] = sum( w.nplant ) + lai [m] = sum( w.lai ) + wai [m] = sum( w.wai ) + tai [m] = sum( w.tai ) + agb [m] = sum( w.nplant * agbconow ) + basarea [m] = sum( w.nplant * baconow ) + demand [m] = sum( w.lai * demandconow) + #------------------------------------------------------------------------------------# + }#end for, year + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # Convert tomonth back to chron. # + #---------------------------------------------------------------------------------------# + print (paste(" - Finding times...",sep="")) + tomonth = chron(tomonth) + #---------------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------------# + # Create a list with unique years. # + #---------------------------------------------------------------------------------------# + print (paste(" - Finding the years and seasons...",sep="")) + year.all = unique(numyears(tomonth)) + if (season.mona == 1){ + nyears = length(year.all) + 1 + year4 = c(year.all,2*year.all[nyears-1] - year.all[nyears-2]) + }else{ + nyears = length(year.all) + year4 = year.all + }#end if + year.desc = paste(year4-c(diff(year4)[1],diff(year4)),year4,sep="-") + year.col = eft.col[match(year4,eft.year)] + #----- Year for seasonal means. --------------------------------------------------------# + yr3mon = year.all + nyr3mon = length(yr3mon) + yr3mon.desc = paste("Dec",sprintf("%2.2i" + ,(yr3mon-c(diff(yr3mon)[1],diff(yr3mon))) %% 100 ) + ,"-Nov",sprintf("%2.2i",yr3mon %% 100),sep="") + yr3mon.col = eft.col[match(yr3mon,eft.year)] + yr3mon.pch = eft.pch[match(yr3mon,eft.year)] + #---------------------------------------------------------------------------------------# + + + dwhena = as.numeric(chron(paste(season.mona,1,year4[2],sep="/"))) + dwhenz = as.numeric(chron(paste(season.mona,1,year4[3],sep="/"))) + sel = tomonth >= dwhena & tomonth <= dwhenz + month.when = tomonth[sel] + + for (tt in 1:ntvar){ + thisvar = tvar[[tt]] + vname = thisvar$vnam + desc = thisvar$desc + if (vname == "rain"){ + unit = "mm/month" + }else{ + unit = thisvar$unit + }#end if + add0 = thisvar$add + mult0 = thisvar$mult + colmean = thisvar$colmean + colerr = thisvar$colerr + coledge = thisvar$coledge + plotit = thisvar$plt + cumul = thisvar$cumul + if (cumul){ + plttype = "l" + }else{ + plttype = "o" + }#end if + + + + + if (plotit){ + print(paste(" * ",desc,"...")) + + + #----- Create the directories. ---------------------------------------------------# + outtser = paste(outpref,"tseries",sep="/") + outbplot = paste(outpref,"bplot" ,sep="/") + if (! file.exists(outtser )) dir.create(outtser ) + if (! file.exists(outbplot)) dir.create(outbplot) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Create the list of data. # + #---------------------------------------------------------------------------------# + outplot = list() + ylimit = NULL + for (y in 2:nyears){ + whena.now = chron(paste(season.mona,1,year4[y-1],sep="/")) + whenz.now = chron(paste(season.mona,1,year4[y] ,sep="/")) + sel = tomonth >= whena.now & tomonth <= whenz.now + nsel = sum(sel) + outplot[[y]] = list() + outplot[[y]]$x = month.when + if (cumul){ + datum = get(vname)[sel] + datum[is.na(datum)] = 0 + outplot[[y]]$y = cumsum(datum) + }else{ + outplot[[y]]$y = get(vname)[sel] + }#end if + + #----- Update range. ----------------------------------------------------------# + if (any(is.finite(outplot[[y]]$y)) ){ + y.min = min(outplot[[y]]$y,na.rm=TRUE) + y.max = max(outplot[[y]]$y,na.rm=TRUE) + ylimit = range(c(ylimit,y.min,y.max)) + }#end if + #------------------------------------------------------------------------------# + }#end for + #----- Make a dummy limit in case everything is empty. ---------------------------# + if (is.null(ylimit)){ + ylimit = c(-1,1) + }else{ + ylimit[2] = ylimit[2] + fracexp * (ylimit[2] - ylimit[1]) + }#end if + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Make the time axis. # + #---------------------------------------------------------------------------------# + whenplot = pretty.time(chron(c(dwhena,dwhenz)),n=8) + whenplot$labels = substring(mlist[nummonths(whenplot$levels)],1,3) + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Plot the data. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outtser,"/ycomp-",vname,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + letitre = paste(lieu," \n",desc,sep="") + lex = "Months" + ley = paste(desc," [",unit,"]") + + + plot(x=outplot[[2]]$x,y=outplot[[2]]$y,type="n",main=letitre,xlab=lex,ylab=ley + ,ylim=ylimit,cex.main=cex.main,xaxt="n") + axis(side=1,at=whenplot$levels,labels=whenplot$labels,padj=whenplot$padj) + if (plotgrid){ + abline(v=whenplot$levels,h=axTicks(side=2),col="gray62",lty="solid") + }#end if + for (y in 2:nyears){ + lines(x=outplot[[y]]$x,y=outplot[[y]]$y,type=plttype,pch=16,cex=1.0 + ,lwd=2.5,col=year.col[y]) + }#end for + legend(x="topleft",inset=0.01,legend=year.desc[2:nyears] + ,lwd=2.5,col=year.col[2:nyears],title="Period",cex=0.9,ncol=3) + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------# + # Split the data into seasonal means. # + #---------------------------------------------------------------------------------# + print(paste(" * Seasonal bar plot: ",desc,"...")) + this.season = season(tomonth,add.year=TRUE) + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Make the last December become part of the first year. # + #---------------------------------------------------------------------------------# + sel = this.season == paste(max(yr3mon)+1,"01",sep="") + this.season[sel] = paste(min(yr3mon),"01",sep="") + yr.season = as.numeric(substring(this.season,1,4)) + #---------------------------------------------------------------------------------# + + #---------------------------------------------------------------------------------# + # Find the seasonality matrix. # + #---------------------------------------------------------------------------------# + this.var = get(vname) + if (cumul){ + season.vec = tapply(X=this.var,INDEX=this.season,FUN=sum) + }else{ + season.vec = tapply(X=this.var,INDEX=this.season,FUN=mean) + }#end if + season.mat = matrix( data = season.vec + , ncol = 4 + , nrow = nyr3mon + , dimnames = list(yr3mon.desc,season.list) + , byrow = TRUE + )#end matrix + if (vname == "rain"){ + ylimit = c(0,1.25 * max(season.vec,na.rm=TRUE)) + }else{ + yl.try = range(season.vec,na.rm=TRUE) + if (any(! is.finite(yl.try)) || ( yl.try[1] == yl.try[2] && yl.try[1] == 0)){ + ylimit = c(-1,1) + leg.pos = "topright" + }else if (yl.try[1] == yl.try[2]){ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.30 * abs(yl.try[1]) + ylimit[2] = yl.try[2] + 0.30 * abs(yl.try[2]) + leg.pos = "topright" + }else if(yl.try[2] > 0){ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.05 * (yl.try[2] - yl.try[1]) + ylimit[2] = yl.try[2] + 0.40 * (yl.try[2] - yl.try[1]) + leg.pos = "topright" + }else{ + ylimit = yl.try + ylimit[1] = yl.try[1] - 0.40 * (yl.try[2] - yl.try[1]) + ylimit[2] = yl.try[2] + 0.05 * (yl.try[2] - yl.try[1]) + leg.pos = "bottomright" + }#end if + }#end if + #---------------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------------# + # Plot the bar plot. # + #---------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outbplot,"/bp_season_",vname,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + letitre = paste(lieu," \n Year comparison: ",desc,sep="") + lex = "Season" + ley = paste(desc," [",unit,"]") + + + barplot(season.mat,col=yr3mon.col,main=letitre,xlab=lex,ylab=ley + ,cex.main=cex.main,ylim=ylimit,legend.text=FALSE,beside=TRUE + ,border="gray23",xpd=FALSE) + box() + legend(x=leg.pos,inset=0.01,legend=yr3mon.desc,fill=yr3mon.col + ,title="Period",cex=0.9,ncol=2) + + + #----- Close the device. ------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end if + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# + + + + #---------------------------------------------------------------------------------------# + # Plot the monthly mean variables as functions of other 2 environment variables. # + #---------------------------------------------------------------------------------------# + print(paste(" + Plotting parameter space: ",lieu,"...",sep="")) + for (xyz in 1:nxyzvar){ + this.xyz = xyzvar[[xyz]] + zvname = this.xyz$zvname + zdesc = this.xyz$zdesc + zkey = this.xyz$zkey + zunit = this.xyz$zunit + xvname = this.xyz$xvname + xdesc = this.xyz$xdesc + xunit = this.xyz$xunit + xleg = this.xyz$xleg + yvname = this.xyz$yvname + ydesc = this.xyz$ydesc + yunit = this.xyz$yunit + yleg = this.xyz$yleg + + #----- Create the directories. -------------------------------------------------------# + outxyzp = paste(outpref,"xyzplot",sep="/") + outzvar = paste(outxyzp,zvname ,sep="/") + if (! file.exists(outxyzp )) dir.create(outxyzp ) + if (! file.exists(outzvar )) dir.create(outzvar ) + #-------------------------------------------------------------------------------------# + + + #----- Number of x and y axes. ------------------------------------------------------# + nxvars = length(xvname) + nyvars = length(yvname) + #------------------------------------------------------------------------------------# + + #------------------------------------------------------------------------------------# + # Loop over all x and y axes. # + #------------------------------------------------------------------------------------# + print(paste(" * Z: ",zdesc,"...")) + for (y in 1:nyvars){ + for (x in 1:nxvars){ + print(paste(" ~ X: ",xdesc[x]," Y: ",ydesc[y],"...")) + + #----- Title. -----------------------------------------------------------------# + letitre = paste(lieu,zdesc,sep="\n") + #----- Attribute symbols according to the year. -------------------------------# + this.pch = eft.pch[match(yr.season,eft.year)] + #----- Expand the edges of the x axis. ----------------------------------------# + xvar = get(xvname[x]) + lex = paste(xdesc[x]," [",xunit[x],"]",sep="") + xrange = range(xvar,na.rm=TRUE) + xlimit = xrange + xlimit[1] = xrange[1] - 0.05 * (xrange[2] - xrange[1]) + xlimit[2] = xrange[2] + 0.05 * (xrange[2] - xrange[1]) + #----- Expand the edges of the y axis. ----------------------------------------# + yvar = get(yvname[y]) + ley = paste(ydesc[y]," [",yunit[y],"]",sep="") + yrange = range(yvar,na.rm=TRUE) + ylimit = yrange + ylimit[1] = yrange[1] - 0.05 * (yrange[2] - yrange[1]) + ylimit[2] = yrange[2] + 0.40 * (yrange[2] - yrange[1]) + #----- Annotation for the colour map ("Z" axis). ------------------------------# + zvar = get(zvname) + lez = paste(zkey,"\n [",zunit,"]",sep="") + #----- Find the position to plot the legend. ----------------------------------# + leg.pos = paste(yleg[y],xleg[x],sep="") + + + + #------------------------------------------------------------------------------# + # Make lists for colourmap. # + #------------------------------------------------------------------------------# + ptitle = list() + ptitle[[1]] = list(main=letitre,xlab=lex,ylab=ley,cex.main=cex.main) + paxes = list() + paxes[[1]] = list( x.axis = list(side=1) + , y.axis = list(side=2) + , grid = list(col="gray62",lty="solid") + , legend = list( x = leg.pos + , inset = 0.01 + , legend = yr3mon.desc + , col = "black" + , bg = "white" + , pch = yr3mon.pch + , title = "Period" + , ncol = 2 + , pt.cex = 1./0.9 + , cex = 0.9 + )#end legend + )#end list + #------------------------------------------------------------------------------# + + + #------------------------------------------------------------------------------# + # Plot the bar plot. # + #------------------------------------------------------------------------------# + for (o in 1:nout){ + fichier = paste(outzvar,"/cmap_x_",xvname[x],"_y_",yvname[y] + ,"_z_",zvname,"-",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=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) + }#end if + + + + #----- Plot the parameter space. -------------------------------------------# + colourmap(x=xvar,y=yvar,z=zvar,xlim=xlimit,ylim=ylimit + ,colour.palette=muitas,cex=1.6,pch=this.pch,lwd=2 + ,plot.title=ptitle + ,key.title=title(main=lez,cex.main=0.8) + ,plot.axes=paxes + )#end colourmap + #---------------------------------------------------------------------------# + + + #---------------------------------------------------------------------------# + # Close the device. # + #---------------------------------------------------------------------------# + if (outform[o] == "x11"){ + locator(n=1) + dev.off() + }else{ + dev.off() + }#end if + #---------------------------------------------------------------------------# + }#end for outform + #------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------# + }#end for + #------------------------------------------------------------------------------------# + }#end for + #---------------------------------------------------------------------------------------# +}#end for places +#------------------------------------------------------------------------------------------# + +#q("no") diff --git a/ED/Template/Template/reject_ed.r b/ED/Template/Template/reject_ed.r index 1465d9674..369bf0c95 100644 --- a/ED/Template/Template/reject_ed.r +++ b/ED/Template/Template/reject_ed.r @@ -3,10 +3,11 @@ here = "thispath" # Current directory. srcdir = "/n/moorcroft_data/mlongo/util/Rsc" # Source directory. outroot = "thisoutroot" myplaces = c("thispoly") -outform = "png" # Formats for output file. Supported formats are: +outform = "thisoutform" # Formats for output file. Supported formats are: # - "X11" - for printing on screen # - "eps" - for postscript printing # - "png" - for PNG printing + # - "pdf" - for PDF printing ntopoffe = 6 # Number of top "offenders" that go to the plot. coloffe = c("firebrick","goldenrod","chartreuse" @@ -411,7 +412,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if ylimit = range(thisvar, na.rm=TRUE) @@ -524,7 +528,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste(description," - ",lieu,sep="") @@ -617,7 +624,10 @@ for (place in myplaces){ ,pointsize=ptsz,res=depth) }else if(outform[o] == "eps"){ postscript(file=fichier,width=size$width,height=size$height - ,pointsize=ptsz,paper=paper) + ,pointsize=ptsz,paper=size$paper) + }else if(outform[o] == "pdf"){ + pdf(file=fichier,onefile=FALSE + ,width=size$width,height=size$height,pointsize=ptsz,paper=size$paper) }#end if letitre = paste("Mean annual cycle - ",lieu,sep="") diff --git a/ED/Template/Template/srun.sh b/ED/Template/Template/srun.sh index 1bd60f3e6..289d0b02f 100755 --- a/ED/Template/Template/srun.sh +++ b/ED/Template/Template/srun.sh @@ -10,34 +10,6 @@ thisnum=myorder #------------------------------------------------------------------------------------------# -#------------------------------------------------------------------------------------------# -# 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 diff --git a/ED/Template/Template/whichrun.r b/ED/Template/Template/whichrun.r index 3ba1f9511..697d43fd8 100644 --- a/ED/Template/Template/whichrun.r +++ b/ED/Template/Template/whichrun.r @@ -1,4 +1,4 @@ -#----- This should be called before anything else, don't define stuff before this line. ---# +#----- This should be called before anything else, don't define stuff before this line. ------# rm(list=ls()) #----- workdir is the user-defined variable section. -----------------------------------------# diff --git a/ED/Template/bringlast.sh b/ED/Template/bringlast.sh index 944a82fcf..14136e0e0 100755 --- a/ED/Template/bringlast.sh +++ b/ED/Template/bringlast.sh @@ -60,71 +60,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/check_run.sh b/ED/Template/check_run.sh index 364586485..f992c3691 100755 --- a/ED/Template/check_run.sh +++ b/ED/Template/check_run.sh @@ -10,6 +10,7 @@ echo ${ncol} here=`pwd` lonlat=${here}'/joborder.txt' +desc=`basename ${here}` #----- Determine the number of polygons to run. -------------------------------------------# let npolys=`wc -l ${lonlat} | awk '{print $1 }'`-3 @@ -63,90 +64,157 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------------# + # Set some variables to check whether the simulation is running. # + #---------------------------------------------------------------------------------------# + jobname="${desc}-${polyname}" + stdout="${here}/${polyname}/serial_out.out" + stderr="${here}/${polyname}/serial_out.err" + lsfout="${here}/${polyname}/serial_lsf.out" + stopped= + #---------------------------------------------------------------------------------------# - if [ -s ${here}/${polyname}/serial_out.out ] + #---------------------------------------------------------------------------------------# + # Check whether the simulation is still running, and if not, why it isn't. # + #---------------------------------------------------------------------------------------# + if [ -s ${stdout} ] then - fatal=`grep "FATAL ERROR" ${here}/${polyname}/serial_out.out | wc -l` - simulating=`grep "Simulating: " ${here}/${polyname}/serial_out.out | tail -1` - if [ ${fatal} -gt 0 ] + #----- Check whether the simulation is running, and when in model time it is. -------# + running=`bjobs -J ${jobname} 2> /dev/null | grep RUN | wc -l` + simline=`grep "Simulating: " ${stdout} | tail -1` + runtime=`echo ${simline} | awk '{print $3}'` + #------------------------------------------------------------------------------------# + + + + #----- Check for segmentation violations. -------------------------------------------# + if [ -s ${stderr} ] + then + segv1=`grep -i "sigsegv" ${stderr} | wc -l` + segv2=`grep -i "segmentation fault" ${stderr} | wc -l` + let sigsegv=${segv1}+${segv2} + else + sigsegv=0 + fi + #------------------------------------------------------------------------------------# + + + + #----- Check whether met files are missing... (bad start) ---------------------------# + metbs1=`grep "Cannot open met driver input file" ${stdout} | wc -l` + metbs2=`grep "Specify ED_MET_DRIVER_DB properly" ${stdout} | wc -l` + let metmiss=${metbs1}+${metbs2} + #------------------------------------------------------------------------------------# + + + + #----- Check for other possible outcomes. -------------------------------------------# + stopped=`grep "FATAL ERROR" ${stdout} | wc -l` + crashed=`grep "IFLAG1 problem." ${stdout} | wc -l` + the_end=`grep "ED execution ends" ${stdout} | wc -l` + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Plot a message so the user knows what is going on. # + #------------------------------------------------------------------------------------# + if [ ${running} -gt 0 ] && [ ${sigsegv} -eq 0 ] + then + echo -e ${opt} "${off} :-) ${polyname} is running (${runtime})..." + elif [ ${sigsegv} -gt 0 ] + then + echo -e ${opt} "${off}>:-# ${polyname} HAD SEGMENTATION VIOLATION... <===========" + elif [ ${crashed} -gt 0 ] + then + echo -e ${opt} "${off} :-( ${polyname} HAS CRASHED (RK4 PROBLEM)... <===========" + elif [ ${metmiss} -gt 0 ] then - echo -e ${opt} ${off}':-( '${polyname}' HAS CRASHED ... <======================' - elif [ -s ${here}/${polyname}/serial_lsf.out ] + echo -e ${opt} "${off} :-/ ${polyname} DID NOT FIND MET DRIVERS... <===========" + elif [ ${stopped} -gt 0 ] + then + echo -e ${opt} "${off} :-S ${polyname} STOPPED (UNKNOWN REASON)... <===========" + elif [ ${the_end} -gt 0 ] then - echo -e ${opt} ${off}':-D '${polyname}' has finished ...' + echo -e ${opt} "${off}o/\o ${polyname} has finished..." else - echo -e ${opt} ${off}':-) '${polyname}' is running. '${simulating}'...' + echo -e ${opt} "${off}<:-| ${polyname} status is unknown..." fi else - echo -e ${opt} ${off}':-| '${polyname}' is pending ...' + echo -e ${opt} ${off}' :-| '${polyname}' is pending ...' fi done diff --git a/ED/Template/clean_scratch.sh b/ED/Template/clean_scratch.sh index ee6606874..774088f76 100755 --- a/ED/Template/clean_scratch.sh +++ b/ED/Template/clean_scratch.sh @@ -57,6 +57,13 @@ unrestricted_parallel) unrestricted_serial) nodes="soph57 soph58 soph59 soph60 soph61 soph62 soph63 soph64" ;; +long_serial) + nodes="soph03 soph04 soph05 soph13 soph14 soph16 soph17 soph18 soph19 soph24 + soph25 soph26 soph27 soph28 soph29 soph30 soph31 soph32 soph33 soph34 + soph35 soph36 soph37 soph38 soph39 soph40 soph41 soph42 soph43 soph44 + soph45 soph46 soph47 soph48 soph49 soph50 soph51 soph52 soph53 soph54 + soph55 soph56" + ;; *) echo ' I cannot recognise queue '${queue}'...' exit 39 diff --git a/ED/Template/delall.sh b/ED/Template/delall.sh index 10571b1a0..59e1635b9 100755 --- a/ED/Template/delall.sh +++ b/ED/Template/delall.sh @@ -120,71 +120,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/epost.sh b/ED/Template/epost.sh index fe96a4e26..374330498 100755 --- a/ED/Template/epost.sh +++ b/ED/Template/epost.sh @@ -1,10 +1,27 @@ #!/bin/bash +. ${HOME}/.bashrc here=`pwd` # ! Main path -diskthere='/n/moorcroftfs2' # ! Disk where the output files are -thisqueue='moorcroft' # ! Queue where jobs should be submitted +diskthere='/n/moorcroftfs2' # ! Disk where the output files are +thisqueue='moorcroft2b' # ! Queue where jobs should be submitted lonlat=${here}'/joborder.txt' # ! File with the job instructions #----- Outroot is the main output directory. ----------------------------------------------# -outroot='/n/moorcroftfs1/mlongo/diary/XXXXXXXXXXXXX/figures/Template' +outroot='/n/moorcroftfs2/mlongo/diary/XXXXXXXXXXX/figures/xxx_XXX/xxxxxxxx' +submit='y' # y = Submit the script; n = Copy the script +#----- Plot only one meteorological cycle. ------------------------------------------------# +onemetcycle='n' # Plot only one met cycle only (ignored by plot_eval_ed.r/plot_census.r) +shiftiata='' # Places that we must shift the cycle +shiftcycle=-5 # In case your met driver doesn't match the model simulation +#----- Check whether to use openlava or typical job submission. ---------------------------# +openlava='n' +#----- Yearly comparison . ----------------------------------------------------------------# +seasonmona=1 +#----- Census comparison. -----------------------------------------------------------------# +varcycle='TRUE' # Find the average mortality for various cycles (TRUE/FALSE). +#----- Output format. ---------------------------------------------------------------------# +outform='c("eps","png","pdf")' # x11 - On screen (deprecated on shell scripts) + # png - Portable Network Graphics + # eps - Encapsulated Post Script + # pdf - Portable Document Format #------------------------------------------------------------------------------------------# #------------------------------------------------------------------------------------------# @@ -21,6 +38,51 @@ monthsdrought="c(12,1,2,3)" # List of months that get drought, if it starts late #------------------------------------------------------------------------------------------# +#------------------------------------------------------------------------------------------# +# If this is an openlava run, load the openlava stuff. # +#------------------------------------------------------------------------------------------# +if [ 'x'${openlava} == 'xy' ] || [ 'x'${openlava} == 'xY' ] +then + . /opt/openlava-2.0/etc/openlava-client.sh +fi +#------------------------------------------------------------------------------------------# + + + +#------------------------------------------------------------------------------------------# +# Make sure that the directory there exists, if not, create all parent directories # +# needed. # +#------------------------------------------------------------------------------------------# +while [ ! -s ${outroot} ] +do + namecheck=`basename ${outroot}` + dircheck=`dirname ${outroot}` + while [ ! -s ${dircheck} ] && [ ${namecheck} != '/' ] + do + namecheck=`basename ${dircheck}` + dircheck=`dirname ${dircheck}` + done + + if [ ${namecheck} == '/' ] + then + echo 'Invalid disk for variable outroot:' + echo ' DISK ='${diskhere} + exit 58 + elif [ ${namecheck} == 'xxxxxxxx' ] || [ ${namecheck} == 'xxx_XXX' ] || + [ ${namecheck} == 'XXXXXXXXXXX' ] + then + echo " - Found this directory in your path: ${namecheck} ..." + echo " - Outroot given: ${outroot} ..." + echo " - It looks like you forgot to set up your outroot path, check it!" + exit 92 + else + echo 'Making directory: '${dircheck}/${namecheck} + mkdir ${dircheck}/${namecheck} + fi +done +#------------------------------------------------------------------------------------------# + + #----- Find the disk here to create the "there" path. -------------------------------------# moi=`whoami` namehere=`basename ${here}` @@ -48,6 +110,7 @@ echo 'Number of polygons: '${npolys}'...' #------------------------------------------------------------------------------------------# # List all the R scripts you want to run. # +# - plot_yearly.r - This creates yearly comparisons based on the monthly mean output. # # - plot_monthly.r - This creates several plots based on the monthly mean output. # # - plot_rk4.r - This creates plots from the detailed output for Runge-Kutta. # # (patch-level only). # @@ -56,6 +119,8 @@ echo 'Number of polygons: '${npolys}'...' # (patch- and cohort-level). # # - plot_budget.r - This creates plots from the detailed budget for Runge-Kutta. # # (patch-level only). # +# - plot_eval_ed.r - This creates plots comparing model with eddy flux observations. # +# - plot_census.r - This creates plots comparing model with biometric data. # # # # The following scripts should work too, but I haven't tested them. # # - plot_daily.r - This creates plots from the daily mean output. # @@ -64,7 +129,7 @@ echo 'Number of polygons: '${npolys}'...' # - reject_ed.r - This tracks the number of steps that were rejected, and what caused # # the step to be rejected. # #------------------------------------------------------------------------------------------# -rscripts="plot_monthly.r" +rscripts="plot_census.r" # plot_monthly.r plot_yearly.r" #rscripts="patchprops.r plot_photo.r" #rscripts="patchprops.r" @@ -100,85 +165,94 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# - #----- Find time and minute. -----------------------------------------------------------# houra=`echo ${timea} | awk '{print substr($1,1,2)}'` minua=`echo ${timea} | awk '{print substr($1,3,2)}'` 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}'` - + metcyca=`grep -i NL%METCYC1 ${here}/${polyname}/ED2IN | awk '{print $3}'` + metcycz=`grep -i NL%METCYCF ${here}/${polyname}/ED2IN | awk '{print $3}'` + #---------------------------------------------------------------------------------------# + if [ ${droughtmark} == "TRUE" ] then let yeara=${droughtyeara}-1 @@ -187,78 +261,214 @@ do for script in ${rscripts} do - echo "Submitting script ${script} for polygon: ${polyname}..." + if [ 'x'${submit} == 'xy' ] || [ 'x'${submit} == 'xY' ] + then + echo "Submitting script ${script} for polygon: ${polyname}..." + else + echo "Copying script ${script} to polygon: ${polyname}..." + fi case ${script} in + plot_yearly.r) + if [ ${metdriver} != 'Sheffield' ] + then + thisyeara=${metcyca} + thisyearz=${metcycz} + for i in ${shiftiata} + do + if [ 'x'${i} == 'x'${polyiata} ] + then + echo ' -> Shifting met cycle' + let metcycle=${metcycz}-${metcyca}+1 + let deltayr=${shiftcycle}*${metcycle} + let thisyeara=${metcyca}+${deltayr} + let thisyearz=${metcycz}+${deltayr} + fi # end [ ${i} == ${iata} ] + done #end for i in ${shiftiata} + else + thisyeara=${metcyca} + thisyearz=${metcycz} + fi # end [ ${metdriver} != 'Sheffield' ] + thismontha=${montha} + thismonthz=${monthz} + thisdatea=${datea} + epostout='pyrs_epost.out' + epostsh='pyrs_epost.sh' + epostlsf='pyrs_epost.lsf' + epostjob='eb-pyrs-'${polyname} + ;; plot_monthly.r) - let thisyeara=${yeara}+0 + if [ ${onemetcycle} == 'y' ] + then + if [ ${metdriver} != 'Sheffield' ] + then + thisyeara=${metcyca} + thisyearz=${metcycz} + for i in ${shiftiata} + do + if [ 'x'${i} == 'x'${polyiata} ] + then + echo ' -> Shifting met cycle' + let metcycle=${metcycz}-${metcyca}+1 + let deltayr=${shiftcycle}*${metcycle} + let thisyeara=${metcyca}+${deltayr} + let thisyearz=${metcycz}+${deltayr} + fi # end [ ${i} == ${iata} ] + done #end for i in ${shiftiata} + else + thisyeara=${metcyca} + thisyearz=${metcycz} + fi # end [ ${metdriver} != 'Sheffield' ] + else + let thisyeara=${yeara}+0 + thisyearz=${yearz} + fi # end [ ${onemetcycle} == 'y' ] + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='pmon_epost.out' + epostsh='pmon_epost.sh' epostlsf='pmon_epost.lsf' - epostjob='eb-pmon-'${polyiata} + epostjob='eb-pmon-'${polyname} + ;; + plot_eval_ed.r) + if [ ${metdriver} != 'Sheffield' ] + then + thisyeara=${metcyca} + thisyearz=${metcycz} + for i in ${shiftiata} + do + if [ 'x'${i} == 'x'${polyiata} ] + then + echo ' -> Shifting met cycle' + let metcycle=${metcycz}-${metcyca}+1 + let deltayr=${shiftcycle}*${metcycle} + let thisyeara=${metcyca}+${deltayr} + let thisyearz=${metcycz}+${deltayr} + fi # end [ ${i} == ${iata} ] + done #end for i in ${shiftiata} + else + thisyeara=${metcyca} + thisyearz=${metcycz} + fi # end [ ${metdriver} != 'Sheffield' ] + thismontha=1 + thismonthz=12 + thisdatea=${datea} + epostout='peed_epost.out' + epostsh='peed_epost.sh' + epostlsf='peed_epost.lsf' + epostjob='eb-peed-'${polyname} + ;; + plot_census.r) + thismontha=${montha} + thismontha=${monthz} + let thisyeara=${yeara}+15 + thisyearz=${yearz} + + thisdatea=${datea} + epostout='pcen_epost.out' + epostsh='pcen_epost.sh' + epostlsf='pcen_epost.lsf' + epostjob='eb-pcen-'${polyname} ;; plot_budget.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} let thisdatea=${datea}+1 epostout='pbdg_epost.out' + epostsh='pbdg_epost.sh' epostlsf='pbdg_epost.lsf' - epostjob='eb-pbdg-'${polyiata} + epostjob='eb-pbdg-'${polyname} ;; plot_rk4.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} let thisdatea=${datea}+1 epostout='prk4_epost.out' + epostsh='prk4_epost.sh' epostlsf='prk4_epost.lsf' - epostjob='eb-prk4-'${polyiata} + epostjob='eb-prk4-'${polyname} ;; plot_rk4pc.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} let thisdatea=${datea}+1 epostout='prpc_epost.out' + epostsh='prpc_epost.sh' epostlsf='prpc_epost.lsf' - epostjob='eb-prpc-'${polyiata} + epostjob='eb-prpc-'${polyname} ;; plot_photo.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} let thisdatea=${datea}+1 epostout='ppht_epost.out' + epostsh='ppht_epost.sh' epostlsf='ppht_epost.lsf' - epostjob='eb-ppht-'${polyiata} + epostjob='eb-ppht-'${polyname} ;; patchprops.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='ppro_epost.out' + epostsh='ppro_epost.sh' epostlsf='ppro_epost.lsf' - epostjob='eb-ppro-'${polyiata} + epostjob='eb-ppro-'${polyname} ;; plot_daily.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='pday_epost.out' + epostsh='pday_epost.sh' epostlsf='pday_epost.lsf' - epostjob='eb-pday-'${polyiata} + epostjob='eb-pday-'${polyname} ;; plot_fast.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='pfst_epost.out' + epostsh='pfst_epost.sh' epostlsf='pfst_epost.lsf' - epostjob='eb-pfst-'${polyiata} + epostjob='eb-pfst-'${polyname} ;; reject_ed.r) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='prej_epost.out' + epostsh='prej_epost.sh' epostlsf='prej_epost.lsf' - epostjob='eb-prej-'${polyiata} + epostjob='eb-prej-'${polyname} ;; *) thisyeara=${yeara} + thisyearz=${yearz} + thismontha=${montha} + thismonthz=${monthz} thisdatea=${datea} epostout='pidn_epost.out' + epostsh='pidn_epost.sh' epostlsf='pidn_epost.lsf' - epostjob='eb-pidn-'${polyiata} + epostjob='eb-pidn-'${polyname} ;; esac @@ -272,25 +482,74 @@ do 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@thismontha@${thismontha}@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@thisyearz@${thisyearz}@g ${here}/${polyname}/${script} + sed -i s@thismonthz@${thismonthz}@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@thisseasonmona@${seasonmona}@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} + sed -i s@myvarcycle@${varcycle}@g ${here}/${polyname}/${script} + sed -i s@thisoutform@${outform}@g ${here}/${polyname}/${script} + sed -i s@mymetcyca@${metcyca}@g ${here}/${polyname}/${script} + sed -i s@mymetcycz@${metcycz}@g ${here}/${polyname}/${script} #----- Run R to get the plots. ------------------------------------------------------# - comm="R CMD BATCH ${here}/${polyname}/${script} ${here}/${polyname}/${epostout}" - bsub -q ${thisqueue} -J ${epostjob} -o ${polyname}/${epostlsf} "${comm}" 1> /dev/null 2> /dev/null + rbin="R CMD BATCH --no-save --no-restore" + comm="${rbin} ${here}/${polyname}/${script} ${here}/${polyname}/${epostout}" + + #------------------------------------------------------------------------------------# + # plot_eval_ed won't run all at once due to the sheer number of HDF5 files. # + # Run it several times until it is complete. # + #------------------------------------------------------------------------------------# + case ${script} in + plot_eval_ed.r) + complete="${here}/${polyname}/eval_load_complete.txt" + echo '#!/bin/bash' > ${here}/${polyname}/${epostsh} + echo "/bin/rm -fr ${complete}" >> ${here}/${polyname}/${epostsh} + echo "while [ ! -s ${complete} ]" >> ${here}/${polyname}/${epostsh} + echo "do" >> ${here}/${polyname}/${epostsh} + echo " sleep 3" >> ${here}/${polyname}/${epostsh} + echo " ${comm}" >> ${here}/${polyname}/${epostsh} + echo "done" >> ${here}/${polyname}/${epostsh} + chmod +x ${here}/${polyname}/${epostsh} + ;; + *) + echo '#!/bin/bash' > ${here}/${polyname}/${epostsh} + echo ${comm} >> ${here}/${polyname}/${epostsh} + chmod +x ${here}/${polyname}/${epostsh} + ;; + esac + #------------------------------------------------------------------------------------# + + + + #------------------------------------------------------------------------------------# + # Submit the job according to the style (LSF or openlava). # + #------------------------------------------------------------------------------------# + if [ 'x'${submit} == 'xy' ] || [ 'x'${submit} == 'xY' ] + then + if [ 'x'${openlava} == 'xy' ] || [ 'x'${openlava} == 'xY' ] + then + bsub="iobsub -J ${epostjob} -o ${here}/${polyname}/${epostlsf}" + bsub="${bsub} ${here}/${polyname}/${epostsh} 1> /dev/null 2> /dev/null" + else + bsub="bsub -q ${thisqueue} -J ${epostjob} -o ${polyname}/${epostlsf}" + bsub="${bsub} ${here}/${polyname}/${epostsh} 1> /dev/null 2> /dev/null" + fi + ${bsub} + fi + #------------------------------------------------------------------------------------# done + #---------------------------------------------------------------------------------------# done #------------------------------------------------------------------------------------------# diff --git a/ED/Template/joborder.txt b/ED/Template/joborder.txt index c339d1c35..1dd8ff514 100644 --- a/ED/Template/joborder.txt +++ b/ED/Template/joborder.txt @@ -1,108 +1,107 @@ ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -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 IFIRE FIRE_PARM IPERCOL ISOILBC RUNOFF_TIME 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 IBIGLEAF IREPRO ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- -harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 2 2 -1.000 -1.000 E 2 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 2 5 0.447 0.191 D 2 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 2 11 0.200 0.680 H 2 0 moorcroft_6100b Manaus_KM34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 2 16 0.380 0.440 D 2 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santarem_km66 s66 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 H 2 0 moorcroft_6100b Santarem_KM66 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 H 2 0 moorcroft_6100b Santarem_KM67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 2 16 0.390 0.590 H 2 0 moorcroft_6100b Santarem_KM83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 D 2 0 moorcroft_6100b Reserva_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 2 2 0.850 0.030 F 2 0 moorcroft_6100b Reserva_Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 2 6 0.562 0.345 E 2 0 moorcroft_6100b Guyaflux 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 2 9 0.240 0.370 C 2 0 moorcroft_6100b Bananal_Island 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 2 9 0.380 0.310 A 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 2 2 0.748 0.006 B 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 2 1 0.937 0.026 D 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 2 11 0.400 0.430 B 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 G 2 0 moorcroft_6100b Fazenda_NS 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 2 11 0.180 0.800 H 2 0 moorcroft_6100b Santarem_KM77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 2 3 0.760 0.160 D 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 2 17 0.200 0.420 D 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 2 1 0.950 0.010 C 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 2 6 0.570 0.290 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 H 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 2 2 0.840 0.120 E 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 2 4 0.259 0.255 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -petrolina pnz -40.510 -9.390 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 -xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 600. 450. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.10 -1.40 2 1.0 0 1 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 2 2 0 2 +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +POLYGON_NAME IATA LONGITUDE LATITUDE YEARA MONTHA DAYA TIMEA YEARZ MONTHZ DAYZ TIMEZ ISOIL NTEXT SAND CLAY DEPTH ISOILBC SLDRAIN 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 DECOMP_SCHEME RRFFACT GROWTHRESP LWIDTH_GRASS LWIDTH_BLTREE LWIDTH_NLTREE Q10_C3 Q10_C4 H2O_LIMIT IMORT_SCHEME DDMORT_CONST ISFCLYRM ICANTURB UBMIN UGBMIN USTMIN GAMM GAMH TPRANDTL RIBMAX ATMCO2 THCRIT SM_FIRE IFIRE FIRE_PARM IPERCOL RUNOFF_TIME 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 IBIGLEAF IREPRO TREEFALL +---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +harvard hvd -72.170 42.540 1199 05 01 0000 1700 01 01 0000 2 2 -1.000 -1.000 E 1 90 2 0 moorcroft_6100b Harvard 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tonzi tzi -120.894 38.427 1199 05 01 0000 1700 01 01 0000 2 5 0.447 0.191 D 1 90 2 0 moorcroft_6100b Tonzi 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +manaus_km34 m34 -60.209 -2.609 1200 01 01 0000 1700 01 01 0000 2 11 0.200 0.680 H 1 90 2 0 moorcroft_6100b Manaus_Km34 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +caxiuana cax -51.458 -1.720 1200 01 01 0000 1700 01 01 0000 2 16 0.380 0.440 D 2 6 2 0 moorcroft_6100b Caxiuana 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +santarem_km67 s67 -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km67 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +santarem_km83 s83 -54.971 -3.018 1200 01 01 0000 1700 01 01 0000 2 16 0.390 0.590 H 1 90 2 0 moorcroft_6100b Santarem_Km83 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +rebio_jaru rja -61.931 -10.083 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 C 2 6 2 0 moorcroft_6100b Rebio_Jaru 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +pedegigante pdg -47.650 -21.619 1200 01 01 0000 1700 01 01 0000 2 2 0.850 0.030 F 1 90 2 0 moorcroft_6100b Pe-de-Gigante 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +paracou gyf -52.912 5.282 1200 01 01 0000 1700 01 01 0000 2 6 0.562 0.345 C 2 6 2 0 moorcroft_6100b Paracou 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +bananal ban -50.159 -9.824 1200 01 01 0000 1700 01 01 0000 2 9 0.240 0.370 C 1 90 2 0 moorcroft_6100b Bananal 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +petrolina pnz -40.370 -9.165 1200 01 01 0000 1700 01 01 0000 2 2 0.821 0.052 C 2 15 2 0 moorcroft_6100b Petrolina 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +fazendans fns -62.357 -10.762 1200 01 01 0000 1700 01 01 0000 2 2 0.800 0.100 G 1 90 2 0 moorcroft_6100b Fazenda_Nossa_Senhora 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +santarem_km77 s77 -54.537 -3.012 1200 01 01 0000 1700 01 01 0000 2 17 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Santarem_Km77 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +la_lorena lor -69.991 -3.056 1200 01 01 0000 1700 01 01 0000 2 9 0.380 0.310 A 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +el_zafire zar -69.902 -4.007 1200 01 01 0000 1700 01 01 0000 2 2 0.748 0.006 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +allpahuayo alp -73.437 -3.953 1200 01 01 0000 1700 01 01 0000 2 1 0.937 0.026 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tambopata tam -69.271 -12.830 1200 01 01 0000 1700 01 01 0000 2 11 0.400 0.430 B 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +kenia qea -62.730 -16.010 1200 01 01 0000 1700 01 01 0000 2 3 0.760 0.160 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +barro_colorado bci -79.850 9.160 1200 01 01 0000 1700 01 01 0000 2 17 0.200 0.420 D 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +cardoso czi -48.010 -25.096 1200 01 01 0000 1700 01 01 0000 2 1 0.950 0.010 C 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +la_selva lzv -84.010 10.430 1200 01 01 0000 1700 01 01 0000 2 6 0.570 0.290 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +la_planada lpn -77.994 1.116 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 H 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sinop ops -55.325 -11.412 1200 01 01 0000 1700 01 01 0000 2 2 0.840 0.120 E 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +yasuni ysn -76.396 -0.686 1200 01 01 0000 1700 01 01 0000 2 4 0.259 0.255 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +alta_floresta afl -56.100 -9.867 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +angra_dos_reis aei -44.300 -22.970 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +araguaiana ayx -51.810 -15.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +araracuara arc -72.398 -0.601 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +asuncion asu -57.560 -25.300 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +belo_horizonte cnf -43.950 -19.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +belem bel -48.480 -1.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +blumenau bnu -49.060 -26.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +boa_vista bvb -60.610 2.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +bogota bog -74.100 4.650 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +brasilia bsb -47.910 -15.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +cabo_frio cfb -42.070 -22.490 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +cajazeiras cjz -38.570 -6.900 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +calabozo clz -67.420 8.920 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +canarana qnr -52.250 -13.560 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +carajas cks -50.722 -5.786 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +chaiten wch -72.500 -42.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +ciudad_guayana cgu -62.762 8.289 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +cochabamba cbb -66.170 -17.420 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +cuiaba cgb -56.100 -15.600 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +curitiba cwb -49.230 -25.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +diamantino dmt -56.620 -14.370 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +dourados dou -54.810 -22.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +el_triunfo etf -67.000 -13.500 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +erechim erm -52.240 -27.610 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +eunapolis enp -39.580 -16.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +fortaleza for -38.530 -3.780 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +iguape igp -47.590 -24.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +imperatriz imp -47.460 -5.530 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +iquique iqq -69.970 -20.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +itabaiana ibn -37.420 -10.680 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +itapeva ipv -48.880 -23.980 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +jacareacanga jcr -57.777 -6.233 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +jiparana jpr -61.980 -10.860 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +joao_pessoa jpa -34.910 -7.100 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +la_esmeralda lfe -65.540 3.170 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +labrea lbr -64.770 -7.280 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +lencois lec -41.350 -12.480 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +linden lyd -58.302 6.015 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +llochegua llo -73.908 -12.410 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +macapa mcp -51.090 0.330 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +malalcahuello zmh -71.580 -38.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +manaus mao -60.020 -3.110 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +manicore mnx -61.280 -5.820 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +maracarume zme -45.954 -2.041 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +maringa mgf -52.010 -23.470 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +mariscal_estagarribia esg -60.624 -22.043 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +montes_claros moc -43.820 -16.710 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +neuquen nqn -68.000 -39.000 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +oeiras oei -42.160 -7.020 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +palmas pmw -48.360 -10.290 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +paramaribo pbm -55.150 5.830 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +piura piu -80.617 -5.207 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +porto_de_moz ptq -52.236 -1.741 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +pucallpa pcl -74.570 -8.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +puerto_suarez psz -58.090 -18.580 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +quibdo uib -76.640 5.690 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +recife rec -34.910 -8.070 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +redencao rdc -49.980 -8.030 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +ribeirao_preto rao -47.780 -21.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +rio_branco rbr -67.890 -9.870 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +riohacha rch -72.926 11.240 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +salta sla -65.483 -24.850 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +san_pedro zpe -54.110 -26.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sao_felix_araguaia sxo -50.690 -11.630 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sao_felix_xingu sxx -51.950 -6.640 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sao_luis slz -44.236 -2.586 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sao_gabriel sjl -66.980 -0.140 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +santa_fe sfn -60.809 -31.712 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +santarem stm -54.959 -2.857 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +sobral qbx -39.990 -4.010 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tarauaca trq -70.781 -8.157 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tefe tff -64.720 -3.380 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +teresina the -42.800 -5.090 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tirios obi -55.940 2.220 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +tolhuin tqh -67.222 -54.502 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +vina_del_mar kna -71.480 -32.950 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +vilhena bvh -60.100 -12.730 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +vitoria vix -40.390 -20.310 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 +xingu xgu -52.636 -9.692 1200 01 01 0000 1700 01 01 0000 1 1 -1.000 -1.000 F 1 90 2 0 moorcroft_6100b Sheffield 600. 1.00 1.00 9.0 7.2 5.2 10000. 1000. 10000. 900. 600. 0.015 0.040 0.016 0.016 0.080 0.055 4000. 2 1.000 0.333 0.05 0.10 0.05 2.4 2.4 2 0 0.8 3 2 0.65 0.25 0.05 13.0 13.0 0.74 0.50 378. -1.20 -1.40 2 1.0 0 3600. 2 1 0 1 0.050 0.100 0.270 0.540 0.100 -0.100 0.800 1.000 1 0 -1 2 0 2 0.0092 diff --git a/ED/Template/nc_check_run.sh b/ED/Template/nc_check_run.sh index 7f53de658..7b4442242 100755 --- a/ED/Template/nc_check_run.sh +++ b/ED/Template/nc_check_run.sh @@ -40,71 +40,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_spawn.sh b/ED/Template/nc_spawn.sh index 658f54c1d..cc15cce4e 100755 --- a/ED/Template/nc_spawn.sh +++ b/ED/Template/nc_spawn.sh @@ -55,71 +55,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/nc_submitter.sh b/ED/Template/nc_submitter.sh index cf137572b..ecf40eb69 100755 --- a/ED/Template/nc_submitter.sh +++ b/ED/Template/nc_submitter.sh @@ -39,71 +39,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/reset.sh b/ED/Template/reset.sh index d00249191..56c25dd31 100755 --- a/ED/Template/reset.sh +++ b/ED/Template/reset.sh @@ -107,71 +107,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# bkill -J ${desc}-${polyname} -q ${queue} @@ -219,71 +224,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/Template/spawn_poly.sh b/ED/Template/spawn_poly.sh index 6578903c5..e80d1697f 100755 --- a/ED/Template/spawn_poly.sh +++ b/ED/Template/spawn_poly.sh @@ -15,7 +15,7 @@ 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' +outthere='n' #----- Disk name (usually just the path until right before your own directory). -----------# diskthere='/n/moorcroftfs2' #----- This is the default path with the met driver. --------------------------------------# @@ -25,9 +25,9 @@ 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' +pdroughtpathdef='/n/moorcroft_data/mlongo/data/ed2_data/drought_met_driver' #----- Should the met driver be copied to local scratch disks? ----------------------------# -copy2scratch='y' +copy2scratch='n' #------------------------------------------------------------------------------------------# # In case we should copy, this is the source where the data is organised to go. This # # will override sitemetdef and pdroughtpath. # @@ -59,6 +59,15 @@ toldef='0.01' initmode=6 #------------------------------------------------------------------------------------------# + +#------------------------------------------------------------------------------------------# +# Which type of under storey should I use? # +# 0 -- No understorey # +# 1 -- Based on sci_005 runs. # +#------------------------------------------------------------------------------------------# +iustein=1 +#------------------------------------------------------------------------------------------# + #------------------------------------------------------------------------------------------# # Name of the unrestricted_parallel scripts: # # callunpa: script that calls callserial.sh for unrestricted_parallel runs. # @@ -92,9 +101,9 @@ execname='ed_2.1-opt' #----- Set the main path for the site, pseudo drought and Sheffield met drivers. ----------# if [ ${copy2scratch} == 'y' -o ${copy2scratch} == 'Y' ] then - sitemet='/scratch/ed2_data/met_driver/site_met_driver' - pdroughtpath='/scratch/ed2_data/met_driver/pseudo_drought' - shefpath='/scratch/ed2_data/met_driver/sheffield' + sitemet='/scratch/mlongo/met_driver/site_met_driver' + pdroughtpath='/scratch/mlongo/met_driver/drought_met_driver' + shefpath='/scratch/mlongo/met_driver/sheffield' else sitemet=${sitemetdef} pdroughtpath=${pdroughtpathdef} @@ -255,71 +264,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# @@ -402,42 +416,60 @@ do /bin/rm -f ${here}/badfile.txt done - fi - #------------------------------------------------------------------------------------# - + #---------------------------------------------------------------------------------# + #---------------------------------------------------------------------------------# + # Run the small R script to check whether the simulation was running or not, # + # and whether there was any cohort left by the time the runs were stopped. # + #---------------------------------------------------------------------------------# + 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 + sed -i s@paththere@${there}@g ${here}/${polyname}/whichrun.r + R CMD BATCH ${here}/${polyname}/whichrun.r ${here}/${polyname}/outwhichrun.txt + while [ ! -s ${here}/${polyname}/statusrun.txt ] + do + sleep 0.5 + done + year=`cat ${here}/${polyname}/statusrun.txt | awk '{print $2}'` + month=`cat ${here}/${polyname}/statusrun.txt | awk '{print $3}'` + date=`cat ${here}/${polyname}/statusrun.txt | awk '{print $4}'` + time=`cat ${here}/${polyname}/statusrun.txt | awk '{print $5}'` + runt=`cat ${here}/${polyname}/statusrun.txt | awk '{print $6}'` + #---------------------------------------------------------------------------------# + 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 + sed -i s@paththere@${there}@g ${here}/${polyname}/whichrun.r + year=${yeara} + month=${montha} + date=${datea} + time=${timea} + runt='INITIAL' + #---------------------------------------------------------------------------------# + fi #------------------------------------------------------------------------------------# - # Run the small R script to check whether the simulation was running or not, # - # and whether there was any cohort left by the time the runs were stopped. # - #------------------------------------------------------------------------------------# - 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 - sed -i s@paththere@${there}@g ${here}/${polyname}/whichrun.r - R CMD BATCH ${here}/${polyname}/whichrun.r ${here}/${polyname}/outwhichrun.txt - while [ ! -s ${here}/${polyname}/statusrun.txt ] - do - sleep 0.5 - done - year=`cat ${here}/${polyname}/statusrun.txt | awk '{print $2}'` - month=`cat ${here}/${polyname}/statusrun.txt | awk '{print $3}'` - date=`cat ${here}/${polyname}/statusrun.txt | awk '{print $4}'` - time=`cat ${here}/${polyname}/statusrun.txt | awk '{print $5}'` - runt=`cat ${here}/${polyname}/statusrun.txt | awk '{print $6}'` - #------------------------------------------------------------------------------------# - 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 @@ -454,13 +486,6 @@ do - - - - - - - #---------------------------------------------------------------------------------------# # Determine which PFTs to use based on the "iata" code. # #---------------------------------------------------------------------------------------# @@ -502,6 +527,35 @@ do + #---------------------------------------------------------------------------------------# + # Determine the census structure. # + #---------------------------------------------------------------------------------------# + let yodd=${yeara}%2 + case ${polyiata} in + gyf) + dtcensus=24 + let yr1stcensus=${yeara}+${yodd} + mon1stcensus=7 + minrecruitdbh=10 + ;; + s67) + dtcensus=24 + let yr1stcensus=${yeara}+1-${yodd} + mon1stcensus=7 + minrecruitdbh=10 + ;; + *) + dtcensus=1 + yr1stcensus=${yeara} + mon1stcensus=1 + minrecruitdbh=10 + ;; + esac + #---------------------------------------------------------------------------------------# + + + + if [ ${pseudodrought} != 'y' ] && [ ${pseudodrought} != 'Y' ] then #------------------------------------------------------------------------------------# @@ -509,82 +563,76 @@ do # dataset, otherwise the site-level tower data is used. # #------------------------------------------------------------------------------------# case ${metdriver} in - Bananal_Island) - metdriverdb=${sitemet}'/Bananal_Island/Bananal_HEADER' + Bananal) + metdriverdb=${sitemet}'/Bananal/Bananal_HEADER' metcyc1=2004 metcycf=2006 imetavg=1 ;; Caxiuana) - metdriverdb=${sitemet}'/Caxiuana/Caxiuana06_HEADER' + metdriverdb=${sitemet}'/Caxiuana/Caxiuana_HEADER' metcyc1=1999 metcycf=2003 imetavg=1 ;; + Fazenda_Nossa_Senhora) + metdriverdb=${sitemet}'/Fazenda_Nossa_Senhora/Fazenda_Nossa_Senhora_HEADER' + metcyc1=1999 + metcycf=2002 + imetavg=1 + ;; Harvard) - metdriverdb=${sitemet}'/Harvard_Forest/Harvard_Forest_HEADER' + metdriverdb=${sitemet}'/Harvard/Harvard_HEADER' metcyc1=1992 metcycf=2003 imetavg=1 ;; - Tonzi) - metdriverdb=${sitemet}'/Tonzi/Tonzi_HEADER' - metcyc1=2000 - metcycf=2010 - imetavg=1 - ;; - Manaus_KM34) - metdriverdb=${sitemet}'/Manaus_KM34/Manaus_KM34_HEADER' - metcyc1=2002 + Manaus_Km34) + metdriverdb=${sitemet}'/Manaus_Km34/Manaus_Km34_HEADER' + metcyc1=1999 metcycf=2005 imetavg=1 ;; - Reserva_Jaru) - metdriverdb=${sitemet}'/Reserva_Jaru/Reserva_Jaru_HEADER' - metcyc1=2000 - metcycf=2002 + Paracou) + metdriverdb=${sitemet}'/Paracou/Paracou_HEADER' + metcyc1=2004 + metcycf=2009 imetavg=1 ;; - Reserva_Pe-de-Gigante) - metdriverdb=${sitemet}'/Reserva_Pe_de_Gigante/Reserva_Pe-de-Gigante_HEADER' + Pe-de-Gigante) + metdriverdb=${sitemet}'/Pe-de-Gigante/Pe-de-Gigante_HEADER' metcyc1=2001 metcycf=2003 imetavg=1 ;; - Santarem_KM66) - metdriverdb=${sitemet}'/Santarem_KM66/Santarem_KM66_HEADER' - metcyc1=2002 - metcycf=2010 + Petrolina) + metdriverdb=${sitemet}'/Petrolina/Petrolina_HEADER' + metcyc1=2004 + metcycf=2011 imetavg=1 ;; - Santarem_KM67) - metdriverdb=${sitemet}'/Santarem_KM67/Santarem_KM67_HEADER' - metcyc1=2002 - metcycf=2004 + Rebio_Jaru) + metdriverdb=${sitemet}'/Rebio_Jaru/Rebio_Jaru_HEADER' + metcyc1=1999 + metcycf=2002 imetavg=1 ;; - Santarem_KM77) - metdriverdb=${sitemet}'/Santarem_KM77/Santarem_KM77_HEADER' + Santarem_Km67) + metdriverdb=${sitemet}'/Santarem_Km67/Santarem_Km67_HEADER' metcyc1=2001 - metcycf=2005 + metcycf=2010 imetavg=1 ;; - Santarem_KM83) - metdriverdb=${sitemet}'/Santarem_KM83/Santarem_KM83_HEADER' + Santarem_Km77) + metdriverdb=${sitemet}'/Santarem_Km77/Santarem_Km77_HEADER' metcyc1=2001 - metcycf=2003 - imetavg=1 - ;; - Fazenda_NS) - metdriverdb=${sitemet}'/Fazenda_Nossa_Senhora/Fazenda_Nossa_Senhora_HEADER' - metcyc1=1999 - metcycf=2001 + metcycf=2005 imetavg=1 ;; - Guyaflux) - metdriverdb=${sitemet}'/Guyaflux/Guyaflux_HEADER' - metcyc1=2007 - metcycf=2009 + Santarem_Km83) + metdriverdb=${sitemet}'/Santarem_Km83/Santarem_Km83_HEADER' + metcyc1=2000 + metcycf=2003 imetavg=1 ;; Sheffield) @@ -598,6 +646,12 @@ do metcycf=2008 imetavg=2 ;; + Tonzi) + metdriverdb=${sitemet}'/Tonzi/Tonzi_HEADER' + metcyc1=2000 + metcycf=2010 + imetavg=1 + ;; *) echo 'Met driver: '${metdriver} echo 'Sorry, this met driver is not valid for regular runs' @@ -616,43 +670,39 @@ do # 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 + let next=${nchar}-11 + polyext=`echo ${polyname} | awk '{print substr($1,'${next}',5)}'` + let nseq=${nchar}-5 + polyseq=`echo ${polyname} | awk '{print substr($1,'${nseq}',5)}'` + metdesc="${polyiata}-${polyext}_${polyseq}" + metdriverdb="${pdroughtpath}/${metdesc}/${metdesc}_HEADER" #------------------------------------------------------------------------------------# - case ${metdriver} in - Santarem_KM66) - metdriverdb=${pdroughtpath}'/Santarem_KM66/S66_'${metdesc}'_HEADER' - metcyc1=1600 - metcycf=1609 - imetavg=1 - ;; - 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 + case ${polyiata} in + s67) + case polyseq in + seq00) + metcyc1=2021 + metcycf=2041 + ;; + seq01) + metcyc1=2021 + metcycf=2037 + ;; + esac imetavg=1 ;; - Manaus_KM34) - metdriverdb=${pdroughtpath}'/Manaus_KM34/M34_'${metdesc}'_HEADER' - metcyc1=1600 - metcycf=1609 + gyf) + case polyseq in + seq00) + metcyc1=2021 + metcycf=2032 + ;; + seq01) + metcyc1=2021 + metcycf=2033 + ;; + esac imetavg=1 ;; *) @@ -983,66 +1033,92 @@ do date=${dateh} time=${timeh} thissfilin=${fullygrown} - elif [ ${initmode} -eq 6 ] + elif [ ${runt} == 'INITIAL' ] && [ ${initmode} -eq 6 ] then thissfilin=${fullygrown} - case ${polyiata} in - hvd) - thissfilin=${bioinit}'/harvard.' - ;; - s66) - thissfilin=${bioinit}'/km67_ustein_newallom.' - ;; - s67) - 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_ustein_newallom.' - ;; - 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}'/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.' + case ${iustein} in + 0) + #----- Frankeinstein's understorey for those that have one. ----------------------# + case ${polyiata} in + hvd) + thissfilin=${bioinit}'/hvd_nounder.' + ;; + cax) + thissfilin=${bioinit}'/cax_nounder.' + ;; + s67|s83) + thissfilin=${bioinit}'/s67_nounder.' + ;; + m34) + thissfilin=${bioinit}'/m34_nounder.' + ;; + gyf) + thissfilin=${bioinit}'/gyf_nounder.' + ;; + pdg) + thissfilin=${bioinit}'/pdg_nounder.' + ;; + rja) + thissfilin=${bioinit}'/rja_nounder.' + ;; + fns) + thissfilin=${bioinit}'/fns_nounder.' + ;; + s77) + thissfilin=${bioinit}'/fns_nounder.' + ;; + *) + echo ' Polygon: '${polyname} + echo ' IATA: '${polyiata} + echo ' IUSTEIN: '${iustein} + echo 'This IATA cannot be used by biomass initialisation with this IUSTEIN!' + exit 59 + ;; + esac ;; - rja) - thissfilin=${bioinit}'/rja_ustein_newallom.' + 1) + #----- New Frankeinstein's under-storey for those that have one. -----------------# + case ${polyiata} in + hvd) + thissfilin=${bioinit}'/hvd_under_sci005.' + ;; + cax) + thissfilin=${bioinit}'/cax_under_sci005.' + ;; + s67|s83) + thissfilin=${bioinit}'/s67_under_sci005.' + ;; + m34) + thissfilin=${bioinit}'/m34_under_sci005.' + ;; + gyf) + thissfilin=${bioinit}'/gyf_under_sci005.' + ;; + pdg) + thissfilin=${bioinit}'/pdg_under_sci005.' + ;; + rja) + thissfilin=${bioinit}'/rja_under_sci005.' + ;; + fns) + thissfilin=${bioinit}'/fns_under_sci005.' + ;; + s77) + thissfilin=${bioinit}'/s77_under_sci005.' + ;; + *) + echo ' Polygon: '${polyname} + echo ' IATA: '${polyiata} + echo ' IUSTEIN: '${iustein} + echo 'This IATA cannot be used by biomass initialisation with this IUSTEIN!' + exit 59 + ;; + esac ;; *) - echo ' Polygon: '${polyname} - echo ' IATA: '${polyiata} - echo 'This IATA cannot be used by biomass initialisation!' - exit 59 + #----- Bad settings. -------------------------------------------------------------# + echo ' IUSTEIN should be 0, or 1 and yours is set to '${iustein}'...' + exit 66 ;; esac else @@ -1051,100 +1127,109 @@ do #---------------------------------------------------------------------------------------# 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@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@myfire@${ifire}@g ${ED2IN} - sed -i s@myfuel@${fireparm}@g ${ED2IN} - sed -i s@mymetavg@${imetavg}@g ${ED2IN} - sed -i s@mypercol@${ipercol}@g ${ED2IN} - sed -i s@mysoilbc@${isoilbc}@g ${ED2IN} - sed -i s@myrunoff@${runoff}@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@mybigleaf@${ibigleaf}@g ${ED2IN} - sed -i s@myrepro@${irepro}@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} + 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@mysoilbc@${polysoilbc}@g ${ED2IN} + sed -i s@mysldrain@${polysldrain}@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@mydecomp@${decomp}@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@mymortscheme@${imortscheme}@g ${ED2IN} + sed -i s@myddmortconst@${ddmortconst}@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@myfire@${ifire}@g ${ED2IN} + sed -i s@myfuel@${fireparm}@g ${ED2IN} + sed -i s@mymetavg@${imetavg}@g ${ED2IN} + sed -i s@mypercol@${ipercol}@g ${ED2IN} + sed -i s@myrunoff@${runoff}@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@mybigleaf@${ibigleaf}@g ${ED2IN} + sed -i s@myrepro@${irepro}@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} + sed -i s@mydtcensus@${dtcensus}@g ${ED2IN} + sed -i s@myyr1stcensus@${yr1stcensus}@g ${ED2IN} + sed -i s@mymon1stcensus@${mon1stcensus}@g ${ED2IN} + sed -i s@myminrecruitdbh@${minrecruitdbh}@g ${ED2IN} + sed -i s@mytreefall@${treefall}@g ${ED2IN} #------ Soil variables. ----------------------------------------------------------------# sed -i s@myslz1@"${polyslz1}"@g ${ED2IN} diff --git a/ED/Template/stopalljobs.sh b/ED/Template/stopalljobs.sh index 0eedcb5b0..5351850f6 100755 --- a/ED/Template/stopalljobs.sh +++ b/ED/Template/stopalljobs.sh @@ -71,71 +71,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# bkill -J ${desc}-${polyname} -q ${queue} diff --git a/ED/Template/submitter.sh b/ED/Template/submitter.sh index 6a24e2f83..be8ef2ab8 100755 --- a/ED/Template/submitter.sh +++ b/ED/Template/submitter.sh @@ -44,71 +44,76 @@ do 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}'` - ifire=`echo ${oi} | awk '{print $60}'` - fireparm=`echo ${oi} | awk '{print $61}'` - ipercol=`echo ${oi} | awk '{print $62}'` - isoilbc=`echo ${oi} | awk '{print $63}'` - runoff=`echo ${oi} | awk '{print $64}'` - imetrad=`echo ${oi} | awk '{print $65}'` - ibranch=`echo ${oi} | awk '{print $66}'` - icanrad=`echo ${oi} | awk '{print $67}'` - crown=`echo ${oi} | awk '{print $68}'` - ltransvis=`echo ${oi} | awk '{print $69}'` - lreflectvis=`echo ${oi} | awk '{print $70}'` - ltransnir=`echo ${oi} | awk '{print $71}'` - lreflectnir=`echo ${oi} | awk '{print $72}'` - orienttree=`echo ${oi} | awk '{print $73}'` - orientgrass=`echo ${oi} | awk '{print $74}'` - clumptree=`echo ${oi} | awk '{print $75}'` - clumpgrass=`echo ${oi} | awk '{print $76}'` - ivegtdyn=`echo ${oi} | awk '{print $77}'` - igndvap=`echo ${oi} | awk '{print $78}'` - iphen=`echo ${oi} | awk '{print $79}'` - iallom=`echo ${oi} | awk '{print $80}'` - ibigleaf=`echo ${oi} | awk '{print $81}'` - irepro=`echo ${oi} | awk '{print $82}'` + polysoilbc=`echo ${oi} | awk '{print $18}'` + polysldrain=`echo ${oi} | awk '{print $19}'` + polycol=`echo ${oi} | awk '{print $20}'` + slzres=`echo ${oi} | awk '{print $21}'` + queue=`echo ${oi} | awk '{print $22}'` + metdriver=`echo ${oi} | awk '{print $23}'` + dtlsm=`echo ${oi} | awk '{print $24}'` + vmfactc3=`echo ${oi} | awk '{print $25}'` + vmfactc4=`echo ${oi} | awk '{print $26}'` + mphototrc3=`echo ${oi} | awk '{print $27}'` + mphototec3=`echo ${oi} | awk '{print $28}'` + mphotoc4=`echo ${oi} | awk '{print $29}'` + bphotoblc3=`echo ${oi} | awk '{print $30}'` + bphotonlc3=`echo ${oi} | awk '{print $31}'` + bphotoc4=`echo ${oi} | awk '{print $32}'` + kwgrass=`echo ${oi} | awk '{print $33}'` + kwtree=`echo ${oi} | awk '{print $34}'` + gammac3=`echo ${oi} | awk '{print $35}'` + gammac4=`echo ${oi} | awk '{print $36}'` + d0grass=`echo ${oi} | awk '{print $37}'` + d0tree=`echo ${oi} | awk '{print $38}'` + alphac3=`echo ${oi} | awk '{print $39}'` + alphac4=`echo ${oi} | awk '{print $40}'` + klowco2=`echo ${oi} | awk '{print $41}'` + decomp=`echo ${oi} | awk '{print $42}'` + rrffact=`echo ${oi} | awk '{print $43}'` + growthresp=`echo ${oi} | awk '{print $44}'` + lwidthgrass=`echo ${oi} | awk '{print $45}'` + lwidthbltree=`echo ${oi} | awk '{print $46}'` + lwidthnltree=`echo ${oi} | awk '{print $47}'` + q10c3=`echo ${oi} | awk '{print $48}'` + q10c4=`echo ${oi} | awk '{print $49}'` + h2olimit=`echo ${oi} | awk '{print $50}'` + imortscheme=`echo ${oi} | awk '{print $51}'` + ddmortconst=`echo ${oi} | awk '{print $52}'` + isfclyrm=`echo ${oi} | awk '{print $53}'` + icanturb=`echo ${oi} | awk '{print $54}'` + ubmin=`echo ${oi} | awk '{print $55}'` + ugbmin=`echo ${oi} | awk '{print $56}'` + ustmin=`echo ${oi} | awk '{print $57}'` + gamm=`echo ${oi} | awk '{print $58}'` + gamh=`echo ${oi} | awk '{print $59}'` + tprandtl=`echo ${oi} | awk '{print $60}'` + ribmax=`echo ${oi} | awk '{print $61}'` + atmco2=`echo ${oi} | awk '{print $62}'` + thcrit=`echo ${oi} | awk '{print $63}'` + smfire=`echo ${oi} | awk '{print $64}'` + ifire=`echo ${oi} | awk '{print $65}'` + fireparm=`echo ${oi} | awk '{print $66}'` + ipercol=`echo ${oi} | awk '{print $67}'` + runoff=`echo ${oi} | awk '{print $68}'` + imetrad=`echo ${oi} | awk '{print $69}'` + ibranch=`echo ${oi} | awk '{print $70}'` + icanrad=`echo ${oi} | awk '{print $71}'` + crown=`echo ${oi} | awk '{print $72}'` + ltransvis=`echo ${oi} | awk '{print $73}'` + lreflectvis=`echo ${oi} | awk '{print $74}'` + ltransnir=`echo ${oi} | awk '{print $75}'` + lreflectnir=`echo ${oi} | awk '{print $76}'` + orienttree=`echo ${oi} | awk '{print $77}'` + orientgrass=`echo ${oi} | awk '{print $78}'` + clumptree=`echo ${oi} | awk '{print $79}'` + clumpgrass=`echo ${oi} | awk '{print $80}'` + ivegtdyn=`echo ${oi} | awk '{print $81}'` + igndvap=`echo ${oi} | awk '{print $82}'` + iphen=`echo ${oi} | awk '{print $83}'` + iallom=`echo ${oi} | awk '{print $84}'` + ibigleaf=`echo ${oi} | awk '{print $85}'` + irepro=`echo ${oi} | awk '{print $86}'` + treefall=`echo ${oi} | awk '{print $87}'` #---------------------------------------------------------------------------------------# diff --git a/ED/build/bin/2ndcomp.sh b/ED/build/bin/2ndcomp.sh index 8adf06e51..50b45cc5b 100755 --- a/ED/build/bin/2ndcomp.sh +++ b/ED/build/bin/2ndcomp.sh @@ -19,7 +19,7 @@ rm -fv disturbance.o disturbance.mod rm -fv disturb_coms.o disturb_coms.mod rm -fv edio.o edio.mod rm -fv ed_1st.o ed_1st.mod -rm -fv ed_bare_restart.o ed_bare_restart.mod +rm -fv ed_bigleaf_init.o ed_bigleaf_init.mod rm -fv ed_driver.o ed_driver.mod rm -fv ed_filelist.o ed_filelist.mod rm -fv ed_grid.o ed_grid.mod diff --git a/ED/build/bin/dependency.mk b/ED/build/bin/dependency.mk index d7609f2b8..4d6479964 100644 --- a/ED/build/bin/dependency.mk +++ b/ED/build/bin/dependency.mk @@ -20,7 +20,7 @@ canopy_struct_dynamics.o: rk4_coms.mod soil_coms.mod therm_lib.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_aux.mod +disturbance.o: mem_polygons.mod mortality.mod pft_coms.mod phenology_aux.mod disturbance.o: phenology_coms.mod euler_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod euler_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod @@ -39,7 +39,7 @@ forestry.o: ed_misc_coms.mod 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: fuse_fiss_utils.mod grid_coms.mod mortality.mod pft_coms.mod -growth_balive.o: physiology_coms.mod +growth_balive.o: phenology_coms.mod physiology_coms.mod heun_driver.o: canopy_air_coms.mod consts_coms.mod ed_max_dims.mod heun_driver.o: ed_misc_coms.mod ed_state_vars.mod grid_coms.mod heun_driver.o: hydrology_coms.mod met_driver_coms.mod rk4_coms.mod @@ -48,7 +48,7 @@ heun_driver.o: therm_lib8.mod hybrid_driver.o: consts_coms.mod ed_max_dims.mod ed_misc_coms.mod hybrid_driver.o: ed_state_vars.mod grid_coms.mod hydrology_coms.mod hybrid_driver.o: met_driver_coms.mod rk4_coms.mod rk4_driver.mod rk4_stepper.mod -hybrid_driver.o: soil_coms.mod therm_lib8.mod +hybrid_driver.o: soil_coms.mod therm_lib.mod therm_lib8.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 @@ -66,7 +66,7 @@ phenology_driv.o: 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 +photosyn_driv.o: soil_coms.mod therm_lib.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 @@ -91,15 +91,19 @@ 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 +soil_respiration.o: rk4_coms.mod soil_coms.mod therm_lib.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 +structural_growth.o: detailed_coms.mod ed_max_dims.mod ed_misc_coms.mod +structural_growth.o: ed_state_vars.mod ed_therm_lib.mod pft_coms.mod +structural_growth.o: physiology_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 disturbance_utils.mod ed_misc_coms.mod vegetation_dynamics.o: ed_state_vars.mod fuse_fiss_utils.mod grid_coms.mod vegetation_dynamics.o: growth_balive.mod mem_polygons.mod +ed_bigleaf_init.o: allometry.mod consts_coms.mod ed_max_dims.mod +ed_bigleaf_init.o: ed_misc_coms.mod ed_node_coms.mod ed_state_vars.mod +ed_bigleaf_init.o: fuse_fiss_utils.mod pft_coms.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 diff --git a/ED/build/bin/objects.mk b/ED/build/bin/objects.mk index a2b8efdbf..afa9ee874 100644 --- a/ED/build/bin/objects.mk +++ b/ED/build/bin/objects.mk @@ -28,6 +28,7 @@ OBJ_MODEL = \ disturb_coms.o \ edio.o \ ed_1st.o \ + ed_bigleaf_init.o \ ed_driver.o \ ed_filelist.o \ ed_grid.o \ diff --git a/ED/build/bin/rules.mk b/ED/build/bin/rules.mk index 7e2ae688a..540e9eab7 100644 --- a/ED/build/bin/rules.mk +++ b/ED/build/bin/rules.mk @@ -93,6 +93,11 @@ ed_1st.o : $(ED_DRIVER)/ed_1st.f90 $(F90_COMMAND) $( 0. Black hole (0 itself is unacceptable) ! ! 1. Homogeneously spread over the layer (i.e., no clumping) ! !---------------------------------------------------------------------------------------! - NL%ICANRAD = 0 + NL%ICANRAD = 0 NL%LTRANS_VIS = 0.050 NL%LTRANS_NIR = 0.270 - NL%LREFLECT_VIS = 0.150 + NL%LREFLECT_VIS = 0.100 NL%LREFLECT_NIR = 0.540 NL%ORIENT_TREE = 0.100 NL%ORIENT_GRASS = -0.100 @@ -852,9 +846,16 @@ $ED_NL !---------------------------------------------------------------------------------------! ! DECOMP_SCHEME -- This specifies the dependence of soil decomposition on temperature. ! - ! 0. ED-2.0 default, the original exponential ! + ! 0. ED-2.1 default, the original exponential (low temperature ! + ! limitation only). ! ! 1. Lloyd and Taylor (1994) model ! ! [[option 1 requires parameters to be set in xml]] ! + ! 2. Similar to ED-1.0 and CENTURY model, heterotrophic respiration ! + ! reaches a maximum at around 38C (using the default parameters), ! + ! then quickly falls to zero at around 50C. It applies a similar ! + ! function for soil moisture, which allows higher decomposition ! + ! rates when it is close to the optimal, plumetting when it is ! + ! almost saturated. ! !---------------------------------------------------------------------------------------! NL%DECOMP_SCHEME = 0 !---------------------------------------------------------------------------------------! @@ -879,7 +880,34 @@ $ED_NL ! 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 + NL%H2O_PLANT_LIM = 2 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! IDDMORT_SCHEME -- This flag determines whether storage should be accounted in the ! + ! carbon balance. ! + ! 0 -- Carbon balance is done in terms of fluxes only. This is the ! + ! default in ED-2.1 ! + ! 1 -- Carbon balance is offset by the storage pool. Plants will be ! + ! in negative carbon balance only when they run out of storage ! + ! and are still losing more carbon than gaining. ! + ! ! + ! DDMORT_CONST -- This constant (k) determines the relative contribution of light ! + ! and soil moisture to the density-dependent mortality rate. Values ! + ! range from 0 (soil moisture only) to 1 (light only). ! + ! ! + ! mort1 ! + ! mu_DD = ------------------------- ! + ! 1 + exp [ mort2 * cr ] ! + ! ! + ! CB CB ! + ! cr = k ------------- + (1 - k) ------------- ! + ! CB_lightmax CB_watermax ! + !---------------------------------------------------------------------------------------! + NL%IDDMORT_SCHEME = 0 + NL%DDMORT_CONST = 0.8 !---------------------------------------------------------------------------------------! @@ -963,7 +991,7 @@ $ED_NL ! ing point is by definition -1.5MPa, so make sure that the value ! ! is above -1.5. ! !---------------------------------------------------------------------------------------! - NL%THETACRIT = -1.15 + NL%THETACRIT = -1.20 !---------------------------------------------------------------------------------------! @@ -1011,20 +1039,27 @@ $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. ! + ! 3. Fire will be triggered with enough biomass and accumulated ! + ! 30-day water deficit exceeds the threshold given by SM_FIRE. ! + ! This is soil independent. ! ! FIRE_PARAMETER -- If fire happens, this will control the intensity of the disturbance ! ! given the amount of fuel (currently the total above-ground ! ! biomass). ! - ! 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 1m ! - ! that will prevent fires to happen. ! - ! < 0. - Minimum mean soil moisture potential in MPa of the top 1m ! - ! 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. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2 or 3, and it has different ! + ! meanings. The sign here matters. ! + ! When INCLUDE_FIRE = 2: ! + ! >= 0. - Minimum relative soil moisture above dry air of the top ! + ! 1m that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top ! + ! 1m 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. ! + ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! + ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! !---------------------------------------------------------------------------------------! - NL%INCLUDE_FIRE = 2 - NL%FIRE_PARAMETER = 0.2 - NL%SM_FIRE = -1.45 + NL%INCLUDE_FIRE = 0 + NL%FIRE_PARAMETER = 0.5 + NL%SM_FIRE = -1.40 !---------------------------------------------------------------------------------------! @@ -1133,7 +1168,7 @@ $ED_NL ! 2. Soil conductivity decreases with depth even for constant soil moisture ! ! , otherwise it is the same as 1. ! !---------------------------------------------------------------------------------------! - NL%IPERCOL = 1 + NL%IPERCOL = 0 !---------------------------------------------------------------------------------------! @@ -1174,7 +1209,7 @@ $ED_NL ! 1. Add the PFT in the INCLUDE_THESE_PFT list ! ! 2. Ignore the cohort ! !---------------------------------------------------------------------------------------! - NL%PFT_1ST_CHECK = 0 + NL%PFT_1ST_CHECK = 0 !---------------------------------------------------------------------------------------! @@ -1236,7 +1271,7 @@ $ED_NL ! average patch age is still 1/TREEFALL_DISTURBANCE_RATE ! !---------------------------------------------------------------------------------------! NL%TREEFALL_DISTURBANCE_RATE = 0.014 - NL%TIME2CANOPY = 0.0 + NL%TIME2CANOPY = 0. !---------------------------------------------------------------------------------------! @@ -1247,7 +1282,7 @@ $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 = 3600.0 + NL%RUNOFF_TIME = 3600. !---------------------------------------------------------------------------------------! @@ -1335,11 +1370,11 @@ $ED_NL !---------------------------------------------------------------------------------------! NL%IMETTYPE = 1 NL%ISHUFFLE = 0 - NL%METCYC1 = 2002 - NL%METCYCF = 2005 + NL%METCYC1 = 2001 + NL%METCYCF = 2010 NL%IMETAVG = 1 NL%IMETRAD = 2 - NL%INITIAL_CO2 = 278.0 + NL%INITIAL_CO2 = 378. !---------------------------------------------------------------------------------------! @@ -1378,6 +1413,27 @@ $ED_NL + !---------------------------------------------------------------------------------------! + ! Census variables. This is going to create unique census statuses to cohorts, to ! + ! better compare the model with census observations. In case you don't intend to ! + ! compare the model with census data, set up DT_CENSUS to 1., otherwise you may reduce ! + ! cohort fusion. ! + ! DT_CENSUS -- Time between census, in months. Currently the maximum is 60 ! + ! months, to avoid excessive memory allocation. Every time the ! + ! simulation reaches the census time step, all census tags will be ! + ! reset. ! + ! YR1ST_CENSUS -- In which year was the first census conducted? ! + ! MON1ST_CENSUS -- In which month was the first census conducted? ! + ! MIN_RECRUIT_DBH -- Minimum DBH that is measured in the census, in cm. ! + !---------------------------------------------------------------------------------------! + NL%DT_CENSUS = 1. + NL%YR1ST_CENSUS = 1901 + NL%MON1ST_CENSUS = 7 + NL%MIN_RECRUIT_DBH = 10 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! The following variables are used to control the detailed output for debugging ! ! purposes. ! @@ -1420,6 +1476,7 @@ $ED_NL !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! ! IOPTINPT -- Optimization configuration. (Currently not used) ! !---------------------------------------------------------------------------------------! diff --git a/ED/src/driver/ed_met_driver.f90 b/ED/src/driver/ed_met_driver.f90 index 0b1394366..b57df3ec1 100644 --- a/ED/src/driver/ed_met_driver.f90 +++ b/ED/src/driver/ed_met_driver.f90 @@ -819,6 +819,7 @@ subroutine update_met_drivers(cgrid) , press2exner & ! function , extemp2theta & ! function , thetaeiv & ! function + , vpdefil & ! function , rehuil ! ! function implicit none @@ -2281,6 +2282,13 @@ subroutine update_met_drivers(cgrid) ,cgrid%met(ipy)%atm_tmp,rvaux,rvaux) !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! And the vapour pressure deficit. ! + !------------------------------------------------------------------------------------! + cgrid%met(ipy)%atm_vpdef = vpdefil(cgrid%met(ipy)%prss,cgrid%met(ipy)%atm_tmp & + ,cgrid%met(ipy)%atm_shv,.true.) + !------------------------------------------------------------------------------------! + !------ Apply met to sites, and adjust met variables for topography. ----------------! call calc_met_lapse(cgrid,ipy) @@ -2344,12 +2352,19 @@ subroutine update_met_drivers(cgrid) rvaux = cgrid%met(ipy)%atm_shv / (1.0 - cgrid%met(ipy)%atm_shv) cpoly%met(isi)%atm_theiv = thetaeiv(cpoly%met(isi)%atm_theta,cpoly%met(isi)%prss & ,cpoly%met(isi)%atm_tmp,rvaux,rvaux) + !---------------------------------------------------------------------------------! + + !----- Find the vapour pressure deficit. -----------------------------------------! + cpoly%met(isi)%atm_vpdef = vpdefil (cpoly%met(isi)%prss,cpoly%met(isi)%atm_tmp & + ,cpoly%met(isi)%atm_shv,.true.) + !---------------------------------------------------------------------------------! !----- Solar radiation -----------------------------------------------------------! cpoly%met(isi)%rshort_diffuse = cpoly%met(isi)%par_diffuse & + cpoly%met(isi)%nir_diffuse cpoly%met(isi)%rshort = cpoly%met(isi)%rshort_diffuse & + cpoly%met(isi)%par_beam + cpoly%met(isi)%nir_beam + !---------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/bdf2_solver.f90 b/ED/src/dynamics/bdf2_solver.f90 index 8a5be7b86..7c2c35b82 100644 --- a/ED/src/dynamics/bdf2_solver.f90 +++ b/ED/src/dynamics/bdf2_solver.f90 @@ -20,11 +20,11 @@ ! !============================================================================== -subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) +subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,dtf,dtb) use grid_coms,only : nzg,nzs use rk4_coms,only : effarea_evap,effarea_heat,effarea_transp, & - rk4site,rk4patchtype,bdf2patchtype,checkbudget,hcapcan + rk4site,rk4patchtype,bdf2patchtype,checkbudget,hcapcan,ibranch_thermo use ed_misc_coms,only : fast_diagnostics use ed_state_vars,only : patchtype use therm_lib8,only : reducedpress8,idealdenssh8 @@ -32,27 +32,24 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) use consts_coms,only : cpdry8,p00i8,rdry8, & rocv8,cpocv8,cliq8,cice8,rocp8,cpocv,epim1, & alli8,t3ple8,alvi38,wdns8,cph2o8,tsupercool_liq8,pi18 - use therm_lib8,only : uint2tl8,uextcm2tl8,tq2enthalpy8, tl2uint8 + use therm_lib8,only : uint2tl8,uextcm2tl8,tq2enthalpy8, tl2uint8, cmtl2uext8 use soil_coms, only : soil8,dslz8 implicit none ! define the previous,current and next patch states - integer,intent(in) :: nstate - real(kind=8),dimension(nstate) :: Y - real(kind=8),dimension(nstate) :: Yf - real(kind=8),dimension(nstate,nstate) :: A - real(kind=8),dimension(nstate) :: B - real,dimension(nstate,nstate) :: IA + integer :: nstate + real(kind=8),pointer,dimension(:) :: Y + real(kind=8),pointer,dimension(:) :: Yf + real(kind=8),pointer,dimension(:,:) :: A + real(kind=8),pointer,dimension(:) :: B type(patchtype),target :: cpatch type(bdf2patchtype), target :: yprev type(rk4patchtype), target :: ycurr type(rk4patchtype), target :: ynext type(rk4patchtype), target :: dydt - integer,dimension(nstate) :: indx real(kind=8),intent(in) :: dtf ! dt for n -> n+1 real(kind=8),intent(in) :: dtb ! dt for n -> n-1 -! real(kind=8),intent(in) :: can_depth integer :: id_tcan,id_tveg,ico integer :: k,ksn @@ -71,15 +68,18 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) real(kind=8) :: xc ! lumped term (canopy) [-] real(kind=8) :: href ! reference spec. enth. [J/kg] real(kind=8) :: gv ! veg-canopy conductivity [m/s] - real(kind=8) :: hfa ! effective area of heat flux [m2/m2] - real(kind=8) :: mlc ! mass flux leaf->can [kg/m2/s] - real(kind=8) :: mwc ! mass flux wood->can - real(kind=8) :: mtr ! mass flux transp veg->can [kg/m2/s] - real(kind=8) :: fliq ! liquid fraction leaf surf [kg/kg] - real(kind=8) :: qv ! water mass on vegetation [kg/m2] - real(kind=8) :: dqvdt ! time partial of qv [kg/m2/s] - real(kind=8) :: xv ! lumped term (vegetation) - + real(kind=8),dimension(300) :: gv_hfa ! effective area of heat times g + real(kind=8),dimension(300) :: mlc ! mass flux leaf->can [kg/m2/s] + real(kind=8),dimension(300) :: mwc ! mass flux wood->can + real(kind=8),dimension(300) :: mtr ! mass flux transp veg->can [kg/m2/s] + real(kind=8),dimension(300) :: fliq ! liquid fraction leaf surf [kg/kg] + real(kind=8),dimension(300) :: qv ! water mass on vegetation [kg/m2] + real(kind=8),dimension(300) :: dqvdt ! time partial of qv [kg/m2/s] + real(kind=8),dimension(300) :: xv ! lumped term (vegetation) + real(kind=8),dimension(300) :: hflx ! enth flux from bunch of stuff + logical,dimension(300) :: resolve ! self-explanatory + + real(kind=8) :: veg_temp,leaf_temp,wood_temp real(kind=8) :: eflxac real(kind=8) :: qwflxgc real(kind=8) :: qwflxac @@ -123,10 +123,10 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ! or moist/dry soil ! !--------------------------------------------------------------------------! -! ksn=0 -! do k=1,ycurr%nlev_sfcwater -! if(ycurr%sfcwater_mass(k)>1.d-5)ksn=k -! end do +!! ksn=0 +!! do k=1,ycurr%nlev_sfcwater +!! if(ycurr%sfcwater_mass(k)>1.d-5)ksn=k +!! end do shctop = soil8(rk4site%ntext_soil(nzg))%slcpd call uextcm2tl8(ynext%soil_energy(nzg),ynext%soil_water(nzg)*wdns8,shctop & @@ -146,18 +146,117 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ,ycurr%sfcwater_fracliq(k),ycurr%can_prss,ynext%can_shv & ,ynext%ground_shv,ynext%ground_ssh,ynext%ground_temp & ,ynext%ground_fliq,ynext%ggsoil) - + + !===========================================================================! + ! Determine the leaf-branch thermodynamics scheme to be used. + ! Set some temporary variables. + ! Calculate the number of elements. + !===========================================================================! + + + resolve(:)=.false. + id_tveg = 1 + select case(ibranch_thermo) + case(0,2) + do ico=1,cpatch%ncohorts + if (ycurr%leaf_resolvable(ico)) then + gv_hfa(ico) = ycurr%leaf_gbh(ico)/(ycurr%can_rhos*cpdry8) & + *effarea_heat*ycurr%lai(ico) + mlc(ico) = ycurr%wflxlc(ico) + mtr(ico) = ycurr%wflxtr(ico) + fliq(ico) = ycurr%leaf_fliq(ico) + qv(ico) = ynext%leaf_water(ico) + dqvdt(ico)= dydt%leaf_water(ico) + xv(ico) = ycurr%leaf_fliq(ico)*cliq8*qv(ico) + & + (1.d0-fliq(ico))*cice8*qv(ico) + & + ycurr%leaf_hcap(ico) + hflx(ico) = ycurr%hflx_lrsti(ico) + resolve(ico) = .true. + id_tveg = id_tveg + 1 + end if + end do + + if(ibranch_thermo.eq.2)then + do ico=1,cpatch%ncohorts + if (ycurr%wood_resolvable(ico)) then + id_tveg = id_tveg + 1 + end if + end do + end if + + case(1) + do ico=1,cpatch%ncohorts + gv_hfa(ico) = 0.0 + mlc(ico) = 0.0 + mtr(ico) = 0.0 + fliq(ico) = -1.0 + qv(ico) = 0.0 + dqvdt(ico) = 0.0 + hflx(ico) = 0.0 + if (ycurr%leaf_resolvable(ico) .or. ycurr%wood_resolvable(ico))then + id_tveg = id_tveg+1 + resolve(ico) = .true. + end if + + if (ycurr%leaf_resolvable(ico)) then + gv_hfa(ico) = ycurr%leaf_gbh(ico)/(ycurr%can_rhos*cpdry8) & + *effarea_heat*ycurr%lai(ico) + mlc(ico) = ycurr%wflxlc(ico) + mtr(ico) = ycurr%wflxtr(ico) + fliq(ico) = ycurr%leaf_fliq(ico) + qv(ico) = ynext%leaf_water(ico) + dqvdt(ico)= dydt%leaf_water(ico) + hflx(ico) = ycurr%hflx_lrsti(ico) + end if + if (ycurr%wood_resolvable(ico)) then + gv_hfa(ico) = gv_hfa(ico)+(ycurr%wood_gbh(ico)/(ycurr%can_rhos*cpdry8) & + *effarea_heat*ycurr%wai(ico)) + mlc(ico) = mlc(ico)+ycurr%wflxwc(ico) + if(fliq(ico)>-0.99)then + fliq(ico) = (fliq(ico)+ycurr%wood_fliq(ico))/2.0 + else + fliq(ico) = ycurr%wood_fliq(ico) + end if + + qv(ico) = qv(ico)+ynext%wood_water(ico) + dqvdt(ico)= dqvdt(ico)+dydt%wood_water(ico) + hflx(ico) = hflx(ico)+ycurr%hflx_wrsti(ico) + end if + + ! We use the wood and the leaf heat capacities regardless + ! of their ability to be solved. + ! --------------------------------------------------------- + + xv(ico) = ycurr%leaf_fliq(ico)*cliq8*ynext%leaf_water(ico) + & + (1.d0-ycurr%leaf_fliq(ico))*cice8*ynext%leaf_water(ico) + & + ycurr%leaf_hcap(ico) + & + ycurr%wood_fliq(ico)*cliq8*ynext%wood_water(ico) + & + (1.d0-ycurr%wood_fliq(ico))*cice8*ynext%wood_water(ico) + & + ycurr%wood_hcap(ico) + + end do + + end select + + nstate = id_tveg + + !------ Allocate the matrices used for the linear operations --------------! + allocate(Y(nstate)) + allocate(Yf(nstate)) + allocate(A(nstate,nstate)) + allocate(B(nstate)) !----- Initialize the matrices used for the linear operations -------------! A = 0.d0 B = 0.d0 Y = 0.d0 + Yf= 0.d0 - !----- Set temporary variables used for readability -----------------------! + !----- Set temporary canopy level variables used for readability ----------! rhoc = ycurr%can_rhos dc = ycurr%can_depth @@ -217,10 +316,11 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) - Y(id_tcan) = (3.d0+(dtf/dtb))*ycurr%can_temp - & + Y(id_tcan) = (3.d0+(dtf/dtb))*ycurr%can_temp - & (dtf/dtb)*yprev%can_temp + 2.d0*B(id_tcan)*dtf - - + + + !===========================================================================! ! Derivatives associated with vegetation <-> canopy-air fluxes !===========================================================================! @@ -229,51 +329,36 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) do ico=1,cpatch%ncohorts - if (ycurr%leaf_resolvable(ico)) then + if (resolve(ico))then id_tveg = id_tveg+1 - gv = ycurr%leaf_gbh(ico)/(ycurr%can_rhos*cpdry8) - hfa = effarea_heat*ycurr%lai(ico) - mlc = ycurr%wflxlc(ico) - mtr = ycurr%wflxtr(ico) - fliq = ycurr%leaf_fliq(ico) - qv = ynext%leaf_water(ico) - dqvdt= dydt%leaf_water(ico) - - xv = fliq*cliq8*qv + (1.d0-fliq)*cice8*qv + ycurr%leaf_hcap(ico) - - - ! dTc/dt ~ Tc) - A(id_tcan,id_tcan) = A(id_tcan,id_tcan) - gv*hfa*rhoc*cpdry8/xc + A(id_tcan,id_tcan) = A(id_tcan,id_tcan) - gv_hfa(ico)*rhoc*cpdry8/xc ! A(dTc/dt ~ Tv) A(id_tcan,id_tveg) = A(id_tcan,id_tveg) & - + (1.d0/xc)*(gv*hfa*rhoc*cpdry8 + mlc*cph2o8 + mtr*cph2o8) + + (1.d0/xc)*(gv_hfa(ico)*rhoc*cpdry8 + mlc(ico)*cph2o8 + mtr(ico)*cph2o8) - - ! Note hflx_lrsti is rshort+rlong+Htrans(soil)+Hint-Hshed - ! B(dTv/dt) - B(id_tveg) = (1.d0/xv)* & - (ycurr%hflx_lrsti(ico) & - - href*mlc & - - href*mtr & - + (fliq*cliq8*t3ple8 - fliq*cice8*t3ple8 - fliq*alli8)*dqvdt) + B(id_tveg) = (1.d0/xv(ico))* & + ( hflx(ico) & + - href*mlc(ico) & + - href*mtr(ico) & + + (fliq(ico)*cliq8*t3ple8 - fliq(ico)*cice8*t3ple8 - fliq(ico)*alli8)*dqvdt(ico)) ! A(dTv/dt ~ Tc) A(id_tveg,id_tcan) = A(id_tveg,id_tcan) + & - (hfa*gv*rhoc*cpdry8)/xv + (gv_hfa(ico)*rhoc*cpdry8)/xv(ico) ! A(dTv/dt ~ Tv) A(id_tveg,id_tveg) = A(id_tveg,id_tveg) + & - (1.d0/xv)*( (fliq*cice8 - fliq*cliq8 - cice8)*dqvdt & - - hfa*rhoc*gv*cpdry8 - (mlc+mtr)*cph2o8) + (1.d0/xv(ico))*( (fliq(ico)*cice8 - fliq(ico)*cliq8 - cice8)*dqvdt(ico) & + - gv_hfa(ico)*rhoc*cpdry8 - (mlc(ico)+mtr(ico))*cph2o8) + - Y(id_tveg) = (3.d0+dtf/dtb)*ycurr%leaf_temp(ico) - & (dtf/dtb)*yprev%leaf_temp(ico) + & 2.d0*B(id_tveg)*dtf @@ -283,64 +368,63 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) end do - ! ======================= WOOD ==========================! - ! If we have yet to do wood temps, do another loop - ! ========================================================! - - if( id_tveg < nstate) then + ! ============================================================! + ! If this is a thermo case where wood is separate, do another + ! ============================================================! + if(ibranch_thermo.eq.2)then do ico=1,cpatch%ncohorts - if (ycurr%wood_resolvable(ico)) then - - id_tveg = id_tveg+1 + gv_hfa(ico) = ycurr%wood_gbh(ico)/(ycurr%can_rhos*cpdry8) & + *effarea_heat*ycurr%wai(ico) + mlc(ico) = ycurr%wflxwc(ico) + mtr(ico) = 0.0 + fliq(ico) = ycurr%wood_fliq(ico) + qv(ico) = ynext%wood_water(ico) + dqvdt(ico)= dydt%wood_water(ico) + xv(ico) = ycurr%wood_fliq(ico)*cliq8*qv(ico) + & + (1.d0-fliq(ico))*cice8*qv(ico) + & + ycurr%wood_hcap(ico) + hflx(ico) = ycurr%hflx_wrsti(ico) + end if + end do + + do ico=1,cpatch%ncohorts + if (ycurr%wood_resolvable(ico)) then - gv = ycurr%wood_gbh(ico)/(ycurr%can_rhos*cpdry8) - hfa = pi18*ycurr%wai(ico) - mlc = ycurr%wflxwc(ico) - mtr = 0.d0 - fliq = ycurr%wood_fliq(ico) - qv = ynext%wood_water(ico) - dqvdt= dydt%wood_water(ico) - - xv = fliq*cliq8*qv + (1.d0-fliq)*cice8*qv + ycurr%wood_hcap(ico) + id_tveg = id_tveg+1 ! dTc/dt ~ Tc) - A(id_tcan,id_tcan) = A(id_tcan,id_tcan) - gv*hfa*rhoc*cpdry8/xc - + A(id_tcan,id_tcan) = A(id_tcan,id_tcan) - gv_hfa(ico)*rhoc*cpdry8/xc + ! A(dTc/dt ~ Tv) A(id_tcan,id_tveg) = A(id_tcan,id_tveg) & - + (1.d0/xc)*(gv*hfa*rhoc*cpdry8 + mlc*cph2o8 + mtr*cph2o8) - - - ! Note hflx_wrsti is rshort+rlong+Hint-Hshed + + (1.d0/xc)*(gv_hfa(ico)*rhoc*cpdry8 + mlc(ico)*cph2o8 + mtr(ico)*cph2o8) ! B(dTv/dt) - B(id_tveg) = (1.d0/xv)* & - (ycurr%hflx_wrsti(ico) & - - href*mlc & - - href*mtr & - + (fliq*cliq8*t3ple8 - fliq*cice8*t3ple8 - fliq*alli8)*dqvdt) - + B(id_tveg) = (1.d0/xv(ico))* & + ( hflx(ico) & + - href*mlc(ico) & + - href*mtr(ico) & + + (fliq(ico)*cliq8*t3ple8 - fliq(ico)*cice8*t3ple8 & + - fliq(ico)*alli8)*dqvdt(ico)) + ! A(dTv/dt ~ Tc) A(id_tveg,id_tcan) = A(id_tveg,id_tcan) + & - (hfa*gv*rhoc*cpdry8)/xv + (gv_hfa(ico)*rhoc*cpdry8)/xv(ico) ! A(dTv/dt ~ Tv) A(id_tveg,id_tveg) = A(id_tveg,id_tveg) + & - (1.d0/xv)*( (fliq*cice8 - fliq*cliq8 - cice8)*dqvdt & - - hfa*rhoc*gv*cpdry8 - (mlc+mtr)*cph2o8) - - - Y(id_tveg) = (3.d0+dtf/dtb)*ycurr%leaf_temp(ico) - & + (1.d0/xv(ico))*( (fliq(ico)*cice8 - fliq(ico)*cliq8 - cice8)*dqvdt(ico) & + - gv_hfa(ico)*rhoc*cpdry8 - (mlc(ico)+mtr(ico))*cph2o8) + + Y(id_tveg) = (3.d0+dtf/dtb)*ycurr%wood_temp(ico) - & (dtf/dtb)*yprev%wood_temp(ico) + & 2.d0*B(id_tveg)*dtf end if - - end do end if @@ -374,7 +458,6 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ynext%can_temp = Y(1) ynext%can_enthalpy = (1.d0-qc)*cpdry8*Y(1) + qc*(href + cph2o8*Y(1)) - ! ------------------------------------------------------------------------! ! Note: Significant assumption being made here. The partial derivative ! ! of the leaf and wood temperature assumed that phase was constant. ! @@ -391,97 +474,168 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ! ------------------------------------------------------------------------! qwflxlc_tot = 0.d0 + qwflxwc_tot = 0.d0 qtransp_tot = 0.d0 hflxlc_tot = 0.d0 + hflxwc_tot = 0.d0 id_tveg=1 - do ico=1,cpatch%ncohorts - if (ycurr%leaf_resolvable(ico)) then - - id_tveg=id_tveg+1 - - ynext%leaf_temp(ico) = Y(id_tveg) - if(ynext%leaf_temp(ico) < t3ple8) then - ynext%leaf_fliq(ico) = 0.d0 - ynext%leaf_energy(ico) = & - ynext%leaf_water(ico)*cice8*ynext%leaf_temp(ico) +& - ynext%leaf_temp(ico)*ycurr%leaf_hcap(ico) - else - ynext%leaf_fliq(ico) = 1.d0 - ynext%leaf_energy(ico) = ynext%leaf_temp(ico)* & - (ycurr%leaf_hcap(ico)+ynext%leaf_water(ico)*cliq8) - & - ynext%leaf_water(ico)*cliq8*tsupercool_liq8 - end if - - ! Back calculate the latent and sensible heat fluxes of leaves - ! ======================================================================== - - ! First calculate the effective qflxlc - qwflxlc = ycurr%wflxlc(ico)*tq2enthalpy8(ycurr%leaf_temp(ico),1.d0,.true.) - - ! Then effective transpiraiton - qtransp = ycurr%wflxtr(ico)*tq2enthalpy8(ycurr%leaf_temp(ico),1.d0,.true.) - - ! Use the resulting change in leaf energy to back-caculate what heat - ! flux would had been - hflxlc = ycurr%hflx_lrsti(ico) - qwflxlc - qtransp - & - (ynext%leaf_energy(ico)-ycurr%leaf_energy(ico))/dtf - - qwflxlc_tot = qwflxlc_tot + qwflxlc - qtransp_tot = qtransp_tot + qtransp - hflxlc_tot = hflxlc_tot + hflxlc - - end if - end do - if( id_tveg < nstate) then + select case(ibranch_thermo) + case(0,2) do ico=1,cpatch%ncohorts - if (ycurr%wood_resolvable(ico)) then - + if (resolve(ico)) then id_tveg=id_tveg+1 + ynext%leaf_temp(ico) = Y(id_tveg) + + if(ynext%leaf_temp(ico) < t3ple8) then + ynext%leaf_fliq(ico) = 0.d0 + ynext%leaf_energy(ico) = & + ynext%leaf_water(ico)*cice8*ynext%leaf_temp(ico) +& + ynext%leaf_temp(ico)*ycurr%leaf_hcap(ico) + else + ynext%leaf_fliq(ico) = 1.d0 + ynext%leaf_energy(ico) = ynext%leaf_temp(ico)* & + (ycurr%leaf_hcap(ico)+ynext%leaf_water(ico)*cliq8) - & + ynext%leaf_water(ico)*cliq8*tsupercool_liq8 + end if + + ! Back calculate the latent and sensible heat fluxes of leaves + ! ======================================================================== + + ! First calculate the effective qflxlc + qwflxlc = ycurr%wflxlc(ico)*tq2enthalpy8(ycurr%leaf_temp(ico),1.d0,.true.) + + ! Then effective transpiraiton + qtransp = ycurr%wflxtr(ico)*tq2enthalpy8(ycurr%leaf_temp(ico),1.d0,.true.) + + ! Use the resulting change in leaf energy to back-caculate what heat + ! flux would had been + hflxlc = ycurr%hflx_lrsti(ico) - qwflxlc - qtransp - & + (ynext%leaf_energy(ico)-ycurr%leaf_energy(ico))/dtf + + qwflxlc_tot = qwflxlc_tot + qwflxlc + qtransp_tot = qtransp_tot + qtransp + hflxlc_tot = hflxlc_tot + hflxlc + end if + end do + + if(ibranch_thermo.eq.2) then + do ico=1,cpatch%ncohorts + if (ycurr%wood_resolvable(ico)) then + id_tveg=id_tveg+1 + ynext%wood_temp(ico) = Y(id_tveg) + if(ynext%wood_temp(ico) < t3ple8) then + ynext%wood_fliq(ico) = 0.d0 + ynext%wood_energy(ico) = & + ynext%wood_water(ico)*cice8*ynext%wood_temp(ico) +& + ynext%wood_temp(ico)*ycurr%wood_hcap(ico) + else + ynext%wood_fliq(ico) = 1.d0 + + ynext%wood_energy(ico) = ynext%wood_temp(ico)* & + (ycurr%wood_hcap(ico)+ynext%wood_water(ico)*cliq8) - & + ynext%wood_water(ico)*cliq8*tsupercool_liq8 + end if + + ! Back calculate the latent and sensible heat fluxes of wood + ! ======================================================================== + qwflxwc = ycurr%wflxwc(ico)*tq2enthalpy8(ycurr%wood_temp(ico),1.d0,.true.) + + hflxwc = ycurr%hflx_wrsti(ico) - qwflxwc - & + (ynext%wood_energy(ico)-ycurr%wood_energy(ico))/dtf + + qwflxwc_tot = qwflxwc_tot + qwflxwc + hflxwc_tot = hflxwc_tot + hflxwc + end if !(if(wood_resolvable)) + end do + end if + + case(1) !select(ibranch_thermo) + +! print*,"" + + do ico=1,cpatch%ncohorts + if (resolve(ico)) then + + id_tveg=id_tveg+1 + + ! Update with the new temperature + ynext%leaf_temp(ico) = Y(id_tveg) ynext%wood_temp(ico) = Y(id_tveg) - if(ynext%wood_temp(ico) < t3ple8) then + + if(ynext%leaf_temp(ico) < t3ple8) then + ynext%leaf_fliq(ico) = 0.d0 ynext%wood_fliq(ico) = 0.d0 - ynext%wood_energy(ico) = & - ynext%wood_water(ico)*cice8*ynext%wood_temp(ico) +& - ynext%wood_temp(ico)*ycurr%wood_hcap(ico) else + ynext%leaf_fliq(ico) = 1.d0 ynext%wood_fliq(ico) = 1.d0 - ynext%wood_energy(ico) = ynext%wood_temp(ico)* & - (ycurr%wood_hcap(ico)+ynext%wood_water(ico)*cliq8) - & - ynext%wood_water(ico)*cliq8*tsupercool_liq8 end if - ! Back calculate the latent and sensible heat fluxes of leaves ! ======================================================================== - - ! First calculate the effective qflxwc - qwflxwc = ycurr%wflxwc(ico)*tq2enthalpy8(ycurr%wood_temp(ico),1.d0,.true.) - - ! Use the resulting change in wood energy to back-caculate what heat - ! flux would had been - hflxwc = ycurr%hflx_wrsti(ico) - qwflxwc - & - (ynext%wood_energy(ico)-ycurr%wood_energy(ico))/dtf - qwflxwc_tot = qwflxwc_tot + qwflxwc - hflxwc_tot = hflxwc_tot + hflxwc + ynext%veg_energy(ico) = 0.0 + ynext%wood_energy(ico) = 0.0 + ynext%leaf_energy(ico) = 0.0 + + if (ycurr%leaf_resolvable(ico) .or. ycurr%wood_resolvable(ico)) then + + ynext%leaf_energy(ico) = cmtl2uext8( & + ycurr%leaf_hcap (ico), & + ynext%leaf_water(ico), & + ynext%leaf_temp (ico), & + ynext%leaf_fliq (ico) ) + + ynext%veg_energy(ico)=ynext%leaf_energy(ico) + + qwflxlc = ycurr%wflxlc(ico) * & + tq2enthalpy8(ycurr%leaf_temp(ico),1.d0,.true.) + + hflxlc = ycurr%hflx_lrsti(ico) - qwflxlc - & + (ynext%leaf_energy(ico)-ycurr%leaf_energy(ico))/dtf + + qwflxlc_tot = qwflxlc_tot + qwflxlc + hflxlc_tot = hflxlc_tot + hflxlc + + ynext%wood_energy(ico) = cmtl2uext8( & + ycurr%wood_hcap (ico), & + ynext%wood_water(ico), & + ynext%wood_temp (ico), & + ynext%wood_fliq (ico) ) + + ynext%veg_energy(ico) = ynext%veg_energy(ico)+ & + ynext%wood_energy(ico) + + qwflxwc = ycurr%wflxwc(ico) * & + tq2enthalpy8(ycurr%wood_temp(ico),1.d0,.true.) + + hflxwc = ycurr%hflx_wrsti(ico) - qwflxwc - & + (ynext%wood_energy(ico)-ycurr%wood_energy(ico))/dtf + + qwflxwc_tot = qwflxwc_tot + qwflxwc + hflxwc_tot = hflxwc_tot + hflxwc + end if + ! How does the temperature of the vegetation derived from + ! its energy compare? - end if - end do - end if - + call uextcm2tl8(ynext%veg_energy(ico),ynext%veg_water(ico) & + ,ycurr%veg_hcap(ico),veg_temp,fliq(ico)) - !!!! =========================================================== - !!!! THIS SCHEME IS NOT UPDATING PRINT DETAILED FLUXES BETWEEN - !!!! LEAVES/WOOD WITH CANOPY AIR - !!!! =========================================================== + if(abs(veg_temp-ynext%leaf_temp(ico))>1d-10)then + print*,"ISSUE IN ENERGY CONSERVATION,BDF2" + stop + end if + + end if + end do + end select ! Update eulerian based budget fluxes @@ -493,12 +647,12 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) eflxac = hcapcan*(ynext%can_enthalpy-ycurr%can_enthalpy)/dtf - & (dydt%avg_sensible_gc + qwflxgc + & hflxlc_tot + qwflxlc_tot + qtransp_tot + hflxwc_tot + qwflxwc_tot) - + +! print*,hflxlc_tot,qwflxlc_tot,qtransp_tot,hflxwc_tot,qwflxwc_tot qwflxac = ycurr%wflxac * tq2enthalpy8(0.5*(ycurr%can_temp+Ta),1.d0,.true.) hflxac = eflxac-qwflxac - if(checkbudget)then @@ -506,7 +660,6 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ynext%ebudget_loss2atm = ynext%ebudget_loss2atm - & dydt%ebudget_loss2atm*dtf - ! Add the new integration dydt%ebudget_loss2atm = -eflxac ynext%ebudget_loss2atm = ynext%ebudget_loss2atm - eflxac*dtf @@ -519,7 +672,6 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ynext%avg_sensible_ac = ynext%avg_sensible_ac - dydt%avg_sensible_ac*dtf ynext%avg_sensible_ac = ynext%avg_sensible_ac + (hflxac)*dtf - end if @@ -539,6 +691,8 @@ subroutine bdf2_solver(cpatch,yprev,ycurr,ynext,dydt,nstate,dtf,dtb) ynext%tpwp = ynext%tpwp -(hflxac/(rhoc*ycurr%can_exner))*dtf + ! Free memory + deallocate(Y,Yf,A,B) return diff --git a/ED/src/dynamics/canopy_struct_dynamics.f90 b/ED/src/dynamics/canopy_struct_dynamics.f90 index d6cd4916e..bc854c864 100644 --- a/ED/src/dynamics/canopy_struct_dynamics.f90 +++ b/ED/src/dynamics/canopy_struct_dynamics.f90 @@ -143,8 +143,7 @@ subroutine canopy_turbulence(cpoly,isi,ipa) , extheta2temp & ! function , tq2enthalpy ! ! function use allometry , only : h2crownbh & ! function - , size2bl & ! function - , dbh2bl ! ! function + , size2bl ! ! function use ed_misc_coms , only : igrass ! ! intent(in) use phenology_coms , only : elongf_min ! ! intent(in) @@ -775,14 +774,13 @@ subroutine canopy_turbulence(cpoly,isi,ipa) !------ Estimate WAI. ------------------------------------------------------! - if (is_grass(ipft) .and. igrass==1) then - !--use actual leaf mass for grass - waiuse = 0.10 * cpatch%nplant(ico) * cpatch%sla(ico) & - * cpatch%bleaf(ico) + if (is_grass(ipft) .and. igrass == 1) then + !---- Use actual leaf mass for new grasses. -----------------------------! + waiuse = 0.10 * cpatch%nplant(ico) * cpatch%sla(ico) * cpatch%bleaf(ico) else - !--use dbh for trees - waiuse = 0.10 * cpatch%nplant(ico) * cpatch%sla(ico) & - * dbh2bl(cpatch%dbh(ico),ipft) + !---- Use dbh for trees and old grasses. --------------------------------! + waiuse = 0.10 * cpatch%nplant(ico) * cpatch%sla(ico) & + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) end if !---------------------------------------------------------------------------! @@ -1404,8 +1402,7 @@ subroutine canopy_turbulence8(csite,initp,ipa) , soil_rough8 ! ! intent(in) use pft_coms , only : is_grass ! ! intent(in) use allometry , only : h2crownbh & ! function - , size2bl & ! function - , dbh2bl ! ! function + , size2bl ! ! function use ed_misc_coms , only : igrass ! ! intent(in) use phenology_coms , only : elongf_min ! ! intent(in) implicit none @@ -1973,7 +1970,7 @@ subroutine canopy_turbulence8(csite,initp,ipa) else !--use dbh for trees waiuse = 1.d-1 * initp%nplant(ico) * dble(cpatch%sla(ico)) & - * dble(dbh2bl(cpatch%dbh(ico),ipft)) + * dble(size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft)) end if !---------------------------------------------------------------------------! @@ -2045,7 +2042,8 @@ subroutine canopy_turbulence8(csite,initp,ipa) ! Dry grasses only. Create a pseudo TAI so it won't be a ! ! singularity. ! !------------------------------------------------------------------------! - tai_drygrass = dble(elongf_min * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft)) + tai_drygrass = dble( elongf_min & + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) ) ladcohort = tai_drygrass / (htopcrown - hbotcrown) !------------------------------------------------------------------------! else diff --git a/ED/src/dynamics/disturbance.f90 b/ED/src/dynamics/disturbance.f90 index dbfa8f72d..c4315838f 100644 --- a/ED/src/dynamics/disturbance.f90 +++ b/ED/src/dynamics/disturbance.f90 @@ -54,6 +54,8 @@ subroutine apply_disturbances(cgrid) , nzs ! ! intent(in) use pft_coms , only : include_pft ! ! intent(in) use allometry , only : area_indices ! ! function + use mortality , only : disturbance_mortality ! ! subroutine + use consts_coms , only : lnexp_max ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -95,6 +97,7 @@ subroutine apply_disturbances(cgrid) real :: area real :: area_fac real :: dA + real :: total_distrate real :: elim_nplant real :: elim_lai real , dimension(3) :: area_old @@ -182,6 +185,19 @@ subroutine apply_disturbances(cgrid) call initialize_disturbed_patch(csite,cpoly%met(isi)%atm_tmp,new_lu,1 & ,cpoly%lsl(isi)) end do + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Reset mortality rates due to disturbance. ! + !---------------------------------------------------------------------------! + resetdist: do ipa=1,onsp + cpatch => csite%patch(ipa) + do ico=1,cpatch%ncohorts + cpatch%mort_rate(5,ico) = 0.0 + end do + end do resetdist + !---------------------------------------------------------------------------! !----- Loop over q, the *destination* landuse type. ------------------------! new_lu_loop: do new_lu = 1, n_dist_types @@ -228,10 +244,11 @@ subroutine apply_disturbances(cgrid) ! always false for new_lu. ! !---------------------------------------------------------------------! if (ploughed .or. abandoned .or. natural .or. logged) then - dA = csite%area(ipa) & - * (1. - exp(- ( cpoly%disturbance_rates(new_lu,old_lu,isi) & - + cpoly%disturbance_memory(new_lu,old_lu,isi) ) ) ) - area = area + dA + total_distrate = cpoly%disturbance_rates (new_lu,old_lu,isi) & + + cpoly%disturbance_memory(new_lu,old_lu,isi) + total_distrate = min(lnexp_max,max(0.,total_distrate)) + dA = csite%area(ipa) * ( 1.0 - exp(- total_distrate) ) + area = area + dA end if !---------------------------------------------------------------------! @@ -314,12 +331,14 @@ subroutine apply_disturbances(cgrid) ! update the litter layer. ! !------------------------------------------------------------------! if (ploughed .or. abandoned .or. natural .or. logged) then - dA = csite%area(ipa) & - * (1. - exp(- ( cpoly%disturbance_rates(new_lu,old_lu,isi) & - + cpoly%disturbance_memory(new_lu,old_lu,isi) ) ) ) + total_distrate = cpoly%disturbance_rates (new_lu,old_lu,isi) & + + cpoly%disturbance_memory(new_lu,old_lu,isi) + total_distrate = min(lnexp_max,max(0.,total_distrate)) + dA = csite%area(ipa) * (1.0 - exp(- total_distrate)) area_fac = dA / csite%area(onsp+new_lu) - + call disturbance_mortality(csite,ipa,total_distrate,new_lu & + ,poly_dest_type,mindbh_harvest) call increment_patch_vars(csite,new_lu+onsp,ipa,area_fac) call insert_survivors(csite,new_lu+onsp,ipa,new_lu,area_fac & ,poly_dest_type,mindbh_harvest) @@ -584,9 +603,10 @@ subroutine apply_disturbances(cgrid) ! always false for new_lu. ! !---------------------------------------------------------------------! if (ploughed .or. abandoned .or. natural .or. logged) then - dA = csite%area(ipa) & - * (1. - exp(- ( cpoly%disturbance_rates(new_lu,old_lu,isi) & - + cpoly%disturbance_memory(new_lu,old_lu,isi) ))) + total_distrate = cpoly%disturbance_rates (new_lu,old_lu,isi) & + + cpoly%disturbance_memory(new_lu,old_lu,isi) + total_distrate = min(lnexp_max,max(0.,total_distrate)) + dA = csite%area(ipa) * (1.0 - exp(- total_distrate)) area = area + dA end if !---------------------------------------------------------------------! @@ -679,11 +699,14 @@ subroutine apply_disturbances(cgrid) ! update the litter layer. ! !------------------------------------------------------------------! if (ploughed) then - dA = csite%area(ipa) & - * (1. - exp(- ( cpoly%disturbance_rates(new_lu,old_lu,isi) & - + cpoly%disturbance_memory(new_lu,old_lu,isi)))) + total_distrate = cpoly%disturbance_rates (new_lu,old_lu,isi) & + + cpoly%disturbance_memory(new_lu,old_lu,isi) + total_distrate = min(lnexp_max,max(0.,total_distrate)) + dA = csite%area(ipa) * (1.0 - exp(- total_distrate)) area_fac = dA / csite%area(onsp+new_lu) + call disturbance_mortality(csite,ipa,total_distrate,new_lu & + ,poly_dest_type,mindbh_harvest) call increment_patch_vars(csite,new_lu+onsp,ipa,area_fac) call accum_dist_litt(csite,new_lu+onsp,ipa,new_lu,area_fac & ,poly_dest_type,mindbh_harvest) @@ -693,12 +716,16 @@ subroutine apply_disturbances(cgrid) else if(abandoned .or. natural .or. logged)then do ipft=1,mypfts i = (new_lu-2)*mypfts+1+ipft - dA = csite%area(ipa) & - * (1. - exp(-(cpoly%disturbance_rates(new_lu,old_lu,isi) & - + cpoly%disturbance_memory(new_lu,old_lu,isi)))) - dA = dA / real(mypfts) + total_distrate = cpoly%disturbance_rates (new_lu,old_lu,isi) & + + cpoly%disturbance_memory(new_lu,old_lu,isi) + total_distrate = min(lnexp_max,max(0.,total_distrate)) + dA = csite%area(ipa) & + * (1.0 - exp(- total_distrate)) + dA = dA / real(mypfts) area_fac = dA / csite%area(onsp+i) + call disturbance_mortality(csite,ipa,total_distrate,new_lu & + ,poly_dest_type,mindbh_harvest) call increment_patch_vars(csite,onsp+i,ipa,area_fac) call accum_dist_litt(csite,onsp+i,ipa,new_lu,area_fac & ,poly_dest_type,mindbh_harvest) @@ -1061,7 +1088,7 @@ subroutine site_disturbance_rates(month, year, cgrid) !------------------------------------------------------------------------------! ! Agriculture to secondary land (1 => 2). Here we also account for ! ! transitions to primary land due to abandonment. In ED definition, a land ! - ! can is considered primary only when the last disturbance. ! + ! is considered primary only when the last disturbance was natural. ! !------------------------------------------------------------------------------! cpoly%disturbance_rates(2,1,isi) = clutime%landuse(8) + clutime%landuse(10) & + clutime%landuse(3) + clutime%landuse(6) @@ -1092,14 +1119,14 @@ subroutine site_disturbance_rates(month, year, cgrid) !------------------------------------------------------------------------! ! If this patch is secondary and mature, compute the weighted aver- ! - ! age of the probability of harvest, using the number of plants as the ! - ! weight. ! + ! age of the probability of harvest, using the basal area as the weight. ! !------------------------------------------------------------------------! if (mature_plantation .or. mature_secondary) then cohortloop: do ico=1,cpatch%ncohorts ipft = cpatch%pft(ico) if (cpatch%dbh(ico) >= cpoly%mindbh_secondary(ipft,isi)) then - weight = cpatch%nplant(ico) * csite%area(ipa) + weight = cpatch%nplant(ico) * cpatch%basarea(ico) & + * csite%area(ipa) pharvest = pharvest & + cpoly%probharv_secondary(ipft,isi) * weight sumweight = sumweight + weight @@ -1114,7 +1141,8 @@ subroutine site_disturbance_rates(month, year, cgrid) end if end do patchloop end if - cpoly%disturbance_rates(2,2,isi) = -0.5 * log(1.0 - pharvest) + !----- Convert the probability into disturbance rate. -------------------------# + cpoly%disturbance_rates(2,2,isi) = - log(1.0 - pharvest) !------------------------------------------------------------------------------! @@ -1220,6 +1248,7 @@ subroutine initialize_disturbed_patch(csite,atm_tmp,np,dp,lsl) csite%can_depth (np) = 0.0 csite%can_theta (np) = 0.0 csite%can_theiv (np) = 0.0 + csite%can_vpdef (np) = 0.0 csite%can_prss (np) = 0.0 csite%can_shv (np) = 0.0 csite%can_co2 (np) = 0.0 @@ -1280,6 +1309,7 @@ subroutine normal_patch_vars(csite,ipa, area_fac) csite%sum_chd (ipa) = csite%sum_chd (ipa) * area_fac csite%can_theta (ipa) = csite%can_theta (ipa) * area_fac csite%can_theiv (ipa) = csite%can_theiv (ipa) * area_fac + csite%can_vpdef (ipa) = csite%can_vpdef (ipa) * area_fac csite%can_prss (ipa) = csite%can_prss (ipa) * area_fac csite%can_shv (ipa) = csite%can_shv (ipa) * area_fac csite%can_co2 (ipa) = csite%can_co2 (ipa) * area_fac @@ -1288,6 +1318,7 @@ subroutine normal_patch_vars(csite,ipa, area_fac) csite%ggveg (ipa) = csite%ggveg (ipa) * area_fac csite%rough (ipa) = csite%rough (ipa) * area_fac csite%mean_rh (ipa) = csite%mean_rh (ipa) * area_fac + csite%mean_cwd_rh (ipa) = csite%mean_cwd_rh (ipa) * area_fac csite%today_A_decomp (ipa) = csite%today_A_decomp (ipa) * area_fac csite%today_Af_decomp (ipa) = csite%today_Af_decomp (ipa) * area_fac csite%fsc_in (ipa) = csite%fsc_in (ipa) * area_fac @@ -1389,6 +1420,9 @@ subroutine increment_patch_vars(csite,np, cp, area_fac) csite%can_theiv (np) = csite%can_theiv (np) & + csite%can_theiv (cp) & * area_fac + csite%can_vpdef (np) = csite%can_vpdef (np) & + + csite%can_vpdef (cp) & + * area_fac csite%can_prss (np) = csite%can_prss (np) & + csite%can_prss (cp) & * area_fac @@ -1413,6 +1447,9 @@ subroutine increment_patch_vars(csite,np, cp, area_fac) csite%mean_rh (np) = csite%mean_rh (np) & + csite%mean_rh (cp) & * area_fac + csite%mean_cwd_rh (np) = csite%mean_cwd_rh (np) & + + csite%mean_cwd_rh (cp) & + * area_fac csite%today_A_decomp (np) = csite%today_A_decomp (np) & + csite%today_A_decomp (cp) & * area_fac @@ -1478,12 +1515,13 @@ end subroutine increment_patch_vars !---------------------------------------------------------------------------------------! subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_harvest) - use ed_state_vars, only : sitetype & ! structure - , patchtype ! ! structure - use ed_misc_coms , only : idoutput & ! intent(in) - , iqoutput & ! intent(in) - , imoutput ! ! intent(in) - use ed_max_dims , only : n_pft ! ! intent(in) + use ed_state_vars, only : sitetype & ! structure + , patchtype ! ! structure + use ed_misc_coms , only : idoutput & ! intent(in) + , iqoutput & ! intent(in) + , imoutput ! ! intent(in) + use ed_max_dims , only : n_pft ! ! intent(in) + use mortality , only : survivorship ! ! function implicit none !----- Arguments. -------------------------------------------------------------------! @@ -1516,17 +1554,22 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har allocate(tpatch) !----- Mask: flag to decide whether the cohort survived or not. ---------------------! - allocate(mask(cpatch%ncohorts)) - mask(:) = .false. + if (cpatch%ncohorts > 0) then + allocate(mask(cpatch%ncohorts)) + mask(:) = .false. - survivalloop: do ico = 1,cpatch%ncohorts - survival_fac = survivorship(q,poly_dest_type, mindbh_harvest, csite, cp, ico) & - * area_fac - n_survivors = cpatch%nplant(ico) * survival_fac + survivalloop: do ico = 1,cpatch%ncohorts + survival_fac = survivorship(q,poly_dest_type, mindbh_harvest, csite, cp, ico) & + * area_fac + n_survivors = cpatch%nplant(ico) * survival_fac + + !----- If something survived, make a new cohort. ------------------------------! + mask(ico) = n_survivors > 0.0 + end do survivalloop + end if + !------------------------------------------------------------------------------------! + - !----- If something survived, make a new cohort. ---------------------------------! - mask(ico) = n_survivors > 0.0 - end do survivalloop !------------------------------------------------------------------------------------! ! If the new patch has received survivors from a donor already, then it should ! @@ -1564,37 +1607,38 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har ! be rescaled. Variables whose units are per plant should _NOT_ be ! ! included here. ! !------------------------------------------------------------------------------! - tpatch%lai (nco) = tpatch%lai (nco) * survival_fac - tpatch%wai (nco) = tpatch%wai (nco) * survival_fac - tpatch%nplant (nco) = tpatch%nplant (nco) * survival_fac - tpatch%mean_gpp (nco) = tpatch%mean_gpp (nco) * survival_fac - tpatch%mean_leaf_resp (nco) = tpatch%mean_leaf_resp (nco) * survival_fac - tpatch%mean_root_resp (nco) = tpatch%mean_root_resp (nco) * survival_fac - tpatch%mean_growth_resp (nco) = tpatch%mean_growth_resp (nco) * survival_fac - tpatch%mean_storage_resp (nco) = tpatch%mean_storage_resp(nco) * survival_fac - tpatch%mean_vleaf_resp (nco) = tpatch%mean_vleaf_resp (nco) * survival_fac - tpatch%today_gpp (nco) = tpatch%today_gpp (nco) * survival_fac - tpatch%today_nppleaf (nco) = tpatch%today_nppleaf (nco) * survival_fac - tpatch%today_nppfroot (nco) = tpatch%today_nppfroot (nco) * survival_fac - tpatch%today_nppsapwood (nco) = tpatch%today_nppsapwood (nco) * survival_fac - tpatch%today_nppcroot (nco) = tpatch%today_nppcroot (nco) * survival_fac - tpatch%today_nppseeds (nco) = tpatch%today_nppseeds (nco) * survival_fac - tpatch%today_nppwood (nco) = tpatch%today_nppwood (nco) * survival_fac - tpatch%today_nppdaily (nco) = tpatch%today_nppdaily (nco) * survival_fac - tpatch%today_gpp_pot (nco) = tpatch%today_gpp_pot (nco) * survival_fac - tpatch%today_gpp_max (nco) = tpatch%today_gpp_max (nco) * survival_fac - tpatch%today_leaf_resp (nco) = tpatch%today_leaf_resp (nco) * survival_fac - tpatch%today_root_resp (nco) = tpatch%today_root_resp (nco) * survival_fac - tpatch%gpp (nco) = tpatch%gpp (nco) * survival_fac - tpatch%leaf_respiration (nco) = tpatch%leaf_respiration (nco) * survival_fac - tpatch%root_respiration (nco) = tpatch%root_respiration (nco) * survival_fac - tpatch%monthly_dndt (nco) = tpatch%monthly_dndt (nco) * survival_fac - tpatch%leaf_water (nco) = tpatch%leaf_water (nco) * survival_fac - tpatch%leaf_hcap (nco) = tpatch%leaf_hcap (nco) * survival_fac - tpatch%leaf_energy (nco) = tpatch%leaf_energy (nco) * survival_fac - tpatch%wood_water (nco) = tpatch%wood_water (nco) * survival_fac - tpatch%wood_hcap (nco) = tpatch%wood_hcap (nco) * survival_fac - tpatch%wood_energy (nco) = tpatch%wood_energy (nco) * survival_fac + tpatch%lai (nco) = tpatch%lai (nco) * survival_fac + tpatch%wai (nco) = tpatch%wai (nco) * survival_fac + tpatch%nplant (nco) = tpatch%nplant (nco) * survival_fac + tpatch%mean_gpp (nco) = tpatch%mean_gpp (nco) * survival_fac + tpatch%mean_leaf_resp (nco) = tpatch%mean_leaf_resp (nco) * survival_fac + tpatch%mean_root_resp (nco) = tpatch%mean_root_resp (nco) * survival_fac + tpatch%mean_growth_resp (nco) = tpatch%mean_growth_resp (nco) * survival_fac + tpatch%mean_storage_resp (nco) = tpatch%mean_storage_resp (nco) * survival_fac + tpatch%mean_vleaf_resp (nco) = tpatch%mean_vleaf_resp (nco) * survival_fac + tpatch%today_gpp (nco) = tpatch%today_gpp (nco) * survival_fac + tpatch%today_nppleaf (nco) = tpatch%today_nppleaf (nco) * survival_fac + tpatch%today_nppfroot (nco) = tpatch%today_nppfroot (nco) * survival_fac + tpatch%today_nppsapwood (nco) = tpatch%today_nppsapwood (nco) * survival_fac + tpatch%today_nppcroot (nco) = tpatch%today_nppcroot (nco) * survival_fac + tpatch%today_nppseeds (nco) = tpatch%today_nppseeds (nco) * survival_fac + tpatch%today_nppwood (nco) = tpatch%today_nppwood (nco) * survival_fac + tpatch%today_nppdaily (nco) = tpatch%today_nppdaily (nco) * survival_fac + tpatch%today_gpp_pot (nco) = tpatch%today_gpp_pot (nco) * survival_fac + tpatch%today_gpp_lightmax (nco) = tpatch%today_gpp_lightmax(nco) * survival_fac + tpatch%today_gpp_moistmax (nco) = tpatch%today_gpp_moistmax(nco) * survival_fac + tpatch%today_leaf_resp (nco) = tpatch%today_leaf_resp (nco) * survival_fac + tpatch%today_root_resp (nco) = tpatch%today_root_resp (nco) * survival_fac + tpatch%gpp (nco) = tpatch%gpp (nco) * survival_fac + tpatch%leaf_respiration (nco) = tpatch%leaf_respiration (nco) * survival_fac + tpatch%root_respiration (nco) = tpatch%root_respiration (nco) * survival_fac + tpatch%monthly_dndt (nco) = tpatch%monthly_dndt (nco) * survival_fac + tpatch%leaf_water (nco) = tpatch%leaf_water (nco) * survival_fac + tpatch%leaf_hcap (nco) = tpatch%leaf_hcap (nco) * survival_fac + tpatch%leaf_energy (nco) = tpatch%leaf_energy (nco) * survival_fac + tpatch%wood_water (nco) = tpatch%wood_water (nco) * survival_fac + tpatch%wood_hcap (nco) = tpatch%wood_hcap (nco) * survival_fac + tpatch%wood_energy (nco) = tpatch%wood_energy (nco) * survival_fac !----- Crown area shall not exceed 1. -----------------------------------------! tpatch%crown_area (nco) = min(1.,tpatch%crown_area(nco) * survival_fac) !----- Carbon flux monthly means are extensive, we must convert them. ---------! @@ -1616,6 +1660,9 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har tpatch%qmean_par_l_diff(:,nco) = tpatch%qmean_par_l_diff (:,nco) & * survival_fac end if + + !----- Make mortality rate due to disturbance zero to avoid double counting. --! + tpatch%mort_rate(5,nco) = 0.0 end if end do cohortloop @@ -1625,7 +1672,7 @@ subroutine insert_survivors(csite, np, cp, q, area_fac,poly_dest_type,mindbh_har call deallocate_patchtype(tpatch) deallocate(tpatch) - deallocate(mask) + if (allocated(mask)) deallocate(mask) return @@ -1655,6 +1702,7 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,poly_dest_type,mindbh_harvest) , l2n_stem ! ! intent(in) use pft_coms , only : agf_bs ! ! intent(in) use grid_coms , only : nzg ! ! intent(in) + use mortality , only : survivorship ! ! function implicit none !----- Arguments. -------------------------------------------------------------------! @@ -1676,6 +1724,7 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,poly_dest_type,mindbh_harvest) real :: struct_lignin real :: fast_litter_n real :: struct_cohort + real :: survival_fac !------------------------------------------------------------------------------------! !---- Initialise the non-scaled litter pools. ---------------------------------------! @@ -1707,19 +1756,22 @@ subroutine accum_dist_litt(csite,np,cp,q,area_fac,poly_dest_type,mindbh_harvest) end select !---------------------------------------------------------------------------------! + !----- Find survivorship only once. ----------------------------------------------! + survival_fac = survivorship(q,poly_dest_type,mindbh_harvest,csite,cp,ico) + fast_litter = fast_litter & - + (1. - survivorship(q,poly_dest_type,mindbh_harvest,csite,cp,ico)) & + + (1. - survival_fac) & * ( f_labile(ipft) * cpatch%balive(ico) + cpatch%bstorage(ico)) & * cpatch%nplant(ico) fast_litter_n = fast_litter_n & - + (1. - survivorship(q,poly_dest_type,mindbh_harvest,csite,cp,ico)) & + + (1. - survival_fac) & * ( f_labile(ipft) * cpatch%balive(ico) / c2n_leaf(ipft) & + cpatch%bstorage(ico) / c2n_storage ) & * cpatch%nplant(ico) struct_cohort = cpatch%nplant(ico) & - * (1. - survivorship(q,poly_dest_type,mindbh_harvest,csite,cp,ico)) & + * (1. - survival_fac) & * ( (1. - loss_fraction ) * cpatch%bdead(ico) & + (1. - f_labile(ipft)) * cpatch%balive(ico) ) @@ -1743,87 +1795,6 @@ end subroutine accum_dist_litt - !=======================================================================================! - !=======================================================================================! - ! This function computes the survivorship rate after some disturbance happens. ! - !---------------------------------------------------------------------------------------! - real function survivorship(dest_type,poly_dest_type,mindbh_harvest,csite,ipa,ico) - use ed_state_vars, only : patchtype & ! structure - , sitetype ! ! structure - use disturb_coms , only : treefall_hite_threshold ! ! intent(in) - use pft_coms , only : treefall_s_ltht & ! intent(in) - , treefall_s_gtht ! ! intent(in) - use ed_max_dims , only : n_pft ! ! intent(in) - - implicit none - !----- Arguments. -------------------------------------------------------------------! - type(sitetype) , target :: csite - real , dimension(n_pft), intent(in) :: mindbh_harvest - integer , intent(in) :: ico - integer , intent(in) :: ipa - integer , intent(in) :: dest_type - integer , intent(in) :: poly_dest_type - !----- Local variables. -------------------------------------------------------------! - type(patchtype) , pointer :: cpatch - integer :: ipft - !------------------------------------------------------------------------------------! - - - cpatch => csite%patch(ipa) - ipft = cpatch%pft(ico) - - !----- Base the survivorship rates on the destination type. -------------------------! - select case(dest_type) - case (1) !----- Agriculture/cropland. -----------------------------------------------! - survivorship = 0.0 - - case (2) !----- Secondary land or forest plantation. --------------------------------! - - !----- Decide the fate based on the type of secondary disturbance. ---------------! - select case (poly_dest_type) - case (0) !----- Land abandonment, assume this is the last harvest. ---------------! - survivorship = 0.0 - case (1) !----- Biomass logging, assume that nothing stays. ----------------------! - survivorship = 0.0 - case (2) !----- Selective logging. -----------------------------------------------! - !------------------------------------------------------------------------------! - ! If the PFT DBH exceeds the minimum PFT for harvesting, the survivorship ! - ! should be zero, otherwise, we assume survivorship similar to the treefall ! - ! disturbance rate for short trees. ! - !------------------------------------------------------------------------------! - if (cpatch%dbh(ico) >= mindbh_harvest(ipft)) then - survivorship = 0.0 - else - survivorship = treefall_s_ltht(ipft) - end if - end select - - case (3) !----- Primary land. -------------------------------------------------------! - - !----- Decide the fate based on the type of natural disturbance. -----------------! - select case (poly_dest_type) - case (0) !----- Treefall, we must check the cohort height. -----------------------! - if (cpatch%hite(ico) < treefall_hite_threshold) then - survivorship = treefall_s_ltht(ipft) - else - survivorship = treefall_s_gtht(ipft) - end if - - case (1) !----- Fire, no survival. -----------------------------------------------! - survivorship = 0.0 - end select - end select - - return - end function survivorship - !=======================================================================================! - !=======================================================================================! - - - - - - !=======================================================================================! !=======================================================================================! ! Add a cohort of the appropriate PFT type to populate a plantation/cropland/pasture ! @@ -1836,8 +1807,11 @@ 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) - use ed_misc_coms , only : dtlsm ! ! intent(in) + , hgt_min & ! intent(in) + , hgt_max & ! intent(in) + , dbh_bigleaf ! ! intent(in) + use ed_misc_coms , only : dtlsm & ! intent(in) + , ibigleaf ! ! intent(in) use fuse_fiss_utils, only : sort_cohorts ! ! sub-routine use ed_therm_lib , only : calc_veg_hcap ! ! function use consts_coms , only : t3ple & ! intent(in) @@ -1905,17 +1879,38 @@ subroutine plant_patch(csite,np,mzg,pft,density,ntext_soil,green_leaf_factor !------------------------------------------------------------------------------------! cpatch%pft(nc) = pft cpatch%nplant(nc) = density - cpatch%hite(nc) = hgt_min(cpatch%pft(nc)) * min(1.0,height_factor) + select case (ibigleaf) + case (0) + !---------------------------------------------------------------------------------! + ! SAS approximation, assign height and use it to find DBH and the structural ! + ! (dead) biomass. ! + !---------------------------------------------------------------------------------! + cpatch%hite (nc) = hgt_min(cpatch%pft(nc)) * min(1.0,height_factor) + cpatch%dbh (nc) = h2dbh(cpatch%hite(nc),cpatch%pft(nc)) + cpatch%bdead(nc) = dbh2bd(cpatch%dbh(nc),cpatch%pft(nc)) + !---------------------------------------------------------------------------------! + + case (1) + !---------------------------------------------------------------------------------! + ! Big leaf approximation, assign the typical DBH and height and use them to ! + ! find height and the structural (dead) biomass. ! + !---------------------------------------------------------------------------------! + cpatch%hite (nc) = hgt_max(cpatch%pft(nc)) + cpatch%dbh (nc) = dbh_bigleaf(cpatch%pft(nc)) + cpatch%bdead(nc) = dbh2bd(cpatch%dbh(nc),cpatch%pft(nc)) + !---------------------------------------------------------------------------------! + end select !------------------------------------------------------------------------------------! + + + !----- Initialise other cohort-level variables. -------------------------------------! call init_ed_cohort_vars(cpatch, nc, lsl) + !------------------------------------------------------------------------------------! - !----- Find DBH and the maximum leaf biomass. ---------------------------------------! - cpatch%dbh(nc) = h2dbh(cpatch%hite(nc),cpatch%pft(nc)) - cpatch%bdead(nc) = dbh2bd(cpatch%dbh(nc),cpatch%pft(nc)) !------------------------------------------------------------------------------------! ! Initialise the active and storage biomass scaled by the leaf drought ! @@ -1942,27 +1937,28 @@ subroutine plant_patch(csite,np,mzg,pft,density,ntext_soil,green_leaf_factor !----- Find the new basal area and above-ground biomass. ----------------------------! cpatch%basarea(nc)= pio4 * cpatch%dbh(nc) * cpatch%dbh(nc) - cpatch%agb(nc) = ed_biomass(cpatch%bdead(nc),cpatch%bleaf(nc),cpatch%bsapwooda(nc)& - ,cpatch%pft(nc)) - - cpatch%leaf_temp(nc) = csite%can_temp(np) - cpatch%leaf_temp_pv(nc)=csite%can_temp(np) - cpatch%leaf_water(nc) = 0.0 - cpatch%leaf_fliq(nc) = 0.0 - cpatch%wood_temp(nc) = csite%can_temp(np) - cpatch%wood_temp_pv(nc)=csite%can_temp(np) - cpatch%wood_water(nc) = 0.0 - cpatch%wood_fliq(nc) = 0.0 + cpatch%agb(nc) = ed_biomass(cpatch%bdead(nc),cpatch%bleaf(nc) & + ,cpatch%bsapwooda(nc),cpatch%pft(nc)) + + cpatch%leaf_temp (nc) = csite%can_temp (np) + cpatch%leaf_temp_pv (nc) = csite%can_temp (np) + cpatch%leaf_water (nc) = 0.0 + cpatch%leaf_vpdef (nc) = csite%can_vpdef (np) + cpatch%leaf_fliq (nc) = 0.0 + cpatch%wood_temp (nc) = csite%can_temp (np) + cpatch%wood_temp_pv (nc) = csite%can_temp (np) + cpatch%wood_water (nc) = 0.0 + cpatch%wood_fliq (nc) = 0.0 !----- Because we assigned no water, the internal energy is simply hcap*T. ----------! - call calc_veg_hcap(cpatch%bleaf(nc),cpatch%bdead(nc),cpatch%bsapwooda(nc) & + call calc_veg_hcap(cpatch%bleaf(nc),cpatch%bdead(nc),cpatch%bsapwooda(nc) & ,cpatch%nplant(nc),cpatch%pft(nc) & ,cpatch%leaf_hcap(nc),cpatch%wood_hcap(nc)) cpatch%leaf_energy(nc) = cpatch%leaf_hcap(nc) * cpatch%leaf_temp(nc) cpatch%wood_energy(nc) = cpatch%wood_hcap(nc) * cpatch%wood_temp(nc) - call is_resolvable(csite,np,nc,green_leaf_factor) + call is_resolvable(csite,np,nc) !----- Should plantations be considered recruits? -----------------------------------! cpatch%new_recruit_flag(nc) = 1 diff --git a/ED/src/dynamics/euler_driver.f90 b/ED/src/dynamics/euler_driver.f90 index b798f24e0..cfaebf24e 100644 --- a/ED/src/dynamics/euler_driver.f90 +++ b/ED/src/dynamics/euler_driver.f90 @@ -119,11 +119,12 @@ subroutine euler_timestep(cgrid) !------------------------------------------------------------------------------! call copy_met_2_rk4site(nzg,csite%can_theta(ipa),csite%can_shv(ipa) & ,csite%can_depth(ipa),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%par_beam & - ,cmet%par_diffuse,cmet%nir_beam,cmet%nir_diffuse & - ,cmet%geoht,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & + ,cmet%atm_vpdef,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%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 cfeb49cbb..91c1d792c 100644 --- a/ED/src/dynamics/events.f90 +++ b/ED/src/dynamics/events.f90 @@ -425,7 +425,7 @@ subroutine event_harvest(agb_frac8,bgb_frac8,fol_frac8,stor_frac8) call update_veg_energy_cweh(csite,ipa,ico,old_leaf_hcap,old_wood_hcap) !----- Update flags telling whether leaves and branches can be solved. ---! - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) enddo @@ -771,6 +771,7 @@ subroutine event_till(rval8) cpatch%leaf_water(ico) = 0.0 cpatch%leaf_fliq(ico) = 0.0 cpatch%leaf_temp(ico) = csite%can_temp(ipa) + cpatch%leaf_vpdef(ico) = csite%can_vpdef(ipa) cpatch%wood_water(ico) = 0.0 cpatch%wood_fliq(ico) = 0.0 cpatch%wood_temp(ico) = csite%can_temp(ipa) @@ -820,7 +821,7 @@ end subroutine event_till !!$ cpatch%hite(ico) = hgt_min(pft) !!$ cpatch%dbh(ico) = h2dbh(hgt_min(pft),pft) !!$ cpatch%bdead(ico) = dbh2bd(cpatch%dbh(ico),pft) -!!$ cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),pft) +!!$ cpatch%bleaf(ico) = size2bl(cpatch%dbh(ico),cpatch%hite(ico),pft) !!$print*,cpatch%hite(ico),cpatch%dbh(ico),cpatch%bdead(ico),cpatch%bleaf(ico) !!$ cpatch%phenology_status(ico) = 0 !!$ cpatch%balive(ico) = cpatch%bleaf(ico)* & diff --git a/ED/src/dynamics/fire.f90 b/ED/src/dynamics/fire.f90 index f61b8db04..8506a01df 100644 --- a/ED/src/dynamics/fire.f90 +++ b/ED/src/dynamics/fire.f90 @@ -17,6 +17,7 @@ subroutine fire_frequency(cgrid) , dslz & ! intent(in) , dslzi ! ! intent(in) use disturb_coms , only : include_fire & ! intent(in) + , sm_fire & ! intent(in) , fire_dryness_threshold & ! intent(in) , fire_smoist_depth & ! intent(in) , k_fire_first & ! intent(in) @@ -79,6 +80,12 @@ subroutine fire_frequency(cgrid) csite%avg_monthly_gndwater(ipa) = csite%avg_monthly_gndwater(ipa) * normfac !------------------------------------------------------------------------------! + + !----- Normalise the monthly mean ground water. -------------------------------! + csite%avg_monthly_waterdef(ipa) = max(0.0,csite%avg_monthly_waterdef(ipa)) + !------------------------------------------------------------------------------! + + !----- Initialize patch fuel. -------------------------------------------------! fuel = 0.0 !------------------------------------------------------------------------------! @@ -145,51 +152,20 @@ subroutine fire_frequency(cgrid) fire_intensity = 0.0 end if !---------------------------------------------------------------------------! + case (3) !---------------------------------------------------------------------------! - ! The threshold not only determines whether fires will happen, it will ! - ! also control the fire intensity. ! + ! The threshold is independent on soil moisture. We use climatological ! + ! water deficit instead. ! !---------------------------------------------------------------------------! - fire_wmass_threshold = 0. - avg_slpot = 0. - do k = k_fire_first, nzg - nsoil = cpoly%ntext_soil(k,isi) - fire_wmass_threshold = fire_wmass_threshold & - + soil(nsoil)%soilfr * dslz(k) * wdns - end do - - if (csite%avg_monthly_gndwater(ipa) < fire_wmass_threshold) then - nsoil = cpoly%ntext_soil(nzg,isi) - !----- Find the equivalent soil moisture. -------------------------------! - avg_slmst = max( soil(nsoil)%soilcp & - , min( soil(nsoil)%slmsts & - , csite%avg_monthly_gndwater(ipa) & - / ( wdns * abs(slz(k_fire_first)) ) ) ) - !------------------------------------------------------------------------! - - - !----- Find the equivalent soil potential. ------------------------------! - avg_slpot = soil(nsoil)%slpots & - / ( avg_slmst / soil(nsoil)%slmsts ) ** soil(nsoil)%slbs - !------------------------------------------------------------------------! - - - !----- Find the scale to reduce or amplify fires. -----------------------! - fire_scale = log( avg_slpot / soil(nsoil)%slpotwp) & - / log(soil(nsoil)%slpotfr / soil(nsoil)%slpotwp) - fire_intensity = max(0.0, fire_parameter * (1.0 - fire_scale) ) - !------------------------------------------------------------------------! - + if (csite%avg_monthly_waterdef(ipa) > sm_fire) then + fire_intensity = fire_parameter + mean_fire_intensity = mean_fire_intensity & + + fire_intensity * csite%area(ipa) else - fire_intensity = 0.0 + fire_intensity = 0.0 end if !---------------------------------------------------------------------------! - - !---------------------------------------------------------------------------! - ! Find the contribution of this patch to fires. ! - !---------------------------------------------------------------------------! - mean_fire_intensity = mean_fire_intensity + fire_intensity * csite%area(ipa) - !---------------------------------------------------------------------------! end select !------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/forestry.f90 b/ED/src/dynamics/forestry.f90 index 28fae0685..bd7252a32 100644 --- a/ED/src/dynamics/forestry.f90 +++ b/ED/src/dynamics/forestry.f90 @@ -91,8 +91,12 @@ subroutine apply_forestry(cpoly, isi, year) end if end do find_lu_year else + write(unit=*,fmt='(a,1x,i6)') ' YEAR =',year + write(unit=*,fmt='(a,1x,i6)') ' USEYEAR =',useyear + write(unit=*,fmt='(a,1x,i6)') ' LANDUSE_YEAR =',cpoly%clutimes(1,isi)%landuse_year + write(unit=*,fmt='(a,1x,i6)') ' NUM_YEARS =',cpoly%num_landuse_years(isi) call fatal_error('Invalid initial year when using land-use disturbance' & - &,'apply_forestry','forestry.f90') + ,'apply_forestry','forestry.f90') end if clutime => cpoly%clutimes(useyear,isi) @@ -757,6 +761,7 @@ subroutine norm_harv_patch(csite,newp) csite%sum_chd(newp) = csite%sum_chd(newp) * area_fac csite%can_theta(newp) = csite%can_theta(newp) * area_fac csite%can_theiv(newp) = csite%can_theiv(newp) * area_fac + csite%can_vpdef(newp) = csite%can_vpdef(newp) * area_fac csite%can_prss(newp) = csite%can_prss(newp) * area_fac csite%can_co2(newp) = csite%can_co2(newp) * area_fac csite%can_shv(newp) = csite%can_shv(newp) * area_fac @@ -765,6 +770,7 @@ subroutine norm_harv_patch(csite,newp) csite%ggveg(newp) = csite%ggveg(newp) * area_fac csite%rough(newp) = csite%rough(newp) * area_fac csite%mean_rh(newp) = csite%mean_rh(newp) * area_fac + csite%mean_cwd_rh(newp) = csite%mean_cwd_rh(newp) * area_fac csite%today_A_decomp(newp) = csite%today_A_decomp(newp) * area_fac csite%today_Af_decomp(newp) = csite%today_Af_decomp(newp) * area_fac csite%repro(1:n_pft,newp) = csite%repro(1:n_pft,newp) * area_fac diff --git a/ED/src/dynamics/growth_balive.f90 b/ED/src/dynamics/growth_balive.f90 index 482f30c3f..a510236ce 100644 --- a/ED/src/dynamics/growth_balive.f90 +++ b/ED/src/dynamics/growth_balive.f90 @@ -61,10 +61,12 @@ subroutine dbalive_dt(cgrid, tfact) real :: daily_C_gain real :: carbon_balance real :: carbon_balance_pot - real :: carbon_balance_max + real :: carbon_balance_lightmax + real :: carbon_balance_moistmax real :: balive_in real :: nitrogen_supply real :: dndt + real :: dlnndt real :: old_leaf_hcap real :: old_wood_hcap real :: nitrogen_uptake @@ -91,16 +93,6 @@ subroutine dbalive_dt(cgrid, tfact) !----- Alias for current PFT. -------------------------------------------! ipft = cpatch%pft(ico) - !----- Update the elongation factor. ------------------------------------! - select case (phenology(ipft)) - 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 - - !----- Initialize cohort nitrogen uptake. -------------------------------! nitrogen_uptake = 0.0 N_uptake_pot = 0.0 @@ -114,24 +106,31 @@ subroutine dbalive_dt(cgrid, tfact) !------------------------------------------------------------------------! 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%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) - cpatch%bleaf(ico) = cpatch%bleaf(ico) & - - cpatch%leaf_maintenance(ico) - cpatch%broot(ico) = cpatch%broot(ico) & - - cpatch%root_maintenance(ico) - cpatch%cb(13,ico) = cpatch%cb(13,ico) & - - cpatch%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) - cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) & - - cpatch%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) + cpatch%balive (ico) = cpatch%balive (ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + cpatch%bleaf (ico) = cpatch%bleaf (ico) & + - cpatch%leaf_maintenance (ico) + cpatch%broot (ico) = cpatch%broot (ico) & + - cpatch%root_maintenance (ico) + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! - ! Storage respriation/turnover_rate. ! + ! Storage respiration/turnover_rate. ! ! Calculate in same way as leaf and root turnover in kgC/plant/year. ! !------------------------------------------------------------------------! @@ -163,7 +162,8 @@ subroutine dbalive_dt(cgrid, tfact) ! 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) + ,carbon_balance_pot,carbon_balance_lightmax & + ,carbon_balance_moistmax) !------------------------------------------------------------------------! @@ -242,13 +242,19 @@ subroutine dbalive_dt(cgrid, tfact) !------------------------------------------------------------------------! ! Do mortality --- note that only frost mortality changes daily. ! + ! Here we do not add the 5th mortality rate (disturbance), because this ! + ! mortality creates a new patch instead of reducing the area. The 5th ! + ! mortality is for diagnostic purposes only. ! !------------------------------------------------------------------------! call mortality_rates(cpatch,ipa,ico,csite%avg_daily_temp(ipa) & ,csite%age(ipa)) - dndt = - sum(cpatch%mort_rate(:,ico)) * cpatch%nplant(ico) * tfact + dlnndt = - sum(cpatch%mort_rate(1:4,ico)) + dndt = dlnndt * cpatch%nplant(ico) + !------------------------------------------------------------------------! - !----- Update monthly mortality rate [plants/m2/month]. -----------------! - cpatch%monthly_dndt(ico) = cpatch%monthly_dndt(ico) + dndt + !----- Update monthly mortality rates [plants/m2/month and 1/month]. ----! + cpatch%monthly_dndt (ico) = cpatch%monthly_dndt (ico) + dndt * tfact + cpatch%monthly_dlnndt(ico) = cpatch%monthly_dlnndt(ico) + dlnndt * tfact !----- Updating LAI, WAI, and CAI. --------------------------------------! @@ -274,7 +280,7 @@ subroutine dbalive_dt(cgrid, tfact) ,cpatch%leaf_hcap(ico),cpatch%wood_hcap(ico)) call update_veg_energy_cweh(csite,ipa,ico,old_leaf_hcap,old_wood_hcap) !----- Update the stability status. -------------------------------------! - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) !------------------------------------------------------------------------! end do @@ -347,10 +353,10 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) real :: daily_C_gain real :: carbon_balance real :: carbon_balance_pot - real :: carbon_balance_max + real :: carbon_balance_lightmax + real :: carbon_balance_moistmax real :: balive_in real :: nitrogen_supply - real :: dndt real :: old_leaf_hcap real :: old_wood_hcap real :: nitrogen_uptake @@ -391,21 +397,18 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) !------------------------------------------------------------------------! 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%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) - cpatch%bleaf(ico) = cpatch%bleaf(ico) & - - cpatch%leaf_maintenance(ico) - cpatch%broot(ico) = cpatch%broot(ico) & - - cpatch%root_maintenance(ico) - cpatch%cb(13,ico) = cpatch%cb(13,ico) & - - cpatch%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) - cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) & - - cpatch%leaf_maintenance(ico) & - - cpatch%root_maintenance(ico) + + !------------------------------------------------------------------------! + ! For the no vegetation dynamics case, we update the carbon balance ! + ! but we do NOT update the living tissues. ! + !------------------------------------------------------------------------! + cpatch%cb_lightmax(13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + cpatch%cb_moistmax(13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_maintenance (ico) & + - cpatch%root_maintenance (ico) + !------------------------------------------------------------------------! !------------------------------------------------------------------------! ! Storage respriation/turnover_rate. ! @@ -439,7 +442,8 @@ subroutine dbalive_dt_eq_0(cgrid, tfact) ! 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) + ,carbon_balance_pot,carbon_balance_lightmax & + ,carbon_balance_moistmax) !------------------------------------------------------------------------! @@ -515,9 +519,6 @@ 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. --------------------! @@ -552,7 +553,7 @@ subroutine transfer_C_from_storage(cpatch,ico,salloc,salloci,nitrogen_uptake , agf_bs & ! intent(in) , qsw ! ! intent(in) use decomp_coms , only : f_labile ! ! intent(in) - use allometry , only : dbh2bl ! ! function + use allometry , only : size2bl ! ! function implicit none !----- Arguments. -------------------------------------------------------------------! type(patchtype), target :: cpatch @@ -577,7 +578,8 @@ subroutine transfer_C_from_storage(cpatch,ico,salloc,salloci,nitrogen_uptake ipft = cpatch%pft(ico) !----- Determine how much biomass we need to go back to allometry. ------------------! - off_allometry_cb = dbh2bl(cpatch%dbh(ico),ipft) * salloc - cpatch%balive(ico) + off_allometry_cb = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) * salloc & + - cpatch%balive(ico) !----- If plants have storage, transfer it to balive. -------------------------------! increment = max(0.0,min(max(0.0, off_allometry_cb),cpatch%bstorage(ico))) @@ -585,11 +587,11 @@ subroutine transfer_C_from_storage(cpatch,ico,salloc,salloci,nitrogen_uptake cpatch%bstorage(ico) = cpatch%bstorage(ico) - increment !----- Compute sapwood and fine root biomass. ---------------------------------------! - cpatch%broot(ico) = q(ipft) * cpatch%balive(ico) * salloci + cpatch%broot(ico) = q(ipft) * cpatch%balive(ico) * salloci cpatch%bsapwooda(ico) = qsw(ipft) * cpatch%hite(ico) * cpatch%balive(ico) * salloci & * agf_bs(ipft) cpatch%bsapwoodb(ico) = qsw(ipft) * cpatch%hite(ico) * cpatch%balive(ico) * salloci & - *(1.-agf_bs(ipft)) + * (1.-agf_bs(ipft)) !------------------------------------------------------------------------------------! ! N uptake is required since c2n_leaf < c2n_storage. Units are kgN/plant/day. ! @@ -704,13 +706,15 @@ end subroutine plant_maintenance !=======================================================================================! !=======================================================================================! subroutine plant_carbon_balances(cpatch,ipa,ico,daily_C_gain,carbon_balance & - ,carbon_balance_pot,carbon_balance_max) - use ed_state_vars, only : patchtype ! ! structure - use pft_coms , only : growth_resp_factor ! ! intent(in) - use consts_coms , only : umol_2_kgC & ! intent(in) - , day_sec ! ! intent(in) - use ed_misc_coms , only : current_time ! ! intent(in) - use ed_max_dims , only : n_pft ! ! intent(in) + ,carbon_balance_pot,carbon_balance_lightmax & + ,carbon_balance_moistmax) + use ed_state_vars , only : patchtype ! ! structure + use pft_coms , only : growth_resp_factor ! ! intent(in) + use consts_coms , only : umol_2_kgC & ! intent(in) + , day_sec ! ! intent(in) + use ed_misc_coms , only : current_time ! ! intent(in) + use ed_max_dims , only : n_pft ! ! intent(in) + use physiology_coms, only : iddmort_scheme ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! type(patchtype) , target :: cpatch @@ -719,12 +723,16 @@ subroutine plant_carbon_balances(cpatch,ipa,ico,daily_C_gain,carbon_balance real , intent(in) :: daily_C_gain real , intent(out) :: carbon_balance real , intent(out) :: carbon_balance_pot - real , intent(out) :: carbon_balance_max + real , intent(out) :: carbon_balance_lightmax + real , intent(out) :: carbon_balance_moistmax !----- Local variables. -------------------------------------------------------------! real :: daily_C_gain_pot - real :: daily_C_gain_max + real :: daily_C_gain_lightmax + real :: daily_C_gain_moistmax real :: growth_respiration_pot - real :: growth_respiration_max + real :: growth_respiration_lightmax + real :: growth_respiration_moistmax + real :: storage_offset integer :: ipft !----- Local constants. -------------------------------------------------------------! logical , parameter :: print_debug = .false. @@ -734,10 +742,35 @@ subroutine plant_carbon_balances(cpatch,ipa,ico,daily_C_gain,carbon_balance !----- Alias for PFT type. ----------------------------------------------------------! ipft = cpatch%pft(ico) + !------------------------------------------------------------------------------------! + - !------ Calculate actual daily carbon balance: kgC/plant/day. -----------------------! + !------------------------------------------------------------------------------------! + ! Compute the storage offset for carbon balance. By including this term we ! + ! make sure that plants won't start dying as soon as they shed their leaves, but ! + ! only when they are in negative carbon balance and without storage. This is done ! + ! only when iddmort_scheme is set to 1. ! + !------------------------------------------------------------------------------------! + select case (iddmort_scheme) + case (0) + !------ Storage is not accounted. ------------------------------------------------! + storage_offset = 0 + !---------------------------------------------------------------------------------! + case (1) + !------ Storage is accounted. ----------------------------------------------------! + storage_offset = cpatch%bstorage(ico) + !---------------------------------------------------------------------------------! + end select + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Calculate actual daily carbon balance: kgC/plant/day. ! + !------------------------------------------------------------------------------------! carbon_balance = daily_C_gain - cpatch%growth_respiration(ico) & - cpatch%vleaf_respiration(ico) + !------------------------------------------------------------------------------------! if (cpatch%nplant(ico) > tiny(1.0)) then @@ -752,43 +785,72 @@ subroutine plant_carbon_balances(cpatch,ipa,ico,daily_C_gain,carbon_balance growth_respiration_pot = max(0.0, daily_C_gain_pot * growth_resp_factor(ipft)) carbon_balance_pot = daily_C_gain_pot - growth_respiration_pot & - cpatch%vleaf_respiration(ico) + !---------------------------------------------------------------------------------! - !----- Calculate maximum carbon balance (used for mortality). --------------------! - daily_C_gain_max = umol_2_kgC * day_sec * ( cpatch%today_gpp_max(ico) & - - cpatch%today_leaf_resp(ico) & - - cpatch%today_root_resp(ico) ) & - / cpatch%nplant(ico) - growth_respiration_max = max(0.0, daily_C_gain_max * growth_resp_factor(ipft)) - carbon_balance_max = daily_C_gain_max - growth_respiration_max & - - cpatch%vleaf_respiration(ico) + + + !---------------------------------------------------------------------------------! + ! Find carbon balance under full light and full soil moisture. They will be ! + ! used for density-dependent mortality. Units: [kgC/plant/day]. ! + !---------------------------------------------------------------------------------! + !------ Full light. --------------------------------------------------------------! + daily_C_gain_lightmax = umol_2_kgC * day_sec & + * ( cpatch%today_gpp_lightmax(ico) & + - cpatch%today_leaf_resp (ico) & + - cpatch%today_root_resp (ico) ) & + / cpatch%nplant(ico) + growth_respiration_lightmax = max(0.0, daily_C_gain_lightmax & + * growth_resp_factor(ipft) ) + carbon_balance_lightmax = daily_C_gain_lightmax - growth_respiration_lightmax & + - cpatch%vleaf_respiration(ico) + !------ Full soil moisture. ------------------------------------------------------! + daily_C_gain_moistmax = umol_2_kgC * day_sec & + * ( cpatch%today_gpp_moistmax(ico) & + - cpatch%today_leaf_resp (ico) & + - cpatch%today_root_resp (ico) ) & + / cpatch%nplant(ico) + growth_respiration_moistmax = max(0.0, daily_C_gain_moistmax & + * growth_resp_factor(ipft) ) + carbon_balance_moistmax = daily_C_gain_moistmax - growth_respiration_moistmax & + - cpatch%vleaf_respiration(ico) + !---------------------------------------------------------------------------------! else - carbon_balance_max = 0.0 - carbon_balance_pot = 0.0 + carbon_balance_pot = 0.0 + carbon_balance_lightmax = 0.0 + carbon_balance_moistmax = 0.0 end if !----- Carbon balances for mortality. -----------------------------------------------! - cpatch%cb(13,ico) = cpatch%cb(13,ico) + carbon_balance - cpatch%cb_max(13,ico) = cpatch%cb_max(13,ico) + carbon_balance_max + cpatch%cb (13,ico) = cpatch%cb (13,ico) + carbon_balance & + + storage_offset + cpatch%cb_lightmax(13,ico) = cpatch%cb_lightmax(13,ico) + carbon_balance_lightmax & + + storage_offset + cpatch%cb_moistmax(13,ico) = cpatch%cb_moistmax(13,ico) + carbon_balance_moistmax & + + storage_offset if (print_debug) then if (first_time(ipft)) then first_time(ipft) = .false. - write (unit=30+ipft,fmt='(a10,15(1x,a12))') & - ' TIME',' PATCH',' COHORT',' NPLANT',' CB_TODAY' & - ,' GROWTH_RESP',' VLEAF_RESP',' TODAY_GPP','TODAY_GPPMAX' & - ,' TODAY_LEAF',' TODAY_ROOT',' CBMAX_TODAY',' CB' & - ,' CBMAX',' LEAF_MAINT',' ROOT_MAINT' + write (unit=30+ipft,fmt='(a10,19(1x,a18))') & + ' TIME',' PATCH',' COHORT',' NPLANT' & + ,' CB_TODAY',' GROWTH_RESP',' VLEAF_RESP' & + ,' TODAY_GPP','TODAY_GPP_LIGHTMAX','TODAY_GPP_MOISTMAX' & + ,' TODAY_LEAF_RESP',' TODAY_ROOT_RESP',' CB_LIGHTMAX_TODAY' & + ,' CB_MOISTMAX_TODAY',' CB',' CB_LIGHTMAX' & + ,' CB_MOISTMAX',' LEAF_MAINTENANCE',' ROOT_MAINTENANCE' & + ,' STORAGE_OFFSET' end if - write(unit=30+ipft,fmt='(2(i2.2,a1),i4.4,2(1x,i12),13(1x,es12.5))') & + write(unit=30+ipft,fmt='(2(i2.2,a1),i4.4,2(1x,i18),17(1x,es18.5))') & current_time%month,'/',current_time%date,'/',current_time%year & ,ipa,ico,cpatch%nplant(ico),carbon_balance,cpatch%growth_respiration(ico) & ,cpatch%vleaf_respiration(ico),cpatch%today_gpp(ico) & - ,cpatch%today_gpp_max(ico),cpatch%today_leaf_resp(ico) & - ,cpatch%today_root_resp(ico),carbon_balance_max,cpatch%cb(13,ico) & - ,cpatch%cb_max(13,ico),cpatch%leaf_maintenance(ico) & - ,cpatch%root_maintenance(ico) + ,cpatch%today_gpp_lightmax(ico),cpatch%today_gpp_moistmax(ico) & + ,cpatch%today_leaf_resp(ico),cpatch%today_root_resp(ico) & + ,carbon_balance_lightmax,carbon_balance_moistmax,cpatch%cb(13,ico) & + ,cpatch%cb_lightmax(13,ico),cpatch%cb_moistmax(13,ico) & + ,cpatch%leaf_maintenance(ico),cpatch%root_maintenance(ico),storage_offset end if return @@ -806,18 +868,20 @@ end subroutine plant_carbon_balances !=======================================================================================! subroutine alloc_plant_c_balance(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) - , agf_bs & ! intent(in) - , r_fract & ! intent(in) - , c2n_stem ! ! intent(in) - use decomp_coms , only : f_labile ! ! intent(in) - use allometry , only : dbh2bl ! ! function + use ed_state_vars , only : sitetype & ! structure + , patchtype ! ! structure + use pft_coms , only : phenology & ! intent(in) + , c2n_storage & ! intent(in) + , c2n_leaf & ! intent(in) + , sla & ! intent(in) + , q & ! intent(in) + , qsw & ! intent(in) + , agf_bs & ! intent(in) + , c2n_stem ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use allometry , only : size2bl ! ! function + use phenology_coms, only : elongf_min ! ! intent(in) + implicit none !----- Arguments. -------------------------------------------------------------------! type(sitetype) , target :: csite @@ -831,27 +895,32 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance !----- Local variables. -------------------------------------------------------------! type(patchtype), pointer :: cpatch integer :: ipft - real :: bl_max + real :: bleaf_aim + real :: broot_aim + real :: bsapwooda_aim + real :: bsapwoodb_aim + real :: balive_aim + real :: bleaf_max real :: balive_max - real :: bl_pot - real :: increment + real :: bloss_max + real :: carbon_debt real :: old_status real :: delta_bleaf real :: delta_broot real :: delta_bsapwooda real :: delta_bsapwoodb real :: available_carbon + real :: increment real :: f_total real :: f_bleaf real :: f_broot real :: f_bsapwooda real :: f_bsapwoodb - real :: f_resp + real :: f_bstorage real :: tr_bleaf real :: tr_broot real :: tr_bsapwooda real :: tr_bsapwoodb - real :: bl logical :: on_allometry logical :: time_to_flush !------------------------------------------------------------------------------------! @@ -865,60 +934,67 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance ! 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) + available_carbon = cpatch%bstorage(ico) + carbon_balance + time_to_flush = carbon_balance > 0.0 .or. & + ( available_carbon > 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 + + + !------------------------------------------------------------------------------------! + ! Check whether to increase living tissue biomass or not. ! + !------------------------------------------------------------------------------------! + if (time_to_flush) then + select case (cpatch%phenology_status(ico)) + case (1) !------------------------------------------------------------------------------! - ! There are leaves, we are not actively dropping leaves and we're off ! + ! 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. ! !------------------------------------------------------------------------------! - !--use dbh for trees - 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_bsapwooda = max (0.0, balive_max * qsw(ipft) * cpatch%hite(ico) * salloci & - * agf_bs(ipft) - cpatch%bsapwooda(ico)) - delta_bsapwoodb = max (0.0, balive_max * qsw(ipft) * cpatch%hite(ico) * salloci & - * (1.-agf_bs(ipft))- cpatch%bsapwoodb(ico)) + bleaf_max = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) + bleaf_aim = bleaf_max * green_leaf_factor * cpatch%elongf(ico) + broot_aim = bleaf_aim * q(ipft) + bsapwooda_aim = bleaf_aim * qsw(ipft) * cpatch%hite(ico) * agf_bs(ipft) + bsapwoodb_aim = bleaf_aim * qsw(ipft) * cpatch%hite(ico) * (1. - agf_bs(ipft)) + balive_aim = bleaf_aim + broot_aim + bsapwooda_aim + bsapwoodb_aim + !---- Amount that bleaf, broot, and bsapwood are off allometry. ---------------! + delta_bleaf = max (0.0, bleaf_aim - cpatch%bleaf (ico)) + delta_broot = max (0.0, broot_aim - cpatch%broot (ico)) + delta_bsapwooda = max (0.0, bsapwooda_aim - cpatch%bsapwooda(ico)) + delta_bsapwoodb = max (0.0, bsapwoodb_aim - cpatch%bsapwoodb(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. ! + ! 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_bsapwooda = delta_bsapwooda / (balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci) - f_bsapwoodb = delta_bsapwoodb / (balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci) - f_total = f_bleaf + f_broot + f_bsapwooda + f_bsapwoodb + f_bleaf = delta_bleaf / bleaf_aim + f_broot = delta_broot / broot_aim + f_bsapwooda = delta_bsapwooda / bsapwooda_aim + f_bsapwoodb = delta_bsapwoodb / bsapwoodb_aim + f_total = f_bleaf + f_broot + f_bsapwooda + f_bsapwoodb + !------------------------------------------------------------------------------! + !------------------------------------------------------------------------------! ! 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_bsapwooda = min( delta_bsapwooda, (f_bsapwooda/f_total) * available_carbon) - tr_bsapwoodb = min( delta_bsapwoodb, (f_bsapwoodb/f_total) * available_carbon) + tr_bleaf = min(delta_bleaf , f_bleaf / f_total * available_carbon) + tr_broot = min(delta_broot , f_broot / f_total * available_carbon) + tr_bsapwooda = min(delta_bsapwooda, f_bsapwooda / f_total * available_carbon) + tr_bsapwoodb = min(delta_bsapwoodb, f_bsapwoodb / f_total * available_carbon) else tr_bleaf = 0. tr_broot = 0. @@ -927,30 +1003,44 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance end if !------------------------------------------------------------------------------! - cpatch%bleaf(ico) = cpatch%bleaf(ico) + tr_bleaf - cpatch%broot(ico) = cpatch%broot(ico) + tr_broot + + + !------------------------------------------------------------------------------! + ! Update the carbon pools of the living tissues. ! + !------------------------------------------------------------------------------! + cpatch%bleaf (ico) = cpatch%bleaf (ico) + tr_bleaf + cpatch%broot (ico) = cpatch%broot (ico) + tr_broot cpatch%bsapwooda(ico) = cpatch%bsapwooda(ico) + tr_bsapwooda cpatch%bsapwoodb(ico) = cpatch%bsapwoodb(ico) + tr_bsapwoodb - cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & - + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) - + cpatch%balive (ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(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_bsapwooda + tr_bsapwoodb)* 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_bsapwooda - tr_bsapwoodb - cpatch%bstorage(ico) = max(0.0, cpatch%bstorage(ico) + increment) !------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------! + ! Check whether there is still some carbon to go to storage or if we are ! + ! burning some of the storage. ! + !------------------------------------------------------------------------------! if (increment <= 0.0) then !---------------------------------------------------------------------------! ! We are using up all of daily C gain and some of bstorage. First ! @@ -989,16 +1079,23 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance !----- 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 + + + !------------------------------------------------------------------------------! + ! Check whether we are on allometry or not. ! + !------------------------------------------------------------------------------! + on_allometry = 2.0 * abs(balive_aim - cpatch%balive(ico)) & + / (balive_aim + 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 + !------------------------------------------------------------------------------! + case default !------------------------------------------------------------------------------! ! 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 ! @@ -1012,54 +1109,395 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance cpatch%today_nppfroot(ico) = 0.0 cpatch%today_nppsapwood(ico) = 0.0 cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) - end if - + !------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------! else !---------------------------------------------------------------------------------! - ! Carbon balance is negative, take it out of storage. ! + ! Carbon balance is negative, decide the source of carbon based on the ! + ! phenology status. If plants were already dropping leaves, then we don't take ! + ! the carbon from storage unless there is no leaf or root biomass left. If ! + ! plants should be growing but they aren't, then we burn the storage first, and ! + ! if the situation persists, then plants start destroying their living tissues. ! !---------------------------------------------------------------------------------! - 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) + cpatch%bstorage(ico) / c2n_storage & - * cpatch%nplant(ico) + carbon_debt = -carbon_balance + select case (cpatch%phenology_status(ico)) + case (0,1) + !------------------------------------------------------------------------------! + ! Plants should be growing or at their maximum, first we try to take all ! + ! the carbon needed from storage. ! + !------------------------------------------------------------------------------! + if (cpatch%bstorage(ico) > carbon_debt) then + !----- Enough carbon in storage, take all carbon needed from there. --------! + cpatch%bstorage(ico) = cpatch%bstorage(ico) - carbon_debt + csite%fsn_in(ipa) = csite%fsn_in(ipa) & + + carbon_debt / c2n_storage * cpatch%nplant(ico) + else + !---------------------------------------------------------------------------! + ! Not enough carbon in storage. Take everything then start destroying ! + ! tissues. ! + !---------------------------------------------------------------------------! + carbon_debt = carbon_debt - cpatch%bstorage(ico) + csite%fsn_in(ipa) = csite%fsn_in(ipa) + cpatch%bstorage(ico) & + / c2n_storage * cpatch%nplant(ico) + cpatch%bstorage(ico) = 0.0 - if (cpatch%phenology_status(ico) == 0) then !---------------------------------------------------------------------------! - ! We were on allometry, but now we need to burn carbon and go off- ! - ! -allometry. ! + ! Find total biomass that can be lost. We take an amount proportional ! + ! to the current biomass of each the pools. ! !---------------------------------------------------------------------------! - cpatch%balive(ico) = cpatch%balive(ico) - increment - cpatch%bleaf(ico) = cpatch%balive(ico) * salloci * green_leaf_factor - cpatch%broot(ico) = cpatch%balive(ico) * q(ipft) * salloci - cpatch%bsapwooda(ico) = cpatch%balive(ico) * cpatch%hite(ico) * qsw(ipft) & - * salloci * agf_bs(ipft) - cpatch%bsapwoodb(ico) = cpatch%balive(ico) * cpatch%hite(ico) * qsw(ipft) & - * salloci * (1.-agf_bs(ipft)) + bloss_max = cpatch%bleaf(ico) + cpatch%broot(ico) + f_bleaf = cpatch%bleaf (ico) / bloss_max + f_broot = cpatch%broot (ico) / bloss_max + + if (bloss_max > carbon_debt) then + !----- Remove biomass accordingly. --------------------------------------! + cpatch%bleaf (ico) = cpatch%bleaf (ico) - f_bleaf * carbon_debt + cpatch%broot (ico) = cpatch%broot (ico) - f_broot * carbon_debt + !------------------------------------------------------------------------! + else + !------------------------------------------------------------------------! + ! This cohort didn't know how to save carbon during its life, and ! + ! has spent everything it had and now it is sunk in huge debt that it ! + ! can't afford. It is with profound sadness that we announce that this ! + ! cohort is going to fertilizer business. ! + !------------------------------------------------------------------------! + carbon_debt = bloss_max + cpatch%bleaf (ico) = 0.0 + cpatch%broot (ico) = 0.0 + !------------------------------------------------------------------------! + end if cpatch%phenology_status(ico) = 1 + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Update living biomass. ! + !---------------------------------------------------------------------------! + cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) + !---------------------------------------------------------------------------! + + + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! NOT SURE IF THIS IS CORRECT N ACCOUNTING ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + csite%fsn_in(ipa) = csite%fsn_in(ipa) + carbon_debt & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft)) & + * cpatch%nplant(ico) + !---------------------------------------------------------------------------! + end if + !------------------------------------------------------------------------------! + case (-1,2) + !------------------------------------------------------------------------------! + ! Plants were already shedding leaves. We swap the order here and remove ! + ! living tissues first, and only if there is nothing left that we remove ! + ! storage. ! + !------------------------------------------------------------------------------! + bloss_max = cpatch%bleaf(ico) + cpatch%broot(ico) + f_bleaf = cpatch%bleaf (ico) / bloss_max + f_broot = cpatch%broot (ico) / bloss_max + + if (bloss_max > carbon_debt) then + !----- Remove biomass accordingly. -----------------------------------------! + cpatch%bleaf (ico) = cpatch%bleaf (ico) - f_bleaf * carbon_debt + cpatch%broot (ico) = cpatch%broot (ico) - f_broot * carbon_debt + !---------------------------------------------------------------------------! + + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! NOT SURE IF THIS IS CORRECT N ACCOUNTING ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + csite%fsn_in(ipa) = csite%fsn_in(ipa) + carbon_debt & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft)) & + * cpatch%nplant(ico) + !---------------------------------------------------------------------------! else - f_resp = cpatch%today_leaf_resp(ico) & - / ( cpatch%today_leaf_resp(ico) + cpatch%today_root_resp(ico) ) - bl = cpatch%bleaf(ico) - f_resp * (increment) + !---------------------------------------------------------------------------! + ! Not enough biomass, remove everything. ! + !---------------------------------------------------------------------------! + carbon_debt = carbon_debt - bloss_max + cpatch%bleaf (ico) = 0.0 + cpatch%broot (ico) = 0.0 + !---------------------------------------------------------------------------! + + + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + ! NOT SURE IF THIS IS CORRECT N ACCOUNTING ! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! + csite%fsn_in(ipa) = csite%fsn_in(ipa) + bloss_max & + * ( f_labile(ipft) / c2n_leaf(ipft) & + + (1.0 - f_labile(ipft)) / c2n_stem(ipft)) & + * cpatch%nplant(ico) + !---------------------------------------------------------------------------! - if (bl > 0.0) then - cpatch%bleaf(ico) = bl - cpatch%broot(ico) = cpatch%broot(ico) - (1.0 - f_resp) * increment + + !---------------------------------------------------------------------------! + ! The living tissues weren't enough to meet the demand, remove what is ! + ! still needed from the storage. ! + !---------------------------------------------------------------------------! + if (cpatch%bstorage(ico) > carbon_debt) then + !----- Enough carbon in storage, take all carbon needed from there. -----! + cpatch%bstorage(ico) = cpatch%bstorage(ico) - carbon_debt + csite%fsn_in(ipa) = csite%fsn_in(ipa) & + + carbon_debt / c2n_storage * cpatch%nplant(ico) + !------------------------------------------------------------------------! else - cpatch%broot(ico) = cpatch%broot(ico) - (increment - cpatch%bleaf(ico)) - cpatch%bleaf(ico) = 0.0 - cpatch%elongf(ico) = 0.0 - cpatch%phenology_status(ico) = 2 + !------------------------------------------------------------------------! + ! This cohort didn't know how to save carbon during its life, and ! + ! has spent everything it had and now it is sunk in huge debt that it ! + ! can't afford. It is with profound sadness that we announce that this ! + ! cohort is going to fertilizer business. ! + !------------------------------------------------------------------------! + csite%fsn_in(ipa) = csite%fsn_in(ipa) + cpatch%bstorage(ico) & + / c2n_storage * cpatch%nplant(ico) + cpatch%bstorage(ico) = 0.0 + !------------------------------------------------------------------------! end if + end if + !------------------------------------------------------------------------------! - cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & - + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) + + !------------------------------------------------------------------------------! + ! Update living biomass. ! + !------------------------------------------------------------------------------! + cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) + !------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------! + + + !---- 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 + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! Alternative subroutine for grasses. ! + !---------------------------------------------------------------------------------------! + subroutine alloc_plant_c_balance_grass(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) + , agf_bs & ! intent(in) + , r_fract & ! intent(in) + , hgt_max & ! intent(in) + , c2n_stem ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use allometry , only : bl2h & ! function + , h2dbh & ! function + , dbh2h ! ! 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_balive + real :: delta_bleaf + real :: delta_broot + real :: delta_bsapwooda + real :: delta_bsapwoodb + real :: available_carbon + real :: f_total + real :: f_bleaf + real :: f_broot + real :: f_bsapwooda + real :: f_bsapwoodb + real :: f_resp + real :: tr_bleaf + real :: tr_broot + real :: tr_bsapwooda + real :: tr_bsapwoodb + real :: bl + real :: dbh_to_height + 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%hite(ico)*(1 + 1e-4)) < hgt_max(ipft)) then ! - could use repro_min_h here instead + !------------------------------------------------------------------------------! + ! The grass is in a vegetative growth phase, put carbon into growth. ! + !------------------------------------------------------------------------------! + !--allow grass to use carbon from that day and from storage to grow + available_carbon = carbon_balance + cpatch%bstorage(ico) + + !--scale maximum growth by elongf (currently grass is "evergreen" so elongf=1) + delta_balive = available_carbon * cpatch%elongf(ico) + increment = available_carbon * (1. - cpatch%elongf(ico)) + + delta_bleaf = delta_balive * salloci * green_leaf_factor + delta_broot = delta_balive * salloci * q (ipft) + delta_bsapwooda = delta_balive * salloci * qsw(ipft) * cpatch%hite(ico) & + * agf_bs(ipft) + delta_bsapwoodb = delta_balive * salloci * qsw(ipft) * cpatch%hite(ico) & + * (1.-agf_bs(ipft)) + + + + cpatch%bleaf(ico) = cpatch%bleaf(ico) + delta_bleaf + cpatch%broot(ico) = cpatch%broot(ico) + delta_broot + cpatch%bsapwooda(ico) = cpatch%bsapwooda(ico) + delta_bsapwooda + cpatch%bsapwoodb(ico) = cpatch%bsapwoodb(ico) + delta_bsapwoodb + + cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) + + !----- NPP allocation in diff pools in KgC/m2/day. ----------------------------! + cpatch%today_nppleaf (ico) = delta_bleaf * cpatch%nplant(ico) + cpatch%today_nppfroot (ico) = delta_broot * cpatch%nplant(ico) + cpatch%today_nppsapwood (ico) = (delta_bsapwooda + delta_bsapwoodb) & + * cpatch%nplant(ico) + cpatch%today_nppdaily (ico) = carbon_balance * cpatch%nplant(ico) + + !----- update height for grasses to match new leaf mass -----------------------! + cpatch%hite(ico) = min(hgt_max(ipft), bl2h(cpatch%bleaf(ico), ipft)) !limit by maximum height + cpatch%dbh(ico) = h2dbh(cpatch%hite(ico), ipft) !--effective_dbh value for grasses + + + !----- put remaining carbon in the storage pool -------------------------------! + 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. ! + !---------------------------------------------------------------------------! + + 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) + + 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 + else !-- plant is at the maximum height. + !------------------------------------------------------------------------------! + ! Grass is at its maximum height. Put carbon gain into storage. ! + ! For agriculture, put carbon into grain (and storage?) ! + !------------------------------------------------------------------------------! + + !--test here if pft is agriculture, if so put most carbon into grain and ------! + !- maybe a little into storage -- STILL TO BE WRITTEN! ------------------------! + !----- Consider adding allocation to harvest pool here ------------------------! + !---ALS=== Agriculture + increment = carbon_balance ! subtract the part that goes into grain for ag here + + cpatch%bstorage(ico) = cpatch%bstorage(ico) + increment + nitrogen_uptake = nitrogen_uptake + increment / 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 !-- end height loop for cb>0 + + + else !-- carbon_balance <0 + !---------------------------------------------------------------------------------! + ! Carbon balance is negative, take it out of storage. ! + !---------------------------------------------------------------------------------! + increment = cpatch%bstorage(ico) + carbon_balance + + + + if (increment <= 0.0) then !-- carbon_balance > bstorage + !----- Take carbon from the Storage pool first --------------------------------! + increment = - increment + cpatch%bstorage(ico) = 0.0 + csite%fsn_in(ipa) = csite%fsn_in(ipa) + cpatch%bstorage(ico) / c2n_storage & + * cpatch%nplant(ico) + + !-- Take the remaining carbon from balive -------------------------------------! + cpatch%balive(ico) = cpatch%balive(ico) - increment + cpatch%bleaf(ico) = cpatch%balive(ico) * salloci * green_leaf_factor + cpatch%broot(ico) = cpatch%balive(ico) * salloci * q(ipft) + cpatch%bsapwooda(ico) = cpatch%balive(ico) * salloci * qsw(ipft) & + * cpatch%hite(ico) * agf_bs(ipft) + cpatch%bsapwoodb(ico) = cpatch%balive(ico) * salloci * qsw(ipft) & + * cpatch%hite(ico) * (1. - agf_bs(ipft)) + + !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ! NOT SURE IF THIS IS CORRECT N ACCOUNTING ! @@ -1070,8 +1508,9 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance + (1.0 - f_labile(ipft)) / c2n_stem(ipft) ) & * cpatch%nplant(ico) - else - !------ Burn the storage pool. Dont' forget the nitrogen. --------------------! + else !-- carbon_balance < bstorage + !------ Remove the necessary carbon from the storage pool. -------------------! + !------ Dont' forget the nitrogen. --------------------------------------------! cpatch%bstorage(ico) = cpatch%bstorage(ico) + carbon_balance csite%fsn_in(ipa) = csite%fsn_in(ipa) - carbon_balance & * ( f_labile(ipft) / c2n_leaf(ipft) & @@ -1085,245 +1524,14 @@ subroutine alloc_plant_c_balance(csite,ipa,ico,salloc,salloci,carbon_balance cpatch%today_nppsapwood(ico) = 0.0 cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) end if + return - end subroutine alloc_plant_c_balance + end subroutine alloc_plant_c_balance_grass !=======================================================================================! !=======================================================================================! -!=======================================================================================! -! Alternative subroutine for grasses -!=======================================================================================! -subroutine alloc_plant_c_balance_grass(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) - , agf_bs & ! intent(in) - , r_fract & ! intent(in) - , hgt_max & ! intent(in) - , c2n_stem ! ! intent(in) - use decomp_coms , only : f_labile ! ! intent(in) - use allometry , only : bl2h & ! function - , h2dbh & ! function - , dbh2h ! ! 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_balive - real :: delta_bleaf - real :: delta_broot - real :: delta_bsapwooda - real :: delta_bsapwoodb - real :: available_carbon - real :: f_total - real :: f_bleaf - real :: f_broot - real :: f_bsapwooda - real :: f_bsapwoodb - real :: f_resp - real :: tr_bleaf - real :: tr_broot - real :: tr_bsapwooda - real :: tr_bsapwoodb - real :: bl - real :: dbh_to_height - 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%hite(ico)*(1 + 1e-4)) < hgt_max(ipft)) then ! - could use repro_min_h here instead - !------------------------------------------------------------------------------! - ! The grass is in a vegetative growth phase, put carbon into growth. ! - !------------------------------------------------------------------------------! - !--allow grass to use carbon from that day and from storage to grow - available_carbon = carbon_balance + cpatch%bstorage(ico) - - !--scale maximum growth by elongf (currently grass is "evergreen" so elongf=1) - delta_balive = available_carbon * cpatch%elongf(ico) - increment = available_carbon * (1. - cpatch%elongf(ico)) - - delta_bleaf = delta_balive * salloci * green_leaf_factor - delta_broot = delta_balive * salloci * q (ipft) - delta_bsapwooda = delta_balive * salloci * qsw(ipft) * cpatch%hite(ico) & - * agf_bs(ipft) - delta_bsapwoodb = delta_balive * salloci * qsw(ipft) * cpatch%hite(ico) & - * (1.-agf_bs(ipft)) - - - - cpatch%bleaf(ico) = cpatch%bleaf(ico) + delta_bleaf - cpatch%broot(ico) = cpatch%broot(ico) + delta_broot - cpatch%bsapwooda(ico) = cpatch%bsapwooda(ico) + delta_bsapwooda - cpatch%bsapwoodb(ico) = cpatch%bsapwoodb(ico) + delta_bsapwoodb - - cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & - + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(ico) - - !----- NPP allocation in diff pools in KgC/m2/day. ----------------------------! - cpatch%today_nppleaf(ico) = delta_bleaf * cpatch%nplant(ico) - cpatch%today_nppfroot(ico) = delta_broot * cpatch%nplant(ico) - cpatch%today_nppsapwood(ico)= (delta_bsapwooda + delta_bsapwoodb)* cpatch%nplant(ico) - cpatch%today_nppdaily(ico) = carbon_balance * cpatch%nplant(ico) - - !----- update height for grasses to match new leaf mass -----------------------! - cpatch%hite(ico) = min(hgt_max(ipft), bl2h(cpatch%bleaf(ico), ipft)) !limit by maximum height - cpatch%dbh(ico) = h2dbh(cpatch%hite(ico), ipft) !--effective_dbh value for grasses - - - !----- put remaining carbon in the storage pool -------------------------------! - 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. ! - !---------------------------------------------------------------------------! - - 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) - - 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 - - else !-- plant is at the maximum height. - !------------------------------------------------------------------------------! - ! Grass is at its maximum height. Put carbon gain into storage. ! - ! For agriculture, put carbon into grain (and storage?) ! - !------------------------------------------------------------------------------! - - !--test here if pft is agriculture, if so put most carbon into grain and ------! - !- maybe a little into storage -- STILL TO BE WRITTEN! ------------------------! - !----- Consider adding allocation to harvest pool here ------------------------! - !---ALS=== Agriculture - increment = carbon_balance ! subtract the part that goes into grain for ag here - - cpatch%bstorage(ico) = cpatch%bstorage(ico) + increment - nitrogen_uptake = nitrogen_uptake + increment / 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 !-- end height loop for cb>0 - - - else !-- carbon_balance <0 - !---------------------------------------------------------------------------------! - ! Carbon balance is negative, take it out of storage. ! - !---------------------------------------------------------------------------------! - increment = cpatch%bstorage(ico) + carbon_balance - - - - if (increment <= 0.0) then !-- carbon_balance > bstorage - !----- Take carbon from the Storage pool first --------------------------------! - increment = - increment - cpatch%bstorage(ico) = 0.0 - csite%fsn_in(ipa) = csite%fsn_in(ipa) + cpatch%bstorage(ico) / c2n_storage & - * cpatch%nplant(ico) - - !-- Take the remaining carbon from balive -------------------------------------! - cpatch%balive(ico) = cpatch%balive(ico) - increment - cpatch%bleaf(ico) = cpatch%balive(ico) * salloci * green_leaf_factor - cpatch%broot(ico) = cpatch%balive(ico) * salloci * q(ipft) - cpatch%bsapwooda(ico) = cpatch%balive(ico) * salloci * qsw(ipft) & - * cpatch%hite(ico) * agf_bs(ipft) - cpatch%bsapwoodb(ico) = cpatch%balive(ico) * salloci * qsw(ipft) & - * cpatch%hite(ico) * (1. - agf_bs(ipft)) - - - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - ! NOT SURE IF THIS IS CORRECT N ACCOUNTING ! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! - csite%fsn_in(ipa) = csite%fsn_in(ipa) + increment & - * ( f_labile(ipft) / c2n_leaf(ipft) & - + (1.0 - f_labile(ipft)) / c2n_stem(ipft) ) & - * cpatch%nplant(ico) - - else !-- carbon_balance < bstorage - !------ Remove the necessary carbon from the storage pool. -------------------! - !------ Dont' forget the nitrogen. --------------------------------------------! - cpatch%bstorage(ico) = cpatch%bstorage(ico) + carbon_balance - csite%fsn_in(ipa) = csite%fsn_in(ipa) - carbon_balance & - * ( f_labile(ipft) / c2n_leaf(ipft) & - + (1.0 - f_labile(ipft)) / c2n_stem(ipft)) & - * cpatch%nplant(ico) - 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_grass -!=======================================================================================! -!=======================================================================================! - - @@ -1343,7 +1551,7 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc , agf_bs & ! intent(in) , c2n_stem ! ! intent(in) use decomp_coms , only : f_labile ! ! intent(in) - use allometry , only : dbh2bl ! ! function + use allometry , only : size2bl ! ! function implicit none !----- Arguments. -------------------------------------------------------------------! type(sitetype) , target :: csite @@ -1357,10 +1565,14 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc !----- Local variables. -------------------------------------------------------------! type(patchtype), pointer :: cpatch integer :: ipft - real :: bl_max - real :: balive_max - real :: bl_pot + real :: bleaf_aim + real :: broot_aim + real :: bsapwooda_aim + real :: bsapwoodb_aim + real :: balive_aim + real :: bleaf_max real :: increment + real :: carbon_loss real :: old_status real :: delta_bleaf real :: delta_broot @@ -1377,7 +1589,6 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc real :: tr_broot real :: tr_bsapwooda real :: tr_bsapwoodb - real :: bl logical :: on_allometry logical :: time_to_flush !------------------------------------------------------------------------------------! @@ -1409,31 +1620,36 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc ! 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_bsapwooda = max (0.0, balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci * agf_bs(ipft) - cpatch%bsapwooda(ico)) - delta_bsapwoodb = max (0.0, balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci * (1.-agf_bs(ipft)) - cpatch%bsapwoodb(ico)) + bleaf_max = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) + bleaf_aim = bleaf_max * green_leaf_factor * cpatch%elongf(ico) + broot_aim = bleaf_max * q(ipft) * cpatch%elongf(ico) + bsapwooda_aim = bleaf_max * qsw(ipft) * cpatch%hite(ico) * cpatch%elongf(ico) & + * agf_bs(ipft) + bsapwoodb_aim = bleaf_max * qsw(ipft) * cpatch%hite(ico) * cpatch%elongf(ico) & + * (1.0 - agf_bs(ipft)) + balive_aim = bleaf_aim + broot_aim + bsapwooda_aim + bsapwoodb_aim + !---- Amount that bleaf, broot, and bsapwood are off allometry. ---------------! + delta_bleaf = max (0.0, bleaf_aim - cpatch%bleaf (ico)) + delta_broot = max (0.0, broot_aim - cpatch%broot (ico)) + delta_bsapwooda = max (0.0, bsapwooda_aim - cpatch%bsapwooda(ico)) + delta_bsapwoodb = max (0.0, bsapwoodb_aim - cpatch%bsapwoodb(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. ! + ! 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_bsapwooda = delta_bsapwooda / (balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci * agf_bs(ipft)) - f_bsapwoodb = delta_bsapwoodb / (balive_max * qsw(ipft) * cpatch%hite(ico) & - * salloci * (1.-agf_bs(ipft))) + f_bleaf = delta_bleaf / bleaf_aim + f_broot = delta_broot / broot_aim + f_bsapwooda = delta_bsapwooda / bsapwooda_aim + f_bsapwoodb = delta_bsapwoodb / bsapwoodb_aim f_total = f_bleaf + f_broot + f_bsapwooda + f_bsapwoodb + !------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------! ! We only allow transfer from storage to living tissues if there is need ! @@ -1452,19 +1668,19 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc end if !------------------------------------------------------------------------------! - cpatch%bleaf(ico) = cpatch%bleaf(ico) + tr_bleaf - cpatch%broot(ico) = cpatch%broot(ico) + tr_broot + cpatch%bleaf (ico) = cpatch%bleaf (ico) + tr_bleaf + cpatch%broot (ico) = cpatch%broot (ico) + tr_broot cpatch%bsapwooda(ico) = cpatch%bsapwooda(ico) + tr_bsapwooda cpatch%bsapwoodb(ico) = cpatch%bsapwoodb(ico) + tr_bsapwoodb - cpatch%balive(ico) = cpatch%bleaf(ico) + cpatch%broot(ico) & + cpatch%balive(ico) = cpatch%bleaf (ico) + cpatch%broot (ico) & + cpatch%bsapwooda(ico) + cpatch%bsapwoodb(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_nppleaf (ico)= tr_bleaf * cpatch%nplant(ico) + cpatch%today_nppfroot (ico)= tr_broot * cpatch%nplant(ico) cpatch%today_nppsapwood(ico)= (tr_bsapwooda + tr_bsapwoodb) * cpatch%nplant(ico) - cpatch%today_nppdaily(ico) = carbon_balance * 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- ! @@ -1514,8 +1730,8 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc 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 + on_allometry = 2.0 * abs(balive_aim - cpatch%balive(ico)) & + / (balive_aim + cpatch%balive(ico)) < 1.e-6 if (cpatch%elongf(ico) == 1.0 .and. on_allometry) then !---------------------------------------------------------------------------! ! We're back to allometry, change phenology_status. ! @@ -1530,12 +1746,15 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc !------------------------------------------------------------------------------! 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 @@ -1543,11 +1762,10 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc !---------------------------------------------------------------------------------! ! Carbon balance is negative, take it out of storage. ! !---------------------------------------------------------------------------------! - increment = cpatch%bstorage(ico) + carbon_balance + carbon_loss = - (cpatch%bstorage(ico) + carbon_balance) - if (increment <= 0.0) then + if (carbon_loss >= 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 @@ -1562,6 +1780,7 @@ subroutine alloc_plant_c_balance_eq_0(csite,ipa,ico,salloc,salloci,carbon_balanc 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 @@ -1580,7 +1799,7 @@ subroutine potential_N_uptake(cpatch,ico,salloc,salloci,balive_in,carbon_balance , c2n_leaf & ! intent(in) , c2n_stem ! ! intent(in) use decomp_coms , only : f_labile ! ! intent(in) - use allometry , only : dbh2bl ! ! intent(in) + use allometry , only : size2bl ! ! intent(in) implicit none !----- Arguments. -------------------------------------------------------------------! type(patchtype), target :: cpatch @@ -1607,7 +1826,8 @@ subroutine potential_N_uptake(cpatch,ico,salloc,salloci,balive_in,carbon_balance elseif (cpatch%phenology_status(ico) == 1) then ! this calculation of bl_max is wrong for grass, but they should not have phenology_status=1 yet - bl_max = dbh2bl(cpatch%dbh(ico),ipft) * green_leaf_factor * cpatch%elongf(ico) + bl_max = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) & + * green_leaf_factor * cpatch%elongf(ico) bl_pot = cpatch%bleaf(ico) + carbon_balance_pot if (bl_pot > bl_max) then diff --git a/ED/src/dynamics/heun_driver.f90 b/ED/src/dynamics/heun_driver.f90 index 5fbcef7fd..45c1a8081 100644 --- a/ED/src/dynamics/heun_driver.f90 +++ b/ED/src/dynamics/heun_driver.f90 @@ -118,11 +118,12 @@ subroutine heun_timestep(cgrid) !------------------------------------------------------------------------------! call copy_met_2_rk4site(nzg,csite%can_theta(ipa),csite%can_shv(ipa) & ,csite%can_depth(ipa),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%par_beam & - ,cmet%par_diffuse,cmet%nir_beam,cmet%nir_diffuse & - ,cmet%geoht,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & + ,cmet%atm_vpdef,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%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/hybrid_driver.f90 b/ED/src/dynamics/hybrid_driver.f90 index f2d4a84dd..6d35094e4 100644 --- a/ED/src/dynamics/hybrid_driver.f90 +++ b/ED/src/dynamics/hybrid_driver.f90 @@ -27,7 +27,7 @@ subroutine hybrid_timestep(cgrid) use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) use ed_misc_coms , only : dtlsm ! ! intent(in) - + use therm_lib , only : tq2enthalpy ! ! function implicit none !----- Arguments ----------------------------------------------------------! @@ -136,19 +136,22 @@ subroutine hybrid_timestep(cgrid) old_can_co2 = csite%can_co2(ipa) old_can_rhos = csite%can_rhos(ipa) old_can_temp = csite%can_temp(ipa) + old_can_prss = csite%can_prss (ipa) + old_can_enthalpy = tq2enthalpy(csite%can_temp(ipa) & + ,csite%can_shv(ipa),.true.) !------------------------------------------------------------------! !------------------------------------------------------------------! ! Copy the meteorological variables to the rk4site structure. ! !------------------------------------------------------------------! call copy_met_2_rk4site(nzg,csite%can_theta(ipa),csite%can_shv(ipa)& - ,csite%can_depth(ipa),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%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) & + ,csite%can_depth(ipa),cmet%vels,cmet%atm_theiv,cmet%atm_vpdef & + ,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%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)) @@ -180,12 +183,12 @@ subroutine hybrid_timestep(cgrid) !------------------------------------------------------------------! call copy_patch_init_carbon(csite,ipa,initp) - !------------------------------------------------------------------! - ! Perform the forward and backward step. It is possible this will! - ! be done over a series of sub-steps. 1)derivs,2)forward,3)back ! - ! 4) check stability and error 5) repeat as shorter or continue ! - !------------------------------------------------------------------! -! call integrate_patch_hybrid(csite, & + !------------------------------------------------------------------! + ! Perform the forward and backward step. It is possible this will! + ! be done over a series of sub-steps. 1)derivs,2)forward,3)back ! + ! 4) check stability and error 5) repeat as shorter or continue ! + !------------------------------------------------------------------! +! call integrate_patch_hybrid(csite, & ! integration_buff%yprev,integration_buff%initp, & ! integration_buff%dinitp,integration_buff%ytemp, & ! ipa,wcurr_loss2atm, & @@ -409,9 +412,9 @@ subroutine hybrid_integ(h1,csite,yprev,initp,dinitp,ytemp,ipa,nsteps) call leaf_derivs(initp,dinitp,csite,ipa,h) - !---------------------------------------------------------------------! - ! Error analysis. Two parts. First leaf/air/step then surface ! + ! Very simple analysis of derivative. ie try to reduce drastic + ! changes in key state variables. !---------------------------------------------------------------------! call fb_dy_step_trunc(initp,restart_step,csite,ipa,dinitp,h,htrunc) @@ -443,7 +446,7 @@ subroutine hybrid_integ(h1,csite,yprev,initp,dinitp,ytemp,ipa,nsteps) ! used in the implicit step. ! ! nsolve = 1 + n_leaf_cohorts + n_wood_cohorts ! !--------------------------------------------------------------------! - call copy_fb_patch(initp,ytemp,cpatch,nsolve) + call copy_fb_patch(initp,ytemp,cpatch) !--------------------------------------------------------------------! ! Integrate the forward step ! @@ -453,7 +456,7 @@ subroutine hybrid_integ(h1,csite,yprev,initp,dinitp,ytemp,ipa,nsteps) !--------------------------------------------------------------------! ! Integrate the implicit/backwards step ! !--------------------------------------------------------------------! - call bdf2_solver(cpatch,yprev,initp,ytemp,dinitp,nsolve,h, & + call bdf2_solver(cpatch,yprev,initp,ytemp,dinitp,h, & dble(csite%hprev(ipa))) @@ -674,7 +677,7 @@ end subroutine hybrid_integ !=========================================================================================! - subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) + subroutine copy_fb_patch(sourcep, targetp, cpatch) use rk4_coms , only : rk4site & ! intent(in) , rk4patchtype & ! structure @@ -697,7 +700,7 @@ subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) integer :: k !---------------------------------------------------------------------------------------! - targetp%can_enthalpy = sourcep%can_enthalpy + targetp%can_enthalpy = sourcep%can_enthalpy targetp%can_theta = sourcep%can_theta targetp%can_temp = sourcep%can_temp targetp%can_shv = sourcep%can_shv @@ -754,6 +757,9 @@ subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) targetp%cwd_rh = sourcep%cwd_rh targetp%rh = sourcep%rh + targetp%water_deficit = sourcep%water_deficit + + do k=rk4site%lsl,nzg targetp%soil_water (k) = sourcep%soil_water (k) targetp%soil_energy (k) = sourcep%soil_energy (k) @@ -776,9 +782,8 @@ subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) do k=1,cpatch%ncohorts targetp%leaf_resolvable (k) = sourcep%leaf_resolvable (k) + targetp%wood_resolvable (k) = sourcep%wood_resolvable (k) - if(targetp%leaf_resolvable(k)) nsolve=nsolve+1 - targetp%leaf_energy (k) = sourcep%leaf_energy (k) targetp%leaf_water (k) = sourcep%leaf_water (k) targetp%leaf_temp (k) = sourcep%leaf_temp (k) @@ -795,8 +800,6 @@ subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) targetp%wood_resolvable (k) = sourcep%wood_resolvable (k) - if(targetp%wood_resolvable(k)) nsolve=nsolve+1 - targetp%wood_energy (k) = sourcep%wood_energy (k) targetp%wood_water (k) = sourcep%wood_water (k) targetp%wood_temp (k) = sourcep%wood_temp (k) @@ -878,6 +881,7 @@ subroutine copy_fb_patch(sourcep, targetp, cpatch,nsolve) targetp%avg_drainage = sourcep%avg_drainage targetp%avg_drainage_heat = sourcep%avg_drainage_heat + do k=rk4site%lsl,nzg targetp%avg_sensible_gg(k) = sourcep%avg_sensible_gg(k) targetp%avg_smoist_gg(k) = sourcep%avg_smoist_gg(k) @@ -1059,6 +1063,8 @@ subroutine inc_fwd_patch(rkp, inc, fac, cpatch) rkp%qpwp = rkp%qpwp + fac * inc%qpwp rkp%cpwp = rkp%cpwp + fac * inc%cpwp + rkp%water_deficit = rkp%water_deficit + fac * inc%water_deficit + 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) @@ -1118,6 +1124,7 @@ subroutine inc_fwd_patch(rkp, inc, fac, cpatch) rkp%avg_sensible_gc = rkp%avg_sensible_gc + fac * inc%avg_sensible_gc rkp%avg_sensible_ac = rkp%avg_sensible_ac + fac * inc%avg_sensible_ac + do k=rk4site%lsl,nzg rkp%avg_sensible_gg(k) = rkp%avg_sensible_gg(k) + fac * inc%avg_sensible_gg(k) rkp%avg_smoist_gg(k) = rkp%avg_smoist_gg(k) + fac * inc%avg_smoist_gg(k) @@ -1275,9 +1282,9 @@ subroutine fb_dy_step_trunc(y,restart_step,csite,ipa,dydx,h,hmin) ! ---------------- Maximum change in canopy Relative Humidity ----------------------! max_dshv_can = 0.15d0 - hmin = (max_dshv_can*y%can_shv)/abs(dydx%can_shv) + hmin = (max_dshv_can*y%can_shv)/max(abs(dydx%can_shv),1.0d-10) - if ( h > max_dshv_can/abs(dydx%can_shv) .and. record_err) then + if ( h > max_dshv_can/max(abs(dydx%can_shv),1.0d-10) .and. record_err) then integ_err(3,1) = integ_err(3,1) + 1_8 end if diff --git a/ED/src/dynamics/mortality.f90 b/ED/src/dynamics/mortality.f90 index 3c037f229..d3b30f13e 100644 --- a/ED/src/dynamics/mortality.f90 +++ b/ED/src/dynamics/mortality.f90 @@ -42,7 +42,7 @@ subroutine mortality_rates(cpatch,ipa,ico,avg_daily_temp, patch_age) !----- Assume happy end, all plants survive... --------------------------------------! - cpatch%mort_rate(:,ico) = 0.0 + cpatch%mort_rate(1:4,ico) = 0.0 ipft = cpatch%pft(ico) !------------------------------------------------------------------------------------! @@ -87,11 +87,143 @@ subroutine mortality_rates(cpatch,ipa,ico,avg_daily_temp, patch_age) else cpatch%mort_rate(4,ico) = 0. end if + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! 5. Disturbance rate mortality. This is not used by the cohort dynamics, instead ! + ! this is just to account for the lost density due to the patch creation. This ! + ! mortality will be determined by the disturbance_mortality subroutine, not here. ! + !------------------------------------------------------------------------------------! + !cpatch%mort_rate(5,ico) = TBD + !------------------------------------------------------------------------------------! return end subroutine mortality_rates !=======================================================================================! !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This subroutine determines the mortality rates associated with the current ! + ! disturbance. ! + !---------------------------------------------------------------------------------------! + subroutine disturbance_mortality(csite,ipa,disturbance_rate,dest_type,poly_dest_type & + ,mindbh_harvest) + use ed_state_vars, only : sitetype & ! structure + , patchtype ! ! structure + use ed_max_dims , only : n_pft ! ! intent(in) + implicit none + !----- Arguments. -------------------------------------------------------------------! + type(sitetype) , target :: csite + integer , intent(in) :: ipa + real , intent(in) :: disturbance_rate + integer , intent(in) :: dest_type + integer , intent(in) :: poly_dest_type + real , dimension(n_pft), intent(in) :: mindbh_harvest + !----- Local variables. -------------------------------------------------------------! + type(patchtype) , pointer :: cpatch + integer :: ico + real :: f_survival + !------------------------------------------------------------------------------------! + + cpatch => csite%patch(ipa) + do ico=1,cpatch%ncohorts + f_survival = survivorship(dest_type,poly_dest_type,mindbh_harvest,csite,ipa,ico) + cpatch%mort_rate(5,ico) = cpatch%mort_rate(5,ico) & + - log( f_survival & + + (1.0 - f_survival) * exp(- disturbance_rate) ) + end do + return + end subroutine disturbance_mortality + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the survivorship rate after some disturbance happens. ! + !---------------------------------------------------------------------------------------! + real function survivorship(dest_type,poly_dest_type,mindbh_harvest,csite,ipa,ico) + use ed_state_vars, only : patchtype & ! structure + , sitetype ! ! structure + use disturb_coms , only : treefall_hite_threshold ! ! intent(in) + use pft_coms , only : treefall_s_ltht & ! intent(in) + , treefall_s_gtht ! ! intent(in) + use ed_max_dims , only : n_pft ! ! intent(in) + + implicit none + !----- Arguments. -------------------------------------------------------------------! + type(sitetype) , target :: csite + real , dimension(n_pft), intent(in) :: mindbh_harvest + integer , intent(in) :: ico + integer , intent(in) :: ipa + integer , intent(in) :: dest_type + integer , intent(in) :: poly_dest_type + !----- Local variables. -------------------------------------------------------------! + type(patchtype) , pointer :: cpatch + integer :: ipft + !------------------------------------------------------------------------------------! + + + cpatch => csite%patch(ipa) + ipft = cpatch%pft(ico) + + !----- Base the survivorship rates on the destination type. -------------------------! + select case(dest_type) + case (1) !----- Agriculture/cropland. -----------------------------------------------! + survivorship = 0.0 + + case (2) !----- Secondary land or forest plantation. --------------------------------! + + !----- Decide the fate based on the type of secondary disturbance. ---------------! + select case (poly_dest_type) + case (0) !----- Land abandonment, assume this is the last harvest. ---------------! + survivorship = 0.0 + case (1) !----- Biomass logging, assume that nothing stays. ----------------------! + survivorship = 0.0 + case (2) !----- Selective logging. -----------------------------------------------! + !------------------------------------------------------------------------------! + ! If the PFT DBH exceeds the minimum PFT for harvesting, the survivorship ! + ! should be zero, otherwise, we assume survivorship similar to the treefall ! + ! disturbance rate for short trees. ! + !------------------------------------------------------------------------------! + if (cpatch%dbh(ico) >= mindbh_harvest(ipft)) then + survivorship = 0.0 + else + survivorship = treefall_s_ltht(ipft) + end if + end select + + case (3) !----- Primary land. -------------------------------------------------------! + + !----- Decide the fate based on the type of natural disturbance. -----------------! + select case (poly_dest_type) + case (0) !----- Treefall, we must check the cohort height. -----------------------! + if (cpatch%hite(ico) < treefall_hite_threshold) then + survivorship = treefall_s_ltht(ipft) + else + survivorship = treefall_s_gtht(ipft) + end if + + case (1) !----- Fire, no survival. -----------------------------------------------! + survivorship = 0.0 + end select + end select + + return + end function survivorship + !=======================================================================================! + !=======================================================================================! end module mortality !==========================================================================================! !==========================================================================================! diff --git a/ED/src/dynamics/phenology_aux.f90 b/ED/src/dynamics/phenology_aux.f90 index 8b72de86c..485e3e552 100644 --- a/ED/src/dynamics/phenology_aux.f90 +++ b/ED/src/dynamics/phenology_aux.f90 @@ -401,7 +401,8 @@ subroutine first_phenology(cgrid) ,cpatch%paw_avg(ico),cpatch%elongf(ico) & ,cpatch%phenology_status(ico) & ,cpatch%bleaf(ico),cpatch%broot(ico) & - ,cpatch%bsapwooda(ico),cpatch%bsapwoodb(ico)& + ,cpatch%bsapwooda(ico) & + ,cpatch%bsapwoodb(ico) & ,cpatch%balive(ico),cpatch%bstorage(ico)) !------------------------------------------------------------------------! @@ -422,7 +423,7 @@ subroutine first_phenology(cgrid) ,cpatch%leaf_hcap(ico),cpatch%wood_hcap(ico) ) cpatch%leaf_energy(ico) = cpatch%leaf_hcap(ico) * cpatch%leaf_temp(ico) cpatch%wood_energy(ico) = cpatch%wood_hcap(ico) * cpatch%wood_temp(ico) - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) !------------------------------------------------------------------------! end do cohortloop !---------------------------------------------------------------------------! @@ -464,9 +465,9 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s use phenology_coms, only : spot_phen & ! intent(in) , elongf_min ! ! intent(in) use pft_coms , only : phenology & ! intent(in) - , agf_bs & ! intent(in) , q & ! intent(in) - , qsw ! ! intent(in) + , qsw & ! intent(in) + , agf_bs ! ! intent(in) use ed_max_dims , only : n_pft ! ! intent(in) use allometry , only : size2bl & ! function , h2crownbh ! ! function @@ -485,8 +486,8 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s integer , intent(out) :: phenology_status ! phenology Flag real , intent(out) :: bleaf ! Leaf biomass real , intent(out) :: broot ! Root biomass - real , intent(out) :: bsapwooda ! Sapwood biomass above ground - real , intent(out) :: bsapwoodb ! Sapwood biomass below ground + real , intent(out) :: bsapwooda ! AG Sapwood biomass + real , intent(out) :: bsapwoodb ! BG Sapwood biomass real , intent(out) :: balive ! Living tissue biomass real , intent(out) :: bstorage ! Storage biomass !----- Local variables --------------------------------------------------------------! @@ -497,10 +498,12 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s real :: bleaf_max ! maximum bleaf real :: balive_max ! balive if on-allometry real :: psi_layer ! Water pot. of this layer - real :: psi_wilt ! Wilting point potential - real :: psi_crit ! Critical point potential real :: mcheight ! Mid-crown height !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! ! Here we decide how to compute the mean available water fraction. ! !------------------------------------------------------------------------------------! @@ -514,14 +517,9 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s psi_layer = slzt(k) - mcheight & + soil(nsoil)%slpots & / (soil_water(k) / 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 - paw_avg = paw_avg + max(0.0, (psi_layer - psi_wilt)) * dslz(k) & - / (psi_crit - psi_wilt) + paw_avg = paw_avg + max(0.0, (psi_layer - soil(nsoil)%slpotwp)) * dslz(k) & + / (soil(nsoil)%slpotld - soil(nsoil)%slpotwp) end do - paw_avg = paw_avg / abs(slz(kroot)) else !----- Use soil moisture (mass) to determine phenology. --------------------------! @@ -555,7 +553,7 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s if (elongf >= 1.0) then phenology_status = 0 elseif (elongf > elongf_min) then - phenology_status = -1 + phenology_status = 1 else phenology_status = 2 elongf = 0. @@ -572,7 +570,7 @@ subroutine pheninit_balive_bstorage(mzg,ipft,kroot,height,dbh,soil_water,ntext_s bleaf = bleaf_max * elongf broot = balive_max * q(ipft) * salloci bsapwooda = balive_max * qsw(ipft) * height * salloci * agf_bs(ipft) - bsapwoodb = balive_max * qsw(ipft) * height * salloci * (1.-agf_bs(ipft)) + bsapwoodb = balive_max * qsw(ipft) * height * salloci * (1.0 - agf_bs(ipft)) balive = bleaf + broot + bsapwooda + bsapwoodb !------------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/phenology_driv.f90 b/ED/src/dynamics/phenology_driv.f90 index 879ddb307..5a9e741af 100644 --- a/ED/src/dynamics/phenology_driv.f90 +++ b/ED/src/dynamics/phenology_driv.f90 @@ -172,7 +172,8 @@ subroutine update_phenology(doy, cpoly, isi, lat) 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) + , elongf_min & ! intent(in) + , elongf_flush ! ! intent(in) use consts_coms , only : t3ple & ! intent(in) , cice & ! intent(in) , cliq & ! intent(in) @@ -183,8 +184,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) use ed_misc_coms , only : current_time ! ! intent(in) use allometry , only : area_indices & ! subroutine , ed_biomass & ! function - , size2bl & ! function - , dbh2bl ! ! function + , size2bl ! ! function use phenology_aux , only : daylength ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! @@ -202,13 +202,14 @@ subroutine update_phenology(doy, cpoly, isi, lat) integer :: ipft logical :: leaf_out_cold logical :: drop_cold - real, dimension(nzg) :: theta real :: daylight real :: delta_bleaf real :: bl_max real :: old_leaf_hcap real :: old_wood_hcap real :: salloci + real :: elongf_try + real :: elongf_grow !----- Variables used only for debugging purposes. -------------------------------------! logical , parameter :: printphen=.false. logical, dimension(n_pft), save :: first_time=.true. @@ -237,7 +238,7 @@ subroutine update_phenology(doy, cpoly, isi, lat) 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)) + ,leaf_out_cold,cpoly%lsl(isi)) cohortloop: do ico = 1,cpatch%ncohorts ipft = cpatch%pft(ico) @@ -246,9 +247,6 @@ subroutine update_phenology(doy, cpoly, isi, lat) !----- 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) @@ -284,9 +282,11 @@ subroutine update_phenology(doy, cpoly, isi, lat) select case (phenology(ipft)) case (0) !------------------------------------------------------------------------------! - ! Evergreen, there is nothing to be done here, move on. ! + ! Evergreen, there is nothing to be done here except to assign maximum ! + ! elongation factor. ! + !------------------------------------------------------------------------------! + cpatch%elongf(ico) = 1.0 !------------------------------------------------------------------------------! - continue case (1) !------------------------------------------------------------------------------! @@ -294,57 +294,78 @@ 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) < 1.0) then + !----- This is the first guess for the new elongation factor. -----------------! + elongf_try = max(0.0, min (1.0, cpatch%paw_avg(ico))) + !------------------------------------------------------------------------------! - !----- It is time to drop leaves. ------------------------------------------! - if (cpatch%phenology_status(ico) < 2) then - !----- Update litter pools. ---------------------------------------------! - cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) & - * cpatch%lai(ico) / cpatch%sla(ico) & - / cpatch%nplant(ico) - csite%fsc_in(ipa) = csite%fsc_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * f_labile(ipft) - csite%fsn_in(ipa) = csite%fsn_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * f_labile(ipft) / c2n_leaf(ipft) - csite%ssc_in(ipa) = csite%ssc_in(ipa) + cpatch%leaf_drop(ico) & - * (1.0 - f_labile(ipft)) - csite%ssl_in(ipa) = csite%ssl_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * (1.0 - f_labile(ipft)) * l2n_stem / c2n_stem(ipft) - - !----- Update plant carbon pools. ---------------------------------------! - cpatch%balive(ico) = cpatch%balive(ico) - cpatch%bleaf(ico) + if (elongf_try < 1.0 .and. cpatch%phenology_status(ico) /= 2) then + !----- It is time to drop leaves. Drop all leaves. ------------------------! + cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) * cpatch%bleaf(ico) + !---------------------------------------------------------------------------! - cpatch%bstorage(ico) = cpatch%bstorage(ico) + cpatch%bleaf(ico) & - * retained_carbon_fraction - !------------------------------------------------------------------------! - ! Contribution due to the fact that c2n_leaf and c2n_storage may be ! - ! different. ! - !------------------------------------------------------------------------! - csite%fsn_in(ipa) = csite%fsn_in(ipa) & - + cpatch%bleaf(ico) * cpatch%nplant(ico) & - * retained_carbon_fraction & - * (1.0 / c2n_leaf(ipft) - 1.0 / c2n_storage) - 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 will update -----------! - !----- carbon pools in growth_balive ---------------------------------! - cpatch%phenology_status(ico) = 1 + !----- Update plant carbon pools. ------------------------------------------! + cpatch%balive (ico) = cpatch%balive(ico) - cpatch%bleaf(ico) + cpatch%bstorage(ico) = cpatch%bstorage(ico) & + + cpatch%bleaf(ico) * retained_carbon_fraction + cpatch%bleaf (ico) = 0.0 + cpatch%elongf (ico) = 0.0 + cpatch%phenology_status(ico) = 2 + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Send the lost leaves to soil carbon and nitrogen pools. ! + !---------------------------------------------------------------------------! + csite%fsc_in(ipa) = csite%fsc_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * f_labile(ipft) + csite%fsn_in(ipa) = csite%fsn_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * f_labile(ipft) / c2n_leaf(ipft) + csite%ssc_in(ipa) = csite%ssc_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * (1.0 - f_labile(ipft)) + csite%ssl_in(ipa) = csite%ssl_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * (1.0 - f_labile(ipft)) * l2n_stem / c2n_stem(ipft) + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Contribution due to the fact that c2n_leaf and c2n_storage may be ! + ! different. ! + !---------------------------------------------------------------------------! + csite%fsn_in(ipa) = csite%fsn_in(ipa) & + + cpatch%leaf_drop(ico) * cpatch%nplant(ico) & + * (1.0 / c2n_leaf(ipft) - 1.0 / c2n_storage) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Deduct the leaf drop from the carbon balance. ! + !---------------------------------------------------------------------------! + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_drop (ico) + !---------------------------------------------------------------------------! + + elseif(elongf_try > 1.0 .and. cpatch%phenology_status(ico) == 2) then + !---------------------------------------------------------------------------! + ! It is time to flush. Change phenology_status will update carbon ! + ! pools in growth_balive. ! + !---------------------------------------------------------------------------! + cpatch%phenology_status(ico) = 1 + cpatch%elongf (ico) = 1.0 + !---------------------------------------------------------------------------! end if ! critical moisture case (2) @@ -358,11 +379,9 @@ subroutine update_phenology(doy, cpoly, isi, lat) ! 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 bl_max = 0.0 end if - delta_bleaf = cpatch%bleaf(ico) - bl_max if (delta_bleaf > 0.0) then @@ -399,14 +418,25 @@ subroutine update_phenology(doy, cpoly, isi, lat) * retained_carbon_fraction & * (1.0 / c2n_leaf(ipft) - 1.0/c2n_storage) cpatch%bleaf(ico) = bl_max - 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) + + !------------------------------------------------------------------------! + ! Deduct the leaf drop from the carbon balance. ! + !------------------------------------------------------------------------! + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax(13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax(13,ico) & + - cpatch%leaf_drop (ico) + !------------------------------------------------------------------------! end if !----- Set status flag. ----------------------------------------------------! if (bl_max == 0.0) then cpatch%phenology_status(ico) = 2 - cpatch%elongf(ico) = 0. + cpatch%elongf(ico) = 0. + else + cpatch%elongf(ico) = 1.0 ! It should become green_leaf_factor... end if elseif (cpatch%phenology_status(ico) == 2 .and. leaf_out_cold) then @@ -414,9 +444,8 @@ subroutine update_phenology(doy, cpoly, isi, lat) ! Update the phenology status (1 means that leaves are growing), ! !---------------------------------------------------------------------------! cpatch%phenology_status(ico) = 1 - ! NML -> now all growth is done in growth_balive - !cpatch%bleaf(ico) = cpoly%green_leaf_factor(ipft,isi) * cpatch%balive(ico) & - ! * salloci + cpatch%elongf (ico) = 1.0 ! It should become green_leaf_factor... + !---------------------------------------------------------------------------! end if @@ -430,37 +459,72 @@ 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. ! !------------------------------------------------------------------------------! + !----- This is the first guess for the new elongation factor. -----------------! + elongf_try = max(0.0, min (1.0, cpatch%paw_avg(ico))) + !----- If extremely dry, force the cohort to shed all leaves... ---------------! + if (elongf_try < elongf_min) elongf_try = 0.0 + !------------------------------------------------------------------------------! - cpatch%elongf(ico) = max(0.0, min (1.0, cpatch%paw_avg(ico))) - bl_max = cpatch%elongf(ico) * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) - !----- In case it is too dry, drop all the leaves... --------------------------! - if (cpatch%elongf(ico) < elongf_min) then - bl_max = 0.0 - end if - + + !----- Find the maximum allowed leaf biomass. ---------------------------------! + bl_max = elongf_try * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! Delta_bleaf is the difference between the current leaf biomass and the ! + ! maximum permitted given the soil moisture conditions. If delta_bleaf is ! + ! positive, it means that the plant has more leaves than it should. ! + !------------------------------------------------------------------------------! delta_bleaf = cpatch%bleaf(ico) - bl_max + !------------------------------------------------------------------------------! + - 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 - csite%fsc_in(ipa) = csite%fsc_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * f_labile(ipft) - csite%fsn_in(ipa) = csite%fsn_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * f_labile(ipft) / c2n_leaf(ipft) - csite%ssc_in(ipa) = csite%ssc_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * (1.0-f_labile(ipft)) - csite%ssl_in(ipa) = csite%ssl_in(ipa) & - + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & - * (1.0 - f_labile(ipft)) * l2n_stem / c2n_stem(ipft) + !------------------------------------------------------------------------------! + ! Check whether drought is becoming more or less severe. ! + !------------------------------------------------------------------------------! + if (delta_bleaf > 0.0) then + !---------------------------------------------------------------------------! + ! Drought conditions are becoming more severe, drop leaves. ! + !---------------------------------------------------------------------------! + if (elongf_try >= elongf_min) then + cpatch%phenology_status(ico) = -1 + else + cpatch%phenology_status(ico) = 2 + end if + cpatch%leaf_drop (ico) = (1.0 - retained_carbon_fraction) * delta_bleaf + cpatch%elongf (ico) = elongf_try !----- Adjust plant carbon pools. ------------------------------------------! - cpatch%balive(ico) = cpatch%balive(ico) - delta_bleaf - cpatch%bstorage(ico) = cpatch%bstorage(ico) + retained_carbon_fraction & - * delta_bleaf + cpatch%bleaf (ico) = bl_max + cpatch%balive (ico) = cpatch%balive(ico) - delta_bleaf + cpatch%bstorage (ico) = cpatch%bstorage(ico) & + + retained_carbon_fraction * delta_bleaf + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Send the lost leaves to soil carbon and nitrogen pools. ! + !---------------------------------------------------------------------------! + csite%fsc_in (ipa) = csite%fsc_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * f_labile(ipft) + csite%fsn_in (ipa) = csite%fsn_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * f_labile(ipft) / c2n_leaf(ipft) + csite%ssc_in (ipa) = csite%ssc_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * (1.0-f_labile(ipft)) + csite%ssl_in (ipa) = csite%ssl_in(ipa) & + + cpatch%nplant(ico) * cpatch%leaf_drop(ico) & + * (1.0 - f_labile(ipft)) * l2n_stem & + / c2n_stem(ipft) + !---------------------------------------------------------------------------! + + !---------------------------------------------------------------------------! ! Contribution due to the fact that c2n_leaf and c2n_storage may be ! ! different. ! @@ -468,34 +532,58 @@ subroutine update_phenology(doy, cpoly, isi, lat) csite%fsn_in(ipa) = csite%fsn_in(ipa) + delta_bleaf*cpatch%nplant(ico) & * retained_carbon_fraction & * (1.0 / c2n_leaf(ipft) - 1.0/c2n_storage) - - cpatch%bleaf(ico) = bl_max - - 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. -----! - cpatch%phenology_status(ico) = 1 - end if - + !---------------------------------------------------------------------------! + !---------------------------------------------------------------------------! + ! Deduct the leaf drop from the carbon balance. ! + !---------------------------------------------------------------------------! + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_drop (ico) + !---------------------------------------------------------------------------! + elseif (cpatch%phenology_status(ico) /= 0) then + !---------------------------------------------------------------------------! + ! Elongation factor could increase, but we first check whether it is ! + ! safe to do so based on the phenology status. ! + !---------------------------------------------------------------------------! + select case(cpatch%phenology_status(ico)) + case (1) + !----- Leaves were already growing, keep growing. -----------------------! + cpatch%elongf (ico) = elongf_try + !------------------------------------------------------------------------! + case (-1,2) + !------------------------------------------------------------------------! + ! Leaves were dropping or gone, we first check that conditions are ! + ! really improving before we turn on leaf production. ! + !------------------------------------------------------------------------! + elongf_grow = min(1.0,max(elongf_flush,cpatch%elongf(ico)+0.02)) + if (elongf_try >= elongf_grow) then + cpatch%elongf (ico) = elongf_try + cpatch%phenology_status(ico) = 1 + end if + !------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------! + end if + !------------------------------------------------------------------------------! end select !---------------------------------------------------------------------------------! + + + !----- Update LAI, WAI, and CAI 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%wai(ico),cpatch%crown_area(ico),cpatch%bsapwooda(ico)) + !---------------------------------------------------------------------------------! + + + !----- Update above-ground biomass. ----------------------------------------------! cpatch%agb(ico) = ed_biomass(cpatch%bdead(ico),cpatch%bleaf(ico) & @@ -507,25 +595,26 @@ subroutine update_phenology(doy, cpoly, isi, lat) !---------------------------------------------------------------------------------! 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%bsapwooda(ico) & + call calc_veg_hcap(cpatch%bleaf(ico),cpatch%bdead(ico),cpatch%bsapwooda(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)) + call is_resolvable(csite,ipa,ico) !----- Printing some debugging stuff if the code is set for it. ------------------! if (printphen) then ipft=cpatch%pft(ico) if (first_time(ipft)) then first_time(ipft) = .false. - write (unit=40+ipft,fmt='(a10,5(1x,a12))') & + write (unit=40+ipft,fmt='(a10,6(1x,a12))') & &' TIME',' PATCH',' COHORT',' NPLANT' & - & ,' LEAF_DROP',' THETA' + & ,' LEAF_DROP',' PAW_AVG',' ELONGF' end if - write (unit=40+ipft,fmt='(2(i2.2,a1),i4.4,2(1x,i12),4(1x,es12.5))') & + write (unit=40+ipft,fmt='(2(i2.2,a1),i4.4,2(1x,i12),5(1x,es12.5))') & current_time%month,'/',current_time%date,'/',current_time%year,ipa,ico & - ,cpatch%nplant(ico),cpatch%leaf_drop(ico),theta(kroot) + ,cpatch%nplant(ico),cpatch%leaf_drop(ico),cpatch%paw_avg(ico) & + ,cpatch%elongf(ico) end if end do cohortloop end do patchloop @@ -557,14 +646,15 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) 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) + , elongf_min & ! intent(in) + , elongf_flush ! ! 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 + , size2bl ! ! function use phenology_aux , only : daylength ! ! function implicit none @@ -590,6 +680,7 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) real :: old_leaf_hcap real :: old_wood_hcap real :: salloci + real :: elongf_try !---------------------------------------------------------------------------------------! @@ -609,7 +700,7 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) 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)) + ,leaf_out_cold,cpoly%lsl(isi)) cohortloop: do ico = 1,cpatch%ncohorts ipft = cpatch%pft(ico) @@ -618,9 +709,6 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) !----- 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) @@ -656,9 +744,10 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) select case (phenology(ipft)) case (0) !------------------------------------------------------------------------------! - ! Evergreen, there is nothing to be done here, move on. ! + ! Evergreen, there is nothing to be done here, assign elongation factor to ! + ! maximum and move on. ! !------------------------------------------------------------------------------! - continue + cpatch%elongf(ico) = 1.0 case (1) !------------------------------------------------------------------------------! @@ -674,16 +763,21 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) 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) + 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_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_drop (ico) + !------------------------------------------------------------------------! end if elseif(theta(kroot) > 1.0 .and. cpatch%phenology_status(ico) == 2) then @@ -693,7 +787,7 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) ! leaves appear all of a sudden. ! !---------------------------------------------------------------------------! cpatch%phenology_status(ico) = 1 - cpatch%bleaf(ico) = dbh2bl(cpatch%dbh(ico),ipft) + cpatch%bleaf(ico) = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) cpatch%balive(ico) = cpatch%balive(ico) + cpatch%bleaf(ico) cpatch%elongf(ico) = 1.0 end if ! critical moisture @@ -714,7 +808,7 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) bleaf_new = 0.0 else bleaf_new = cpoly%green_leaf_factor(ipft,isi) & - * dbh2bl(cpatch%dbh(ico),ipft) + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) end if delta_bleaf = cpatch%bleaf(ico) - bleaf_new @@ -740,15 +834,22 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) ! 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) + cpatch%bleaf (ico) = bleaf_new + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_drop (ico) !------------------------------------------------------------------------! end if !----- Set status flag. ----------------------------------------------------! if (bleaf_new == 0.0) then cpatch%phenology_status(ico) = 2 + cpatch%elongf (ico) = 0. + else + cpatch%elongf (ico) = 1. end if !---------------------------------------------------------------------------! @@ -758,8 +859,9 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) ! Update the phenology status (1 means that leaves are growing), ! !---------------------------------------------------------------------------! cpatch%phenology_status(ico) = 1 + cpatch%elongf (ico) = 1. cpatch%bleaf(ico) = cpoly%green_leaf_factor(ipft,isi) & - * dbh2bl(cpatch%dbh(ico),ipft) + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) cpatch%balive(ico) = cpatch%balive(ico) + cpatch%bleaf(ico) !---------------------------------------------------------------------------! end if @@ -775,56 +877,71 @@ subroutine update_phenology_eq_0(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))) + elongf_try = max(0.0, min (1.0, cpatch%paw_avg(ico))) + + !----- In case it is too dry, drop all the leaves. ----------------------------! + if (elongf_try < elongf_min) elongf_try = 0. + !----- Find the new leaf biomass. ---------------------------------------------! + bleaf_new = elongf_try * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) !------------------------------------------------------------------------------! - ! In case it is too dry, drop all the leaves, otherwise scale the leaf ! - ! biomass with elongation factor. ! + ! Delta_bleaf is the difference between the current leaf biomass and the ! + ! maximum permitted given the soil moisture conditions. If delta_bleaf is ! + ! positive, it means that the plant has more leaves than it should. ! !------------------------------------------------------------------------------! - 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 + !------------------------------------------------------------------------------! + ! Check whether plants have any leaves. ! + !------------------------------------------------------------------------------! + if (delta_bleaf > 0.0) then !---------------------------------------------------------------------------! - ! 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. -------------------------------------------------------! + ! Drought conditions are becoming more severe, drop leaves. ! + !---------------------------------------------------------------------------! + if (elongf_try > elongf_min) then + cpatch%phenology_status(ico) = -1 + else 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. -----------! + cpatch%leaf_drop(ico) = (1.0 - retained_carbon_fraction) * delta_bleaf + cpatch%elongf (ico) = elongf_try + !----- Adjust plant carbon pools. ------------------------------------------! + cpatch%balive (ico) = cpatch%balive(ico) - delta_bleaf + cpatch%bleaf (ico) = bleaf_new + cpatch%bstorage (ico) = cpatch%bstorage(ico) & + + retained_carbon_fraction * delta_bleaf + !---------------------------------------------------------------------------! - elseif (cpatch%elongf(ico) > elongf_min .and. & - cpatch%phenology_status(ico) /= 0 ) then - !----- Not in allometry but growing, allocate carbon in growth_balive. -----! + !---------------------------------------------------------------------------! + ! Deduct the leaf drop from the carbon balance. ! + !---------------------------------------------------------------------------! + cpatch%cb (13,ico) = cpatch%cb (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_lightmax (13,ico) = cpatch%cb_lightmax (13,ico) & + - cpatch%leaf_drop (ico) + cpatch%cb_moistmax (13,ico) = cpatch%cb_moistmax (13,ico) & + - cpatch%leaf_drop (ico) + !---------------------------------------------------------------------------! + else + !---------------------------------------------------------------------------! + ! Conditions are slightly more humid. Let them grow. ! + !---------------------------------------------------------------------------! + cpatch%elongf (ico) = elongf_try + cpatch%phenology_status(ico) = 1 + cpatch%bleaf (ico) = bleaf_new + cpatch%balive (ico) = cpatch%balive(ico) - delta_bleaf + !----- Decide the status based on whether bleaf is at maximum or not. ------! 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, WAI, and CAI accordingly. -------------------------------------! @@ -847,7 +964,7 @@ subroutine update_phenology_eq_0(doy, cpoly, isi, lat) ,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)) + call is_resolvable(csite,ipa,ico) end do cohortloop end do patchloop return @@ -868,7 +985,7 @@ end subroutine update_phenology_eq_0 ! long term dry condition? ! !------------------------------------------------------------------------------------------! subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd,sum_dgd & - ,drop_cold,leaf_out_cold,theta,lsl) + ,drop_cold,leaf_out_cold,lsl) use grid_coms , only : nzg ! ! intent(in) use soil_coms , only : soil & ! intent(in) , dslz & ! intent(in) @@ -891,7 +1008,6 @@ subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd real , intent(inout) :: sum_chd ! logical , intent(out) :: drop_cold ! logical , intent(out) :: leaf_out_cold ! - real , dimension(nzg), intent(out) :: theta ! !----- Local variables -----------------------------------------------------------------! real :: gdd_threshold integer :: k1 @@ -903,7 +1019,6 @@ subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd !----- Initialize variables. -----------------------------------------------------------! drop_cold = .false. leaf_out_cold = .false. - theta(1:nzg) = 0.0 select case (iphen_scheme) !---------------------------------------------------------------------------------------! @@ -927,22 +1042,6 @@ subroutine phenology_thresholds(daylight,soil_temp,soil_water,soil_class,sum_chd leaf_out_cold = sum_dgd >= gdd_threshold end select - !---------------------------------------------------------------------------------------! - ! Calculate average theta for drought deciduous PFTs. The different k1's ! - ! represent different rooting depths. ! - !---------------------------------------------------------------------------------------! - theta(1:nzg) = 0.0 - topsoil = soil_class(nzg) - do k1 = lsl, nzg - do k2 = k1,nzg - nsoil = soil_class(k2) - theta(k1) = theta(k1) & - + (soil_water(k2) - soil(nsoil)%soilwp) * dslz(k2) & - / (soil(nsoil)%soilld - soil(nsoil)%soilwp) - end do - theta(k1) = - theta(k1) / slz(k1) - end do - return end subroutine phenology_thresholds !==========================================================================================! @@ -959,7 +1058,7 @@ end subroutine phenology_thresholds !------------------------------------------------------------------------------------------! subroutine assign_prescribed_phen(green_leaf_factor,leaf_aging_factor,dbh,height,pft & ,drop_cold,leaf_out_cold,bl_max) - use allometry , only : dbh2bl + use allometry , only : size2bl use phenology_coms, only : elongf_min implicit none !------ Arguments. ---------------------------------------------------------------------! @@ -975,7 +1074,7 @@ subroutine assign_prescribed_phen(green_leaf_factor,leaf_aging_factor,dbh,height drop_cold = green_leaf_factor /= leaf_aging_factor leaf_out_cold = green_leaf_factor > elongf_min .and. (.not. drop_cold) - bl_max = green_leaf_factor * dbh2bl(dbh, pft) + bl_max = green_leaf_factor * size2bl(dbh, height, pft) return end subroutine assign_prescribed_phen diff --git a/ED/src/dynamics/photosyn_driv.f90 b/ED/src/dynamics/photosyn_driv.f90 index 87b4da455..67864cbac 100644 --- a/ED/src/dynamics/photosyn_driv.f90 +++ b/ED/src/dynamics/photosyn_driv.f90 @@ -31,7 +31,7 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil use phenology_coms , only : llspan_inf ! ! intent(in) use farq_leuning , only : lphysiol_full ! ! sub-routine use allometry , only : h2crownbh ! ! function - + use therm_lib , only : qslif ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(sitetype) , target :: csite ! Current site @@ -79,6 +79,7 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil real :: pss_available_water real :: vm0_tuco real :: llspan_tuco + real :: can_ssh integer, dimension(n_pft) :: tuco_pft !---------------------------------------------------------------------------------------! @@ -294,13 +295,14 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil !------------------------------------------------------------------------------! - !------------------------------------------------------------------------------! - ! Scale photosynthetically active radiation per unit of leaf. ! + ! Find the 100% relative humidity. This is a temporary test to make the ! + ! maximum carbon balance less negative. ! !------------------------------------------------------------------------------! - leaf_par = csite%par_l_max(ipa) / cpatch%lai(tuco) + can_ssh = csite%can_shv(ipa) !------------------------------------------------------------------------------! + !------------------------------------------------------------------------------! ! Call the photosynthesis for maximum photosynthetic rates. The units ! ! of the input and output are the standard in most of ED modules, but many of ! @@ -311,10 +313,10 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil call lphysiol_full( & ! csite%can_prss(ipa) & ! Canopy air pressure [ Pa] , csite%can_rhos(ipa) & ! Canopy air density [ kg/m³] - , csite%can_shv(ipa) & ! Canopy air sp. humidity [ kg/kg] + , can_ssh & ! Canopy air sp. humidity [ kg/kg] , csite%can_co2(ipa) & ! Canopy air CO2 mixing ratio [ µmol/mol] , ipft & ! Plant functional type [ ---] - , leaf_par & ! Absorbed photos. active rad. [ W/m²] + , csite%par_l_max(ipa) & ! Absorbed photos. active rad. [ W/m²leaf] , cpatch%leaf_temp(tuco) & ! Leaf temperature [ K] , cpatch%lint_shv(tuco) & ! Leaf intercellular spec. hum. [ kg/kg] , green_leaf_factor(ipft) & ! Greenness rel. to on-allometry [ ---] @@ -394,7 +396,7 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil , csite%can_shv(ipa) & ! Canopy air sp. humidity [ kg/kg] , csite%can_co2(ipa) & ! Canopy air CO2 mixing ratio [ µmol/mol] , ipft & ! Plant functional type [ ---] - , leaf_par & ! Absorbed photos. active rad. [ W/m²] + , leaf_par & ! Absorbed photos. active rad. [ W/m²leaf] , cpatch%leaf_temp(ico) & ! Leaf temperature [ K] , cpatch%lint_shv(ico) & ! Leaf intercellular spec. hum. [ kg/kg] , green_leaf_factor(ipft) & ! Greenness rel. to on-allometry [ ---] @@ -474,6 +476,8 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil cpatch%stomatal_conductance(ico) = cpatch%fs_open(ico) *cpatch%gsw_open(ico) & + (1.0 - cpatch%fs_open(ico)) & * cpatch%gsw_closed(ico) + !------------------------------------------------------------------------------! + !----- GPP, averaged over frqstate. -------------------------------------------! cpatch%gpp(ico) = cpatch%lai(ico) & @@ -481,9 +485,13 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil + (1.0 - cpatch%fs_open(ico)) * cpatch%A_closed(ico) ) & + cpatch%leaf_respiration(ico) cpatch%mean_gpp(ico) = cpatch%mean_gpp(ico) + cpatch%gpp(ico) + !------------------------------------------------------------------------------! + !----- GPP, summed over 1 day. [µmol/m²ground] --------------------------------! cpatch%today_gpp(ico) = cpatch%today_gpp(ico) + cpatch%gpp(ico) + !------------------------------------------------------------------------------! + !----- Potential GPP if no N limitation. [µmol/m²ground] ----------------------! cpatch%today_gpp_pot(ico) = cpatch%today_gpp_pot(ico) & @@ -491,14 +499,33 @@ subroutine canopy_photosynthesis(csite,cmet,mzg,ipa,lsl,ntext_soil * ( cpatch%fsw(ico) * cpatch%A_open(ico) & + (1.0 - cpatch%fsw(ico)) * cpatch%A_closed(ico)) & + cpatch%leaf_respiration(ico) + !------------------------------------------------------------------------------! - !----- Maximum GPP if at the top of the canopy [µmol/m²ground] ----------------! - cpatch%today_gpp_max(ico) = cpatch%today_gpp_max(ico) & - + cpatch%lai(ico) & - * ( cpatch%fs_open(ico) * csite%A_o_max(ipft,ipa) & - + (1.0 - cpatch%fs_open(ico)) & - * csite%A_c_max(ipft,ipa)) & - + cpatch%leaf_respiration(ico) + + + !------------------------------------------------------------------------------! + ! Find the maximum productivities: ! + ! ! + ! - today_gpp_lightmax: productivity of this cohort if it were at the top ! + ! of the canopy (full light), with the actual fsw. ! + ! - today_gpp_moistmax: productivity of this cohort if the soil moisture ! + ! was such that fsw would be 1 (full moisture), with ! + ! the actual light. ! + ! ! + ! These productivites are used to scale the relative carbon balance, which ! + ! will control density-dependent mortality. ! + !------------------------------------------------------------------------------! + cpatch%today_gpp_lightmax(ico) = cpatch%today_gpp_lightmax(ico) & + + cpatch%lai(ico) & + * ( cpatch%fs_open(ico) & + * csite%A_o_max(ipft,ipa) & + + (1.0 - cpatch%fs_open(ico)) & + * csite%A_c_max(ipft,ipa) ) & + + cpatch%leaf_respiration(ico) + cpatch%today_gpp_moistmax(ico) = cpatch%today_gpp_moistmax(ico) & + + cpatch%lai(ico) * cpatch%A_open(ico) & + + cpatch%leaf_respiration(ico) + !------------------------------------------------------------------------------! else !----- If the cohort wasn't solved, we must assign some zeroes. ------------------! diff --git a/ED/src/dynamics/radiate_driver.f90 b/ED/src/dynamics/radiate_driver.f90 index 35c01e917..5623e0974 100644 --- a/ED/src/dynamics/radiate_driver.f90 +++ b/ED/src/dynamics/radiate_driver.f90 @@ -252,6 +252,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu integer :: colour integer :: k integer :: ksn + integer :: tuco_leaf real :: fcpct real :: albedo_soil_par real :: albedo_soil_nir @@ -395,6 +396,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu !------------------------------------------------------------------------------------! cohort_count = 0 tuco = 0 + tuco_leaf = 0 !------------------------------------------------------------------------------------! @@ -456,22 +458,30 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu if (cpatch%leaf_resolvable(ico) .or. cpatch%wood_resolvable(ico)) then !----- This will eventually have the index of the tallest used cohort. -----! tuco = ico + !---------------------------------------------------------------------------! cohort_count = cohort_count + 1 pft_array (cohort_count) = cpatch%pft(ico) + + + !---------------------------------------------------------------------------! ! Here we only tell the true LAI if the leaf is resolvable, and the ! - ! true WAI if the wood is resolvable. ! + ! true WAI if the wood is resolvable. Also, for photosynthesis, we must ! + ! keep track of the tallest cohort that has leaves (we track the array ! + ! counters because we will extract the information directly from the ! + ! arrays. ! !---------------------------------------------------------------------------! if (cpatch%leaf_resolvable(ico)) then - lai_array (cohort_count) = dble(cpatch%lai(ico)) + tuco_leaf = cohort_count + lai_array (cohort_count) = dble(cpatch%lai(ico)) else - lai_array (cohort_count) = 0.d0 + lai_array (cohort_count) = 0.d0 end if if (cpatch%wood_resolvable(ico)) then - wai_array (cohort_count) = dble(cpatch%wai(ico)) + wai_array (cohort_count) = dble(cpatch%wai(ico)) else - wai_array (cohort_count) = 0.d0 + wai_array (cohort_count) = 0.d0 end if !---------------------------------------------------------------------------! @@ -487,6 +497,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu light_level_array (cohort_count) = 0.d0 light_beam_level_array (cohort_count) = 0.d0 light_diff_level_array (cohort_count) = 0.d0 + !---------------------------------------------------------------------------! !---------------------------------------------------------------------------! ! Decide whether to assume infinite crown, or the crown area allometry ! @@ -538,18 +549,38 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu !------------------------------------------------------------------------------! ! Check whether the cohort is resolvable or not. ! !------------------------------------------------------------------------------! - if (cpatch%leaf_resolvable(1) .or. cpatch%wood_resolvable(1)) then + if (cpatch%leaf_resolvable(1) .or. cpatch%wood_resolvable(1)) then tuco = 1 !---- Dummy variable. ---------------------------------------------! + + !---------------------------------------------------------------------------! - ! Patch/cohort has enough leaf or wood. Find the number of layers for ! - ! the radiation scheme. ! + ! Here we only tell the true LAI if the leaf is resolvable, and the ! + ! true ! + ! WAI if the wood is resolvable. Also, for photosynthesis, we must keep track ! + ! of the tallest cohort that has leaves (we track the array counters because ! + ! we will extract the information directly from the arrays. ! !---------------------------------------------------------------------------! - cohort_count = ceiling( (cpatch%lai(1) + cpatch%wai(1)) / tai_lyr_max ) - bl_lai_each = cpatch%lai(1) / real(cohort_count) - bl_wai_each = cpatch%wai(1) / real(cohort_count) + if (cpatch%leaf_resolvable(1) .and. cpatch%wood_resolvable(1)) then + cohort_count = ceiling( (cpatch%lai(1) + cpatch%wai(1)) / tai_lyr_max ) + bl_lai_each = cpatch%lai(1) / real(cohort_count) + bl_wai_each = cpatch%wai(1) / real(cohort_count) + tuco_leaf = cohort_count + elseif (cpatch%leaf_resolvable(1)) then + cohort_count = ceiling( cpatch%lai(1) / tai_lyr_max ) + bl_lai_each = cpatch%lai(1) / real(cohort_count) + bl_wai_each = 0.0 + tuco_leaf = cohort_count + elseif (cpatch%wood_resolvable(1)) then + cohort_count = ceiling( cpatch%wai(1) / tai_lyr_max ) + bl_lai_each = 0.0 + bl_wai_each = cpatch%wai(1) / real(cohort_count) + end if !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! ! Loop over all layers, and assign equal amounts of LAI and WAI such ! ! that they add back to the total amount. We impose crown model off for ! @@ -641,7 +672,7 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu 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 & + albedo_soil_nir = min(soilcol(colour)%alb_nir_dry & ,soilcol(colour)%alb_nir_wet + fcpct) !------------------------------------------------------------------------------! end select @@ -900,16 +931,22 @@ subroutine sfcrad_ed(cosz,cosaoi,csite,mzg,mzs,ntext_soil,ncol_soil,maxcohort,tu ! 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 + if (tuco_leaf /= 0) then + ipft = pft_array(tuco_leaf) + wleaf_vis = sngloff( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(tuco_leaf) & + / ( clumping_factor(ipft) & + * (1.d0 - leaf_scatter_vis(ipft)) & + * LAI_array(tuco_leaf) & + + (1.d0 - wood_scatter_vis(ipft)) & + * WAI_array(tuco_leaf) ) & + , tiny_offset) + csite%par_l_beam_max(ipa) = par_v_beam_array(tuco_leaf) * wleaf_vis & + / LAI_array(tuco_leaf) + csite%par_l_diffuse_max(ipa) = par_v_diffuse_array(tuco_leaf) * wleaf_vis & + / LAI_array(tuco_leaf) + end if !------------------------------------------------------------------------------! diff --git a/ED/src/dynamics/reproduction.f90 b/ED/src/dynamics/reproduction.f90 index f7b960777..b876dd527 100644 --- a/ED/src/dynamics/reproduction.f90 +++ b/ED/src/dynamics/reproduction.f90 @@ -42,9 +42,8 @@ subroutine reproduction(cgrid, month) 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 , size2bl & ! function + , h2dbh & ! function , dbh2h & ! function , ed_biomass & ! function , area_indices & ! subroutine @@ -172,13 +171,17 @@ subroutine reproduction(cgrid, month) !------------------------------------------------------------------! ! We assign the recruit in the temporary recruitment structure. ! !------------------------------------------------------------------! - rectest%pft = ipft - rectest%leaf_temp = csite%can_temp(ipa) - rectest%wood_temp = csite%can_temp(ipa) - rectest%leaf_temp_pv=csite%can_temp(ipa) - rectest%wood_temp_pv=csite%can_temp(ipa) + rectest%pft = ipft + rectest%leaf_temp = csite%can_temp (ipa) + rectest%wood_temp = csite%can_temp (ipa) + rectest%leaf_temp_pv = csite%can_temp (ipa) + rectest%wood_temp_pv = csite%can_temp (ipa) + rectest%leaf_vpdef = csite%can_vpdef(ipa) - !- recruits start at minimum height and dbh and bleaf are calculated from that + !------------------------------------------------------------------! + ! Recruits start at minimum height and dbh and bleaf are ! + ! calculated from that. ! + !------------------------------------------------------------------! rectest%hite = hgt_min(ipft) rectest%dbh = h2dbh(rectest%hite, ipft) rectest%krdepth = dbh2krdepth(rectest%hite,rectest%dbh & @@ -232,7 +235,6 @@ subroutine reproduction(cgrid, month) ! patch. Send the seed litter to the soil pools for decomposition.! !------------------------------------------------------------------! !---ALS=== dont send all seeds to litter! Keep it for harvesting? ! - csite%fast_soil_N(ipa) = csite%fast_soil_N(ipa) & + csite%repro(ipft,ipa) / c2n_recruit(ipft) csite%fast_soil_C(ipa) = csite%fast_soil_C(ipa) & @@ -311,6 +313,7 @@ subroutine reproduction(cgrid, month) cpatch%wood_temp (ico) = recruit(inew)%wood_temp cpatch%leaf_temp_pv (ico) = recruit(inew)%leaf_temp_pv cpatch%wood_temp_pv (ico) = recruit(inew)%wood_temp_pv + cpatch%leaf_vpdef (ico) = recruit(inew)%leaf_vpdef !---------------------------------------------------------------------! @@ -326,13 +329,17 @@ subroutine reproduction(cgrid, month) ! Computing initial AGB and Basal Area. Their derivatives will be ! ! zero. ! !---------------------------------------------------------------------! - cpatch%agb(ico) = ed_biomass(cpatch%bdead(ico),cpatch%bleaf(ico) & - ,cpatch%bsapwooda(ico),cpatch%pft(ico)) - - cpatch%basarea(ico) = pio4 * cpatch%dbh(ico) * cpatch%dbh(ico) - cpatch%dagb_dt(ico) = 0.0 - cpatch%dba_dt(ico) = 0.0 - cpatch%ddbh_dt(ico) = 0.0 + cpatch%agb (ico) = ed_biomass( cpatch%bdead (ico) & + , cpatch%bleaf (ico) & + , cpatch%bsapwooda (ico) & + , cpatch%pft (ico) ) + cpatch%basarea (ico) = pio4 * cpatch%dbh(ico) * cpatch%dbh(ico) + cpatch%dagb_dt (ico) = 0.0 + cpatch%dlnagb_dt(ico) = 0.0 + cpatch%dba_dt (ico) = 0.0 + cpatch%dlnba_dt (ico) = 0.0 + cpatch%ddbh_dt (ico) = 0.0 + cpatch%dlndbh_dt(ico) = 0.0 !---------------------------------------------------------------------! ! Setting new_recruit_flag to 1 indicates that this cohort is ! ! included when we tally agb_recruit, basal_area_recruit. ! @@ -357,7 +364,7 @@ subroutine reproduction(cgrid, month) cpatch%leaf_energy(ico) = cpatch%leaf_hcap(ico)*cpatch%leaf_temp(ico) cpatch%wood_energy(ico) = cpatch%wood_hcap(ico)*cpatch%wood_temp(ico) - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) !----- Update number of cohorts in this site. ------------------------! csite%cohort_count(ipa) = csite%cohort_count(ipa) + 1 @@ -450,71 +457,67 @@ subroutine reproduction(cgrid, month) !------------------------------------------------------------------------! ! Check to make sure that it is not too cold and reproduction is on ! !------------------------------------------------------------------------! - if( cpoly%min_monthly_temp(isi) >= plant_min_temp(ipft) - 5.0 .and. & - repro_scheme /= 0 ) then + if ( cpoly%min_monthly_temp(isi) >= plant_min_temp(ipft) - 5.0 .and. & + repro_scheme /= 0 ) then - nplant_inc = csite%repro(ipft,ipa) / one_plant_c(ipft) - - !------------------------------------------------------------------! - ! Will only reproduce/grow if on-allometry so dont' have to ! - ! worry about elongation factor ! - !------------------------------------------------------------------! - bleaf_plant = dbh2bl(cpatch%dbh(ico),ipft) - bdead_plant = dbh2bd(cpatch%dbh(ico),ipft) - balive_plant = dbh2bl(cpatch%dbh(ico),ipft) * (1.0 + qsw(ipft) & - * cpatch%hite(ico) + q(ipft)) - broot_plant = balive_plant * q(ipft) / (1.0 + qsw(ipft) & - * cpatch%hite(ico) + q(ipft)) - bsapwood_plant = balive_plant * qsw(ipft) * cpatch%hite(ico) & - / (1.0 + qsw(ipft) * cpatch%hite(ico) + q(ipft)) - - cpatch%today_nppleaf(ico) = nplant_inc * bleaf_plant - cpatch%today_nppfroot(ico) = nplant_inc * broot_plant - cpatch%today_nppsapwood(ico)= nplant_inc * bsapwood_plant - cpatch%today_nppwood(ico) = agf_bs(ipft) * nplant_inc & - * bdead_plant - cpatch%today_nppcroot(ico) = (1. - agf_bs(ipft)) * nplant_inc & - * bdead_plant - - cpatch%nplant(ico) = cpatch%nplant(ico) + nplant_inc - - - !----- Reset the carbon available for reproduction. ---------------! - csite%repro(ipft,ipa) = 0.0 + !---------------------------------------------------------------------! + ! Plants don't have size distribution, so use the standard value ! + ! of one plant to find a population increase that is consistent with ! + ! the expected average biomass. ! + !---------------------------------------------------------------------! + nplant_inc = csite%repro(ipft,ipa) / one_plant_c(ipft) + cpatch%nplant(ico) = cpatch%nplant(ico) + nplant_inc + !---------------------------------------------------------------------! - !------------------------------------------------------------------! - ! Obtain derived properties these will have changed ! - !------------------------------------------------------------------! - !----- Find LAI, WAI, and CAI. ------------------------------------! - 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) & + !----- Reset the carbon available for reproduction. ------------------! + csite%repro(ipft,ipa) = 0.0 + !---------------------------------------------------------------------! + + !---------------------------------------------------------------------! + ! Will only reproduce/grow if on-allometry so dont' have to worry ! + ! about elongation factor. ! + !---------------------------------------------------------------------! + bleaf_plant = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) + broot_plant = bleaf_plant * q(ipft) + bsapwood_plant = bleaf_plant * qsw(ipft) * cpatch%hite(ico) + balive_plant = bleaf_plant + broot_plant + bsapwood_plant + bdead_plant = dbh2bd(cpatch%dbh(ico),ipft) + + cpatch%today_nppleaf(ico) = nplant_inc * bleaf_plant + cpatch%today_nppfroot(ico) = nplant_inc * broot_plant + cpatch%today_nppsapwood(ico)= nplant_inc * bsapwood_plant + cpatch%today_nppwood(ico) = agf_bs(ipft) * nplant_inc * bdead_plant + cpatch%today_nppcroot(ico) = (1. - agf_bs(ipft)) * nplant_inc & + * bdead_plant + + + !---------------------------------------------------------------------! + ! Obtain derived properties these will have changed ! + !---------------------------------------------------------------------! + !----- Find LAI, WAI, and CAI. ---------------------------------------! + 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%wai(ico) & ,cpatch%crown_area(ico),cpatch%bsapwooda(ico)) - !----- Find heat capacity and vegetation internal energy. ---------! - call calc_veg_hcap(cpatch%bleaf(ico),cpatch%bdead(ico) & + !----- Find heat capacity and vegetation internal energy. ------------! + call calc_veg_hcap(cpatch%bleaf(ico),cpatch%bdead(ico) & ,cpatch%bsapwooda(ico),cpatch%nplant(ico) & ,cpatch%pft(ico) & ,cpatch%leaf_hcap(ico),cpatch%wood_hcap(ico)) - cpatch%leaf_energy(ico) = cpatch%leaf_hcap(ico) & - * cpatch%leaf_temp(ico) - cpatch%wood_energy(ico) = cpatch%wood_hcap(ico) & - * cpatch%wood_temp(ico) + cpatch%leaf_energy(ico) = cpatch%leaf_hcap(ico) * cpatch%leaf_temp(ico) + cpatch%wood_energy(ico) = cpatch%wood_hcap(ico) * cpatch%wood_temp(ico) - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) end if end do cohortloop_big end do patchloop_big - - - !------------------------------------------------------------------------------! - ! Now that recruitment has occured rescale patches and update properties ! !------------------------------------------------------------------------------! - !call rescale_patches(csite) - + update_patch_loop_big: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) @@ -585,10 +588,6 @@ subroutine reproduction_eq_0(cgrid, month) 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 - , area_indices ! ! subroutine use grid_coms , only : nzg ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! diff --git a/ED/src/dynamics/rk4_derivs.F90 b/ED/src/dynamics/rk4_derivs.F90 index f0d0315e5..ff6882bfa 100644 --- a/ED/src/dynamics/rk4_derivs.F90 +++ b/ED/src/dynamics/rk4_derivs.F90 @@ -91,8 +91,10 @@ subroutine leaftw_derivs(mzg,mzs,initp,dinitp,csite,ipa,dt) , dslzti8 & ! intent(in) , slcons18 & ! intent(in) , slzt8 & ! intent(in) + , dslzt8 & ! intent(in) , ss & ! intent(in) , isoilbc & ! intent(in) + , sin_sldrain8 & ! intent(in) , freezecoef8 ! ! intent(in) use ed_misc_coms , only : dtlsm & ! intent(in) , current_time & ! intent(in) @@ -371,37 +373,24 @@ end subroutine canopy_derivs_two case (2) !------------------------------------------------------------------------------------! - ! Super drainage. Make the water potential at the layer beneath to be at dry ! - ! air soil, and find the corresponding hydraulic conductivity. ! + ! Lateral drainage (or reduced drainage). Find the equivalent depth of the ! + ! layer beneath as a function of the slope (sldrain), and assume the soil moisture ! + ! and matric potential to be the same as the bottom layer. Notice that when sldrain ! + ! is zero this becomes the flat bedrock condition, and when sldrain is 90 degrees, ! + ! then it becomes free drainage. ! !------------------------------------------------------------------------------------! - initp%soil_water (kben) = soil8(nsoil)%soilcp + initp%soil_water (kben) = initp%soil_water (klsl) initp%soil_fracliq (kben) = initp%soil_fracliq (klsl) wgpfrac = min(initp%soil_water(kben)/soil8(nsoil)%slmsts, 1.d0) - rk4aux%hydcond (kben) = slcons18(kben,nsoil) & - * wgpfrac ** (2.d0 * soil8(nsoil)%slbs + 3.d0) - rk4aux%psiplusz (kben) = slzt8(kben) + soil8(nsoil)%slpots & - / wgpfrac ** soil8(nsoil)%slbs + rk4aux%hydcond (kben) = rk4aux%hydcond (klsl) + rk4aux%psiplusz (kben) = slzt8(klsl) - dslzt8(klsl) * sin_sldrain8 & + + soil8(nsoil)%slpots / wgpfrac ** soil8(nsoil)%slbs rk4aux%drysoil (kben) = .false. rk4aux%satsoil (kben) = .false. !------------------------------------------------------------------------------------! case (3) - !------------------------------------------------------------------------------------! - ! Make the soil moisture in the layer beneath to be at field capacity. ! - !------------------------------------------------------------------------------------! - initp%soil_water (kben) = soil8(nsoil)%slmsts - initp%soil_fracliq (kben) = initp%soil_fracliq (klsl) - - wgpfrac = min(initp%soil_water(kben)/soil8(nsoil)%sfldcap, 1.d0) - rk4aux%hydcond (kben) = slcons18(kben,nsoil) & - * wgpfrac ** (2.d0 * soil8(nsoil)%slbs + 3.d0) - rk4aux%psiplusz (kben) = slzt8(kben) + soil8(nsoil)%slpots & - / wgpfrac ** soil8(nsoil)%slbs - rk4aux%drysoil (kben) = .false. - rk4aux%satsoil (kben) = .false. - - case (4) !------------------------------------------------------------------------------------! ! Aquifer. Make the soil moisture in the layer beneath to be always saturated. ! !------------------------------------------------------------------------------------! @@ -415,6 +404,7 @@ end subroutine canopy_derivs_two / wgpfrac ** soil8(nsoil)%slbs rk4aux%drysoil (kben) = .false. rk4aux%satsoil (kben) = .false. + end select !---------------------------------------------------------------------------------------! @@ -427,7 +417,7 @@ end subroutine canopy_derivs_two ,ddewgnd,throughfall_tot,qthroughfall_tot,dthroughfall_tot & ,wshed_tot,qwshed_tot,dwshed_tot,dt) !---------------------------------------------------------------------------------------! - + @@ -917,12 +907,12 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de real(kind=8) :: transp_tot ! Total transpiration (water) real(kind=8) :: qtransp_tot ! Total transpiration (energy) real(kind=8) :: cflxlc_tot ! Total leaf -> CAS CO2 flux + real(kind=8) :: cflxwc_tot ! Total wood -> CAS CO2 flux real(kind=8) :: wflxlc_tot ! Leaf -> CAS evaporation (water) real(kind=8) :: wflxwc_tot ! Wood -> CAS evaporation (water) real(kind=8) :: qwflxlc_tot ! Leaf -> CAS evaporation (energy) real(kind=8) :: qwflxwc_tot ! Wood -> CAS evaporation (energy) real(kind=8) :: rho_ustar ! - real(kind=8) :: storage_decay ! real(kind=8) :: leaf_flux ! real(kind=8) :: min_leaf_water ! real(kind=8) :: max_leaf_water ! @@ -956,8 +946,6 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de cpatch => csite%patch(ipa) !---------------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------------! ! Computing the fluxes from atmosphere to canopy. ! !---------------------------------------------------------------------------------------! @@ -1202,10 +1190,11 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de !---------------------------------------------------------------------------------------! ! Heterotrophic respiration is a patch-level variable, so we initialise the total ! ! vegetation to canopy carbon flux with the total heterotrophic respiration due to the ! - ! coarse wood debris, and remove that from the ground to canopy carbon flux to avoid ! + ! coarse woody debris, and remove that from the ground to canopy carbon flux to avoid ! ! double counting. ! !---------------------------------------------------------------------------------------! - cflxlc_tot = initp%cwd_rh + cflxlc_tot = 0.d0 + cflxwc_tot = initp%cwd_rh cflxgc = initp%rh - initp%cwd_rh !---------------------------------------------------------------------------------------! @@ -1214,15 +1203,19 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de cflxgc = cflxgc + initp%root_resp(ico) !------------------------------------------------------------------------------------! - ! Calculate 'decay' term of storage. ! + ! Add the respiration terms according to their "source". ! + ! Ground -> CAS : root respiration and non-CWD heterotrophic respiration. ! + ! Wood -> CAS : CWD respiration, Growth respiration, and storage (the latter due ! + ! to lack of a better place to put). ! + ! Leaf -> CAS : Leaf respiration, Virtual leaf respiration - GPP. ! !------------------------------------------------------------------------------------! - storage_decay = initp%growth_resp(ico) + initp%storage_resp(ico) & - + initp%vleaf_resp(ico) - cflxlc_tot = cflxlc_tot + storage_decay + cflxlc_tot = cflxlc_tot + initp%vleaf_resp(ico) + cflxwc_tot = cflxwc_tot + initp%growth_resp(ico) + initp%storage_resp(ico) !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! ! LEAF BUDGET - Check whether the leaves of this cohort haven't been flagged as non- ! ! resolvable, i.e., it has leaves, belongs to a patch that is not too ! @@ -1240,6 +1233,26 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de kroot = cpatch%krdepth(ico) + !---------------------------------------------------------------------------------! + ! Calculate interception by leaves by scaling the intercepted water by the ! + ! LAI of each cohort. If this causes excess of water/ice over the leaf surface, ! + ! no problem, the water will shed at adjust_veg_properties. ! + ! ! + ! IMPORTANT, according to RGK, this block must come before the dt < -8000. block ! + ! because hybrid predictive capping needs leaf_intercepted. ! + !---------------------------------------------------------------------------------! + wshed = 0.d0 + qwshed = 0.d0 + dwshed = 0.d0 + leaf_intercepted = intercepted_max * initp%lai(ico) * taii + leaf_qintercepted = qintercepted_max * initp%lai(ico) * taii + throughfall = 0.d0 + qthroughfall = 0.d0 + dthroughfall = 0.d0 + !---------------------------------------------------------------------------------! + + + !------ Calculate leaf-level CO2 flux -------------------------------------------! leaf_flux = initp%gpp(ico) - initp%leaf_resp(ico) @@ -1299,17 +1312,18 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de max_dwdt = initp%leaf_water(ico)/dt - max_leaf_water = rk4leaf_maxwhc*initp%lai(ico) - !------------------------------------------------------------------------! ! If we ever have shedding, force wshed to cap out at that maximum ! ! leaf water. Assume this process happens before evaporation. ! !------------------------------------------------------------------------! - wshed = max(0.d0,( (initp%leaf_water(ico) + leaf_intercepted*dt) & - - max_leaf_water) / dt) - qwshed = wshed * tl2uint8(initp%leaf_temp(ico),initp%leaf_fliq(ico)) - dwshed = wshed * ( initp%leaf_fliq(ico) * wdnsi8 & - + (1.d0-initp%leaf_fliq(ico)) * fdnsi8) +!! TURNIGN OFF SHEDDING FOR NOW +!! + +!! wshed = max(0.d0,( (initp%leaf_water(ico) + leaf_intercepted*dt) & +!! - max_leaf_water) / dt) +!! qwshed = wshed * tl2uint8(initp%leaf_temp(ico),initp%leaf_fliq(ico)) +!! dwshed = wshed * ( initp%leaf_fliq(ico) * wdnsi8 & +!! + (1.d0-initp%leaf_fliq(ico)) * fdnsi8) !------------------------------------------------------------------------! @@ -1402,23 +1416,6 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de - !---------------------------------------------------------------------------------! - ! Calculate interception by leaves by scaling the intercepted water by the ! - ! LAI of each cohort. If this causes excess of water/ice over the leaf surface, ! - ! no problem, the water will shed at adjust_veg_properties. ! - !---------------------------------------------------------------------------------! - wshed = 0.d0 - qwshed = 0.d0 - dwshed = 0.d0 - leaf_intercepted = intercepted_max * initp%lai(ico) * taii - leaf_qintercepted = qintercepted_max * initp%lai(ico) * taii - throughfall = 0.d0 - qthroughfall = 0.d0 - dthroughfall = 0.d0 - !---------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------! ! Find the water energy balance for this cohort. ! !---------------------------------------------------------------------------------! @@ -1524,10 +1521,33 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de ! throughfall. Later on, these "unsafe" cohorts will have their wood ! ! energy set to equilibrium with the canopy air space (temperature). ! !------------------------------------------------------------------------------------! + + if (initp%wood_resolvable(ico)) then !------ Define some aliases to indices -------------------------------------------! ipft = cpatch%pft(ico) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Calculate interception by wood by scaling the intercepted water by the ! + ! WAI of each cohort. If this causes excess of water/ice over the wood surface, ! + ! no problem, the water will shed at adjust_veg_properties. ! + ! ! + ! IMPORTANT, according to RGK, this block must come before the dt < -8000. block ! + ! because hybrid predictive capping needs wood_intercepted. ! + !---------------------------------------------------------------------------------! + wshed = 0.d0 + qwshed = 0.d0 + dwshed = 0.d0 + wood_intercepted = intercepted_max * initp%wai(ico) * taii + wood_qintercepted = qintercepted_max * initp%wai(ico) * taii + throughfall = 0.d0 + qthroughfall = 0.d0 + dthroughfall = 0.d0 + !---------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------! ! Define the minimum wood water to be considered, and the maximum amount ! @@ -1597,6 +1617,37 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de !---------------------------------------------------------------------------------! + !---------------------------------------------------------------------------! + ! This is called by the hybrid solver only. ! + !---------------------------------------------------------------------------! + if (dt>-8000.d0) then + + max_dwdt = initp%wood_water(ico)/dt + + !------------------------------------------------------------------------! + ! If we ever have shedding, force wshed to cap out at that maximum ! + ! leaf water. Assume this process happens before evaporation. ! + !------------------------------------------------------------------------! +!! TURNIGN OFF SHEDDING FOR NOW +!! + +!! wshed = max(0.d0,( (initp%wood_water(ico) + wood_intercepted*dt) & +!! - max_wood_water) / dt) +!! qwshed = wshed * tl2uint8(initp%wood_temp(ico),initp%wood_fliq(ico)) +!! dwshed = wshed * ( initp%wood_fliq(ico) * wdnsi8 & +!! + (1.d0-initp%wood_fliq(ico)) * fdnsi8) + !------------------------------------------------------------------------! + + + !----- Then constrain the amount that can be evaporated. ----------------! + wflxwc = min(wflxwc,max_dwdt+wood_intercepted-wshed) + !------------------------------------------------------------------------! + end if + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! ! Calculate wood-to-canopy sensible heat flux. Consider the full circumference ! @@ -1609,23 +1660,6 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de - !---------------------------------------------------------------------------------! - ! Calculate interception by wood by scaling the intercepted water by the ! - ! WAI of each cohort. If this causes excess of water/ice over the wood surface, ! - ! no problem, the water will shed at adjust_veg_properties. ! - !---------------------------------------------------------------------------------! - wshed = 0.d0 - qwshed = 0.d0 - dwshed = 0.d0 - wood_intercepted = intercepted_max * initp%wai(ico) * taii - wood_qintercepted = qintercepted_max * initp%wai(ico) * taii - throughfall = 0.d0 - qthroughfall = 0.d0 - dthroughfall = 0.d0 - !---------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------! ! Find the water energy balance for this cohort. ! !---------------------------------------------------------------------------------! @@ -1731,17 +1765,17 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de !---------------------------------------------------------------------------------------! dinitp%can_enthalpy = ( hflxgc + hflxlc_tot + hflxwc_tot & + qwflxgc - qdewgndflx + qwflxlc_tot + qwflxwc_tot + qtransp_tot & - + eflxac ) * hcapcani + + eflxac ) * hcapcani dinitp%can_shv = ( wflxgc - dewgndflx + wflxlc_tot & - + wflxwc_tot + transp_tot + wflxac ) * wcapcani - dinitp%can_co2 = ( cflxgc + cflxlc_tot + cflxac ) * ccapcani + + wflxwc_tot + transp_tot + wflxac ) * wcapcani + dinitp%can_co2 = ( cflxgc + cflxlc_tot + cflxwc_tot + cflxac ) * ccapcani !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! if (.false.) then !if (dt>-8000.d0) then - a = ( cflxgc + cflxlc_tot & + a = ( cflxgc + cflxlc_tot + cflxwc_tot & + initp%can_rhos*initp%ggbare*mmdryi8*rk4site%atm_co2) * ccapcani b = (initp%can_rhos*initp%ggbare*mmdryi8) * ccapcani @@ -1756,13 +1790,22 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de * (rk4site%atm_co2*dt - ((a/b)*dt - c0*exp(-b*dt)/b + & c0/b + (a/b)*exp(-b*dt)/b - (a/b)/b )) - dinitp%can_co2 = ( cflxgc + cflxlc_tot + cflxac) * ccapcani + dinitp%can_co2 = ( cflxgc + cflxlc_tot + cflxwc_tot + cflxac) * ccapcani end if !---------------------------------------------------------------------------------------! initp%wflxac = wflxac + + + !---------------------------------------------------------------------------------------! + ! Water deficit. ! + !---------------------------------------------------------------------------------------! + dinitp%water_deficit = - (wflxac + rk4site%pcpg) + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! Integrate diagnostic variables - These are not activated unless fast file-type ! ! outputs are selected. This will speed up the integrator. ! @@ -1771,7 +1814,8 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de dinitp%avg_carbon_ac = cflxac ! Carbon flx, Atmo->Canopy - dinitp%avg_carbon_st = cflxgc + cflxlc_tot + cflxac ! Carbon storage flux + dinitp%avg_carbon_st = cflxgc + cflxwc_tot & + + cflxlc_tot + cflxac ! Carbon storage flux dinitp%avg_sensible_ac = hflxac ! Sens. heat, Atmo->Canopy dinitp%avg_vapor_ac = wflxac ! Lat. heat, Atmo->Canopy @@ -1836,7 +1880,8 @@ subroutine canopy_derivs_two(mzg,initp,dinitp,csite,ipa,hflxgc,wflxgc,qwflxgc,de dinitp%co2budget_loss2atm = - cflxac dinitp%ebudget_loss2atm = - eflxac dinitp%wbudget_loss2atm = - wflxac - dinitp%co2budget_storage = dinitp%co2budget_storage + cflxgc + cflxlc_tot + cflxac + dinitp%co2budget_storage = dinitp%co2budget_storage & + + cflxgc + cflxlc_tot + cflxwc_tot + cflxac dinitp%ebudget_netrad = dble(compute_netrad(csite,ipa)) dinitp%ebudget_storage = dinitp%ebudget_storage + dinitp%ebudget_netrad & + rk4site%qpcpg - dinitp%ebudget_loss2atm diff --git a/ED/src/dynamics/rk4_driver.F90 b/ED/src/dynamics/rk4_driver.F90 index c19f5a0be..770927e3a 100644 --- a/ED/src/dynamics/rk4_driver.F90 +++ b/ED/src/dynamics/rk4_driver.F90 @@ -136,12 +136,12 @@ subroutine rk4_timestep(cgrid,ifm) !---------------------------------------------------------------------------! call copy_met_2_rk4site(nzg,csite%can_theta(ipa),csite%can_shv(ipa) & ,csite%can_depth(ipa),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%par_beam,cmet%par_diffuse & - ,cmet%nir_beam,cmet%nir_diffuse,cmet%geoht & - ,cpoly%lsl(isi),cpoly%ntext_soil(:,isi) & + ,cmet%atm_vpdef,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%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)) !---------------------------------------------------------------------------! @@ -360,6 +360,7 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad use grid_coms , only : nzg & ! intent(in) , nzs ! ! intent(in) use therm_lib , only : thetaeiv & ! subroutine + , vpdefil & ! subroutine , uextcm2tl & ! subroutine , cmtl2uext & ! subroutine , qslif ! ! function @@ -398,9 +399,11 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad real(kind=8) :: gnd_water real(kind=8) :: psiplusz real(kind=8) :: mcheight + real(kind=4) :: step_waterdef real(kind=4) :: can_rvap !----- Local contants ---------------------------------------------------------------! - real , parameter :: tendays_sec=10.*day_sec + real , parameter :: tendays_sec = 10. * day_sec + real , parameter :: thirtydays_sec = 30. * day_sec !----- External function ------------------------------------------------------------! real , external :: sngloff !------------------------------------------------------------------------------------! @@ -423,10 +426,6 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad csite%snowfac(ipa) = sngloff(initp%snowfac ,tiny_offset) csite%total_sfcw_depth(ipa) = sngloff(initp%total_sfcw_depth,tiny_offset) - - - - !------------------------------------------------------------------------------------! ! Find the ice-vapour equivalent potential temperature. This is done outside the ! ! integrator because it is an iterative method and currently we are not using it as ! @@ -438,6 +437,13 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ,can_rvap ) !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! + ! Find the vapour pressure deficit, which is diagnostic only. ! + !------------------------------------------------------------------------------------! + csite%can_vpdef(ipa) = vpdefil(csite%can_prss(ipa),csite%can_temp(ipa) & + ,csite%can_shv(ipa) ,.true.) + !------------------------------------------------------------------------------------! + csite%ggbare(ipa) = sngloff(initp%ggbare ,tiny_offset) csite%ggveg (ipa) = sngloff(initp%ggveg ,tiny_offset) csite%ggnet (ipa) = sngloff(initp%ggnet ,tiny_offset) @@ -542,6 +548,15 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad + !------------------------------------------------------------------------------------! + ! Update the water deficit. This is done as a 30-day running average. ! + !------------------------------------------------------------------------------------! + step_waterdef = sngloff(initp%water_deficit,tiny_offset) + csite%avg_monthly_waterdef(ipa) = csite%avg_monthly_waterdef(ipa) + step_waterdef + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! ! This variable is the monthly mean ground water that will be used to control ! ! fire disturbance. ! @@ -709,6 +724,16 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad !------------------------------------------------------------------------! + !------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! ! Copy the conductances. ! !------------------------------------------------------------------------! @@ -747,6 +772,17 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad cpatch%lint_shv(ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) !------------------------------------------------------------------------! + + !------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !------------------------------------------------------------------------! + + !----- Set water demand and conductances to zero. -----------------------! cpatch%psi_open (ico) = 0.0 cpatch%psi_closed(ico) = 0.0 @@ -849,6 +885,18 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ! then convert it to specific humidity. ! !---------------------------------------------------------------------------! cpatch%lint_shv(ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !---------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !---------------------------------------------------------------------------! + !----- Copy the meteorological wind to here. -------------------------------! cpatch%veg_wind(ico) = sngloff(rk4site%vels, tiny_offset) !----- Set water demand and conductances to zero. --------------------------! @@ -904,6 +952,18 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ! then convert it to specific humidity. ! !---------------------------------------------------------------------------! cpatch%lint_shv(ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !---------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !---------------------------------------------------------------------------! + !----- Copy the meteorological wind to here. -------------------------------! cpatch%veg_wind(ico) = sngloff(rk4site%vels, tiny_offset) !----- Set water demand and conductances to zero. --------------------------! @@ -946,6 +1006,20 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ! then convert it to specific humidity. ! !---------------------------------------------------------------------------! cpatch%lint_shv(ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !---------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !---------------------------------------------------------------------------! + + + !----- Convert the wind. ---------------------------------------------------! cpatch%veg_wind(ico) = sngloff(initp%veg_wind(ico),tiny_offset) !---------------------------------------------------------------------------! @@ -998,6 +1072,19 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ! then convert it to specific humidity. ! !---------------------------------------------------------------------------! cpatch%lint_shv(ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !---------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !---------------------------------------------------------------------------! + + !----- Copy the meteorological wind to here. -------------------------------! cpatch%veg_wind(ico) = sngloff(rk4site%vels, tiny_offset) !----- Set water demand and conductances to zero. --------------------------! @@ -1031,6 +1118,19 @@ subroutine initp2modelp(hdid,initp,csite,ipa,wbudget_loss2atm,ebudget_netrad ! then convert it to specific humidity. ! !---------------------------------------------------------------------------! cpatch%lint_shv (ico) = qslif(csite%can_prss(ipa),cpatch%leaf_temp(ico)) + !---------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------! + ! Find the leaf-level vapour pressure deficit using canopy pressure ! + ! and humitdity, but leaf temperature. ! + !---------------------------------------------------------------------------! + cpatch%leaf_vpdef(ico) = vpdefil( csite%can_prss (ipa) & + , cpatch%leaf_temp(ico) & + , csite%can_shv (ipa), .true.) + !---------------------------------------------------------------------------! + + !----- Copy the meteorological wind to here. -------------------------------! cpatch%veg_wind (ico) = sngloff(rk4site%vels, tiny_offset) !----- Set water demand and conductances to zero. --------------------------! diff --git a/ED/src/dynamics/rk4_integ_utils.f90 b/ED/src/dynamics/rk4_integ_utils.f90 index 4cbfda8c2..7b70dd9bc 100644 --- a/ED/src/dynamics/rk4_integ_utils.f90 +++ b/ED/src/dynamics/rk4_integ_utils.f90 @@ -215,10 +215,11 @@ end subroutine odeint ! is to ensure all variables are in double precision, so consistent with the buffer vari- ! ! ables. ! !------------------------------------------------------------------------------------------! -subroutine copy_met_2_rk4site(mzg,can_theta,can_shv,can_depth,vels,atm_theiv,atm_theta & - ,atm_tmp,atm_shv,atm_co2,zoff,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) +subroutine copy_met_2_rk4site(mzg,can_theta,can_shv,can_depth,vels,atm_theiv,atm_vpdef & + ,atm_theta,atm_tmp,atm_shv,atm_co2,zoff,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) @@ -237,6 +238,7 @@ subroutine copy_met_2_rk4site(mzg,can_theta,can_shv,can_depth,vels,atm_theiv,atm real , intent(in) :: can_depth real , intent(in) :: vels real , intent(in) :: atm_theiv + real , intent(in) :: atm_vpdef real , intent(in) :: atm_theta real , intent(in) :: atm_tmp real , intent(in) :: atm_shv @@ -276,6 +278,7 @@ subroutine copy_met_2_rk4site(mzg,can_theta,can_shv,can_depth,vels,atm_theiv,atm !----- Convert to double precision. ----------------------------------------------------! rk4site%atm_theiv = dble(atm_theiv ) + rk4site%atm_vpdef = dble(atm_vpdef ) rk4site%atm_theta = dble(atm_theta ) rk4site%atm_tmp = dble(atm_tmp ) rk4site%atm_shv = dble(atm_shv ) @@ -387,7 +390,8 @@ subroutine inc_rk4_patch(rkp, inc, fac, cpatch) rkp%virtual_water = rkp%virtual_water + fac * inc%virtual_water rkp%virtual_depth = rkp%virtual_depth + fac * inc%virtual_depth - + rkp%water_deficit = rkp%water_deficit + fac * inc%water_deficit + rkp%upwp = rkp%upwp + fac * inc%upwp rkp%wpwp = rkp%wpwp + fac * inc%wpwp rkp%tpwp = rkp%tpwp + fac * inc%tpwp @@ -1248,6 +1252,8 @@ subroutine copy_rk4_patch(sourcep, targetp, cpatch) targetp%cwd_rh = sourcep%cwd_rh targetp%rh = sourcep%rh + targetp%water_deficit = sourcep%water_deficit + do k=rk4site%lsl,nzg targetp%soil_water (k) = sourcep%soil_water (k) targetp%soil_energy (k) = sourcep%soil_energy (k) diff --git a/ED/src/dynamics/rk4_misc.f90 b/ED/src/dynamics/rk4_misc.f90 index c4545f047..643899b8b 100644 --- a/ED/src/dynamics/rk4_misc.f90 +++ b/ED/src/dynamics/rk4_misc.f90 @@ -429,6 +429,12 @@ subroutine copy_patch_init(sourcesite,ipa,targetp) targetp%wbudget_loss2drainage = 0.d0 targetp%wbudget_loss2runoff = 0.d0 end if + !---------------------------------------------------------------------------------------! + + + !----- Water deficit, always start with zero. ------------------------------------------! + targetp%water_deficit = 0.d0 + !---------------------------------------------------------------------------------------! if (print_detailed) call reset_rk4_fluxes(targetp) @@ -1877,8 +1883,10 @@ subroutine adjust_sfcw_properties(nzg,nzs,initp,hdid,csite,ipa) wmass_free = 0.d0 energy_free = 0.d0 depth_free = 0.d0 + !---------------------------------------------------------------------------------! end if + !------------------------------------------------------------------------------------! end if !---------------------------------------------------------------------------------------! @@ -3431,13 +3439,13 @@ subroutine print_csiteipa(csite, ipa) write (unit=*,fmt='(80a)') ('-',k=1,80) write (unit=*,fmt='(a)' ) 'Wood information (only the resolvable ones shown): ' write (unit=*,fmt='(80a)') ('-',k=1,80) - write (unit=*,fmt='(2(a7,1x),8(a12,1x))') & + write (unit=*,fmt='(2(a7,1x),9(a12,1x))') & ' PFT','KRDEPTH',' NPLANT',' WAI',' DBH',' BDEAD' & - ,' BSAPWOODA',' BSAPWOODB',' WOOD_ENERGY',' WOOD_TEMP' & + ,' BSAPWOODA',' BSAPWOODB',' WOOD_ENERGY',' WOOD_TEMP' & ,' WOOD_WATER' do ico = 1,cpatch%ncohorts if (cpatch%wood_resolvable(ico)) then - write(unit=*,fmt='(2(i7,1x),8(es12.4,1x))') cpatch%pft(ico), cpatch%krdepth(ico) & + write(unit=*,fmt='(2(i7,1x),9(es12.4,1x))') cpatch%pft(ico), cpatch%krdepth(ico) & ,cpatch%nplant(ico),cpatch%wai(ico),cpatch%dbh(ico),cpatch%bdead(ico) & ,cpatch%bsapwooda(ico),cpatch%bsapwoodb(ico),cpatch%wood_energy(ico) & ,cpatch%wood_temp(ico),cpatch%wood_water(ico) @@ -3466,11 +3474,13 @@ subroutine print_csiteipa(csite, ipa) write (unit=*,fmt='(80a)') ('-',k=1,80) - write (unit=*,fmt='(6(a12,1x))') ' CAN_THEIV',' CAN_TEMP',' CAN_SHV' & - ,' CAN_PRSS',' CAN_CO2',' GGNET' - write (unit=*,fmt='(6(es12.4,1x))') csite%can_theiv(ipa),csite%can_temp(ipa) & - ,csite%can_shv(ipa) ,csite%can_prss(ipa) & - ,csite%can_co2(ipa) ,csite%ggnet (ipa) + write (unit=*,fmt='(7(a12,1x))') ' CAN_THEIV',' CAN_TEMP',' CAN_SHV' & + ,' CAN_PRSS',' CAN_CO2',' CAN_VPDEF' & + ,' GGNET' + write (unit=*,fmt='(7(es12.4,1x))') csite%can_theiv (ipa),csite%can_temp (ipa) & + , csite%can_shv (ipa),csite%can_prss (ipa) & + , csite%can_co2 (ipa),csite%can_vpdef (ipa) & + , csite%ggnet (ipa) write (unit=*,fmt='(80a)') ('-',k=1,80) @@ -3540,7 +3550,8 @@ subroutine print_rk4patch(y,csite,ipa) , nzs ! ! intent(in) use ed_misc_coms , only : current_time ! ! intent(in) use consts_coms , only : pio1808 ! ! intent(in) - use therm_lib8 , only : thetaeiv8 ! ! function + use therm_lib8 , only : thetaeiv8 & ! function + , vpdefil8 ! ! function implicit none !----- Arguments -----------------------------------------------------------------------! type(rk4patchtype) , target :: y @@ -3552,11 +3563,16 @@ subroutine print_rk4patch(y,csite,ipa) integer :: ico real(kind=8) :: y_can_rvap real(kind=8) :: y_can_theiv + real(kind=8) :: y_can_vpdef !---------------------------------------------------------------------------------------! - !----- Find the ice-vapour equivalent potential temperature (output only). -------------! + !---------------------------------------------------------------------------------------! + ! Find the ice-vapour equivalent potential temperature and vapour pressure deficit ! + ! (output only). ! + !---------------------------------------------------------------------------------------! y_can_rvap = y%can_shv / (1.d0 - y%can_shv) y_can_theiv = thetaeiv8(y%can_theta,y%can_prss,y%can_temp,y_can_rvap,y_can_rvap) + y_can_vpdef = vpdefil8 (y%can_prss,y%can_temp,y%can_shv,.true.) !---------------------------------------------------------------------------------------! cpatch => csite%patch(ipa) @@ -3584,6 +3600,7 @@ subroutine print_rk4patch(y,csite,ipa) write (unit=*,fmt='(a,1x,es12.4)') ' Air potential temp. : ',rk4site%atm_theta write (unit=*,fmt='(a,1x,es12.4)') ' Air theta_Eiv : ',rk4site%atm_theiv write (unit=*,fmt='(a,1x,es12.4)') ' Air sp. enthalpy (can.hgt.): ',rk4site%atm_enthalpy + write (unit=*,fmt='(a,1x,es12.4)') ' Air vapour pres. deficit : ',rk4site%atm_vpdef write (unit=*,fmt='(a,1x,es12.4)') ' H2Ov mixing ratio : ',rk4site%atm_shv write (unit=*,fmt='(a,1x,es12.4)') ' CO2 mixing ratio : ',rk4site%atm_co2 write (unit=*,fmt='(a,1x,es12.4)') ' Pressure : ',rk4site%atm_prss @@ -3675,12 +3692,12 @@ subroutine print_rk4patch(y,csite,ipa) write (unit=*,fmt='(80a)') ('=',k=1,80) write (unit=*,fmt='(a)' ) 'Wood information (only those resolvable are shown): ' write (unit=*,fmt='(80a)') ('-',k=1,80) - write (unit=*,fmt='(2(a7,1x),5(a12,1x))') & + write (unit=*,fmt='(2(a7,1x),6(a12,1x))') & ' PFT','KRDEPTH',' NPLANT',' HEIGHT',' DBH',' BDEAD' & ,' BSAPWOODA',' BSAPWOODB' do ico = 1,cpatch%ncohorts if (cpatch%wood_resolvable(ico)) then - write(unit=*,fmt='(2(i7,1x),5(es12.4,1x))') cpatch%pft(ico), cpatch%krdepth(ico) & + write(unit=*,fmt='(2(i7,1x),6(es12.4,1x))') cpatch%pft(ico), cpatch%krdepth(ico) & ,cpatch%nplant(ico),cpatch%hite(ico),cpatch%dbh(ico),cpatch%bdead(ico) & ,cpatch%bsapwooda(ico),cpatch%bsapwoodb(ico) end if @@ -3732,14 +3749,16 @@ subroutine print_rk4patch(y,csite,ipa) ,csite%lai(ipa),y%can_depth,y%can_co2,y%can_prss & ,y%ggnet write (unit=*,fmt='(80a)') ('-',k=1,80) - write (unit=*,fmt='(9(a12,1x))') ' CAN_RHOS',' CAN_THEIV',' CAN_THETA' & + write (unit=*,fmt='(10(a12,1x))') ' CAN_RHOS',' CAN_THEIV',' CAN_THETA' & ,' CAN_TEMP',' CAN_SHV',' CAN_SSH' & - ,' CAN_RVAP',' CAN_RHV','CAN_ENTHALPY' + ,' CAN_RVAP',' CAN_VPDEF',' CAN_RHV' & + ,'CAN_ENTHALPY' - write (unit=*,fmt='(9(es12.4,1x))') y%can_rhos , y_can_theiv , y%can_theta & + write (unit=*,fmt='(10(es12.4,1x))') y%can_rhos , y_can_theiv , y%can_theta & , y%can_temp , y%can_shv , y%can_ssh & - , y_can_rvap , y%can_rhv , y%can_enthalpy + , y_can_rvap , y_can_vpdef , y%can_rhv & + , y%can_enthalpy write (unit=*,fmt='(80a)') ('-',k=1,80) @@ -3827,7 +3846,8 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) , rk4site & ! intent(in) , detail_pref ! ! intent(in) use therm_lib8 , only : uextcm2tl8 & ! sub-routine - , thetaeiv8 ! ! function + , thetaeiv8 & ! function + , vpdefil8 ! ! function use soil_coms , only : soil8 ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! @@ -3873,9 +3893,10 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) real(kind=8) :: elapsec real(kind=8) :: can_rvap real(kind=8) :: can_theiv + real(kind=8) :: can_vpdef !----- Local constants. ----------------------------------------------------------------! - character(len=10), parameter :: phfmt='(83(a,1x))' - character(len=48), parameter :: pbfmt='(3(i13,1x),4(es13.6,1x),3(i13,1x),73(es13.6,1x))' + character(len=10), parameter :: phfmt='(85(a,1x))' + character(len=48), parameter :: pbfmt='(3(i13,1x),4(es13.6,1x),3(i13,1x),75(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. --------------------------------------------------------! @@ -3971,6 +3992,7 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) can_rvap = initp%can_shv / (1.d0 - initp%can_shv) can_theiv = thetaeiv8( initp%can_theta , initp%can_prss , initp%can_temp & , can_rvap , can_rvap ) + can_vpdef = vpdefil8 ( initp%can_prss , initp%can_temp , initp%can_shv , .true. ) !---------------------------------------------------------------------------------------! par_b_beam = dble(csite%par_b_beam (ipa)) @@ -4051,27 +4073,28 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) , ' 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', ' CAN.ENTHALPY' & - , ' 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' + , ' ATM.VPDEF' , ' MET.RSHORT', ' MET.RLONG' & + , ' CAN.PRSS' , ' CAN.TEMP', ' CAN.SHV' & + , ' CAN.CO2' , ' CAN.DEPTH', ' CAN.RHOS' & + , ' CAN.RELHUM' , ' CAN.THETA', ' CAN.THEIV' & + , ' CAN.ENTHALPY' , ' 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' + @@ -4095,27 +4118,28 @@ subroutine print_rk4_state(initp,fluxp,csite,ipa,elapsed,hdid) , rk4site%atm_shv , rk4site%atm_co2 , rk4site%vels & , rk4site%pcpg , rk4site%geoht , rk4site%atm_rhos & , rk4site%atm_rhv , rk4site%atm_theta , rk4site%atm_theiv & - , rk4site%rshort , rk4site%rlong , initp%can_prss & - , initp%can_temp , initp%can_shv , initp%can_co2 & - , initp%can_depth , initp%can_rhos , initp%can_rhv & - , initp%can_theta , can_theiv , initp%can_enthalpy & - , initp%ground_temp , initp%ground_shv , avg_leaf_temp & - , sum_leaf_water , avg_wood_temp , sum_wood_water & - , initp%ggbare , initp%ggveg , initp%ggnet & - , initp%opencan_frac , initp%soil_tempk(nzg) , initp%soil_water(nzg) & - , soil8(nsoil)%soilcp , soil8(nsoil)%soilwp , soil8(nsoil)%sfldcap & - , soil8(nsoil)%slmsts , 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_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 + , rk4site%atm_vpdef , rk4site%rshort , rk4site%rlong & + , initp%can_prss , initp%can_temp , initp%can_shv & + , initp%can_co2 , initp%can_depth , initp%can_rhos & + , initp%can_rhv , initp%can_theta , can_theiv & + , initp%can_enthalpy , initp%ground_temp , initp%ground_shv & + , avg_leaf_temp , sum_leaf_water , avg_wood_temp & + , sum_wood_water , initp%ggbare , initp%ggveg & + , initp%ggnet , initp%opencan_frac , initp%soil_tempk(nzg) & + , initp%soil_water(nzg) , soil8(nsoil)%soilcp , soil8(nsoil)%soilwp & + , soil8(nsoil)%sfldcap , soil8(nsoil)%slmsts , 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_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 076dd1138..b1d1c3bd6 100644 --- a/ED/src/dynamics/soil_respiration.f90 +++ b/ED/src/dynamics/soil_respiration.f90 @@ -8,8 +8,10 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) , patchtype ! ! structure use soil_coms , only : soil & ! intent(in) , dslz & ! intent(in) - , slz & ! intent(in) - , nzg ! ! intent(in) + , slz ! ! intent(in) + use decomp_coms , only : k_rh_active ! ! intent(in) + use consts_coms , only : wdns ! ! intent(in) + use therm_lib , only : uextcm2tl ! ! function implicit none !----- Arguments. ----------------------------------------------------------------------! type(sitetype) , target :: csite @@ -22,7 +24,16 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) integer :: ipft integer :: k integer :: kroot + integer :: nsoil real :: Lc + real :: rel_soil_moist + real :: sum_soil_energy + real :: sum_soil_water + real :: sum_soil_hcap + real :: sum_soil_slmsts + real :: sum_soil_soilcp + real :: avg_soil_temp + real :: avg_soil_fliq !----- External functions. -------------------------------------------------------------! real , external :: het_resp_weight real , external :: root_resp_norm @@ -45,7 +56,7 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) ! spread throughout the entire depth. ! !------------------------------------------------------------------------------------! cpatch%root_respiration(ico) = 0.0 - do k = kroot,nzg + do k = kroot,mzg cpatch%root_respiration(ico) = cpatch%root_respiration(ico) & + root_resp_norm(ipft,csite%soil_tempk(k,ipa)) & * dslz(k) @@ -71,23 +82,68 @@ subroutine soil_respiration(csite,ipa,mzg,ntext_soil) end do !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Integrate the soil extensive properties, plus the minimum and maximum possible ! + ! soil water content of the active layer. ! + !---------------------------------------------------------------------------------------! + sum_soil_energy = 0.0 + sum_soil_hcap = 0.0 + sum_soil_water = 0.0 + sum_soil_slmsts = 0.0 + sum_soil_soilcp = 0.0 + do k = k_rh_active,mzg + nsoil = ntext_soil(k) + + !------------------------------------------------------------------------------------! + ! Convert the units so energy is in J/m2, heat capacity in J/m2/K, and water in ! + ! kg/m2. ! + !------------------------------------------------------------------------------------! + sum_soil_energy = sum_soil_energy + csite%soil_energy(k,ipa) * dslz(k) + sum_soil_hcap = sum_soil_hcap + soil(nsoil)%slcpd * dslz(k) + sum_soil_water = sum_soil_water + csite%soil_water (k,ipa) * wdns * dslz(k) + sum_soil_slmsts = sum_soil_slmsts + soil(nsoil)%slmsts * wdns * dslz(k) + sum_soil_soilcp = sum_soil_soilcp + soil(nsoil)%soilcp * wdns * dslz(k) + !------------------------------------------------------------------------------------! + end do + !---------------------------------------------------------------------------------------! + + + + !----- Find the average temperature and the relative soil moisture. --------------------! + call uextcm2tl(sum_soil_energy,sum_soil_water,sum_soil_hcap,avg_soil_temp,avg_soil_fliq) + rel_soil_moist = min( 1.0, max(0.0, ( sum_soil_water - sum_soil_soilcp ) & + / ( sum_soil_slmsts - sum_soil_soilcp ) ) ) + !---------------------------------------------------------------------------------------! + + + !----- Compute soil/temperature modulation of heterotrophic respiration. ---------------! - csite%A_decomp(ipa) = het_resp_weight(csite%soil_tempk(mzg,ipa) & - ,csite%soil_water(mzg,ipa) & - ,ntext_soil(mzg)) + csite%A_decomp(ipa) = het_resp_weight(avg_soil_temp,rel_soil_moist) !---------------------------------------------------------------------------------------! + + !----- Compute nitrogen immobilization factor. -----------------------------------------! call resp_f_decomp(csite,ipa, Lc) + !---------------------------------------------------------------------------------------! + + !----- Compute heterotrophic respiration. ----------------------------------------------! call resp_rh(csite,ipa, Lc) + !---------------------------------------------------------------------------------------! + + !----- Update averaged variables. ------------------------------------------------------! - csite%today_A_decomp(ipa) = csite%today_A_decomp(ipa) + csite%A_decomp(ipa) + csite%today_A_decomp (ipa) = csite%today_A_decomp (ipa) + csite%A_decomp(ipa) csite%today_Af_decomp(ipa) = csite%today_Af_decomp(ipa) & - + csite%A_decomp(ipa) * csite%f_decomp(ipa) - csite%mean_rh(ipa) = csite%mean_rh(ipa) + csite%rh(ipa) + + csite%A_decomp (ipa) * csite%f_decomp(ipa) + csite%mean_rh (ipa) = csite%mean_rh (ipa) + csite%rh (ipa) + csite%mean_cwd_rh (ipa) = csite%mean_cwd_rh (ipa) + csite%cwd_rh (ipa) + !---------------------------------------------------------------------------------------! return end subroutine soil_respiration @@ -205,56 +261,115 @@ end function root_resp_norm ! This function computes the heterotrophic respiration limitation factor, which ! ! includes limitations due to temperature and soil moisture. ! !------------------------------------------------------------------------------------------! -real function het_resp_weight(soil_tempk,soil_water,nsoil) +real function het_resp_weight(soil_tempk,rel_soil_moist) use decomp_coms, only : resp_temperature_increase & ! intent(in) , resp_opt_water & ! intent(in) , resp_water_below_opt & ! intent(in) , resp_water_above_opt & ! intent(in) - , LloydTaylor ! ! intent(in) - use soil_coms , only : soil ! ! intent(in) + , decomp_scheme & ! intent(in) + , rh_lloyd_1 & ! intent(in) + , rh_lloyd_2 & ! intent(in) + , rh_lloyd_3 & ! intent(in) + , rh_decay_low & ! intent(in) + , rh_decay_high & ! intent(in) + , rh_low_temp & ! intent(in) + , rh_high_temp & ! intent(in) + , rh_decay_dry & ! intent(in) + , rh_decay_wet & ! intent(in) + , rh_dry_smoist & ! intent(in) + , rh_wet_smoist ! ! intent(in) + use consts_coms, only : lnexp_min & ! intent(in) + , lnexp_max ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! - real , intent(in) :: soil_tempk - real , intent(in) :: soil_water - integer, intent(in) :: nsoil + real(kind=4), intent(in) :: soil_tempk + real(kind=4), intent(in) :: rel_soil_moist !----- Local variables. ----------------------------------------------------------------! - real :: temperature_limitation - real :: water_limitation - real :: rel_soil_moist + real(kind=4) :: temperature_limitation + real(kind=4) :: water_limitation + real(kind=4) :: lnexplloyd + real(kind=4) :: lnexplow + real(kind=4) :: lnexphigh + real(kind=4) :: tlow_fun + real(kind=4) :: thigh_fun + real(kind=4) :: lnexpdry + real(kind=4) :: lnexpwet + real(kind=4) :: smdry_fun + real(kind=4) :: smwet_fun !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! ! Find the temperature dependence. ! !---------------------------------------------------------------------------------------! - if (LloydTaylor) then - !----- Use Lloyd and Taylor (1994) temperature dependence. --------------------------! - temperature_limitation = min( 1.0 & - , resp_temperature_increase & - * exp(308.56 * (1./56.02 - 1./(soil_tempk-227.15)) ) ) - else - !----- Use original exponential temperature dependence. -----------------------------! + select case(decomp_scheme) + case (0) + !----- Use original ED-2.1 exponential temperature dependence. ----------------------! temperature_limitation = min( 1.0 & , exp( resp_temperature_increase * (soil_tempk-318.15))) - end if + !------------------------------------------------------------------------------------! + case (1) + !----- Use Lloyd and Taylor (1994) temperature dependence. --------------------------! + lnexplloyd = rh_lloyd_1 * ( rh_lloyd_2 - 1. / (soil_tempk - rh_lloyd_3)) + lnexplloyd = max(lnexp_min,min(lnexp_max,lnexplloyd)) + temperature_limitation = min( 1.0, resp_temperature_increase * exp(lnexplloyd) ) + !------------------------------------------------------------------------------------! + case (2) + !------------------------------------------------------------------------------------! + ! Similar to the original ED-1.0 formulation, which is based on the CENTURY ! + ! model. The change in the functional form is to avoid power of negative numbers, ! + ! but the coefficients were tuned to give a similar curve. ! + !------------------------------------------------------------------------------------! + !----- Low temperature limitation. --------------------------------------------------! + lnexplow = rh_decay_low * (rh_low_temp - soil_tempk) + lnexplow = max(lnexp_min,min(lnexp_max,lnexplow)) + tlow_fun = 1.0 + exp(lnexplow) + !----- High temperature limitation. -------------------------------------------------! + lnexphigh = rh_decay_high * (soil_tempk - rh_high_temp) + lnexphigh = max(lnexp_min,min(lnexp_max,lnexphigh)) + thigh_fun = 1.0 + exp(lnexphigh) + !----- Temperature limitation is a combination of both. -----------------------------! + temperature_limitation = 1.0 / (tlow_fun * thigh_fun ) + !------------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! - ! Find the relative soil moisture, then the moisture dependence. ! + ! Find the limitation due to soil moisture. ! !---------------------------------------------------------------------------------------! - rel_soil_moist = (soil_water - soil(nsoil)%soilcp) & - / (soil(nsoil)%slmsts - soil(nsoil)%soilcp) - if (rel_soil_moist <= resp_opt_water)then - water_limitation = exp( (rel_soil_moist - resp_opt_water) * resp_water_below_opt) - else - water_limitation = exp( (resp_opt_water - rel_soil_moist) * resp_water_above_opt) - end if - + select case (decomp_scheme) + case (0,1) + !----- ED-2.1 default, also used when decomp_scheme is 1. ---------------------------! + if (rel_soil_moist <= resp_opt_water)then + water_limitation = exp( (rel_soil_moist - resp_opt_water) * resp_water_below_opt) + else + water_limitation = exp( (resp_opt_water - rel_soil_moist) * resp_water_above_opt) + end if + !------------------------------------------------------------------------------------! + case (2) + !----- Dry soil limitation. ---------------------------------------------------------! + lnexpdry = rh_decay_dry * (rh_dry_smoist - rel_soil_moist) + lnexpdry = max(lnexp_min,min(lnexp_max,lnexpdry)) + smdry_fun = 1.0 + exp(lnexpdry) + !----- Wet soil limitation. ---------------------------------------------------------! + lnexpwet = rh_decay_wet * (rel_soil_moist - rh_wet_smoist) + lnexpwet = max(lnexp_min,min(lnexp_max,lnexpwet)) + smwet_fun = 1.0 + exp(lnexpwet) + !----- Soil moisture limitation is a combination of both. ---------------------------! + water_limitation = 1.0 / (smdry_fun * smwet_fun) + !------------------------------------------------------------------------------------! + end select + !---------------------------------------------------------------------------------------! + + + !----- Compute the weight, which is just the combination of both. ----------------------! het_resp_weight = temperature_limitation * water_limitation - + !---------------------------------------------------------------------------------------! + return end function het_resp_weight !==========================================================================================! @@ -274,7 +389,7 @@ subroutine resp_f_decomp(csite,ipa,Lc) use ed_state_vars, only : sitetype ! ! structure use decomp_coms , only : r_stsc & ! intent(in) , N_immobil_supply_scale & ! intent(in) - , K1 & ! intent(in) + , decay_rate_stsc & ! intent(in) , n_decomp_lim ! ! intent(in) use pft_coms , only : c2n_structural & ! intent(in) , c2n_slow ! ! intent(in) @@ -300,7 +415,7 @@ subroutine resp_f_decomp(csite,ipa,Lc) end if if (n_decomp_lim == 1) then - N_immobilization_demand = csite%A_decomp(ipa) * Lc * K1 & + N_immobilization_demand = csite%A_decomp(ipa) * Lc * decay_rate_stsc & * csite%structural_soil_C(ipa) & * ((1.0 - r_stsc) / c2n_slow - 1.0 / c2n_structural) @@ -328,40 +443,43 @@ end subroutine resp_f_decomp !------------------------------------------------------------------------------------------! subroutine resp_rh(csite,ipa,Lc) - use ed_state_vars, only : sitetype ! ! structure - use consts_coms , only : kgCday_2_umols ! ! intent(in) - use decomp_coms , only : K1 & ! intent(in) - , K2 & ! intent(in) - , K3 & ! intent(in) - , r_fsc & ! intent(in) - , r_ssc & ! intent(in) - , r_stsc & ! intent(in) - , cwd_frac ! ! intent(in) + use ed_state_vars, only : sitetype ! ! structure + use consts_coms , only : kgCday_2_umols ! ! intent(in) + use decomp_coms , only : decay_rate_stsc & ! intent(in) + , decay_rate_fsc & ! intent(in) + , decay_rate_ssc & ! intent(in) + , r_fsc & ! intent(in) + , r_ssc & ! intent(in) + , r_stsc & ! intent(in) + , cwd_frac ! ! intent(in) implicit none !----- Arguments. ----------------------------------------------------------------------! - type(sitetype), target :: csite - integer , intent(in) :: ipa - real , intent(in) :: Lc + type(sitetype), target :: csite + integer , intent(in) :: ipa + real , intent(in) :: Lc !----- Local variables. ----------------------------------------------------------------! - real :: fast_C_loss - real :: structural_C_loss - real :: slow_C_loss + real :: fast_C_loss + real :: structural_C_loss + real :: slow_C_loss !---------------------------------------------------------------------------------------! - !----- The following variables have units of [kgC/m2/day]. -----------------------------! - fast_C_loss = csite%A_decomp(ipa) * K2 * csite%fast_soil_C(ipa) - structural_C_loss = csite%A_decomp(ipa) * Lc * K1 * csite%structural_soil_C(ipa) & - * csite%f_decomp(ipa) - slow_C_loss = csite%A_decomp(ipa) * K3 * csite%slow_soil_C(ipa) - !----- The following variables have units of [umol_CO2/m2/s]. --------------------------! - csite%rh(ipa) = kgCday_2_umols * ( r_fsc * fast_C_loss + r_stsc * structural_C_loss & - + r_ssc * slow_C_loss) - csite%cwd_rh(ipa) = kgCday_2_umols * (r_stsc * structural_C_loss + r_ssc * slow_C_loss) & - * cwd_frac + fast_C_loss = kgCday_2_umols * csite%A_decomp(ipa) & + * decay_rate_fsc * csite%fast_soil_C(ipa) + structural_C_loss = kgCday_2_umols * csite%A_decomp(ipa) * Lc * decay_rate_stsc & + * csite%structural_soil_C(ipa)* csite%f_decomp(ipa) + slow_C_loss = kgCday_2_umols * csite%A_decomp(ipa) & + * decay_rate_ssc * csite%slow_soil_C(ipa) + !---------------------------------------------------------------------------------------! + + !----- Find the heterotrophic respiration and the fraction due to CWD. -----------------! + csite%rh(ipa) = r_fsc * fast_C_loss + r_stsc * structural_C_loss & + + r_ssc * slow_C_loss + csite%cwd_rh(ipa) = cwd_frac * (r_stsc * structural_C_loss + r_ssc * slow_C_loss) + !---------------------------------------------------------------------------------------! return end subroutine resp_rh @@ -382,9 +500,9 @@ subroutine update_C_and_N_pools(cgrid) use ed_state_vars, only : edtype & ! structure , polygontype & ! structure , sitetype ! ! structure - use decomp_coms , only : K1 & ! intent(in) - , K2 & ! intent(in) - , K3 & ! intent(in) + use decomp_coms , only : decay_rate_fsc & ! intent(in) + , decay_rate_stsc & ! intent(in) + , decay_rate_ssc & ! intent(in) , r_stsc ! ! intent(in) use pft_coms , only : c2n_slow & ! intent(in) , c2n_structural ! ! intent(in) @@ -428,23 +546,26 @@ subroutine update_C_and_N_pools(cgrid) end if !----- Fast pools. ------------------------------------------------------------! - fast_C_loss = csite%today_A_decomp(ipa) * K2 * csite%fast_soil_C(ipa) - fast_N_loss = csite%today_A_decomp(ipa) * K2 * csite%fast_soil_N(ipa) + fast_C_loss = csite%today_A_decomp(ipa) * decay_rate_fsc & + * csite%fast_soil_C(ipa) + fast_N_loss = csite%today_A_decomp(ipa) * decay_rate_fsc & + * csite%fast_soil_N(ipa) !----- Structural pools. ------------------------------------------------------! - structural_C_loss = csite%today_Af_decomp(ipa) * Lc * K1 & + structural_C_loss = csite%today_Af_decomp(ipa) * Lc * decay_rate_stsc & * csite%structural_soil_C(ipa) - structural_L_loss = csite%today_Af_decomp(ipa) * Lc * K1 & + structural_L_loss = csite%today_Af_decomp(ipa) * Lc * decay_rate_stsc & * csite%structural_soil_L(ipa) !----- Slow pools. ------------------------------------------------------------! slow_C_input = (1.0 - r_stsc) * structural_C_loss - slow_C_loss = csite%today_A_decomp(ipa) * K3 * csite%slow_soil_C(ipa) + slow_C_loss = csite%today_A_decomp(ipa) * decay_rate_ssc & + * csite%slow_soil_C(ipa) !----- Mineralized pool. ------------------------------------------------------! csite%mineralized_N_input = fast_N_loss + slow_C_loss / c2n_slow csite%mineralized_N_loss = csite%total_plant_nitrogen_uptake(ipa) & - + csite%today_Af_decomp(ipa) * Lc * K1 & + + csite%today_Af_decomp(ipa) * Lc * decay_rate_stsc & * csite%structural_soil_C(ipa) & * ( (1.0 - r_stsc) / c2n_slow - 1.0 / c2n_structural) diff --git a/ED/src/dynamics/structural_growth.f90 b/ED/src/dynamics/structural_growth.f90 index 6302f3649..26e162736 100644 --- a/ED/src/dynamics/structural_growth.f90 +++ b/ED/src/dynamics/structural_growth.f90 @@ -6,29 +6,30 @@ ! doing. Changing the order can affect the C/N budgets. ! !------------------------------------------------------------------------------------------! subroutine structural_growth(cgrid, month) - use ed_state_vars , only : edtype & ! structure - , polygontype & ! structure - , sitetype & ! structure - , patchtype ! ! structure - use pft_coms , only : q & ! intent(in) - , qsw & ! intent(in) - , seedling_mortality & ! intent(in) - , c2n_leaf & ! intent(in) - , c2n_storage & ! intent(in) - , c2n_recruit & ! intent(in) - , c2n_stem & ! intent(in) - , l2n_stem & ! intent(in) - , negligible_nplant & ! intent(in) - , is_grass & ! 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) - use ed_misc_coms , only : ibigleaf ! ! intent(in) - use ed_therm_lib , only : calc_veg_hcap & ! function - , update_veg_energy_cweh ! ! function - use ed_misc_coms , only : igrass ! ! intent(in) - + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype & ! structure + , patchtype ! ! structure + use pft_coms , only : q & ! intent(in) + , qsw & ! intent(in) + , seedling_mortality & ! intent(in) + , c2n_leaf & ! intent(in) + , c2n_storage & ! intent(in) + , c2n_recruit & ! intent(in) + , c2n_stem & ! intent(in) + , l2n_stem & ! intent(in) + , negligible_nplant & ! intent(in) + , is_grass & ! intent(in) + , agf_bs & ! intent(in) + , cbr_severe_stress ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use ed_max_dims , only : n_pft & ! intent(in) + , n_dbh ! ! intent(in) + use ed_misc_coms , only : ibigleaf ! ! intent(in) + use ed_therm_lib , only : calc_veg_hcap & ! function + , update_veg_energy_cweh ! ! function + use ed_misc_coms , only : igrass ! ! intent(in) + use physiology_coms, only : ddmort_const ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -43,8 +44,7 @@ subroutine structural_growth(cgrid, month) integer :: ico integer :: ilu integer :: ipft - integer :: update_month - integer :: imonth + integer :: prev_month real :: salloc real :: salloci real :: balive_in @@ -56,6 +56,9 @@ subroutine structural_growth(cgrid, month) real :: bstorage_in real :: agb_in real :: ba_in + real :: cbr_light + real :: cbr_moist + real :: cbr_now real :: f_bseeds real :: f_bdead real :: balive_mort_litter @@ -65,8 +68,6 @@ subroutine structural_growth(cgrid, month) real :: seed_litter real :: net_seed_N_uptake real :: net_stem_N_uptake - real :: cb_act - real :: cb_max real :: old_leaf_hcap real :: old_wood_hcap !---------------------------------------------------------------------------------------! @@ -108,9 +109,16 @@ subroutine structural_growth(cgrid, month) ! sparse cohort is about to be terminated, anyway). ! ! NB: monthly_dndt may be negative. ! !---------------------------------------------------------------------------! - cpatch%monthly_dndt(ico) = max(cpatch%monthly_dndt(ico) & - ,negligible_nplant(ipft) - cpatch%nplant(ico)) - cpatch%nplant(ico) = cpatch%nplant(ico) + cpatch%monthly_dndt(ico) + cpatch%monthly_dndt (ico) = max( cpatch%monthly_dndt (ico) & + , negligible_nplant (ipft) & + - cpatch%nplant (ico) ) + cpatch%monthly_dlnndt(ico) = max( cpatch%monthly_dlnndt (ico) & + , log( negligible_nplant(ipft) & + / cpatch%nplant (ico) ) ) + cpatch%nplant(ico) = cpatch%nplant(ico) & + * exp(cpatch%monthly_dlnndt(ico)) + !---------------------------------------------------------------------------! + !----- Calculate litter owing to mortality. --------------------------------! balive_mort_litter = - cpatch%balive(ico) * cpatch%monthly_dndt(ico) @@ -120,7 +128,8 @@ subroutine structural_growth(cgrid, month) + struct_litter !----- Reset monthly_dndt. -------------------------------------------------! - cpatch%monthly_dndt(ico) = 0.0 + cpatch%monthly_dndt (ico) = 0.0 + cpatch%monthly_dlnndt(ico) = 0.0 !----- Determine how to distribute what is in bstorage. --------------------! call plant_structural_allocation(cpatch%pft(ico),cpatch%hite(ico) & @@ -139,14 +148,6 @@ subroutine structural_growth(cgrid, month) * cpatch%bstorage(ico) * cpatch%nplant(ico) end if - if (ibigleaf == 0 ) then - !------ 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) - end if - !---------------------------------------------------------------------------! ! Rebalance the plant nitrogen uptake considering the actual alloc- ! ! ation to structural growth. This is necessary because c2n_stem does not ! @@ -217,45 +218,92 @@ subroutine structural_growth(cgrid, month) ,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)) + call is_resolvable(csite,ipa,ico) !---------------------------------------------------------------------------! !----- 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 (month == 1) then + prev_month = 12 + else + prev_month = month - 1 + end if + cpatch%cb (prev_month,ico) = cpatch%cb (13,ico) + cpatch%cb_lightmax (prev_month,ico) = cpatch%cb_lightmax (13,ico) + cpatch%cb_moistmax (prev_month,ico) = cpatch%cb_moistmax (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 + cpatch%cb (13,ico) = 0.0 + cpatch%cb_lightmax (13,ico) = 0.0 + cpatch%cb_moistmax (13,ico) = 0.0 + !---------------------------------------------------------------------------! - !----- Compute the relative carbon balance. --------------------------------! - cb_act = 0.0 - cb_max = 0.0 - - if (is_grass(ipft).and. igrass==1) then !!Grass loop, use past month's carbon balance only - cb_act = cpatch%cb(update_month,ico) - cb_max = cpatch%cb_max(update_month,ico) - else !!Tree loop, use annual average carbon balance - do imonth = 1,12 - cb_act = cb_act + cpatch%cb(imonth,ico) - cb_max = cb_max + cpatch%cb_max(imonth,ico) - end do + + + !---------------------------------------------------------------------------! + ! Find the relative carbon balance for the imediate previous month. ! + !---------------------------------------------------------------------------! + !----- Light-related carbon balance. ---------------------------------------! + if (ddmort_const == 0.) then + cbr_light = 1.0 + elseif (cpatch%cb_lightmax(prev_month,ico) > 0.0) then + cbr_light = min(1.0, cpatch%cb (prev_month,ico) & + / cpatch%cb_lightmax (prev_month,ico) ) + else + cbr_light = cbr_severe_stress(ipft) end if - - if(cb_max > 0.0)then - cpatch%cbr_bar(ico) = cb_act / cb_max + !----- Soil moisture-related carbon balance. -------------------------------! + if (ddmort_const == 1.) then + cbr_moist = 1.0 + elseif (cpatch%cb_moistmax(prev_month,ico) > 0.0) then + cbr_moist = min(1.0, cpatch%cb (prev_month,ico) & + / cpatch%cb_moistmax (prev_month,ico) ) else - cpatch%cbr_bar(ico) = 0.0 + cbr_moist = cbr_severe_stress(ipft) + end if + !----- Relative carbon balance: a linear combination of the two factors. ---! + if ( cbr_light == cbr_severe_stress(ipft) .and. & + cbr_moist == cbr_severe_stress(ipft) ) then + cbr_now = cbr_severe_stress(ipft) + else + cbr_now = cbr_severe_stress(ipft) & + + ( cbr_light - cbr_severe_stress(ipft) ) & + * ( cbr_moist - cbr_severe_stress(ipft) ) & + / ( ddmort_const * cbr_moist & + + (1.0 - ddmort_const) * cbr_light & + - cbr_severe_stress(ipft) ) + end if + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Check which type of plant this cohort is. ! + !---------------------------------------------------------------------------! + if (is_grass(ipft) .and. igrass == 1) then + !------------------------------------------------------------------------! + ! New grasses. Only the imediate past month is considered. ! + !------------------------------------------------------------------------! + cpatch%cbr_bar(ico) = cbr_now + !------------------------------------------------------------------------! + else + !------------------------------------------------------------------------! + ! Trees or old grasses. Update the running average. ! + !------------------------------------------------------------------------! + cpatch%cbr_bar(ico) = (11. * cpatch%cbr_bar(ico) + cbr_now) / 12. + !------------------------------------------------------------------------! end if - !---------------------------------------------------------------------------! @@ -296,25 +344,29 @@ end subroutine structural_growth ! doing. Changing the order can affect the C/N budgets. ! !------------------------------------------------------------------------------------------! subroutine structural_growth_eq_0(cgrid, month) - use ed_state_vars , only : edtype & ! structure - , polygontype & ! structure - , sitetype & ! structure - , patchtype ! ! structure - use pft_coms , only : q & ! intent(in) - , qsw & ! intent(in) - , seedling_mortality & ! intent(in) - , c2n_leaf & ! intent(in) - , c2n_storage & ! intent(in) - , c2n_recruit & ! intent(in) - , c2n_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) - use ed_therm_lib , only : calc_veg_hcap & ! function - , update_veg_energy_cweh ! ! function + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype & ! structure + , patchtype ! ! structure + use pft_coms , only : q & ! intent(in) + , qsw & ! intent(in) + , seedling_mortality & ! intent(in) + , c2n_leaf & ! intent(in) + , c2n_storage & ! intent(in) + , c2n_recruit & ! intent(in) + , c2n_stem & ! intent(in) + , l2n_stem & ! intent(in) + , negligible_nplant & ! intent(in) + , agf_bs & ! intent(in) + , cbr_severe_stress & ! intent(in) + , is_grass ! ! intent(in) + use decomp_coms , only : f_labile ! ! intent(in) + use ed_max_dims , only : n_pft & ! intent(in) + , n_dbh ! ! intent(in) + use ed_therm_lib , only : calc_veg_hcap & ! function + , update_veg_energy_cweh ! ! function + use ed_misc_coms , only : igrass ! ! intent(in) + use physiology_coms, only : ddmort_const ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(edtype) , target :: cgrid @@ -329,10 +381,12 @@ subroutine structural_growth_eq_0(cgrid, month) integer :: ico integer :: ilu integer :: ipft - integer :: update_month - integer :: imonth + integer :: prev_month real :: salloc real :: salloci + real :: cbr_light + real :: cbr_moist + real :: cbr_now real :: balive_in real :: bdead_in real :: hite_in @@ -350,8 +404,6 @@ subroutine structural_growth_eq_0(cgrid, month) real :: seed_litter real :: net_seed_N_uptake real :: net_stem_N_uptake - real :: cb_act - real :: cb_max real :: old_leaf_hcap real :: old_wood_hcap !---------------------------------------------------------------------------------------! @@ -392,8 +444,8 @@ subroutine structural_growth_eq_0(cgrid, month) ! 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) + cpatch%monthly_dndt (ico) = 0.0 + cpatch%monthly_dlnndt(ico) = 0.0 !----- Calculate litter owing to mortality. --------------------------------! balive_mort_litter = - cpatch%balive(ico) * cpatch%monthly_dndt(ico) @@ -445,45 +497,96 @@ 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) - 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) + !---------------------------------------------------------------------------! !----- 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 (month == 1) then + prev_month = 12 + else + prev_month = month - 1 + end if + cpatch%cb (prev_month,ico) = cpatch%cb (13,ico) + cpatch%cb_lightmax (prev_month,ico) = cpatch%cb_lightmax (13,ico) + cpatch%cb_moistmax (prev_month,ico) = cpatch%cb_moistmax (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 - cb_act = cb_act + cpatch%cb(imonth,ico) - cb_max = cb_max + cpatch%cb_max(imonth,ico) - end do - if(cb_max > 0.0)then - cpatch%cbr_bar(ico) = cb_act / cb_max + cpatch%cb (13,ico) = 0.0 + cpatch%cb_lightmax (13,ico) = 0.0 + cpatch%cb_moistmax (13,ico) = 0.0 + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Find the relative carbon balance for the imediate previous month. ! + !---------------------------------------------------------------------------! + !----- Light-related carbon balance. ---------------------------------------! + if (ddmort_const == 0.) then + cbr_light = 1.0 + elseif (cpatch%cb_lightmax(prev_month,ico) > 0.0) then + cbr_light = min(1.0, cpatch%cb (prev_month,ico) & + / cpatch%cb_lightmax (prev_month,ico) ) else - cpatch%cbr_bar(ico) = 0.0 + cbr_light = cbr_severe_stress(ipft) + end if + !----- Soil moisture-related carbon balance. -------------------------------! + if (ddmort_const == 1.) then + cbr_moist = 1.0 + elseif (cpatch%cb_moistmax(prev_month,ico) > 0.0) then + cbr_moist = min(1.0, cpatch%cb (prev_month,ico) & + / cpatch%cb_moistmax (prev_month,ico) ) + else + cbr_moist = cbr_severe_stress(ipft) + end if + !----- Relative carbon balance: a linear combination of the two factors. ---! + if ( cbr_light == cbr_severe_stress(ipft) .and. & + cbr_moist == cbr_severe_stress(ipft) ) then + cbr_now = cbr_severe_stress(ipft) + else + cbr_now = cbr_severe_stress(ipft) & + + ( cbr_light - cbr_severe_stress(ipft) ) & + * ( cbr_moist - cbr_severe_stress(ipft) ) & + / ( ddmort_const * cbr_moist & + + (1.0 - ddmort_const) * cbr_light & + - cbr_severe_stress(ipft) ) + end if + !---------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------! + ! Check which type of plant this cohort is. ! + !---------------------------------------------------------------------------! + if (is_grass(ipft) .and. igrass == 1) then + !------------------------------------------------------------------------! + ! New grasses. Only the imediate past month is considered. ! + !------------------------------------------------------------------------! + cpatch%cbr_bar(ico) = cbr_now + !------------------------------------------------------------------------! + else + !------------------------------------------------------------------------! + ! Trees or old grasses. Update the running average. ! + !------------------------------------------------------------------------! + cpatch%cbr_bar(ico) = (11. * cpatch%cbr_bar(ico) + cbr_now) / 12. + !------------------------------------------------------------------------! end if !---------------------------------------------------------------------------! @@ -586,39 +689,62 @@ subroutine plant_structural_allocation(ipft,hite,dbh,lat,phen_status,f_bseeds,f_ ! dropping leaves or off allometry. ! !------------------------------------------------------------------------------------! if ((phenology(ipft) /= 2 .or. late_spring) .and. phen_status == 0) then + !---------------------------------------------------------------------------------! + ! This is where allocation to seeds is occuring. It will need to be ! + ! modified but I'm leaving it for later --- GRASSES! Want to add a functional ! + ! form to constrain this throughout the season - also consider moving this to ! + ! growth_balive since it isn't actually structural growth ! + !---------------------------------------------------------------------------------! + if (is_grass(ipft)) then + select case(igrass) + case (0) + !----- Bonsai grasses. -----------------------------------------------------! + if (dbh >= dbh_crit(ipft)) then + !------------------------------------------------------------------------! + ! Grasses have reached the maximum height, stop growing in size and ! + ! send everything to reproduction. ! + !------------------------------------------------------------------------! + f_bseeds = 1.0 - st_fract(ipft) + elseif (hite <= repro_min_h(ipft)) then + !----- The plant is too short, invest as much as it can in growth. ------! + f_bseeds = 0.0 + else + !----- Medium-sized bonsai, use prescribed reproduction rate. -----------! + f_bseeds = r_fract(ipft) + end if + f_bdead = 1.0 - st_fract(ipft) - f_bseeds + !---------------------------------------------------------------------------! + + + case (1) + !----- New grasses loop. ---------------------------------------------------! + if ((hite * (1 + 1.0e-4)) >= hgt_max(ipft)) then + !------------------------------------------------------------------------! + ! Grasses have reached the maximum height, stop growing in size and ! + ! send everything to reproduction. ! + !------------------------------------------------------------------------! + f_bseeds = 1.0 - st_fract(ipft) + elseif ((hite * (1 + epsilon(1.))) <= repro_min_h(ipft)) then + !----- The plant is too short, invest as much as it can in growth. ------! + f_bseeds = 0.0 + else ! repro_min_h < hite< hgt_max + !----- Medium-sized grass, use prescribed reproduction rate. ------------! + f_bseeds = r_fract(ipft) + end if + f_bdead = 0.0 + end select !------------------------------------------------------------------------------! - !---ALS=== This is where allocation to seeds is occuring. It will need to be ! - ! modified but I'm leaving it for later --- GRASSES! Want to add a functional ! - ! form to constrain this throughout the season - also consider moving this to ! - ! growth_balive since it isn't actually structural growth ! - !------------------------------------------------------------------------------! - if (is_grass(ipft).and. igrass==1) then !-----------------Grass loop--------------! - if ((hite * (1 + 1.0e-4)) >= hgt_max(ipft)) then - !--------------------------------------------------------------------------! - ! Grasses have reached the maximum height, stop growing in size and send ! - ! everything to reproduction. ! - !--------------------------------------------------------------------------! - f_bseeds = 1.0 - st_fract(ipft) - f_bdead = 0.0 - elseif ((hite * (1 + epsilon(1.))) <= repro_min_h(ipft)) then - !----- The plant is too short, invest as much as it can in growth. --------! - f_bseeds = 0.0 - f_bdead = 0.0 - else ! repro_min_h < hite< hgt_max - !----- Plant is with a certain height, use prescribed reproduction rate. --! - f_bseeds = r_fract(ipft) - f_bdead = 0.0 - end if - elseif (hite <= repro_min_h(ipft)) then !----------------- Tree Loop -------------! - !----- The plant is too short, invest as much as it can in growth. ------------! + + elseif (hite <= repro_min_h(ipft)) then + !----- The tree is too short, invest as much as it can in growth. -------------! f_bseeds = 0.0 f_bdead = 1.0 - st_fract(ipft) - f_bseeds else - !----- Plant is with a certain height, use prescribed reproduction rate. ------! + !----- Medium-sized tree, use prescribed reproduction rate. -------------------! f_bseeds = r_fract(ipft) f_bdead = 1.0 - st_fract(ipft) - f_bseeds - end if !!end tree loop - else !-- Plant should not allocate carbon to seeds or grow new biomass -------------! + end if + else !-- Plant should not allocate carbon to seeds or grow new biomass. ------------! f_bdead = 0.0 f_bseeds = 0.0 end if @@ -680,16 +806,19 @@ subroutine update_derived_cohort_props(cpatch,ico,green_leaf_factor,lsl) , is_grass ! ! intent(in) use allometry , only : bd2dbh & ! function , dbh2h & ! function - , dbh2bl & ! function , dbh2krdepth & ! function , bl2dbh & ! function , bl2h & ! function - , h2bl & ! function + , size2bl & ! function , ed_biomass & ! function , area_indices ! ! subroutine use consts_coms , only : pio4 ! ! intent(in) - use ed_misc_coms , only : igrass ! ! intent(in) - + use ed_misc_coms , only : igrass & ! intent(in) + , current_time ! ! intent(in) + use detailed_coms , only : dt_census & ! intent(in) + , yr1st_census & ! intent(in) + , mon1st_census & ! intent(in) + , min_recruit_dbh ! ! intent(in) implicit none !----- Arguments -----------------------------------------------------------------------! type(patchtype), target :: cpatch @@ -697,56 +826,73 @@ subroutine update_derived_cohort_props(cpatch,ico,green_leaf_factor,lsl) real , intent(in) :: green_leaf_factor integer , intent(in) :: lsl !----- Local variables -----------------------------------------------------------------! - real :: bl - real :: bl_max - integer :: ipft + real :: bleaf_max + integer :: ipft + integer :: elapsed_months + logical :: census_time !---------------------------------------------------------------------------------------! - + + !---------------------------------------------------------------------------------------! + ! Find the number of elapsed months since the first census, and decide whether there ! + ! was a census last month or not. It is absolutely fine to be negative, although none ! + ! of the cohorts will be flagged as measured until the first census. ! + ! ! + ! IMPORTANT: the flag will be updated only AFTER the census month, because the time ! + ! step is at the beginning of the month, likely to be just before the ! + ! census... ! + !---------------------------------------------------------------------------------------! + elapsed_months = (current_time%year-yr1st_census-1)*12 & + + current_time%month + (12 - mon1st_census - 1) + census_time = elapsed_months >= 0 .and. mod(elapsed_months,dt_census) == 0 + !---------------------------------------------------------------------------------------! + ipft = cpatch%pft(ico) !----- Get DBH and height --------------------------------------------------------------! - if (is_grass(ipft).and. igrass==1) then - !--Grasses get dbh_effective and height from bleaf + if (is_grass(ipft) .and. igrass == 1) then + !---- New grasses get dbh_effective and height from bleaf. -------------------------! cpatch%dbh(ico) = bl2dbh(cpatch%bleaf(ico), ipft) - cpatch%hite(ico) = bl2h(cpatch%bleaf(ico),ipft) + cpatch%hite(ico) = bl2h (cpatch%bleaf(ico), ipft) else - !--Trees get dbh from bdead + !---- Trees and old grasses get dbh from bdead. ------------------------------------! cpatch%dbh(ico) = bd2dbh(ipft, cpatch%bdead(ico)) - cpatch%hite(ico) = dbh2h(ipft, cpatch%dbh(ico)) + cpatch%hite(ico) = dbh2h (ipft, cpatch%dbh (ico)) end if + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Update the recruitment flag regarding DBH if needed. ! + !---------------------------------------------------------------------------------------! + if (cpatch%dbh(ico) >= min_recruit_dbh) then + cpatch%recruit_dbh(ico) = min(2,cpatch%recruit_dbh(ico) + 1) + end if + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Update the census status if this is the time to do so. ! + !---------------------------------------------------------------------------------------! + if ( cpatch%dbh(ico) >= min_recruit_dbh .and. census_time ) then + cpatch%census_status(ico) = min(2,cpatch%census_status(ico) + 1) + end if + !---------------------------------------------------------------------------------------! - - !----- Check the phenology status and whether it needs to change. ----------------------! - select case (cpatch%phenology_status(ico)) - case (0,1) - - select case (phenology(cpatch%pft(ico))) - 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 - - if (is_grass(ipft).and. igrass==1) then - !---ALS== not sure what maximum leaf should be for grasses? Use actual leaves for now. - bl_max = cpatch%bleaf(ico) - else - bl_max = dbh2bl(cpatch%dbh(ico),ipft) * green_leaf_factor * cpatch%elongf(ico) - end if - - !------------------------------------------------------------------------------------! - ! If LEAF biomass is not the maximum, set it to 1 (leaves partially flushed), ! - ! otherwise, set it to 0 (leaves are fully flushed). ! - !------------------------------------------------------------------------------------! - if (cpatch%bleaf(ico) < bl_max .or. cpatch%elongf(ico) < 1.0) then - cpatch%phenology_status(ico) = 1 - else - cpatch%phenology_status(ico) = 0 - end if + !---------------------------------------------------------------------------------------! + ! Because DBH may have increased, the maximum leaf biomass may be different, which ! + ! will put plants off allometry even if they were on-allometry before. Here we check ! + ! whether this is the case. ! + !---------------------------------------------------------------------------------------! + if ((.not. is_grass(ipft)) .or. igrass /= 1) then + select case (cpatch%phenology_status(ico)) + case (0) + bleaf_max = size2bl(cpatch%dbh(ico),cpatch%hite(ico),cpatch%pft(ico)) + if (cpatch%bleaf(ico) < bleaf_max) cpatch%phenology_status(ico) = 1 + end select + end if + !---------------------------------------------------------------------------------------! - end select - !----- Update LAI, WAI, and CAI. -------------------------------------------------------! call area_indices(cpatch%nplant(ico),cpatch%bleaf(ico),cpatch%bdead(ico) & ,cpatch%balive(ico),cpatch%dbh(ico), cpatch%hite(ico),cpatch%pft(ico) & @@ -756,7 +902,7 @@ subroutine update_derived_cohort_props(cpatch,ico,green_leaf_factor,lsl) !----- Finding the new basal area and above-ground biomass. ----------------------------! cpatch%basarea(ico)= pio4 * cpatch%dbh(ico) * cpatch%dbh(ico) cpatch%agb(ico) = ed_biomass(cpatch%bdead(ico),cpatch%bleaf(ico) & - ,cpatch%bsapwooda(ico),cpatch%pft(ico)) + ,cpatch%bsapwooda(ico),cpatch%pft(ico)) !----- Update rooting depth ------------------------------------------------------------! cpatch%krdepth(ico) = dbh2krdepth(cpatch%hite(ico),cpatch%dbh(ico),ipft,lsl) @@ -832,9 +978,15 @@ subroutine update_vital_rates(cpatch,ico,ilu,dbh_in,bdead_in,balive_in,hite_in,b ! Change the agb growth to kgC/plant/year, basal area to cm2/plant/year, and DBH ! ! growth to cm/year. ! !---------------------------------------------------------------------------------------! - cpatch%dagb_dt(ico) = (cpatch%agb(ico) - agb_in ) * 12.0 - cpatch%dba_dt(ico) = (cpatch%basarea(ico) - ba_in ) * 12.0 - cpatch%ddbh_dt(ico) = (cpatch%dbh(ico) - dbh_in ) * 12.0 + cpatch%dagb_dt (ico) = (cpatch%agb(ico) - agb_in ) * 12.0 + cpatch%dlnagb_dt (ico) = log(cpatch%agb(ico) / agb_in ) * 12.0 + cpatch%dba_dt (ico) = (cpatch%basarea(ico) - ba_in ) * 12.0 + cpatch%dlnba_dt (ico) = log(cpatch%basarea(ico) / ba_in ) * 12.0 + cpatch%ddbh_dt (ico) = (cpatch%dbh(ico) - dbh_in ) * 12.0 + cpatch%dlndbh_dt (ico) = log(cpatch%dbh(ico) / dbh_in ) * 12.0 + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! These are polygon-level variable, so they are done in kgC/m2. Update the current ! diff --git a/ED/src/init/ed_bigleaf_init.f90 b/ED/src/init/ed_bigleaf_init.f90 new file mode 100644 index 000000000..0a78e668a --- /dev/null +++ b/ED/src/init/ed_bigleaf_init.f90 @@ -0,0 +1,463 @@ +!==========================================================================================! +!==========================================================================================! +! This sub-routine converts a conventional SAS initialisation into a big leaf. ! +!------------------------------------------------------------------------------------------! +subroutine ed_bigleaf_init(cgrid) + use ed_node_coms , only : mynum ! ! intent(in) + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype & ! structure + , patchtype & ! structure + , allocate_sitetype & ! subroutine + , deallocate_sitetype & ! subroutine + , allocate_patchtype & ! subroutine + , deallocate_patchtype ! ! subroutine + use ed_max_dims , only : n_pft & ! intent(in) + , n_dist_types ! ! intent(in) + use allometry , only : size2bl & ! function + , dbh2bd & ! function + , area_indices & ! function + , ed_biomass ! ! function + use pft_coms , only : hgt_max & ! intent(in) + , dbh_bigleaf & ! intent(in) + , sla & ! intent(in) + , q & ! intent(in) + , qsw & ! intent(in) + , agf_bs ! ! intent(in) + use ed_misc_coms , only : igrass ! ! intent(in) + use fuse_fiss_utils, only : sort_cohorts & ! subroutine + , sort_patches ! ! subroutine + use consts_coms , only : pio4 ! ! intent(in) + implicit none + + !----- Arguments. ----------------------------------------------------------------------! + type(edtype) , target :: cgrid + !----- Local variables. ----------------------------------------------------------------! + type(polygontype), pointer :: cpoly + type(sitetype) , pointer :: csite + type(patchtype) , pointer :: cpatch + integer , dimension(n_dist_types) :: lu_npatch + integer :: site_npatch + integer :: ipy + integer :: isi + integer :: ipa + integer :: ico + integer :: ipft + integer :: ilu + integer :: ncohorts + integer :: npatchco + integer :: nsitepat + integer :: k + logical , dimension(n_pft) :: pft_mask + logical , dimension(n_dist_types) :: lu_mask + logical , dimension(n_dist_types) :: lu_desert + real , dimension(n_pft) :: pft_area + real , dimension(n_pft,n_dist_types) :: lai + real , dimension(n_dist_types) :: area + real , dimension(n_dist_types) :: fsc + real , dimension(n_dist_types) :: ssc + real , dimension(n_dist_types) :: stsc + real , dimension(n_dist_types) :: stsl + real , dimension(n_dist_types) :: msn + real , dimension(n_dist_types) :: fsn + real , dimension(n_dist_types) :: sum_dgd + real , dimension(n_dist_types) :: sum_chd + real :: lu_area + real :: site_area + real :: new_area + real :: area_sum + real :: area_tot + real :: patch_agb + real :: patch_bsa + real :: patch_pop + real :: site_lai + real :: site_agb + real :: site_bsa + real :: site_pop + real :: site_fsc + real :: site_ssc + real :: site_stsc + real :: poly_lai + real :: poly_agb + real :: poly_bsa + real :: poly_pop + real :: poly_fsc + real :: poly_ssc + real :: poly_stsc + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Loop over all sites. ! + !---------------------------------------------------------------------------------------! + write(unit=*,fmt='(141a)' ) ('-',k=1,141) + write(unit=*,fmt='(a,1x,i5)' ) ' Mynum = ',mynum + write(unit=*,fmt='(141a)' ) ('-',k=1,141) + write(unit=*,fmt='(11(a,1x))') ' IPY',' NSITES',' NPATCHES' & + ,' NCOHORTS',' NPLANT',' LAI' & + ,' AGB',' BASAL_AREA',' FAST_SC' & + ,' SLOW_SC',' STRUCT_SC' + write(unit=*,fmt='(141a)' ) ('-',k=1,141) + polyloop: do ipy=1,cgrid%npolygons + + cpoly => cgrid%polygon(ipy) + firstsiteloop: do isi=1,cpoly%nsites + + !----- Reset all structures before loop over paches. -----------------------------! + lai (:,:) = 0. + area (:) = 0. + fsc (:) = 0. + ssc (:) = 0. + stsc (:) = 0. + stsl (:) = 0. + msn (:) = 0. + fsn (:) = 0. + sum_dgd (:) = 0. + sum_chd (:) = 0. + + !---------------------------------------------------------------------------------! + ! Determine the site-level properties. ! + !---------------------------------------------------------------------------------! + csite => cpoly%site(isi) + inpatchloop: do ipa = 1,csite%npatches + + !------------------------------------------------------------------------------! + ! Find the land use type for this patch. We will aggregate all patches ! + ! with this disturbance type. ! + !------------------------------------------------------------------------------! + ilu = csite%dist_type(ipa) + area (ilu) = area (ilu) + csite%area (ipa) + fsc (ilu) = fsc (ilu) + csite%fast_soil_C (ipa) * csite%area(ipa) + ssc (ilu) = ssc (ilu) + csite%slow_soil_C (ipa) * csite%area(ipa) + stsc (ilu) = stsc (ilu) + csite%structural_soil_C (ipa) * csite%area(ipa) + stsl (ilu) = stsl (ilu) + csite%structural_soil_L (ipa) * csite%area(ipa) + msn (ilu) = msn (ilu) + csite%mineralized_soil_N(ipa) * csite%area(ipa) + fsn (ilu) = fsn (ilu) + csite%fast_soil_N (ipa) * csite%area(ipa) + sum_dgd(ilu) = sum_dgd(ilu) + csite%sum_dgd (ipa) * csite%area(ipa) + sum_chd(ilu) = sum_chd(ilu) + csite%sum_chd (ipa) * csite%area(ipa) + !------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------! + ! Integrate the cohort-level properties. ! + !------------------------------------------------------------------------------! + cpatch => csite%patch(ipa) + incohortloop: do ico=1,cpatch%ncohorts + !---------------------------------------------------------------------------! + ! Find the PFT for this cohort. We aggregate all cohorts of this PFT. ! + ! The only variable we need is the leaf area index, which is preserved at ! + ! the site level. Because this subroutine is called immediately after the ! + ! initialisation and before the first phenology check, LAI is always ! + ! positive as long as the cohort exists. ! + !---------------------------------------------------------------------------! + ipft = cpatch%pft(ico) + lai(ipft,ilu) = lai(ipft,ilu) + cpatch%lai(ico) * csite%area(ipa) + !---------------------------------------------------------------------------! + end do incohortloop + !------------------------------------------------------------------------------! + + + !----- Remove all cohorts. ----------------------------------------------------! + call deallocate_patchtype(cpatch) + cpatch%ncohorts = 0 + !------------------------------------------------------------------------------! + end do inpatchloop + !---------------------------------------------------------------------------------! + + + !----- Remove all patches. -------------------------------------------------------! + call deallocate_sitetype(csite) + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! The new number of patches is going to be the total number of PFTs that ! + ! exist amongst all land use types. ! + ! 1. We add bdead and bleaf because the new grasses don't have structural ! + ! biomass. ! + ! 2. In case the biomass is zero but the area of the type is not, we make one ! + ! empty patch. This can happen when the previous simulation evolved to a ! + ! desert, for example. ! + !---------------------------------------------------------------------------------! + do ilu=1,n_dist_types + lu_npatch(ilu) = count(lai(:,ilu) > 0.) + lu_desert(ilu) = lu_npatch(ilu) == 0 .and. area(ilu) > 0. + if (lu_desert(ilu)) lu_npatch(ilu) = 1 + end do + site_npatch = sum(lu_npatch) + !---------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------! + ! Allocate the right number of patches. ! + !---------------------------------------------------------------------------------! + call allocate_sitetype(csite,site_npatch) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! Populate th patches with either 0 or 1 cohort each. ! + !---------------------------------------------------------------------------------! + ipa = 0 + addluloop: do ilu=1,n_dist_types + if (lu_desert(ilu)) then + !---------------------------------------------------------------------------! + ! This land use type existed but became a desert. Create an empty ! + ! patch. ! + !---------------------------------------------------------------------------! + ipa = ipa + 1 + csite%dist_type (ipa) = ilu + csite%area (ipa) = area(ilu) + csite%age (ipa) = 0.0 + csite%fast_soil_C (ipa) = fsc (ilu) / area(ilu) + csite%slow_soil_C (ipa) = ssc (ilu) / area(ilu) + csite%structural_soil_C (ipa) = stsc(ilu) / area(ilu) + csite%structural_soil_L (ipa) = stsl(ilu) / area(ilu) + csite%mineralized_soil_N(ipa) = msn (ilu) / area(ilu) + csite%fast_soil_N (ipa) = fsn (ilu) / area(ilu) + csite%sum_dgd (ipa) = 0.0 + csite%sum_chd (ipa) = 0.0 + csite%plantation (ipa) = 0 + csite%cohort_count (ipa) = 0 + !---------------------------------------------------------------------------! + + elseif (lu_npatch(ilu) /= 0) then + !---------------------------------------------------------------------------! + ! This land use type has cohorts. The first step is to find the total ! + ! area that each patch/cohort/PFT is entitled. ! + !---------------------------------------------------------------------------! + pft_area(:) = lai(:,ilu) / sum(lai(:,ilu)) + + !----- Loop over all PFTs, and add those that have something. --------------! + addpftloop: do ipft = 1,n_pft + if (lai(ipft,ilu) > 0.0) then + ipa = ipa + 1 + !----- Initialise the patch-level properties. ------------------------! + csite%dist_type (ipa) = ilu + csite%area (ipa) = pft_area(ipft) * area(ilu) + csite%age (ipa) = 0.0 + csite%fast_soil_C (ipa) = fsc (ilu) / area(ilu) + csite%slow_soil_C (ipa) = ssc (ilu) / area(ilu) + csite%structural_soil_C (ipa) = stsc(ilu) / area(ilu) + csite%structural_soil_L (ipa) = stsl(ilu) / area(ilu) + csite%mineralized_soil_N(ipa) = msn (ilu) / area(ilu) + csite%fast_soil_N (ipa) = fsn (ilu) / area(ilu) + csite%sum_dgd (ipa) = sum_dgd(ilu) + csite%sum_chd (ipa) = sum_chd(ilu) + csite%plantation (ipa) = 0 + csite%cohort_count (ipa) = 1 + + !----- Big-leaf model, therefore only one cohort per patch. ----------! + cpatch => csite%patch(ipa) + call allocate_patchtype(cpatch,1) + cpatch%pft (1) = ipft + cpatch%hite (1) = hgt_max(ipft) + cpatch%dbh (1) = dbh_bigleaf(ipft) + cpatch%bleaf (1) = size2bl(cpatch%dbh(1),cpatch%hite(1),ipft) + cpatch%bdead (1) = dbh2bd (cpatch%dbh(1),ipft) + cpatch%broot (1) = cpatch%bleaf(1) * q(ipft) + cpatch%bsapwooda (1) = agf_bs(ipft) * cpatch%bleaf(1) & + * qsw(ipft) * cpatch%hite(1) + cpatch%bsapwoodb (1) = (1.0 - agf_bs(ipft)) * cpatch%bleaf(1) & + * qsw(ipft) * cpatch%hite(1) + cpatch%balive (1) = cpatch%bleaf (1) + cpatch%broot (1) & + + cpatch%bsapwooda(1) + cpatch%bsapwoodb(1) + cpatch%sla (1) = sla (ipft) + cpatch%nplant (1) = lai (ipft,ilu) & + / ( cpatch%sla(1) * cpatch%bleaf(1) & + * csite%area(ipa) ) + !---------------------------------------------------------------------! + + + !---------------------------------------------------------------------! + ! Start plants with full phenology and in great carbon balance, ! + ! we will take care of phenology after this sub-routine. ! + !---------------------------------------------------------------------! + cpatch%cb (1:12,1) = 1.0 + cpatch%cb_lightmax (1:12,1) = 1.0 + cpatch%cb_moistmax (1:12,1) = 1.0 + cpatch%cb (13,1) = 0.0 + cpatch%cb_lightmax (13,1) = 0.0 + cpatch%cb_moistmax (13,1) = 0.0 + cpatch%phenology_status (1) = 0 + cpatch%bstorage (1) = 0.0 + !---------------------------------------------------------------------! + + + + !----- Assign LAI, WAI, and CAI --------------------------------------! + call area_indices(cpatch%nplant(1),cpatch%bleaf(1),cpatch%bdead(1) & + ,cpatch%balive(1),cpatch%dbh(1), cpatch%hite(1) & + ,cpatch%pft(1),cpatch%sla(1),cpatch%lai(1) & + ,cpatch%wai(1),cpatch%crown_area(1) & + ,cpatch%bsapwooda(1)) + + !----- Above ground biomass, use the allometry. ----------------------! + cpatch%agb(1) = ed_biomass(cpatch%bdead(1),cpatch%bleaf(1) & + ,cpatch%bsapwooda(1),cpatch%pft(1)) + cpatch%basarea(1) = pio4 * cpatch%dbh(1) * cpatch%dbh(1) + + !----- Growth rates, start with zero. --------------------------------! + cpatch%dagb_dt (1) = 0. + cpatch%dlnagb_dt(1) = 0. + cpatch%dba_dt (1) = 0. + cpatch%dlnba_dt (1) = 0. + cpatch%ddbh_dt (1) = 0. + cpatch%dlndbh_dt(1) = 0. + + !---------------------------------------------------------------------! + ! Initialise other cohort variables. Some of them won't be ! + ! updated unless the lai exceeds lai_min. ! + !---------------------------------------------------------------------! + cpatch%fsw (1) = 1.0 + cpatch%gpp (1) = 0.0 + cpatch%par_l(1) = 0.0 + !---------------------------------------------------------------------! + + !----- Update the patch level above-ground biomass. ------------------! + csite%plant_ag_biomass(ipa) = csite%plant_ag_biomass(ipa) & + + cpatch%agb(1) * cpatch%nplant(1) + !---------------------------------------------------------------------! + end if + end do addpftloop + !---------------------------------------------------------------------------! + end if + !------------------------------------------------------------------------------! + end do addluloop + !---------------------------------------------------------------------------------! + end do firstsiteloop + !------------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------------! + ! Initialise all the other site , patch , and cohort level variables. ! + !------------------------------------------------------------------------------------! + initsiteloop: do isi = 1,cpoly%nsites + area_sum = 0.0 + ncohorts = 0 + + + !----- Make sure that the total patch area is 1. ---------------------------------! + csite => cpoly%site(isi) + area_tot = sum(csite%area(1:csite%npatches)) + csite%area(:) = csite%area(:)/area_tot + + !----- Find the patch-level LAI, WAI, and CAI. -----------------------------------! + do ipa=1,csite%npatches + area_sum = area_sum + csite%area(ipa) + csite%lai(ipa) = 0.0 + csite%wai(ipa) = 0.0 + cpatch => csite%patch(ipa) + do ico = 1,cpatch%ncohorts + csite%lai(ipa) = csite%lai(ipa) + cpatch%lai(ico) + csite%wai(ipa) = csite%wai(ipa) + cpatch%wai(ico) + ncohorts = ncohorts + 1 + end do + end do + + !----- Initialise the cohort variables, then sort them by size. ------------------! + do ipa = 1,csite%npatches + cpatch => csite%patch(ipa) + do ico = 1,cpatch%ncohorts + call init_ed_cohort_vars(cpatch,ico,cpoly%lsl(isi)) + end do + + !----- Make sure that cohorts are organised from tallest to shortest. ---------! + call sort_cohorts(cpatch) + end do + + !----- Initialise the patch-level variables. -------------------------------------! + call init_ed_patch_vars(csite,1,csite%npatches,cpoly%lsl(isi)) + + !----- Make sure that patches are organised from oldest to youngest. -------------! + call sort_patches(csite) + end do initsiteloop + !------------------------------------------------------------------------------------! + + + + !----- Initialise site-level variables. ---------------------------------------------! + call init_ed_site_vars(cpoly,cgrid%lat(ipy)) + + + !----- Get a diagnostic on the polygon's vegetation. --------------------------------! + poly_pop = 0.0 + poly_lai = 0.0 + poly_agb = 0.0 + poly_bsa = 0.0 + poly_fsc = 0.0 + poly_ssc = 0.0 + poly_stsc = 0.0 + ncohorts = 0 + + do isi = 1,cpoly%nsites + nsitepat = 0 + csite => cpoly%site(isi) + + site_pop = 0.0 + site_lai = 0.0 + site_agb = 0.0 + site_bsa = 0.0 + site_fsc = 0.0 + site_ssc = 0.0 + site_stsc = 0.0 + do ipa = 1,csite%npatches + csite%lai(ipa) = 0.0 + csite%wai(ipa) = 0.0 + npatchco = 0 + + cpatch => csite%patch(ipa) + patch_pop = 0.0 + patch_agb = 0.0 + patch_bsa = 0.0 + do ico = 1,cpatch%ncohorts + ncohorts = ncohorts+1 + npatchco = npatchco+1 + csite%lai(ipa) = csite%lai(ipa) + cpatch%lai(ico) + csite%wai(ipa) = csite%wai(ipa) + cpatch%wai(ico) + patch_pop = patch_pop + cpatch%nplant(ico) + patch_agb = patch_agb + cpatch%nplant(ico) * cpatch%agb (ico) + patch_bsa = patch_bsa + cpatch%nplant(ico) * cpatch%basarea(ico) + end do + site_pop = site_pop + patch_pop * csite%area(ipa) + site_lai = site_lai + csite%lai (ipa) * csite%area(ipa) + site_agb = site_agb + patch_agb * csite%area(ipa) + site_bsa = site_bsa + patch_bsa * csite%area(ipa) + site_fsc = site_fsc + csite%fast_soil_C (ipa) * csite%area(ipa) + site_ssc = site_ssc + csite%slow_soil_C (ipa) * csite%area(ipa) + site_stsc = site_stsc + csite%structural_soil_C(ipa) * csite%area(ipa) + + csite%cohort_count(ipa) = npatchco + nsitepat = nsitepat + 1 + end do + + poly_pop = poly_pop + site_pop * cpoly%area(isi) + poly_lai = poly_lai + site_lai * cpoly%area(isi) + poly_agb = poly_agb + site_agb * cpoly%area(isi) + poly_bsa = poly_bsa + site_bsa * cpoly%area(isi) + poly_fsc = poly_fsc + site_fsc * cpoly%area(isi) + poly_ssc = poly_ssc + site_ssc * cpoly%area(isi) + poly_stsc = poly_stsc + site_stsc * cpoly%area(isi) + + cpoly%patch_count(isi) = nsitepat + + + write (unit=*,fmt='(4(i12,1x),7(f12.3,1x))') ipy,cpoly%nsites,nsitepat,ncohorts & + ,poly_pop,poly_lai,poly_agb,poly_bsa & + ,poly_fsc,poly_ssc,poly_stsc + end do + + !----- Initialise the polygon-level variables. --------------------------------------! + call init_ed_poly_vars(cgrid) + end do polyloop + write(unit=*,fmt='(141a)') ('-',k=1,141) + write(unit=*,fmt='(a)') ' ' + write(unit=*,fmt='(a)') ' ' + !---------------------------------------------------------------------------------------! + return +end subroutine ed_bigleaf_init +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/init/ed_init.f90 b/ED/src/init/ed_init.f90 index 8dab8618a..79e4c5076 100644 --- a/ED/src/init/ed_init.f90 +++ b/ED/src/init/ed_init.f90 @@ -78,7 +78,7 @@ subroutine set_site_defprops() integer :: npoly integer :: nsite integer :: k - real :: sc + integer :: sc real :: zmin real :: fa real :: fb @@ -338,7 +338,7 @@ subroutine load_ecosystem_state() do igr = 1,ngrids call read_site_file(edgrid_g(igr),igr) end do - case (4) + case (4,7) continue case default call set_site_defprops() @@ -373,7 +373,7 @@ subroutine load_ecosystem_state() write(unit=*,fmt='(a)') ' + Doing near-bare-ground big-leaf initialization...' end if do igr=1,ngrids - call near_bare_ground_big_leaf_init(edgrid_g(igr)) + call near_bare_ground_big_leaf_init(edgrid_g(igr)) end do end select @@ -381,18 +381,49 @@ subroutine load_ecosystem_state() !----- Initialize with ED1-type restart information. --------------------------------! write(unit=*,fmt='(a,i3.3)') ' + Initializing from ED restart file. Node: ',mynum call read_ed10_ed20_history_file + select case (ibigleaf) + case (1) + do igr=1,ngrids + call ed_bigleaf_init(edgrid_g(igr)) + end do + end select case (4) write(unit=*,fmt='(a,i3.3)') ' + Initializing from ED2.1 state file. Node: ',mynum call read_ed21_history_file + select case (ibigleaf) + case (1) + do igr=1,ngrids + call ed_bigleaf_init(edgrid_g(igr)) + end do + end select case (5,99) write(unit=*,fmt='(a,i3.3)') & ' + Initializing from a collection of ED2.1 state files. Node: ',mynum call read_ed21_history_unstruct + select case (ibigleaf) + case (1) + do igr=1,ngrids + call ed_bigleaf_init(edgrid_g(igr)) + end do + end select + case (7) + write(unit=*,fmt='(a,i3.3)') & + ' + Initializing Soils+Veg from nearest neighbor ED2.1 files. Node: ',mynum + call read_ed21_polyclone + select case (ibigleaf) + case (1) + do igr=1,ngrids + call ed_bigleaf_init(edgrid_g(igr)) + end do + end select + end select + + if (mynum < nnodetot) call MPI_Send(ping,1,MPI_INTEGER,sendnum,101,MPI_COMM_WORLD,ierr) !---------------------------------------------------------------------------------------! diff --git a/ED/src/init/ed_init_atm.F90 b/ED/src/init/ed_init_atm.F90 index c9576a7d7..03915ef74 100644 --- a/ED/src/init/ed_init_atm.F90 +++ b/ED/src/init/ed_init_atm.F90 @@ -5,7 +5,8 @@ !------------------------------------------------------------------------------------------! subroutine ed_init_atm() use ed_misc_coms , only : runtype & ! intent(in) - , ibigleaf ! ! intent(in) + , ibigleaf & ! intent(in) + , ied_init_mode ! ! intent(in) use ed_state_vars , only : edtype & ! structure , polygontype & ! structure , sitetype & ! structure @@ -35,6 +36,7 @@ subroutine ed_init_atm() use ed_therm_lib , only : calc_veg_hcap & ! subroutine , ed_grndvap ! ! subroutine use therm_lib , only : thetaeiv & ! function + , vpdefil & ! function , idealdenssh & ! function , qslif & ! function , reducedpress & ! function @@ -128,6 +130,8 @@ subroutine ed_init_atm() csite%can_theiv(ipa) = thetaeiv(csite%can_theta(ipa),csite%can_prss(ipa) & ,csite%can_temp(ipa),rvaux,rvaux) + csite%can_vpdef(ipa) = vpdefil (csite%can_prss(ipa),csite%can_temp(ipa) & + ,csite%can_shv (ipa),.true.) csite%can_rhos (ipa) = idealdenssh(csite%can_prss(ipa) & ,csite%can_temp(ipa),csite%can_shv(ipa)) @@ -149,12 +153,13 @@ subroutine ed_init_atm() ! thermal equilibrium with the canopy air space and no intercepted ! ! water sitting on top of leaves and branches. ! !------------------------------------------------------------------------! - cpatch%leaf_water (ico) = 0.0 - cpatch%wood_water (ico) = 0.0 - cpatch%leaf_temp (ico) = csite%can_temp(ipa) - cpatch%wood_temp (ico) = csite%can_temp(ipa) + cpatch%leaf_water (ico) = 0.0 + cpatch%wood_water (ico) = 0.0 + cpatch%leaf_temp (ico) = csite%can_temp (ipa) + cpatch%wood_temp (ico) = csite%can_temp (ipa) cpatch%leaf_temp_pv (ico) = csite%can_temp_pv(ipa) cpatch%wood_temp_pv (ico) = csite%can_temp_pv(ipa) + cpatch%leaf_vpdef (ico) = csite%can_vpdef (ipa) if (csite%can_temp(ipa) == t3ple) then cpatch%leaf_fliq (ico) = 0.5 cpatch%wood_fliq (ico) = 0.5 @@ -181,7 +186,7 @@ subroutine ed_init_atm() , cpatch%wood_temp (ico) & , cpatch%wood_fliq (ico) ) - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) !----- Initialise the leaf surface and intercellular properties. --------! cpatch%lsfc_shv_open(ico) = cmet%atm_shv @@ -250,7 +255,8 @@ subroutine ed_init_atm() patchloop2: do ipa = 1,csite%npatches cpatch => csite%patch(ipa) - if (csite%soil_tempk(1,ipa) == -100.0 .or. isoilstateinit == 0) then + if (csite%soil_tempk(1,ipa) == -100.0 .or. isoilstateinit == 0 & + .or. ied_init_mode == 7 ) then ! The third is redundant, but keep it groundloop2: do k = 1, nzg nsoil=cpoly%ntext_soil(k,isi) @@ -274,7 +280,9 @@ subroutine ed_init_atm() !---------------------------------------------------------------------! ! Initialise soil moisture and internal energy. ! !---------------------------------------------------------------------! - csite%soil_water(k,ipa) = ed_soil_idx2water(slmstr(k),nsoil) + if (ied_init_mode /= 7) then + csite%soil_water(k,ipa) = ed_soil_idx2water(slmstr(k),nsoil) + end if csite%soil_energy(k,ipa) = cmtl2uext( soil(nsoil)%slcpd & , csite%soil_water(k,ipa)*wdns & , csite%soil_tempk(k,ipa) & diff --git a/ED/src/init/ed_nbg_init.f90 b/ED/src/init/ed_nbg_init.f90 index 618bfa947..eec637c0d 100644 --- a/ED/src/init/ed_nbg_init.f90 +++ b/ED/src/init/ed_nbg_init.f90 @@ -221,8 +221,10 @@ subroutine init_nbg_cohorts(csite,lsl,ipa_a,ipa_z) * salloci * agf_bs(ipft) cpatch%bsapwoodb(ico) = qsw(ipft) * cpatch%hite(ico) * cpatch%balive(ico) & * salloci * (1.-agf_bs(ipft)) - cpatch%bstorage(ico) = 0.5 * ( cpatch%bleaf(ico) + cpatch%broot(ico) & - + cpatch%bsapwooda(ico)+ cpatch%bsapwoodb(ico)) + cpatch%bstorage(ico) = 0.5 * ( cpatch%bleaf(ico) & + + cpatch%broot(ico) & + + cpatch%bsapwooda(ico) & + + cpatch%bsapwoodb(ico)) !----- Find the initial area indices (LAI, WAI, CAI). ----------------------------! call area_indices(cpatch%nplant(ico),cpatch%bleaf(ico),cpatch%bdead(ico) & @@ -404,34 +406,34 @@ end subroutine init_cohorts_by_layers ! This subroutine initializes a near-bare ground 'big-leaf' ed run. ! !------------------------------------------------------------------------------------------! subroutine near_bare_ground_big_leaf_init(cgrid) - use ed_state_vars , only : edtype & ! structure - , polygontype & ! structure - , sitetype & ! structure - , patchtype & ! structure - , allocate_sitetype & ! subroutine - , allocate_patchtype! ! subroutine - use ed_misc_coms , only : ied_init_mode & ! intent(in) - , ibigleaf ! ! intent(in) - use physiology_coms, only : n_plant_lim ! ! intent(in) - use grid_coms , only : nzg ! ! intent(in) - use pft_coms , only : q & ! intent(in) - , qsw & ! intent(in) - , sla & ! intent(in) - , agf_bs & ! intent(in) - , hgt_min & ! intent(in) - , include_pft & ! intent(in) - , include_these_pft & ! intent(in) - , include_pft_ag & ! intent(in) - , init_density ! ! intent(in) - use consts_coms , only : t3ple & ! intent(in) - , pio4 & ! intent(in) - , kgom2_2_tonoha& ! intent(in) - , tonoha_2_kgom2! ! intent(in) - use allometry , only : h2dbh & ! function - , dbh2bd & ! function - , dbh2bl & ! function - , ed_biomass & ! function - , area_indices ! ! subroutine + use ed_state_vars , only : edtype & ! structure + , polygontype & ! structure + , sitetype & ! structure + , patchtype & ! structure + , allocate_sitetype & ! subroutine + , allocate_patchtype ! ! subroutine + use ed_misc_coms , only : ied_init_mode & ! intent(in) + , ibigleaf ! ! intent(in) + use physiology_coms , only : n_plant_lim ! ! intent(in) + use grid_coms , only : nzg ! ! intent(in) + use pft_coms , only : q & ! intent(in) + , qsw & ! intent(in) + , sla & ! intent(in) + , agf_bs & ! intent(in) + , dbh_bigleaf & ! intent(in) + , hgt_max & ! intent(in) + , include_pft & ! intent(in) + , include_these_pft & ! intent(in) + , include_pft_ag & ! intent(in) + , init_density ! ! intent(in) + use consts_coms , only : t3ple & ! intent(in) + , pio4 & ! intent(in) + , kgom2_2_tonoha & ! intent(in) + , tonoha_2_kgom2 ! ! intent(in) + use allometry , only : dbh2bd & ! function + , size2bl & ! function + , ed_biomass & ! function + , area_indices ! ! subroutine implicit none !----- Arguments. ----------------------------------------------------------------------! @@ -525,12 +527,12 @@ subroutine near_bare_ground_big_leaf_init(cgrid) ! quantities using the standard allometry for this PFT. ! !---------------------------------------------------------------------------! cpatch%nplant(ico) = init_density(ipft) - cpatch%hite(ico) = hgt_min(ipft) + cpatch%dbh(ico) = dbh_bigleaf(ipft) + cpatch%hite(ico) = hgt_max(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) + cpatch%bleaf(ico) = size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) cpatch%sla(ico) = sla(ipft) salloc = 1.0 + q(ipft) + qsw(ipft) * cpatch%hite(ico) diff --git a/ED/src/init/ed_params.f90 b/ED/src/init/ed_params.f90 index 071168f51..7f3248144 100644 --- a/ED/src/init/ed_params.f90 +++ b/ED/src/init/ed_params.f90 @@ -190,7 +190,8 @@ subroutine init_ed_misc_coms , vary_rad & ! intent(out) , max_thsums_dist & ! intent(out) , max_poihist_dist & ! intent(out) - , max_poi99_dist ! ! intent(out) + , max_poi99_dist & ! intent(out) + , suppress_h5_warnings implicit none @@ -272,6 +273,13 @@ subroutine init_ed_misc_coms max_poihist_dist = 250. !---------------------------------------------------------------------------------------! + ! If you dont want to read a million warnings about certain initialization + ! variables not being available in the history input file, set this to + ! true. Its better for new users to see what is missing though. + + suppress_h5_warnings = .false. + + return end subroutine init_ed_misc_coms !==========================================================================================! @@ -406,6 +414,7 @@ subroutine init_lapse_params() lapse%atm_tmp = 0.0 lapse%atm_theta = 0.0 lapse%atm_theiv = 0.0 + lapse%atm_vpdef = 0.0 lapse%atm_shv = 0.0 lapse%prss = 0.0 lapse%pcpg = 0.0 @@ -1419,6 +1428,8 @@ end subroutine init_can_lyr_params subroutine init_pft_photo_params() use ed_max_dims , only : n_pft ! ! intent(in) + use ed_misc_coms , only : ibigleaf & ! intent(in) + , iallom ! ! intent(in) use pft_coms , only : D0 & ! intent(out) , Vm_low_temp & ! intent(out) , Vm_high_temp & ! intent(out) @@ -1470,6 +1481,11 @@ subroutine init_pft_photo_params() implicit none !---------------------------------------------------------------------------------------! + + !----- Local variables. ----------------------------------------------------------------! + real(kind=4) :: ssfact + !---------------------------------------------------------------------------------------! + D0(1) = d0_grass D0(2:4) = d0_tree D0(5) = d0_grass @@ -1529,22 +1545,39 @@ subroutine init_pft_photo_params() - !------ Vm0 is the maximum photosynthesis capacity in µmol/m2/s. -----------------------! - 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) = 21.875000 * vmfact_c3 - Vm0(17) = 15.625000 * vmfact_c3 + !---------------------------------------------------------------------------------------! + ! Vm0 is the maximum photosynthesis capacity in µmol/m2/s. Notice that depending ! + ! on the size structure (SAS or Big Leaf), there is an addition factor multiplied. ! + !---------------------------------------------------------------------------------------! + !----- Find the additional factor to multiply Vm0. -------------------------------------! + select case (ibigleaf) + case (0) + !----- SAS, use only the modification from the namelist. ----------------------------! + ssfact = 1.0 + case (1) + select case (iallom) + case (0,1) + ssfact = 3.0 + case (2) + ssfact = 3.0 + end select + end select + !---- Define Vm0 for all PFTs. ---------------------------------------------------------! + Vm0(1) = 12.500000 * ssfact * vmfact_c4 + Vm0(2) = 18.750000 * ssfact * vmfact_c3 + Vm0(3) = 12.500000 * ssfact * vmfact_c3 + Vm0(4) = 6.250000 * ssfact * vmfact_c3 + Vm0(5) = 18.300000 * ssfact * vmfact_c3 + Vm0(6) = 11.350000 * ssfact * vmfact_c3 + Vm0(7) = 11.350000 * ssfact * vmfact_c3 + Vm0(8) = 4.540000 * ssfact * vmfact_c3 + Vm0(9) = 20.387075 * ssfact * vmfact_c3 + Vm0(10) = 17.454687 * ssfact * vmfact_c3 + Vm0(11) = 6.981875 * ssfact * vmfact_c3 + Vm0(12:13) = 18.300000 * ssfact * vmfact_c3 + Vm0(14:15) = 12.500000 * ssfact * vmfact_c4 + Vm0(16) = 20.833333 * ssfact * vmfact_c3 + Vm0(17) = 15.625000 * ssfact * vmfact_c3 !---------------------------------------------------------------------------------------! @@ -1578,10 +1611,10 @@ subroutine init_pft_photo_params() dark_respiration_factor(11) = gamma_c3 dark_respiration_factor(12) = gamma_c3 dark_respiration_factor(13) = gamma_c3 - dark_respiration_factor(14) = gamma_c3 ! why are these not c4? - dark_respiration_factor(15) = gamma_c3 ! why are these not c4? + dark_respiration_factor(14) = gamma_c4 + dark_respiration_factor(15) = gamma_c4 dark_respiration_factor(16) = gamma_c3 - dark_respiration_factor(17) = gamma_c3 * 1.2 + dark_respiration_factor(17) = gamma_c3 !---------------------------------------------------------------------------------------! @@ -1726,19 +1759,37 @@ end subroutine init_pft_photo_params !==========================================================================================! !==========================================================================================! subroutine init_decomp_params() - use consts_coms , only : yr_day ! ! intent(in) - use decomp_coms , only : resp_opt_water & ! intent(in) - , resp_water_below_opt & ! intent(in) - , resp_water_above_opt & ! intent(in) - , resp_temperature_increase & ! intent(in) - , N_immobil_supply_scale & ! intent(in) - , cwd_frac & ! intent(in) - , r_fsc & ! intent(in) - , r_stsc & ! intent(in) - , r_ssc & ! intent(in) - , K1 & ! intent(in) - , K2 & ! intent(in) - , K3 ! ! intent(in) + use soil_coms , only : slz ! ! intent(in) + use grid_coms , only : nzg ! ! intent(in) + use consts_coms , only : yr_day & ! intent(in) + , t00 ! ! intent(in) + use decomp_coms , only : n_decomp_lim & ! intent(in) + , decomp_scheme & ! intent(in) + , resp_opt_water & ! intent(out) + , resp_water_below_opt & ! intent(out) + , resp_water_above_opt & ! intent(out) + , resp_temperature_increase & ! intent(out) + , N_immobil_supply_scale & ! intent(out) + , cwd_frac & ! intent(out) + , r_fsc & ! intent(out) + , r_stsc & ! intent(out) + , r_ssc & ! intent(out) + , decay_rate_stsc & ! intent(out) + , decay_rate_fsc & ! intent(out) + , decay_rate_ssc & ! intent(out) + , rh_lloyd_1 & ! intent(out) + , rh_lloyd_2 & ! intent(out) + , rh_lloyd_3 & ! intent(out) + , rh_decay_low & ! intent(out) + , rh_decay_high & ! intent(out) + , rh_low_temp & ! intent(out) + , rh_high_temp & ! intent(out) + , rh_decay_dry & ! intent(out) + , rh_decay_wet & ! intent(out) + , rh_dry_smoist & ! intent(out) + , rh_wet_smoist & ! intent(out) + , rh_active_depth & ! intent(out) + , k_rh_active ! ! intent(out) resp_opt_water = 0.8938 resp_water_below_opt = 5.0786 @@ -1749,9 +1800,70 @@ subroutine init_decomp_params() r_fsc = 1.0 r_stsc = 0.3 r_ssc = 1.0 - K1 = 4.5 / yr_day - K2 = 11.0 / yr_day - K3 = 100.2 / yr_day + !---------------------------------------------------------------------------------------! + ! MLO. After talking to Paul, it seems the decay rate for the slow carbon pool is ! + ! artificially high for when nitrogen limitation is turned on. If it is turned ! + ! off, however, then the slow carbon will disappear very quickly. I don't want ! + ! to mess other people's results, so I will change the rate only when ! + ! decomp_scheme is 2, and only when nitrogen limitation is off. I think this ! + ! should be applied to all schemes, but I will let the users of these schemes to ! + ! decide. ! + !---------------------------------------------------------------------------------------! + select case (decomp_scheme) + case (0,1) + decay_rate_fsc = 11.0 / yr_day ! former K2 + decay_rate_stsc = 4.5 / yr_day ! former K1 + decay_rate_ssc = 100.2 / yr_day ! former K3 + case (2) + decay_rate_fsc = 11.0 / yr_day ! former K2 + decay_rate_stsc = 4.5 / yr_day ! former K1 + select case (n_decomp_lim) + case (0) + decay_rate_ssc = 0.2 / yr_day ! former K3 + case (1) + decay_rate_ssc = 100.2 / yr_day ! former K3 + end select + end select + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! Parameters used for the Lloyd and Taylor (1994) temperature dependence. ! + !---------------------------------------------------------------------------------------! + rh_lloyd_1 = 308.56 + rh_lloyd_2 = 1./56.02 + rh_lloyd_3 = 227.15 + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Parameters used for the ED-1.0/CENTURY based functions of temperature and soil ! + ! moisture. ! + !---------------------------------------------------------------------------------------! + rh_decay_low = 0.24 + rh_decay_high = 0.60 + rh_low_temp = 18.0 + t00 + rh_high_temp = 45.0 + t00 + rh_decay_dry = 12.0 + rh_decay_wet = 36.0 + rh_dry_smoist = 0.48 + rh_wet_smoist = 0.98 + !---------------------------------------------------------------------------------------! + + + !----- Determine the top layer to consider for fires in case include_fire is 2 or 3. ---! + select case (decomp_scheme) + case (0,1) + rh_active_depth = slz(nzg) + k_rh_active = nzg + case (2) + rh_active_depth = -0.20 + k_rh_loop: do k_rh_active=nzg-1,1,-1 + if (slz(k_rh_active) < rh_active_depth) exit k_rh_loop + end do k_rh_loop + k_rh_active = k_rh_active + 1 + end select + !---------------------------------------------------------------------------------------! return @@ -1809,7 +1921,7 @@ subroutine init_pft_resp_params() growth_resp_factor(16) = growthresp growth_resp_factor(17) = 0.4503 - leaf_turnover_rate(1) = 3.0 + leaf_turnover_rate(1) = 2.0 leaf_turnover_rate(2) = 1.0 leaf_turnover_rate(3) = 0.5 leaf_turnover_rate(4) = onethird @@ -1822,9 +1934,9 @@ subroutine init_pft_resp_params() leaf_turnover_rate(11) = 0.0 leaf_turnover_rate(12) = 2.0 leaf_turnover_rate(13) = 2.0 - leaf_turnover_rate(14) = 3.0 - leaf_turnover_rate(15) = 3.0 - leaf_turnover_rate(16) = 3.0 + leaf_turnover_rate(14) = 2.0 + leaf_turnover_rate(15) = 2.0 + leaf_turnover_rate(16) = 2.0 leaf_turnover_rate(17) = onesixth !----- Root turnover rate. ------------------------------------------------------------! @@ -1846,11 +1958,11 @@ subroutine init_pft_resp_params() 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 - storage_turnover_rate(3) = 0.00 ! 0.25 - storage_turnover_rate(4) = 0.00 ! 0.25 - storage_turnover_rate(5) = 0.00 ! 0.25 + storage_turnover_rate(1) = onethird + storage_turnover_rate(2) = onesixth + storage_turnover_rate(3) = onesixth + storage_turnover_rate(4) = onesixth + storage_turnover_rate(5) = 0.00 storage_turnover_rate(6) = 0.00 ! 0.25 storage_turnover_rate(7) = 0.00 ! 0.25 storage_turnover_rate(8) = 0.00 ! 0.25 @@ -1859,10 +1971,10 @@ subroutine init_pft_resp_params() storage_turnover_rate(11) = 0.6243 storage_turnover_rate(12) = 0.00 ! 0.25 storage_turnover_rate(13) = 0.00 ! 0.25 - storage_turnover_rate(14) = 0.00 ! 0.25 - storage_turnover_rate(15) = 0.00 ! 0.25 - storage_turnover_rate(16) = 0.00 ! 0.25 - storage_turnover_rate(17) = 0.00 ! 0.25 + storage_turnover_rate(14) = onethird + storage_turnover_rate(15) = onethird + storage_turnover_rate(16) = onethird + storage_turnover_rate(17) = onesixth f_labile(1:5) = 1.0 f_labile(6:11) = 0.79 @@ -1937,6 +2049,7 @@ subroutine init_pft_mort_params() use pft_coms , only : mort1 & ! intent(out) , mort2 & ! intent(out) , mort3 & ! intent(out) + , cbr_severe_stress & ! intent(out) , rho & ! intent(out) , seedling_mortality & ! intent(out) , treefall_s_gtht & ! intent(out) @@ -1945,8 +2058,10 @@ subroutine init_pft_mort_params() , frost_mort ! ! intent(out) use consts_coms , only : t00 & ! intent(in) , lnexp_max & ! intent(in) + , onethird & ! intent(in) , twothirds ! ! intent(in) - use ed_misc_coms, only : ibigleaf ! ! intent(in) + use ed_misc_coms, only : ibigleaf & ! intent(in) + , iallom ! ! intent(in) use disturb_coms, only : treefall_disturbance_rate & ! intent(inout) , time2canopy ! ! intent(in) @@ -1973,10 +2088,13 @@ subroutine init_pft_mort_params() frost_mort(16:17) = 3.0 - mort1(1) = 10.0 - mort1(2) = 10.0 - mort1(3) = 10.0 - mort1(4) = 10.0 + !---------------------------------------------------------------------------------------! + ! The following variables control the density-dependent mortality rates. ! + !---------------------------------------------------------------------------------------! + mort1(1) = 5.0 ! 10.0 + mort1(2) = 5.0 ! 10.0 + mort1(3) = 5.0 ! 10.0 + mort1(4) = 5.0 ! 10.0 mort1(5) = 1.0 mort1(6) = 1.0 mort1(7) = 1.0 @@ -1986,15 +2104,15 @@ subroutine init_pft_mort_params() mort1(11) = 1.0 mort1(12) = 1.0 mort1(13) = 1.0 - mort1(14) = 10.0 - mort1(15) = 10.0 - mort1(16) = 10.0 - mort1(17) = 10.0 - - mort2(1) = 20.0 - mort2(2) = 20.0 - mort2(3) = 20.0 - mort2(4) = 20.0 + mort1(14) = 5.0 ! 10.0 + mort1(15) = 5.0 ! 10.0 + mort1(16) = 5.0 ! 10.0 + mort1(17) = 5.0 ! 10.0 + + mort2(1) = 10.0 ! 20.0 + mort2(2) = 10.0 ! 20.0 + mort2(3) = 10.0 ! 20.0 + mort2(4) = 10.0 ! 20.0 mort2(5) = 20.0 mort2(6) = 20.0 mort2(7) = 20.0 @@ -2004,30 +2122,64 @@ subroutine init_pft_mort_params() mort2(11) = 20.0 mort2(12) = 20.0 mort2(13) = 20.0 - mort2(14) = 20.0 - mort2(15) = 20.0 - mort2(16) = 20.0 - mort2(17) = 20.0 - - mort3(1) = 0.15 * (1. - rho(1) / rho(4)) - mort3(2) = 0.15 * (1. - rho(2) / rho(4)) - mort3(3) = 0.15 * (1. - rho(3) / rho(4)) - mort3(4) = 0.0 - mort3(5) = 0.066 - mort3(6) = 0.0033928 - mort3(7) = 0.0043 - mort3(8) = 0.0023568 - mort3(9) = 0.006144 - mort3(10) = 0.003808 - mort3(11) = 0.00428 - mort3(12) = 0.066 - mort3(13) = 0.066 - mort3(14) = 0.15 * (1. - rho(14) / rho(4)) - mort3(15) = 0.15 * (1. - rho(15) / rho(4)) - mort3(16) = 0.15 * (1. - rho(16) / rho(4)) - mort3(17) = 0.0043 ! Same as pines + mort2(14) = 10.0 ! 20.0 + mort2(15) = 10.0 ! 20.0 + mort2(16) = 10.0 ! 20.0 + mort2(17) = 10.0 ! 20.0 + + !---------------------------------------------------------------------------------------! + ! This variable controls the density-independent mortality rate due to ageing. ! + ! This value is a constant in units of [fraction/year]. ! + !---------------------------------------------------------------------------------------! + if (treefall_disturbance_rate > 0.) then + mort3(1) = treefall_disturbance_rate * ( 0.15 * (1. - rho(1) / rho(4)) ) / 0.014 + mort3(2) = treefall_disturbance_rate * ( 0.15 * (1. - rho(2) / rho(4)) ) / 0.014 + mort3(3) = treefall_disturbance_rate * ( 0.15 * (1. - rho(3) / rho(4)) ) / 0.014 + mort3(4) = 0.0 + mort3(5) = 0.066 + mort3(6) = 0.0033928 + mort3(7) = 0.0043 + mort3(8) = 0.0023568 + mort3(9) = 0.006144 + mort3(10) = 0.003808 + mort3(11) = 0.00428 + mort3(12) = 0.066 + mort3(13) = 0.066 + mort3(14) = treefall_disturbance_rate * ( 0.15 * (1. - rho(14) / rho(4)) ) / 0.014 + mort3(15) = treefall_disturbance_rate * ( 0.15 * (1. - rho(15) / rho(4)) ) / 0.014 + mort3(16) = treefall_disturbance_rate * ( 0.15 * (1. - rho(16) / rho(4)) ) / 0.014 + mort3(17) = 0.0043 ! Same as pines + else + mort3(1) = 0.15 * (1. - rho(1) / rho(4)) + mort3(2) = 0.15 * (1. - rho(2) / rho(4)) + mort3(3) = 0.15 * (1. - rho(3) / rho(4)) + mort3(4) = 0.0 + mort3(5) = 0.066 + mort3(6) = 0.0033928 + mort3(7) = 0.0043 + mort3(8) = 0.0023568 + mort3(9) = 0.006144 + mort3(10) = 0.003808 + mort3(11) = 0.00428 + mort3(12) = 0.066 + mort3(13) = 0.066 + mort3(14) = 0.15 * (1. - rho(14) / rho(4)) + mort3(15) = 0.15 * (1. - rho(15) / rho(4)) + mort3(16) = 0.15 * (1. - rho(16) / rho(4)) + mort3(17) = 0.0043 ! Same as pines + end if + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! This is the default mortality for when the maximum carbon balance is negative. ! + ! Default in ED-1.0 and ED-2.0 was to assume zero, an alternative is to assume maximum ! + ! mortality. ! + !---------------------------------------------------------------------------------------! + !cbr_severe_stress(1:17) = 0.0 + cbr_severe_stress(1:17) = log(epsilon(1.0)) / mort2(1:17) + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! ! Here we check whether we need to re-calculate the treefall disturbance rate so it ! @@ -2106,12 +2258,35 @@ subroutine init_pft_mort_params() !---------------------------------------------------------------------------------------! - seedling_mortality(1) = 0.95 - seedling_mortality(2:4) = 0.95 - seedling_mortality(5) = 0.95 - seedling_mortality(6:15) = 0.95 - seedling_mortality(16) = 0.95 - seedling_mortality(17) = 0.95 + + select case (ibigleaf) + case (0) + seedling_mortality(1) = 0.95 + seedling_mortality(2:4) = 0.95 + seedling_mortality(5) = 0.95 + seedling_mortality(6:15) = 0.95 + seedling_mortality(16) = 0.95 + seedling_mortality(17) = 0.95 + case (1) + select case (iallom) + case (0,1) + seedling_mortality(1) = 0.9500 + seedling_mortality(2:4) = onethird + seedling_mortality(5) = 0.9500 + seedling_mortality(6:8) = onethird + seedling_mortality(9:11) = onethird + seedling_mortality(12:16) = 0.9500 + seedling_mortality(17) = onethird + case (2) + seedling_mortality(1) = 0.9500 + seedling_mortality(2:4) = 0.4000 + seedling_mortality(5) = 0.9500 + seedling_mortality(6:8) = 0.4000 + seedling_mortality(9:11) = 0.4000 + seedling_mortality(12:16) = 0.9500 + seedling_mortality(17) = 0.4000 + end select + end select treefall_s_gtht(1:17) = 0.0 @@ -2165,6 +2340,7 @@ subroutine init_pft_alloc_params() , hgt_max & ! intent(out) , min_dbh & ! intent(out) , dbh_crit & ! intent(out) + , dbh_bigleaf & ! intent(out) , min_bdead & ! intent(out) , bdead_crit & ! intent(out) , b1Ht & ! intent(out) @@ -2190,8 +2366,9 @@ subroutine init_pft_alloc_params() , sapwood_ratio ! ! intent(out) use allometry , only : h2dbh & ! function , dbh2bd & ! function - , dbh2bl ! ! function - use consts_coms , only : twothirds & ! intent(in) + , size2bl ! ! function + use consts_coms , only : onethird & ! intent(in) + , twothirds & ! intent(in) , huge_num & ! intent(in) , pi1 ! ! intent(in) use ed_max_dims , only : n_pft & ! intent(in) @@ -2335,8 +2512,8 @@ subroutine init_pft_alloc_params() SLA(11) = 60.0 SLA(12) = 22.0 SLA(13) = 22.0 - SLA(14) = 21.0 ! 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(14))) * sla_scale - SLA(15) = 21.0 ! 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(15))) * sla_scale + SLA(14) = 22.7 ! 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(14))) * sla_scale + SLA(15) = 22.7 ! 10.0**(sla_inter + sla_slope * log10(12.0/leaf_turnover_rate(15))) * sla_scale SLA(16) = 22.7 !--value from Mike Dietze: mean: 22.7, median 19.1, 95% CI: 5.7, 78.6 SLA(17) = 10.0 @@ -2400,11 +2577,10 @@ subroutine init_pft_alloc_params() ! Initial density of plants, for near-bare-ground simulations [# of individuals/m2] ! !---------------------------------------------------------------------------------------! if (igrass==1) then - init_density_grass = 1. + init_density_grass = 1. else - init_density_grass = 0.1 + init_density_grass = 0.1 end if - init_density(1) = init_density_grass init_density(2:4) = 0.1 init_density(5) = 0.1 @@ -2543,19 +2719,68 @@ subroutine init_pft_alloc_params() !---------------------------------------------------------------------------------------! - ! MIN_DBH -- minimum DBH allowed for the PFT. ! - ! DBH_CRIT -- minimum DBH that brings the PFT to its tallest possible height. ! + ! 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) - dbh_crit(ipft) = h2dbh(hgt_max(ipft),ipft) + min_dbh (ipft) = h2dbh(hgt_min(ipft),ipft) + dbh_crit (ipft) = h2dbh(hgt_max(ipft),ipft) end do !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! This is the typical DBH that all big leaf plants will have. Because the big-leaf ! + ! ED doesn't really solve individuals, the typical DBH should be one that makes a good ! + ! ratio between LAI and biomass. This is a tuning parameter and right now the initial ! + ! guess is about 1/3 of the critical DBH for trees. ! + !---------------------------------------------------------------------------------------! + select case (iallom) + case (0,1) + dbh_bigleaf( 1) = dbh_crit( 1) + dbh_bigleaf( 2) = dbh_crit( 2) + dbh_bigleaf( 3) = dbh_crit( 3) + dbh_bigleaf( 4) = dbh_crit( 4) + dbh_bigleaf( 5) = dbh_crit( 5) + dbh_bigleaf( 6) = dbh_crit( 6) + dbh_bigleaf( 7) = dbh_crit( 7) + dbh_bigleaf( 8) = dbh_crit( 8) + dbh_bigleaf( 9) = dbh_crit( 9) + dbh_bigleaf(10) = dbh_crit(10) + dbh_bigleaf(11) = dbh_crit(11) + dbh_bigleaf(12) = dbh_crit(12) + dbh_bigleaf(13) = dbh_crit(13) + dbh_bigleaf(14) = dbh_crit(14) + dbh_bigleaf(15) = dbh_crit(15) + dbh_bigleaf(16) = dbh_crit(16) + dbh_bigleaf(17) = dbh_crit(17) + case (2) + dbh_bigleaf( 1) = dbh_crit( 1) + dbh_bigleaf( 2) = 29.69716 + dbh_bigleaf( 3) = 31.41038 + dbh_bigleaf( 4) = 16.67251 + dbh_bigleaf( 5) = dbh_crit( 5) + dbh_bigleaf( 6) = dbh_crit( 6) * onethird + dbh_bigleaf( 7) = dbh_crit( 7) * onethird + dbh_bigleaf( 8) = dbh_crit( 8) * onethird + dbh_bigleaf( 9) = dbh_crit( 9) * onethird + dbh_bigleaf(10) = dbh_crit(10) * onethird + dbh_bigleaf(11) = dbh_crit(11) * onethird + dbh_bigleaf(12) = dbh_crit(12) + dbh_bigleaf(13) = dbh_crit(13) + dbh_bigleaf(14) = dbh_crit(14) + dbh_bigleaf(15) = dbh_crit(15) + dbh_bigleaf(16) = dbh_crit(16) + dbh_bigleaf(17) = 30.0 + end select + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! - ! DBH-leaf allometry. Assign temperate PFTs outside the loop, and the tropical ! - ! ones inside the loop. ! + ! DBH-leaf and dead biomass allometries. We first define them for the default, ! + ! size-and-age structure case, but we may overwrite them depending on the allometry. ! !---------------------------------------------------------------------------------------! !----- DBH-leaf allometry intercept [kg leaf biomass / plant * cm^(-b2Bl)]. ------------! b1Bl(1:4) = 0.0 @@ -2602,15 +2827,6 @@ subroutine init_pft_alloc_params() end select end if end do - !---------------------------------------------------------------------------------------! - - - - - !---------------------------------------------------------------------------------------! - ! DBH-stem allometry. Assign temperate PFTs outside the loop, and the tropical ! - ! ones inside the loop. ! - !---------------------------------------------------------------------------------------! !----- DBH-stem allometry intercept [kg stem biomass / plant * cm^(-b2Bs)] -------------! b1Bs_small(1:4) = 0.0 b1Bs_small(5) = 1.0e-5 @@ -2638,8 +2854,8 @@ subroutine init_pft_alloc_params() b2Bs_small(16) = 0.0 b2Bs_small(17) = 0.0 !---------------------------------------------------------------------------------------! - ! The temperate PFTs use the same b1Bs and b2Bs for small and big trees, copy the ! - ! values. ! + ! The temperate PFTs use the same b1Bs and b2Bs for small and big trees, copy ! + ! the values. ! !---------------------------------------------------------------------------------------! b1Bs_large(:) = b1Bs_small(:) b2Bs_large(:) = b2Bs_small(:) @@ -2677,9 +2893,55 @@ subroutine init_pft_alloc_params() end select end if !------------------------------------------------------------------------------------! + end do + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! In case we run big leaf model with IALLOM set to 0 or 1, we must change some of ! + ! the allometric parameters. ! + !---------------------------------------------------------------------------------------! + if (ibigleaf == 1 .and. (iallom == 0 .or. iallom == 1)) then + b1Bl ( 1) = 0.04538826 + b1Bl ( 2) = 0.07322115 + b1Bl ( 3) = 0.07583497 + b1Bl ( 4) = 0.08915847 + b1Bl (14:16) = 0.04538826 + b1Bl ( 17) = 0.07322115 + + b2Bl ( 1) = 1.316338 + b2Bl ( 2) = 1.509083 + b2Bl ( 3) = 1.646576 + b2Bl ( 4) = 1.663773 + b2Bl (14:16) = 1.316338 + b2Bl ( 17) = 1.509083 + + b1Bs_small( 1) = 0.05291854 + b1Bs_small( 2) = 0.15940854 + b1Bs_small( 3) = 0.21445616 + b1Bs_small( 4) = 0.26890751 + b1Bs_small(14:16) = 0.05291854 + b1Bs_small( 17) = 0.15940854 + + b2Bs_small( 1) = 3.706955 + b2Bs_small( 2) = 2.342587 + b2Bs_small( 3) = 2.370640 + b2Bs_small( 4) = 2.254336 + b2Bs_small(14:16) = 3.706955 + b2Bs_small( 17) = 2.342587 + + b1Bs_large (:) = b1Bs_small(:) + b2Bs_large (:) = b2Bs_small(:) + end if + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Fill in variables tha are derived from bdead allometry. ! + !---------------------------------------------------------------------------------------! + do ipft = 1, n_pft !------------------------------------------------------------------------------------! ! -- 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 ! @@ -2828,68 +3090,68 @@ subroutine init_pft_alloc_params() !---------------------------------------------------------------------------------------! select case (ibigleaf) case (0) - !----- Size and age structure. -----------------------------------------------------! - select case (iallom) - case (0,1) - init_density(1) = 1.0 - init_density(2:4) = 1.0 - init_density(5) = 0.1 - init_density(6:8) = 0.1 - init_density(9:11) = 0.1 - init_density(12:13) = 0.1 - init_density(14:15) = 0.1 - init_density(16) = 1.0 - init_density(17) = 1.0 - case (2) - init_density(1) = 0.1 - init_density(2:4) = 0.1 - init_density(5) = 0.1 - init_density(6:8) = 0.1 - init_density(9:11) = 0.1 - init_density(12:13) = 0.1 - init_density(14:15) = 0.1 - init_density(16) = 0.1 - init_density(17) = 0.1 - end select - - !----- Define a non-sense number. --------------------------------------------------! - init_laimax(1:17) = huge_num - - case(1) - !----- Big leaf. 1st we set the maximum initial LAI for each PFT. ------------------! - init_laimax(1:17) = 0.1 - do ipft=1,n_pft - init_bleaf = dbh2bl(dbh_crit(ipft),ipft) - init_density(ipft) = init_laimax(ipft) / (init_bleaf * SLA(ipft)) - end do - !-----------------------------------------------------------------------------------! + !----- Size and age structure. ------------------------------------------------------! + select case (iallom) + case (0,1) + init_density(1) = 1.0 + init_density(2:4) = 1.0 + init_density(5) = 0.1 + init_density(6:8) = 0.1 + init_density(9:11) = 0.1 + init_density(12:13) = 0.1 + init_density(14:15) = 0.1 + init_density(16) = 1.0 + init_density(17) = 1.0 + case (2) + init_density(1) = 0.1 + init_density(2:4) = 0.1 + init_density(5) = 0.1 + init_density(6:8) = 0.1 + init_density(9:11) = 0.1 + init_density(12:13) = 0.1 + init_density(14:15) = 0.1 + init_density(16) = 0.1 + init_density(17) = 0.1 + end select + + !----- Define a non-sense number. ---------------------------------------------------! + init_laimax(1:17) = huge_num + + case(1) + !----- Big leaf. 1st we set the maximum initial LAI for each PFT. -------------------! + init_laimax(1:17) = 0.1 + do ipft=1,n_pft + init_bleaf = size2bl(dbh_bigleaf(ipft),hgt_max(ipft),ipft) + init_density(ipft) = init_laimax(ipft) / (init_bleaf * SLA(ipft)) + end do + !------------------------------------------------------------------------------------! end select !---------------------------------------------------------------------------------------! if (write_allom) then open (unit=18,file=trim(allom_file),status='replace',action='write') - write(unit=18,fmt='(299a)') ('-',n=1,299) - write(unit=18,fmt='(23(1x,a))') ' PFT',' Tropical',' Grass' & + write(unit=18,fmt='(312a)') ('-',n=1,312) + write(unit=18,fmt='(24(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',' Init_dens' & - ,' Init_LAImax',' SLA' + ,' DBH_Crit',' DBH_BigLeaf',' Bdead_Crit' & + ,' Init_dens',' Init_LAImax',' SLA' - write(unit=18,fmt='(299a)') ('-',n=1,299) + write(unit=18,fmt='(312a)') ('-',n=1,312) do ipft=1,n_pft - write (unit=18,fmt='(8x,i5,2(12x,l1),20(1x,es12.5))') & + write (unit=18,fmt='(8x,i5,2(12x,l1),21(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),init_density(ipft) & - ,init_laimax(ipft),sla(ipft) + ,dbh_crit(ipft),dbh_bigleaf(ipft),bdead_crit(ipft) & + ,init_density(ipft),init_laimax(ipft),sla(ipft) end do - write(unit=18,fmt='(299a)') ('-',n=1,299) + write(unit=18,fmt='(312a)') ('-',n=1,312) close(unit=18,status='keep') end if @@ -2949,6 +3211,7 @@ end subroutine init_pft_nitro_params ! This subroutine sets up some PFT and leaf dependent properties. ! !------------------------------------------------------------------------------------------! subroutine init_pft_leaf_params() + use ed_misc_coms , only : igrass ! ! intent(in) use rk4_coms , only : ibranch_thermo ! ! intent(in) use pft_coms , only : phenology & ! intent(out) , b1Cl & ! intent(out) @@ -2958,44 +3221,92 @@ subroutine init_pft_leaf_params() , wat_dry_ratio_grn & ! intent(out) , wat_dry_ratio_ngrn & ! intent(out) , delta_c ! ! intent(out) - use consts_coms , only : t3ple ! ! intent(out) + use consts_coms , only : t3ple ! ! intent(out) use phenology_coms , only :iphen_scheme implicit none - select case (iphen_scheme) - case (-1) - phenology(1:8) = 0 - phenology(9:11) = 2 - phenology(12:17) = 0 - case (0,1) - phenology(1) = 1 - phenology(2:4) = 1 - phenology(5) = 1 - phenology(6:8) = 0 - phenology(9:11) = 2 - phenology(12:15) = 1 - phenology(16) = 1 - phenology(17) = 0 - case (2) - phenology(1) = 0 - phenology(2:4) = 4 - phenology(5) = 0 - phenology(6:8) = 0 - phenology(9:11) = 2 - phenology(12:15) = 4 - phenology(16) = 0 - phenology(17) = 0 - case (3) - phenology(1) = 4 - phenology(2:4) = 3 - phenology(5) = 4 - phenology(6:8) = 0 - phenology(9:11) = 2 - phenology(12:15) = 4 - phenology(16) = 4 - phenology(17) = 0 + !---------------------------------------------------------------------------------------! + ! Tree phenology is the same for both cases, but in the new grass allometry they ! + ! must be evergreens. ! + !---------------------------------------------------------------------------------------! + select case (igrass) + case (0) + !----- Bonsai grasses. --------------------------------------------------------------! + select case (iphen_scheme) + case (-1) + phenology(1:8) = 0 + phenology(9:11) = 2 + phenology(12:17) = 0 + case (0,1) + phenology(1) = 1 + phenology(2:4) = 1 + phenology(5) = 1 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 1 + phenology(16) = 1 + phenology(17) = 0 + case (2) + phenology(1) = 4 + phenology(2:4) = 4 + phenology(5) = 4 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 4 + phenology(16) = 4 + phenology(17) = 0 + case (3) + phenology(1) = 4 + phenology(2:4) = 3 + phenology(5) = 4 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 4 + phenology(16) = 4 + phenology(17) = 0 + end select + !------------------------------------------------------------------------------------! + case (1) + !----- New grasses. -----------------------------------------------------------------! + select case (iphen_scheme) + case (-1) + phenology(1:8) = 0 + phenology(9:11) = 2 + phenology(12:17) = 0 + case (0,1) + phenology(1) = 0 + phenology(2:4) = 1 + phenology(5) = 0 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 1 + phenology(16) = 0 + phenology(17) = 0 + case (2) + phenology(1) = 0 + phenology(2:4) = 4 + phenology(5) = 0 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 0 + phenology(16) = 0 + phenology(17) = 0 + case (3) + phenology(1) = 0 + phenology(2:4) = 3 + phenology(5) = 0 + phenology(6:8) = 0 + phenology(9:11) = 2 + phenology(12:15) = 0 + phenology(16) = 0 + phenology(17) = 0 + end select + !------------------------------------------------------------------------------------! end select + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! ! The following parameters are second sources found in Gu et al. (2007) ! @@ -3122,6 +3433,7 @@ end subroutine init_pft_repro_params subroutine init_pft_derived_params() use decomp_coms , only : f_labile ! ! intent(in) use detailed_coms , only : idetailed ! ! intent(in) + use ed_misc_coms , only : ibigleaf ! ! intent(in) use ed_max_dims , only : n_pft & ! intent(in) , str_len ! ! intent(in) use consts_coms , only : onesixth & ! intent(in) @@ -3139,16 +3451,17 @@ subroutine init_pft_derived_params() , pft_name16 & ! intent(in) , hgt_max & ! intent(in) , dbh_crit & ! intent(in) + , dbh_bigleaf & ! intent(in) , one_plant_c & ! intent(out) , min_recruit_size & ! intent(out) , min_cohort_size & ! intent(out) , negligible_nplant & ! intent(out) , c2n_recruit & ! intent(out) , veg_hcap_min ! ! intent(out) - use phenology_coms , only : elongf_min ! ! intent(in) + use phenology_coms , only : elongf_min & ! intent(in) + , elongf_flush ! ! intent(in) use allometry , only : h2dbh & ! function , dbh2h & ! function - , dbh2bl & ! function , size2bl & ! function , dbh2bd ! ! function use ed_therm_lib , only : calc_veg_hcap ! ! function @@ -3168,6 +3481,11 @@ subroutine init_pft_derived_params() real :: bsapwood_max real :: balive_max real :: bdead_max + real :: bleaf_bl + real :: broot_bl + real :: bsapwood_bl + real :: balive_bl + real :: bdead_bl real :: leaf_hcap_min real :: wood_hcap_min real :: lai_min @@ -3189,18 +3507,21 @@ subroutine init_pft_derived_params() !---------------------------------------------------------------------------------------! if (print_zero_table) then open (unit=61,file=trim(zero_table_fn),status='replace',action='write') - write (unit=61,fmt='(24(a,1x))') ' PFT', 'NAME ' & + write (unit=61,fmt='(29(a,1x))') ' PFT', 'NAME ' & ,' HGT_MIN',' DBH' & ,' BLEAF_MIN',' BROOT_MIN' & ,'BSAPWOOD_MIN',' BALIVE_MIN' & - ,' BDEAD_MIN',' BLEAF_MAX' & - ,' BROOT_MAX','BSAPWOOD_MAX' & - ,' BALIVE_MAX',' BDEAD_MAX' & - ,' INIT_DENS','MIN_REC_SIZE' & - ,'MIN_COH_SIZE',' NEGL_NPLANT' & - ,' SLA','VEG_HCAP_MIN' & - ,' LAI_MIN',' HGT_MAX' & - ,' DBH_CRIT',' ONE_PLANT_C' + ,' BDEAD_MIN',' BLEAF_BL' & + ,' BROOT_BL',' BSAPWOOD_BL' & + ,' BALIVE_BL',' BDEAD_BL' & + ,' BLEAF_MAX',' BROOT_MAX' & + ,'BSAPWOOD_MAX',' BALIVE_MAX' & + ,' BDEAD_MAX',' INIT_DENS' & + ,'MIN_REC_SIZE','MIN_COH_SIZE' & + ,' NEGL_NPLANT',' SLA' & + ,'VEG_HCAP_MIN',' LAI_MIN' & + ,' HGT_MAX',' DBH_CRIT' & + ,' ONE_PLANT_C' end if min_plant_dens = onesixth * minval(init_density) do ipft = 1,n_pft @@ -3214,6 +3535,7 @@ subroutine init_pft_derived_params() bdead_min = dbh2bd(dbh,ipft) !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! ! Find the maximum bleaf and bdead supported. This is to find the negligible ! ! nplant so we ensure that the cohort is always terminated if its mortality rate is ! @@ -3221,7 +3543,7 @@ subroutine init_pft_derived_params() !------------------------------------------------------------------------------------! huge_dbh = 3. * dbh_crit(ipft) huge_height = dbh2h(ipft, dbh_crit(ipft)) - bleaf_max = dbh2bl(huge_dbh,ipft) + bleaf_max = size2bl(huge_dbh,huge_height,ipft) broot_max = bleaf_max * q(ipft) bsapwood_max = bleaf_max * qsw(ipft) * huge_height balive_max = bleaf_max + broot_max + bsapwood_max @@ -3232,7 +3554,25 @@ subroutine init_pft_derived_params() !------------------------------------------------------------------------------------! ! Biomass of one individual plant at recruitment. ! !------------------------------------------------------------------------------------! - one_plant_c(ipft) = bdead_min + balive_min + bleaf_bl = size2bl(dbh_bigleaf(ipft),hgt_min(ipft),ipft) + broot_bl = bleaf_bl * q(ipft) + bsapwood_bl = bleaf_bl * qsw(ipft) * hgt_max(ipft) + balive_bl = bleaf_bl + broot_bl + bsapwood_bl + bdead_bl = dbh2bd(dbh_bigleaf(ipft),ipft) + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the carbon value for one plant. If SAS approximation, we define it as ! + ! the carbon of a seedling, and for the big leaf case we assume the typical big leaf ! + ! plant size. ! + !------------------------------------------------------------------------------------! + select case (ibigleaf) + case (0) + one_plant_c(ipft) = bdead_min + balive_min + case (1) + one_plant_c(ipft) = bdead_bl + balive_bl + end select !------------------------------------------------------------------------------------! @@ -3245,13 +3585,6 @@ subroutine init_pft_derived_params() min_recruit_size(ipft) = min_plant_dens * one_plant_c(ipft) !------------------------------------------------------------------------------------! - write (unit=*,fmt='(a,1x,es12.4)') ' - min_recruit_size: ',min_recruit_size(ipft) - write (unit=*,fmt='(a,1x,es12.4)') ' - min_plant_den: ',min_plant_dens - write (unit=*,fmt='(a,1x,es12.4)') ' - balive_min: ',balive_min - write (unit=*,fmt='(a,1x,es12.4)') ' - bdead_min: ',bdead_min - write (unit=*,fmt='(a,1x,es12.4)') ' - dbh: ',dbh - write (unit=*,fmt='(a,1x,es12.4)') ' - bleaf_min: ',bleaf_min - !------------------------------------------------------------------------------------! ! Minimum size (measured as biomass of living and structural tissues) allowed in ! @@ -3296,12 +3629,14 @@ subroutine init_pft_derived_params() if (print_zero_table) then - write (unit=61,fmt='(i5,1x,a16,1x,22(es12.5,1x))') & + write (unit=61,fmt='(i5,1x,a16,1x,27(es12.5,1x))') & ipft,pft_name16(ipft),hgt_min(ipft) & ,dbh,bleaf_min,broot_min,bsapwood_min & - ,balive_min,bdead_min,bleaf_max & - ,broot_max,bsapwood_max,balive_max & - ,bdead_max,init_density(ipft) & + ,balive_min,bdead_min,bleaf_bl & + ,broot_bl,bsapwood_bl,balive_bl & + ,bdead_bl,bleaf_max,broot_max & + ,bsapwood_max,balive_max,bdead_max & + ,init_density(ipft) & ,min_recruit_size(ipft) & ,min_cohort_size(ipft) & ,negligible_nplant(ipft) & @@ -3822,14 +4157,20 @@ subroutine init_soil_coms , soil_rough8 & ! intent(out) , snow_rough8 & ! intent(out) , freezecoef & ! intent(out) - , freezecoef8 ! ! intent(out) + , freezecoef8 & ! intent(out) + , sldrain & ! intent(out) + , sldrain8 & ! intent(out) + , sin_sldrain & ! intent(out) + , sin_sldrain8 ! ! 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) + , day_sec & ! intent(in) + , pio180 & ! intent(in) + , pio1808 ! ! intent(in) implicit none !----- Local variables. ----------------------------------------------------------------! @@ -4235,6 +4576,16 @@ subroutine init_soil_coms soil_rough8 = dble(soil_rough) snow_rough8 = dble(snow_rough) freezecoef8 = dble(freezecoef) + + !---------------------------------------------------------------------------------------! + ! Find the double precision version of the drainage slope, and find and save the ! + ! sine of it. ! + !---------------------------------------------------------------------------------------! + sldrain8 = dble(sldrain) + sin_sldrain = sin(sldrain * pio180 ) + sin_sldrain8 = sin(sldrain8 * pio1808) + !---------------------------------------------------------------------------------------! + return end subroutine init_soil_coms !==========================================================================================! @@ -4255,6 +4606,7 @@ subroutine init_phen_coms , thetacrit & ! intent(in) , retained_carbon_fraction & ! intent(out) , elongf_min & ! intent(out) + , elongf_flush & ! intent(out) , spot_phen & ! intent(out) , dl_tr & ! intent(out) , st_tr1 & ! intent(out) @@ -4301,6 +4653,15 @@ subroutine init_phen_coms + !---------------------------------------------------------------------------------------! + ! Minimum elongation factor that allows plants to start flushing out new leaves if ! + ! they are drought deciduous and have been losing leaves. ! + !---------------------------------------------------------------------------------------! + elongf_flush = 0.25 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! Flag that checks whether to Use soil potential rather than soil moisture to drive ! ! phenology. ! diff --git a/ED/src/init/ed_type_init.f90 b/ED/src/init/ed_type_init.f90 index 653e131a4..8cc7860f5 100644 --- a/ED/src/init/ed_type_init.f90 +++ b/ED/src/init/ed_type_init.f90 @@ -37,28 +37,29 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) !---------------------------------------------------------------------------------------! - cpatch%mean_gpp(ico) = 0.0 - cpatch%mean_leaf_resp(ico) = 0.0 - cpatch%mean_root_resp(ico) = 0.0 - cpatch%mean_growth_resp(ico) = 0.0 - cpatch%mean_storage_resp(ico) = 0.0 - cpatch%mean_vleaf_resp(ico) = 0.0 - cpatch%today_leaf_resp(ico) = 0.0 - cpatch%today_root_resp(ico) = 0.0 - cpatch%today_gpp(ico) = 0.0 - cpatch%today_nppleaf(ico) = 0.0 - cpatch%today_nppfroot(ico) = 0.0 - cpatch%today_nppsapwood(ico) = 0.0 - cpatch%today_nppcroot(ico) = 0.0 - cpatch%today_nppseeds(ico) = 0.0 - cpatch%today_nppwood(ico) = 0.0 - cpatch%today_nppdaily(ico) = 0.0 - cpatch%today_gpp_pot(ico) = 0.0 - cpatch%today_gpp_max(ico) = 0.0 - - cpatch%light_level (ico) = 0.0 - cpatch%light_level_beam(ico) = 0.0 - cpatch%light_level_diff(ico) = 0.0 + cpatch%mean_gpp (ico) = 0.0 + cpatch%mean_leaf_resp (ico) = 0.0 + cpatch%mean_root_resp (ico) = 0.0 + cpatch%mean_growth_resp (ico) = 0.0 + cpatch%mean_storage_resp (ico) = 0.0 + cpatch%mean_vleaf_resp (ico) = 0.0 + cpatch%today_leaf_resp (ico) = 0.0 + cpatch%today_root_resp (ico) = 0.0 + cpatch%today_gpp (ico) = 0.0 + cpatch%today_nppleaf (ico) = 0.0 + cpatch%today_nppfroot (ico) = 0.0 + cpatch%today_nppsapwood (ico) = 0.0 + cpatch%today_nppcroot (ico) = 0.0 + cpatch%today_nppseeds (ico) = 0.0 + cpatch%today_nppwood (ico) = 0.0 + cpatch%today_nppdaily (ico) = 0.0 + cpatch%today_gpp_pot (ico) = 0.0 + cpatch%today_gpp_lightmax (ico) = 0.0 + cpatch%today_gpp_moistmax (ico) = 0.0 + + cpatch%light_level (ico) = 0.0 + cpatch%light_level_beam (ico) = 0.0 + cpatch%light_level_diff (ico) = 0.0 cpatch%gpp(ico) = 0.0 cpatch%leaf_respiration(ico) = 0.0 @@ -78,49 +79,53 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) !---------------------------------------------------------------------------------------! - cpatch%monthly_dndt(ico) = 0.0 - cpatch%mort_rate(:,ico) = 0.0 - - cpatch%dagb_dt(ico) = 0.0 - cpatch%dba_dt(ico) = 0.0 - cpatch%ddbh_dt(ico) = 0.0 - - - cpatch%par_l(ico) = 0.0 - cpatch%par_l_beam(ico) = 0.0 - cpatch%par_l_diffuse(ico) = 0.0 - cpatch%rshort_l(ico) = 0.0 - cpatch%rshort_l_beam(ico) = 0.0 - cpatch%rshort_l_diffuse(ico) = 0.0 - cpatch%rlong_l(ico) = 0.0 - cpatch%rlong_l_surf(ico) = 0.0 - cpatch%rlong_l_incid(ico) = 0.0 - cpatch%rshort_w(ico) = 0.0 - cpatch%rshort_w_beam(ico) = 0.0 - cpatch%rshort_w_diffuse(ico) = 0.0 - cpatch%rlong_w(ico) = 0.0 - cpatch%rlong_w_surf(ico) = 0.0 - cpatch%rlong_w_incid(ico) = 0.0 - - cpatch%leaf_gbh(ico) = 0.0 - cpatch%leaf_gbw(ico) = 0.0 - cpatch%wood_gbh(ico) = 0.0 - cpatch%wood_gbw(ico) = 0.0 - cpatch%A_open(ico) = 0.0 - cpatch%A_closed(ico) = 0.0 - cpatch%psi_open(ico) = 0.0 - cpatch%psi_closed(ico) = 0.0 - cpatch%water_supply(ico) = 0.0 - cpatch%gsw_open(ico) = 0.0 - cpatch%gsw_closed(ico) = 0.0 - cpatch%stomatal_conductance(ico) = 0.0 + cpatch%monthly_dndt (ico) = 0.0 + cpatch%monthly_dlnndt (ico) = 0.0 + cpatch%mort_rate (:,ico) = 0.0 + + cpatch%dagb_dt (ico) = 0.0 + cpatch%dlnagb_dt (ico) = 0.0 + cpatch%dba_dt (ico) = 0.0 + cpatch%dlnba_dt (ico) = 0.0 + cpatch%ddbh_dt (ico) = 0.0 + cpatch%dlndbh_dt (ico) = 0.0 + + + cpatch%par_l (ico) = 0.0 + cpatch%par_l_beam (ico) = 0.0 + cpatch%par_l_diffuse (ico) = 0.0 + cpatch%rshort_l (ico) = 0.0 + cpatch%rshort_l_beam (ico) = 0.0 + cpatch%rshort_l_diffuse (ico) = 0.0 + cpatch%rlong_l (ico) = 0.0 + cpatch%rlong_l_surf (ico) = 0.0 + cpatch%rlong_l_incid (ico) = 0.0 + cpatch%rshort_w (ico) = 0.0 + cpatch%rshort_w_beam (ico) = 0.0 + cpatch%rshort_w_diffuse (ico) = 0.0 + cpatch%rlong_w (ico) = 0.0 + cpatch%rlong_w_surf (ico) = 0.0 + cpatch%rlong_w_incid (ico) = 0.0 + + cpatch%leaf_gbh (ico) = 0.0 + cpatch%leaf_gbw (ico) = 0.0 + cpatch%wood_gbh (ico) = 0.0 + cpatch%wood_gbw (ico) = 0.0 + cpatch%A_open (ico) = 0.0 + cpatch%A_closed (ico) = 0.0 + cpatch%psi_open (ico) = 0.0 + cpatch%psi_closed (ico) = 0.0 + cpatch%water_supply (ico) = 0.0 + cpatch%gsw_open (ico) = 0.0 + cpatch%gsw_closed (ico) = 0.0 + cpatch%stomatal_conductance (ico) = 0.0 - cpatch%leaf_maintenance (ico) = 0.0 - cpatch%root_maintenance (ico) = 0.0 - cpatch%leaf_drop (ico) = 0.0 - cpatch%paw_avg (ico) = 0.0 - cpatch%elongf (ico) = 0.0 + cpatch%leaf_maintenance (ico) = 0.0 + cpatch%root_maintenance (ico) = 0.0 + cpatch%leaf_drop (ico) = 0.0 + cpatch%paw_avg (ico) = 0.0 + cpatch%elongf (ico) = 0.0 !---------------------------------------------------------------------------------------! @@ -130,11 +135,13 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) ! element (current month integration) must be set to 0, though, otherwise the first ! ! month carbon balance will be incorrect. ! !---------------------------------------------------------------------------------------! - cpatch%cb(1:12,ico) = 1.0 - cpatch%cb_max(1:12,ico) = 1.0 - cpatch%cbr_bar(ico) = 1.0 - cpatch%cb(13,ico) = 0.0 - cpatch%cb_max(13,ico) = 0.0 + cpatch%cb (1:12,ico) = 1.0 + cpatch%cb_lightmax (1:12,ico) = 1.0 + cpatch%cb_moistmax (1:12,ico) = 1.0 + cpatch%cbr_bar (ico) = 1.0 + cpatch%cb (13,ico) = 0.0 + cpatch%cb_lightmax (13,ico) = 0.0 + cpatch%cb_moistmax (13,ico) = 0.0 !---------------------------------------------------------------------------------------! @@ -149,9 +156,14 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) !---------------------------------------------------------------------------------------! - ! First census must be 1. Not sure what this variable does, though. ! + ! First census must be 1. Not sure what this variable does, though. Recruit_dbh ! + ! is a diagnostic variable that tells the cohort status regarding DBH recruitment, and ! + ! census_status is similar to recruit_dbh, except that is updated only when there is a ! + ! census. ! !---------------------------------------------------------------------------------------! - cpatch%first_census(ico) = 1 + cpatch%first_census (ico) = 1 + cpatch%recruit_dbh (ico) = 0 + cpatch%census_status (ico) = 0 !---------------------------------------------------------------------------------------! @@ -163,6 +175,7 @@ subroutine init_ed_cohort_vars(cpatch,ico, lsl) cpatch%leaf_hcap(ico) = 0. cpatch%leaf_temp(ico) = 0. cpatch%leaf_temp_pv(ico) = 0. + cpatch%leaf_vpdef(ico) = 0. cpatch%leaf_water(ico) = 0. cpatch%leaf_fliq(ico) = 0. cpatch%wood_energy(ico) = 0. @@ -339,7 +352,8 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) , minimum_canopy_depth ! ! intent(in) use ed_misc_coms , only : imoutput & ! intent(in) , idoutput & ! intent(in) - , iqoutput ! ! intent(in) + , iqoutput & ! intent(in) + , ied_init_mode implicit none !----- Arguments. ----------------------------------------------------------------------! type(sitetype) , target :: csite @@ -354,7 +368,9 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) !------ Initialise soil state variables. -----------------------------------------------! - csite%soil_water(1:nzg,ip1:ip2) = 0.0 + if (ied_init_mode.ne.7)then + csite%soil_water(1:nzg,ip1:ip2) = 0.0 + end if csite%soil_energy(1:nzg,ip1:ip2) = 0.0 csite%soil_tempk(1:nzg,ip1:ip2) = 0.0 csite%soil_fracliq(1:nzg,ip1:ip2) = 0.0 @@ -380,8 +396,10 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%avg_daily_temp (ip1:ip2) = 0.0 csite%avg_monthly_gndwater(ip1:ip2) = 0.0 + csite%avg_monthly_waterdef(ip1:ip2) = 0.0 csite%mean_rh(ip1:ip2) = 0.0 + csite%mean_cwd_rh(ip1:ip2) = 0.0 csite%mean_nep(ip1:ip2) = 0.0 csite%A_decomp(ip1:ip2) = 0.0 @@ -413,6 +431,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%co2budget_gpp (ip1:ip2) = 0.0 csite%co2budget_gpp_dbh (:,ip1:ip2) = 0.0 csite%co2budget_rh (ip1:ip2) = 0.0 + csite%co2budget_cwd_rh (ip1:ip2) = 0.0 csite%co2budget_plresp (ip1:ip2) = 0.0 csite%co2budget_initialstorage (ip1:ip2) = 0.0 csite%co2budget_loss2atm (ip1:ip2) = 0.0 @@ -441,6 +460,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%dmean_A_decomp (ip1:ip2) = 0.0 csite%dmean_Af_decomp (ip1:ip2) = 0.0 csite%dmean_rh (ip1:ip2) = 0.0 + csite%dmean_cwd_rh (ip1:ip2) = 0.0 csite%dmean_co2_residual (ip1:ip2) = 0.0 csite%dmean_energy_residual (ip1:ip2) = 0.0 csite%dmean_water_residual (ip1:ip2) = 0.0 @@ -454,6 +474,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%mmean_A_decomp (ip1:ip2) = 0.0 csite%mmean_Af_decomp (ip1:ip2) = 0.0 csite%mmean_rh (ip1:ip2) = 0.0 + csite%mmean_cwd_rh (ip1:ip2) = 0.0 csite%mmean_co2_residual (ip1:ip2) = 0.0 csite%mmean_energy_residual (ip1:ip2) = 0.0 csite%mmean_water_residual (ip1:ip2) = 0.0 @@ -465,6 +486,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) if (iqoutput > 0) then csite%qmean_rh (:,ip1:ip2) = 0.0 + csite%qmean_cwd_rh (:,ip1:ip2) = 0.0 csite%qmean_albedo (:,ip1:ip2) = 0.0 csite%qmean_albedo_beam (:,ip1:ip2) = 0.0 csite%qmean_albedo_diffuse (:,ip1:ip2) = 0.0 @@ -514,6 +536,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%avg_available_water (ip1:ip2) = 0.0 csite%avg_leaf_energy (ip1:ip2) = 0.0 csite%avg_leaf_temp (ip1:ip2) = 0.0 + csite%avg_leaf_vpdef (ip1:ip2) = 0.0 csite%avg_leaf_hcap (ip1:ip2) = 0.0 csite%avg_leaf_fliq (ip1:ip2) = 0.0 csite%avg_leaf_water (ip1:ip2) = 0.0 @@ -552,7 +575,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%mineralized_N_loss (ip1:ip2) = 0.0 csite%mineralized_N_input (ip1:ip2) = 0.0 - csite%watertable(ip1:ip2) = slz(lsl) + csite%watertable(ip1:ip2) = slz(lsl) csite%ustar (ip1:ip2) = 0.0 csite%tstar (ip1:ip2) = 0.0 csite%qstar (ip1:ip2) = 0.0 @@ -566,6 +589,7 @@ subroutine init_ed_patch_vars(csite,ip1,ip2,lsl) csite%wpwp (ip1:ip2) = 0.0 csite%can_theiv (ip1:ip2) = 0.0 + csite%can_vpdef (ip1:ip2) = 0.0 csite%can_temp (ip1:ip2) = 0.0 csite%can_temp_pv (ip1:ip2) = 0.0 csite%can_rhos (ip1:ip2) = 0.0 diff --git a/ED/src/init/landuse_init.f90 b/ED/src/init/landuse_init.f90 index f7e3a03e0..f278c8b5a 100644 --- a/ED/src/init/landuse_init.f90 +++ b/ED/src/init/landuse_init.f90 @@ -30,6 +30,7 @@ subroutine landuse_init type(polygontype) , pointer :: cpoly type(sitetype) , pointer :: csite type(lutime) , pointer :: clutime + type(lutime) , pointer :: onelutime character(len=str_len), dimension(maxlist) :: full_list character(len=str_len), dimension(maxlist) :: lu_list real , dimension(maxlist) :: llon_list @@ -336,9 +337,10 @@ subroutine landuse_init !----- Disturbances. ----------------------------------------------------! do iyear = 1,cpoly%num_landuse_years(isi) - clutime => cpoly%clutimes(iyear,isi) - clutime%landuse_year = clutime%landuse_year - clutime%landuse(1:num_lu_trans) = clutime%landuse(1:num_lu_trans) + clutime => cpoly%clutimes(iyear,isi) + onelutime => cpoly%clutimes(iyear,1) + clutime%landuse_year = onelutime%landuse_year + clutime%landuse(1:num_lu_trans) = onelutime%landuse(1:num_lu_trans) end do end do siteloop diff --git a/ED/src/io/average_utils.f90 b/ED/src/io/average_utils.f90 index 920cd4981..340543a00 100644 --- a/ED/src/io/average_utils.f90 +++ b/ED/src/io/average_utils.f90 @@ -39,12 +39,14 @@ subroutine int_met_avg(cgrid) do isi = 1,cpoly%nsites !---- Site-level averages. ------------------------------------------------------! - cpoly%avg_atm_tmp(isi) = cpoly%avg_atm_tmp(isi) & - + cpoly%met(isi)%atm_tmp * tfact - cpoly%avg_atm_shv(isi) = cpoly%avg_atm_shv(isi) & - + cpoly%met(isi)%atm_shv * tfact - cpoly%avg_atm_prss(isi) = cpoly%avg_atm_prss(isi) & - + cpoly%met(isi)%prss * tfact + cpoly%avg_atm_tmp (isi) = cpoly%avg_atm_tmp (isi) & + + cpoly%met(isi)%atm_tmp * tfact + cpoly%avg_atm_vpdef(isi) = cpoly%avg_atm_vpdef (isi) & + + cpoly%met(isi)%atm_vpdef * tfact + cpoly%avg_atm_shv (isi) = cpoly%avg_atm_shv (isi) & + + cpoly%met(isi)%atm_shv * tfact + cpoly%avg_atm_prss (isi) = cpoly%avg_atm_prss (isi) & + + cpoly%met(isi)%prss * tfact !----- Now the polygon-level averages. -------------------------------------------! cgrid%avg_nir_beam(ipy) = cgrid%avg_nir_beam(ipy) & @@ -67,6 +69,10 @@ subroutine int_met_avg(cgrid) + cpoly%met(isi)%atm_tmp * cpoly%area(isi) & * tfact * polygon_area_i + cgrid%avg_atm_vpdef(ipy) = cgrid%avg_atm_vpdef(ipy) & + + cpoly%met(isi)%atm_vpdef * cpoly%area(isi) & + * tfact * polygon_area_i + cgrid%avg_atm_shv(ipy) = cgrid%avg_atm_shv(ipy) & + cpoly%met(isi)%atm_shv * cpoly%area(isi) & * tfact * polygon_area_i @@ -254,7 +260,8 @@ subroutine normalize_averaged_vars(cgrid,frqsum,dtlsm) ! doesn't have integral values, so we normalise using tfact. Its units will ! ! become µmol/m²/s. ! !------------------------------------------------------------------------------! - csite%mean_rh(ipa) = csite%mean_rh(ipa) * tfact + csite%mean_rh (ipa) = csite%mean_rh (ipa) * tfact + csite%mean_cwd_rh(ipa) = csite%mean_cwd_rh(ipa) * tfact !------------------------------------------------------------------------------! ! Budget variables. They contain integral values, so we must divide by ! @@ -264,6 +271,7 @@ subroutine normalize_averaged_vars(cgrid,frqsum,dtlsm) csite%co2budget_gpp_dbh(:,ipa) = csite%co2budget_gpp_dbh(:,ipa) * frqsumi csite%co2budget_plresp(ipa) = csite%co2budget_plresp(ipa) * frqsumi csite%co2budget_rh(ipa) = csite%co2budget_rh(ipa) * frqsumi + csite%co2budget_cwd_rh(ipa) = csite%co2budget_cwd_rh(ipa) * frqsumi csite%co2budget_loss2atm(ipa) = csite%co2budget_loss2atm(ipa) * frqsumi csite%co2budget_denseffect(ipa) = csite%co2budget_denseffect(ipa) * frqsumi csite%co2budget_residual(ipa) = csite%co2budget_residual(ipa) * frqsumi @@ -326,6 +334,7 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_par_beam (ipy) = 0.0 cgrid%avg_par_diffuse (ipy) = 0.0 cgrid%avg_atm_tmp (ipy) = 0.0 + cgrid%avg_atm_vpdef (ipy) = 0.0 cgrid%avg_atm_shv (ipy) = 0.0 cgrid%avg_rshort (ipy) = 0.0 cgrid%avg_rshort_diffuse (ipy) = 0.0 @@ -349,6 +358,7 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_leaf_hcap (ipy) = 0.0 cgrid%avg_leaf_fliq (ipy) = 0.0 cgrid%avg_leaf_water (ipy) = 0.0 + cgrid%avg_leaf_vpdef (ipy) = 0.0 cgrid%avg_wood_energy (ipy) = 0.0 cgrid%avg_wood_temp (ipy) = 0.0 @@ -363,6 +373,7 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_can_prss (ipy) = 0.0 cgrid%avg_can_theta (ipy) = 0.0 cgrid%avg_can_theiv (ipy) = 0.0 + cgrid%avg_can_vpdef (ipy) = 0.0 cgrid%avg_can_depth (ipy) = 0.0 cgrid%avg_drainage (ipy) = 0.0 @@ -431,6 +442,7 @@ subroutine reset_averaged_vars(cgrid) cgrid%avg_storage_resp (ipy) = 0.0 cgrid%avg_vleaf_resp (ipy) = 0.0 cgrid%avg_htroph_resp (ipy) = 0.0 + cgrid%avg_cwd_resp (ipy) = 0.0 cgrid%avg_leaf_drop (ipy) = 0.0 cgrid%avg_leaf_maintenance (ipy) = 0.0 cgrid%avg_root_maintenance (ipy) = 0.0 @@ -459,16 +471,17 @@ subroutine reset_averaged_vars(cgrid) siteloop: do isi = 1,cpoly%nsites csite => cpoly%site(isi) - cpoly%avg_atm_tmp(isi) = 0.0 - cpoly%avg_atm_shv(isi) = 0.0 - cpoly%avg_atm_prss(isi) = 0.0 + cpoly%avg_atm_tmp (isi) = 0.0 + cpoly%avg_atm_vpdef (isi) = 0.0 + cpoly%avg_atm_shv (isi) = 0.0 + cpoly%avg_atm_prss (isi) = 0.0 - cpoly%avg_soil_temp(:,isi) = 0.0 - cpoly%avg_soil_water(:,isi) = 0.0 - cpoly%avg_soil_mstpot(:,isi) = 0.0 - cpoly%avg_soil_energy(:,isi) = 0.0 - cpoly%avg_soil_fracliq(:,isi) = 0.0 - cpoly%avg_soil_rootfrac(:,isi) = 0.0 + cpoly%avg_soil_temp (:,isi) = 0.0 + cpoly%avg_soil_water (:,isi) = 0.0 + cpoly%avg_soil_mstpot (:,isi) = 0.0 + cpoly%avg_soil_energy (:,isi) = 0.0 + cpoly%avg_soil_fracliq (:,isi) = 0.0 + cpoly%avg_soil_rootfrac (:,isi) = 0.0 @@ -481,6 +494,7 @@ subroutine reset_averaged_vars(cgrid) csite%co2budget_gpp(ipa) = 0.0 csite%co2budget_gpp_dbh(:,ipa) = 0.0 csite%co2budget_rh(ipa) = 0.0 + csite%co2budget_cwd_rh(ipa) = 0.0 csite%co2budget_plresp(ipa) = 0.0 csite%co2budget_residual(ipa) = 0.0 csite%co2budget_loss2atm(ipa) = 0.0 @@ -550,6 +564,7 @@ subroutine reset_averaged_vars(cgrid) csite%avg_rk4step(ipa) = 0.0 csite%avg_available_water(ipa) = 0.0 csite%mean_rh(ipa) = 0.0 + csite%mean_cwd_rh(ipa) = 0.0 cohortloop: do ico=1,cpatch%ncohorts cpatch%leaf_respiration(ico) = 0.0 @@ -634,6 +649,7 @@ subroutine integrate_ed_daily_output_state(cgrid) real :: patch_lma real :: sss_can_theta real :: sss_can_theiv + real :: sss_can_vpdef real :: sss_can_shv real :: sss_can_co2 real :: sss_can_prss @@ -642,12 +658,14 @@ subroutine integrate_ed_daily_output_state(cgrid) real :: sss_leaf_water real :: sss_leaf_energy real :: sss_leaf_hcap + real :: sss_leaf_vpdef real :: sss_wood_water real :: sss_wood_energy real :: sss_wood_hcap real :: pss_leaf_water real :: pss_leaf_energy real :: pss_leaf_hcap + real :: pss_leaf_vpdef real :: pss_wood_water real :: pss_wood_energy real :: pss_wood_hcap @@ -672,14 +690,16 @@ subroutine integrate_ed_daily_output_state(cgrid) !----- Initialize auxiliary variables to add sitetype variables. --------------------! site_lma = 0. site_lai = 0. - sss_leaf_energy = 0. - sss_leaf_water = 0. - sss_leaf_hcap = 0. - sss_wood_energy = 0. - sss_wood_water = 0. - sss_wood_hcap = 0. + sss_leaf_energy = 0. + sss_leaf_water = 0. + sss_leaf_hcap = 0. + sss_leaf_vpdef = 0. + sss_wood_energy = 0. + sss_wood_water = 0. + sss_wood_hcap = 0. sss_can_theta = 0. sss_can_theiv = 0. + sss_can_vpdef = 0. sss_can_shv = 0. sss_can_co2 = 0. sss_can_prss = 0. @@ -725,6 +745,7 @@ subroutine integrate_ed_daily_output_state(cgrid) pss_leaf_energy = 0. pss_leaf_water = 0. pss_leaf_hcap = 0. + pss_leaf_vpdef = 0. pss_wood_energy = 0. pss_wood_water = 0. pss_wood_hcap = 0. @@ -737,6 +758,7 @@ subroutine integrate_ed_daily_output_state(cgrid) pss_leaf_energy = pss_leaf_energy + sum(cpatch%leaf_energy)*csite%area(ipa) pss_leaf_water = pss_leaf_water + sum(cpatch%leaf_water )*csite%area(ipa) pss_leaf_hcap = pss_leaf_hcap + sum(cpatch%leaf_hcap )*csite%area(ipa) + pss_leaf_vpdef = pss_leaf_vpdef + sum(cpatch%leaf_vpdef )*csite%area(ipa) pss_wood_energy = pss_wood_energy + sum(cpatch%wood_energy)*csite%area(ipa) pss_wood_water = pss_wood_water + sum(cpatch%wood_water )*csite%area(ipa) pss_wood_hcap = pss_wood_hcap + sum(cpatch%wood_hcap )*csite%area(ipa) @@ -827,6 +849,7 @@ subroutine integrate_ed_daily_output_state(cgrid) sss_leaf_energy = sss_leaf_energy + (pss_leaf_energy*site_area_i)*cpoly%area(isi) sss_leaf_water = sss_leaf_water + (pss_leaf_water *site_area_i)*cpoly%area(isi) sss_leaf_hcap = sss_leaf_hcap + (pss_leaf_hcap *site_area_i)*cpoly%area(isi) + sss_leaf_vpdef = sss_leaf_vpdef + (pss_leaf_vpdef *site_area_i)*cpoly%area(isi) sss_wood_energy = sss_wood_energy + (pss_wood_energy*site_area_i)*cpoly%area(isi) sss_wood_water = sss_wood_water + (pss_wood_water *site_area_i)*cpoly%area(isi) sss_wood_hcap = sss_wood_hcap + (pss_wood_hcap *site_area_i)*cpoly%area(isi) @@ -838,6 +861,9 @@ subroutine integrate_ed_daily_output_state(cgrid) sss_can_theiv = sss_can_theiv + cpoly%area(isi) & * ( sum(csite%can_theiv * csite%area) & * site_area_i ) + sss_can_vpdef = sss_can_vpdef + cpoly%area(isi) & + * ( sum(csite%can_vpdef * csite%area) & + * site_area_i ) sss_can_shv = sss_can_shv + cpoly%area(isi) & * ( sum(csite%can_shv * csite%area) & * site_area_i ) @@ -865,6 +891,8 @@ subroutine integrate_ed_daily_output_state(cgrid) + sss_leaf_water * poly_area_i cgrid%dmean_leaf_hcap(ipy) = cgrid%dmean_leaf_hcap(ipy) & + sss_leaf_hcap * poly_area_i + cgrid%dmean_leaf_vpdef(ipy) = cgrid%dmean_leaf_vpdef(ipy) & + + sss_leaf_vpdef * poly_area_i cgrid%dmean_wood_energy(ipy) = cgrid%dmean_wood_energy(ipy) & + sss_wood_energy * poly_area_i cgrid%dmean_wood_water(ipy) = cgrid%dmean_wood_water(ipy) & @@ -875,6 +903,8 @@ subroutine integrate_ed_daily_output_state(cgrid) + sss_can_theta * poly_area_i cgrid%dmean_can_theiv(ipy) = cgrid%dmean_can_theiv(ipy) & + sss_can_theiv * poly_area_i + cgrid%dmean_can_vpdef(ipy) = cgrid%dmean_can_vpdef(ipy) & + + sss_can_vpdef * poly_area_i cgrid%dmean_can_shv(ipy) = cgrid%dmean_can_shv(ipy) & + sss_can_shv * poly_area_i cgrid%dmean_can_co2(ipy) = cgrid%dmean_can_co2(ipy) & @@ -894,6 +924,9 @@ subroutine integrate_ed_daily_output_state(cgrid) cgrid%dmean_atm_temp(ipy) = cgrid%dmean_atm_temp(ipy) & + cpoly%met(isi)%atm_tmp & * cpoly%area(isi) * poly_area_i + cgrid%dmean_atm_vpdef(ipy) = cgrid%dmean_atm_vpdef(ipy) & + + cpoly%met(isi)%atm_vpdef & + * cpoly%area(isi) * poly_area_i cgrid%dmean_rshort(ipy) = cgrid%dmean_rshort(ipy) & + ( cpoly%met(isi)%nir_beam & + cpoly%met(isi)%nir_diffuse & @@ -937,6 +970,8 @@ subroutine integrate_ed_daily_output_state(cgrid) + sss_leaf_water * poly_area_i cgrid%qmean_leaf_hcap (it,ipy) = cgrid%qmean_leaf_hcap (it,ipy) & + sss_leaf_hcap * poly_area_i + cgrid%qmean_leaf_vpdef (it,ipy) = cgrid%qmean_leaf_vpdef (it,ipy) & + + sss_leaf_vpdef * poly_area_i cgrid%qmean_wood_energy (it,ipy) = cgrid%qmean_wood_energy (it,ipy) & + sss_wood_energy * poly_area_i cgrid%qmean_wood_water (it,ipy) = cgrid%qmean_wood_water (it,ipy) & @@ -947,6 +982,8 @@ subroutine integrate_ed_daily_output_state(cgrid) + sss_can_theta * poly_area_i cgrid%qmean_can_theiv (it,ipy) = cgrid%qmean_can_theiv (it,ipy) & + sss_can_theiv * poly_area_i + cgrid%qmean_can_vpdef (it,ipy) = cgrid%qmean_can_vpdef (it,ipy) & + + sss_can_vpdef * poly_area_i cgrid%qmean_can_shv (it,ipy) = cgrid%qmean_can_shv (it,ipy) & + sss_can_shv * poly_area_i cgrid%qmean_can_co2 (it,ipy) = cgrid%qmean_can_co2 (it,ipy) & @@ -966,6 +1003,9 @@ subroutine integrate_ed_daily_output_state(cgrid) cgrid%qmean_atm_temp (it,ipy) = cgrid%qmean_atm_temp (it,ipy) & + cpoly%met(isi)%atm_tmp & * cpoly%area(isi) * poly_area_i + cgrid%qmean_atm_vpdef (it,ipy) = cgrid%qmean_atm_vpdef (it,ipy) & + + cpoly%met(isi)%atm_vpdef & + * cpoly%area(isi) * poly_area_i cgrid%qmean_rshort (it,ipy) = cgrid%qmean_rshort (it,ipy) & + ( cpoly%met(isi)%nir_beam & + cpoly%met(isi)%nir_diffuse & @@ -1228,12 +1268,18 @@ subroutine integrate_ed_daily_output_flux(cgrid) csite%dmean_rh (ipa) = csite%dmean_rh (ipa) & + csite%co2budget_rh (ipa) & * umols_2_kgCyr + csite%dmean_cwd_rh (ipa) = csite%dmean_cwd_rh (ipa) & + + csite%co2budget_cwd_rh (ipa) & + * umols_2_kgCyr csite%dmean_rk4step (ipa) = csite%dmean_rk4step (ipa) & + csite%avg_rk4step (ipa) if (iqoutput > 0) then csite%qmean_rh (it,ipa) = csite%qmean_rh (it,ipa) & + csite%co2budget_rh (ipa) & * umols_2_kgCyr + csite%qmean_cwd_rh (it,ipa) = csite%qmean_cwd_rh (it,ipa) & + + csite%co2budget_cwd_rh (ipa) & + * umols_2_kgCyr csite%qmean_albedo (it,ipa) = csite%qmean_albedo (it,ipa) & + csite%avg_albedo (ipa) csite%qmean_albedo_beam (it,ipa) = csite%qmean_albedo_beam (it,ipa) & @@ -1441,6 +1487,9 @@ 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 + cgrid%qmean_cwd_rh (it,ipy) = cgrid%qmean_cwd_rh (it,ipy) & + + cgrid%avg_cwd_resp (ipy) & + * umols_2_kgCyr cgrid%qmean_ustar (it,ipy) = cgrid%qmean_ustar (it,ipy) & + cgrid%avg_ustar (ipy) @@ -1550,6 +1599,11 @@ subroutine integrate_ed_daily_output_flux(cgrid) * cgrid%avg_htroph_resp (ipy) & * umols_2_kgCyr * umols_2_kgCyr + cgrid%qmsqu_cwd_rh (it,ipy) = cgrid%qmsqu_cwd_rh (it,ipy) & + + cgrid%avg_cwd_resp (ipy) & + * cgrid%avg_cwd_resp (ipy) & + * umols_2_kgCyr * umols_2_kgCyr + cgrid%qmsqu_carbon_ac (it,ipy) = cgrid%qmsqu_carbon_ac (it,ipy) & + cgrid%avg_carbon_ac (ipy) & * cgrid%avg_carbon_ac (ipy) @@ -1712,11 +1766,17 @@ subroutine normalize_ed_daily_vars(cgrid,timefac1) !----- Included a loop so it won't crash with empty cohorts... ----------------! cohortloop: do ico=1,cpatch%ncohorts - cpatch%today_gpp(ico) = cpatch%today_gpp(ico) * timefac1 - cpatch%today_gpp_pot(ico) = cpatch%today_gpp_pot(ico) * timefac1 - cpatch%today_gpp_max(ico) = cpatch%today_gpp_max(ico) * timefac1 - cpatch%today_leaf_resp(ico) = cpatch%today_leaf_resp(ico) * timefac1 - cpatch%today_root_resp(ico) = cpatch%today_root_resp(ico) * timefac1 + !---------------------------------------------------------------------------! + ! Normalise the variables used to compute carbon balance. ! + !---------------------------------------------------------------------------! + cpatch%today_gpp (ico) = cpatch%today_gpp (ico) * timefac1 + cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * timefac1 + cpatch%today_gpp_lightmax (ico) = cpatch%today_gpp_lightmax (ico) * timefac1 + cpatch%today_gpp_moistmax (ico) = cpatch%today_gpp_moistmax (ico) * timefac1 + cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * timefac1 + cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * timefac1 + !---------------------------------------------------------------------------! + !---------------------------------------------------------------------------! ! We now update the daily means of GPP, and leaf and root respiration, ! @@ -1742,6 +1802,8 @@ subroutine normalize_ed_daily_vars(cgrid,timefac1) * csite%area(ipa) & * umols_2_kgCyr end if + !---------------------------------------------------------------------------! + !---------------------------------------------------------------------------! ! We update the following monthly means here because these dmean vari- ! @@ -1756,8 +1818,11 @@ subroutine normalize_ed_daily_vars(cgrid,timefac1) cpatch%mmean_root_resp(ico) = cpatch%mmean_root_resp(ico) & + cpatch%dmean_root_resp(ico) end if + !---------------------------------------------------------------------------! end do cohortloop + !------------------------------------------------------------------------------! end do patchloop + !---------------------------------------------------------------------------------! if (save_daily) then sss_gpp = sss_gpp + pss_gpp * site_area_i * cpoly%area(isi) sss_leaf_resp = sss_leaf_resp + pss_leaf_resp * site_area_i * cpoly%area(isi) @@ -2047,6 +2112,7 @@ subroutine normalize_ed_daily_output_vars(cgrid) real :: pss_vleaf_resp , sss_vleaf_resp real :: pss_growth_resp , sss_growth_resp real :: sss_rh + real :: sss_cwd_rh real :: sss_albedo real :: sss_albedo_beam real :: sss_albedo_diffuse @@ -2091,17 +2157,20 @@ subroutine normalize_ed_daily_output_vars(cgrid) cgrid%dmean_leaf_energy(ipy) = cgrid%dmean_leaf_energy(ipy) * dtlsm_o_daysec cgrid%dmean_leaf_hcap(ipy) = cgrid%dmean_leaf_hcap(ipy) * dtlsm_o_daysec cgrid%dmean_leaf_water(ipy) = cgrid%dmean_leaf_water(ipy) * dtlsm_o_daysec + cgrid%dmean_leaf_vpdef(ipy) = cgrid%dmean_leaf_vpdef(ipy) * dtlsm_o_daysec cgrid%dmean_wood_energy(ipy) = cgrid%dmean_wood_energy(ipy) * dtlsm_o_daysec cgrid%dmean_wood_hcap(ipy) = cgrid%dmean_wood_hcap(ipy) * dtlsm_o_daysec cgrid%dmean_wood_water(ipy) = cgrid%dmean_wood_water(ipy) * dtlsm_o_daysec cgrid%dmean_can_theta(ipy) = cgrid%dmean_can_theta(ipy) * dtlsm_o_daysec cgrid%dmean_can_theiv(ipy) = cgrid%dmean_can_theiv(ipy) * dtlsm_o_daysec + cgrid%dmean_can_vpdef(ipy) = cgrid%dmean_can_vpdef(ipy) * dtlsm_o_daysec cgrid%dmean_can_shv(ipy) = cgrid%dmean_can_shv(ipy) * dtlsm_o_daysec cgrid%dmean_can_co2(ipy) = cgrid%dmean_can_co2(ipy) * dtlsm_o_daysec cgrid%dmean_can_prss(ipy) = cgrid%dmean_can_prss(ipy) * dtlsm_o_daysec cgrid%dmean_gnd_temp(ipy) = cgrid%dmean_gnd_temp(ipy) * dtlsm_o_daysec cgrid%dmean_gnd_shv (ipy) = cgrid%dmean_gnd_shv (ipy) * dtlsm_o_daysec cgrid%dmean_atm_temp(ipy) = cgrid%dmean_atm_temp(ipy) * dtlsm_o_daysec + cgrid%dmean_atm_vpdef(ipy) = cgrid%dmean_atm_vpdef(ipy) * dtlsm_o_daysec cgrid%dmean_rshort(ipy) = cgrid%dmean_rshort(ipy) * dtlsm_o_daysec cgrid%dmean_rshort_diff(ipy) = cgrid%dmean_rshort_diff(ipy) * dtlsm_o_daysec cgrid%dmean_rlong(ipy) = cgrid%dmean_rlong(ipy) * dtlsm_o_daysec @@ -2210,6 +2279,7 @@ subroutine normalize_ed_daily_output_vars(cgrid) sss_storage_resp = 0. sss_vleaf_resp = 0. sss_rh = 0. + sss_cwd_rh = 0. sss_albedo = 0. sss_albedo_beam = 0. sss_albedo_diffuse = 0. @@ -2358,7 +2428,8 @@ subroutine normalize_ed_daily_output_vars(cgrid) ! in µmol(CO2)/m²/s, so we multiply by the number of seconds in a year and ! ! convert to kgC, so the final units will be kgC/m2/yr. ! !------------------------------------------------------------------------------! - csite%dmean_rh(ipa) = csite%dmean_rh(ipa) * frqsum_o_daysec + csite%dmean_rh (ipa) = csite%dmean_rh (ipa) * frqsum_o_daysec + csite%dmean_cwd_rh(ipa) = csite%dmean_cwd_rh(ipa) * frqsum_o_daysec !------------------------------------------------------------------------------! @@ -2366,9 +2437,12 @@ subroutine normalize_ed_daily_output_vars(cgrid) !------------------------------------------------------------------------------! ! Albedo is updated over daylight hours only. ! !------------------------------------------------------------------------------! - csite%dmean_albedo(ipa) = csite%dmean_rh(ipa) * frqsum_o_daylight - csite%dmean_albedo(ipa) = csite%dmean_rh(ipa) * frqsum_o_daylight - csite%dmean_albedo(ipa) = csite%dmean_rh(ipa) * frqsum_o_daylight + csite%dmean_albedo (ipa) = csite%dmean_albedo (ipa) & + * frqsum_o_daylight + csite%dmean_albedo_beam (ipa) = csite%dmean_albedo_beam (ipa) & + * frqsum_o_daylight + csite%dmean_albedo_diffuse (ipa) = csite%dmean_albedo_diffuse (ipa) & + * frqsum_o_daylight !------------------------------------------------------------------------------! if (cpatch%ncohorts > 0) then @@ -2411,6 +2485,9 @@ subroutine normalize_ed_daily_output_vars(cgrid) sss_rh = sss_rh & + (sum(csite%dmean_rh * csite%area) * site_area_i) & * cpoly%area(isi) + sss_cwd_rh = sss_cwd_rh & + + (sum(csite%dmean_cwd_rh * csite%area) * site_area_i) & + * cpoly%area(isi) sss_albedo = sss_albedo & + (sum(csite%dmean_albedo * csite%area) * site_area_i) & * cpoly%area(isi) @@ -2439,6 +2516,8 @@ subroutine normalize_ed_daily_output_vars(cgrid) cgrid%dmean_rh (ipy) = cgrid%dmean_rh (ipy) & + sss_rh * poly_area_i + cgrid%dmean_cwd_rh (ipy) = cgrid%dmean_cwd_rh (ipy) & + + sss_cwd_rh * poly_area_i cgrid%dmean_albedo (ipy) = cgrid%dmean_albedo (ipy) & + sss_albedo * poly_area_i cgrid%dmean_albedo_beam (ipy) = cgrid%dmean_albedo_beam (ipy) & @@ -2496,25 +2575,32 @@ subroutine zero_ed_daily_vars(cgrid) !----- Reset variables stored in sitetype. ------------------------------------! csite%today_A_decomp(ipa) = 0.0 csite%today_Af_decomp(ipa) = 0.0 + !------------------------------------------------------------------------------! + !----- Reset variables stored in patchtype. -----------------------------------! do ico = 1, cpatch%ncohorts - cpatch%today_gpp (ico) = 0.0 - cpatch%today_nppleaf (ico) = 0.0 - cpatch%today_nppfroot (ico) = 0.0 - cpatch%today_nppsapwood (ico) = 0.0 - cpatch%today_nppcroot (ico) = 0.0 - cpatch%today_nppseeds (ico) = 0.0 - cpatch%today_nppwood (ico) = 0.0 - cpatch%today_nppdaily (ico) = 0.0 - cpatch%today_gpp_pot (ico) = 0.0 - cpatch%today_gpp_max (ico) = 0.0 - cpatch%today_leaf_resp(ico) = 0.0 - cpatch%today_root_resp(ico) = 0.0 + cpatch%today_gpp (ico) = 0.0 + cpatch%today_nppleaf (ico) = 0.0 + cpatch%today_nppfroot (ico) = 0.0 + cpatch%today_nppsapwood (ico) = 0.0 + cpatch%today_nppcroot (ico) = 0.0 + cpatch%today_nppseeds (ico) = 0.0 + cpatch%today_nppwood (ico) = 0.0 + cpatch%today_nppdaily (ico) = 0.0 + cpatch%today_gpp_pot (ico) = 0.0 + cpatch%today_gpp_lightmax (ico) = 0.0 + cpatch%today_gpp_moistmax (ico) = 0.0 + cpatch%today_leaf_resp (ico) = 0.0 + cpatch%today_root_resp (ico) = 0.0 end do + !------------------------------------------------------------------------------! end do + !---------------------------------------------------------------------------------! end do + !------------------------------------------------------------------------------------! end do + !---------------------------------------------------------------------------------------! return end subroutine zero_ed_daily_vars !==========================================================================================! @@ -2591,6 +2677,7 @@ subroutine zero_ed_daily_output_vars(cgrid) cgrid%dmean_carbon_st (ipy) = 0. cgrid%dmean_plresp (ipy) = 0. cgrid%dmean_rh (ipy) = 0. + cgrid%dmean_cwd_rh (ipy) = 0. cgrid%dmean_leaf_resp (ipy) = 0. cgrid%dmean_root_resp (ipy) = 0. cgrid%dmean_growth_resp (ipy) = 0. @@ -2609,6 +2696,7 @@ subroutine zero_ed_daily_output_vars(cgrid) cgrid%dmean_leaf_hcap (ipy) = 0. cgrid%dmean_leaf_water (ipy) = 0. cgrid%dmean_leaf_temp (ipy) = 0. + cgrid%dmean_leaf_vpdef (ipy) = 0. cgrid%dmean_wood_energy (ipy) = 0. cgrid%dmean_wood_hcap (ipy) = 0. cgrid%dmean_wood_water (ipy) = 0. @@ -2620,9 +2708,11 @@ subroutine zero_ed_daily_output_vars(cgrid) cgrid%dmean_can_prss (ipy) = 0. cgrid%dmean_can_theta (ipy) = 0. cgrid%dmean_can_theiv (ipy) = 0. + cgrid%dmean_can_vpdef (ipy) = 0. cgrid%dmean_gnd_temp (ipy) = 0. cgrid%dmean_gnd_shv (ipy) = 0. cgrid%dmean_atm_temp (ipy) = 0. + cgrid%dmean_atm_vpdef (ipy) = 0. cgrid%dmean_rshort (ipy) = 0. cgrid%dmean_rshort_diff (ipy) = 0. cgrid%dmean_rlong (ipy) = 0. @@ -2652,6 +2742,7 @@ subroutine zero_ed_daily_output_vars(cgrid) csite%dmean_energy_residual(ipa) = 0. csite%dmean_water_residual (ipa) = 0. csite%dmean_rh (ipa) = 0. + csite%dmean_cwd_rh (ipa) = 0. csite%dmean_rk4step (ipa) = 0. csite%dmean_A_decomp (ipa) = 0. csite%dmean_Af_decomp (ipa) = 0. @@ -2790,6 +2881,8 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_plresp (ipy) cgrid%mmean_rh (ipy) = cgrid%mmean_rh (ipy) & + cgrid%dmean_rh (ipy) + cgrid%mmean_cwd_rh (ipy) = cgrid%mmean_cwd_rh (ipy) & + + cgrid%dmean_cwd_rh (ipy) cgrid%mmean_growth_resp (ipy) = cgrid%mmean_growth_resp (ipy) & + cgrid%dmean_growth_resp (ipy) cgrid%mmean_storage_resp (ipy) = cgrid%mmean_storage_resp (ipy) & @@ -2819,6 +2912,8 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_leaf_hcap (ipy) cgrid%mmean_leaf_water (ipy) = cgrid%mmean_leaf_water (ipy) & + cgrid%dmean_leaf_water (ipy) + cgrid%mmean_leaf_vpdef (ipy) = cgrid%mmean_leaf_vpdef (ipy) & + + cgrid%dmean_leaf_vpdef (ipy) cgrid%mmean_wood_energy (ipy) = cgrid%mmean_wood_energy (ipy) & + cgrid%dmean_wood_energy (ipy) cgrid%mmean_wood_hcap (ipy) = cgrid%mmean_wood_hcap (ipy) & @@ -2829,6 +2924,8 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_can_theta (ipy) cgrid%mmean_can_theiv (ipy) = cgrid%mmean_can_theiv (ipy) & + cgrid%dmean_can_theiv (ipy) + cgrid%mmean_can_vpdef (ipy) = cgrid%mmean_can_vpdef (ipy) & + + cgrid%dmean_can_vpdef (ipy) cgrid%mmean_can_shv (ipy) = cgrid%mmean_can_shv (ipy) & + cgrid%dmean_can_shv (ipy) cgrid%mmean_can_co2 (ipy) = cgrid%mmean_can_co2 (ipy) & @@ -2841,6 +2938,8 @@ subroutine integrate_ed_monthly_output_vars(cgrid) + cgrid%dmean_gnd_shv (ipy) cgrid%mmean_atm_temp (ipy) = cgrid%mmean_atm_temp (ipy) & + cgrid%dmean_atm_temp (ipy) + cgrid%mmean_atm_vpdef (ipy) = cgrid%mmean_atm_vpdef (ipy) & + + cgrid%dmean_atm_vpdef (ipy) cgrid%mmean_rshort (ipy) = cgrid%mmean_rshort (ipy) & + cgrid%dmean_rshort (ipy) cgrid%mmean_rshort_diff (ipy) = cgrid%mmean_rshort_diff (ipy) & @@ -2899,6 +2998,9 @@ subroutine integrate_ed_monthly_output_vars(cgrid) cgrid%mmsqu_rh (ipy) = cgrid%mmsqu_rh (ipy) & + cgrid%dmean_rh (ipy) & * cgrid%dmean_rh (ipy) + cgrid%mmsqu_cwd_rh (ipy) = cgrid%mmsqu_cwd_rh (ipy) & + + cgrid%dmean_cwd_rh (ipy) & + * cgrid%dmean_cwd_rh (ipy) cgrid%mmsqu_sensible_ac(ipy) = cgrid%mmsqu_sensible_ac(ipy) & + cgrid%dmean_sensible_ac(ipy) & * cgrid%dmean_sensible_ac(ipy) @@ -2950,6 +3052,8 @@ subroutine integrate_ed_monthly_output_vars(cgrid) csite%mmean_rh (ipa) = csite%mmean_rh (ipa) & + csite%dmean_rh (ipa) + csite%mmean_cwd_rh (ipa) = csite%mmean_cwd_rh (ipa) & + + csite%dmean_cwd_rh (ipa) csite%mmean_albedo (ipa) = csite%mmean_albedo (ipa) & + csite%dmean_albedo (ipa) csite%mmean_albedo_beam (ipa) = csite%mmean_albedo_beam (ipa) & @@ -3087,6 +3191,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) real, dimension(n_pft,n_dbh) :: pss_bseeds real, dimension(n_pft,n_dbh) :: pss_pldens real :: sss_rh + real :: sss_cwd_rh real :: sss_fsw real :: sss_fsn real :: sss_fs_open @@ -3176,6 +3281,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) 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 + cgrid%mmean_cwd_rh (ipy) = cgrid%mmean_cwd_rh (ipy) * ndaysi cgrid%mmean_leaf_resp (ipy) = cgrid%mmean_leaf_resp (ipy) * ndaysi cgrid%mmean_root_resp (ipy) = cgrid%mmean_root_resp (ipy) * ndaysi cgrid%mmean_growth_resp (ipy) = cgrid%mmean_growth_resp (ipy) * ndaysi @@ -3189,17 +3295,20 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%mmean_leaf_energy (ipy) = cgrid%mmean_leaf_energy (ipy) * ndaysi cgrid%mmean_leaf_hcap (ipy) = cgrid%mmean_leaf_hcap (ipy) * ndaysi cgrid%mmean_leaf_water (ipy) = cgrid%mmean_leaf_water (ipy) * ndaysi + cgrid%mmean_leaf_vpdef (ipy) = cgrid%mmean_leaf_vpdef (ipy) * ndaysi cgrid%mmean_wood_energy (ipy) = cgrid%mmean_wood_energy (ipy) * ndaysi cgrid%mmean_wood_hcap (ipy) = cgrid%mmean_wood_hcap (ipy) * ndaysi cgrid%mmean_wood_water (ipy) = cgrid%mmean_wood_water (ipy) * ndaysi cgrid%mmean_can_theta (ipy) = cgrid%mmean_can_theta (ipy) * ndaysi cgrid%mmean_can_theiv (ipy) = cgrid%mmean_can_theiv (ipy) * ndaysi + cgrid%mmean_can_vpdef (ipy) = cgrid%mmean_can_vpdef (ipy) * ndaysi cgrid%mmean_can_shv (ipy) = cgrid%mmean_can_shv (ipy) * ndaysi cgrid%mmean_can_co2 (ipy) = cgrid%mmean_can_co2 (ipy) * ndaysi cgrid%mmean_can_prss (ipy) = cgrid%mmean_can_prss (ipy) * ndaysi cgrid%mmean_gnd_temp (ipy) = cgrid%mmean_gnd_temp (ipy) * ndaysi cgrid%mmean_gnd_shv (ipy) = cgrid%mmean_gnd_shv (ipy) * ndaysi cgrid%mmean_atm_temp (ipy) = cgrid%mmean_atm_temp (ipy) * ndaysi + cgrid%mmean_atm_vpdef (ipy) = cgrid%mmean_atm_vpdef (ipy) * ndaysi cgrid%mmean_rshort (ipy) = cgrid%mmean_rshort (ipy) * ndaysi cgrid%mmean_rshort_diff (ipy) = cgrid%mmean_rshort_diff (ipy) * ndaysi cgrid%mmean_rlong (ipy) = cgrid%mmean_rlong (ipy) * ndaysi @@ -3238,6 +3347,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) 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_cwd_rh (ipy) = cgrid%mmsqu_cwd_rh (ipy) * ndaysi cgrid%mmsqu_sensible_ac (ipy) = cgrid%mmsqu_sensible_ac (ipy) * ndaysi cgrid%mmsqu_sensible_lc (ipy) = cgrid%mmsqu_sensible_lc (ipy) * ndaysi cgrid%mmsqu_sensible_wc (ipy) = cgrid%mmsqu_sensible_wc (ipy) * ndaysi @@ -3360,6 +3470,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) csite%mmean_energy_residual(ipa) = csite%mmean_energy_residual(ipa) * ndaysi csite%mmean_water_residual(ipa) = csite%mmean_water_residual(ipa) * ndaysi csite%mmean_rh(ipa) = csite%mmean_rh(ipa) * ndaysi + csite%mmean_cwd_rh(ipa) = csite%mmean_cwd_rh(ipa) * ndaysi csite%mmean_rk4step(ipa) = csite%mmean_rk4step(ipa) * ndaysi csite%mmean_A_decomp(ipa) = csite%mmean_A_decomp(ipa) * ndaysi csite%mmean_Af_decomp(ipa) = csite%mmean_Af_decomp(ipa) * ndaysi @@ -3494,6 +3605,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) !----- Initialise site sums (auxiliary variables). ----------------------------! poly_area_i = 1./sum(cpoly%area) sss_rh = 0. + sss_cwd_rh = 0. sss_fsn = 0. sss_fsw = 0. sss_fs_open = 0. @@ -3567,6 +3679,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) csite%qmean_rh (t,ipa) = csite%qmean_rh (t,ipa) & * ndaysi + csite%qmean_cwd_rh (t,ipa) = csite%qmean_cwd_rh (t,ipa) & + * ndaysi csite%qmean_albedo (t,ipa) = csite%qmean_albedo (t,ipa) & * ndaysi csite%qmean_albedo_beam (t,ipa) = csite%qmean_albedo_beam (t,ipa) & @@ -3582,8 +3696,10 @@ subroutine normalize_ed_monthly_output_vars(cgrid) * cpoly%area(isi) sss_fs_open = sss_fs_open + (pss_fs_open * site_area_i) & * cpoly%area(isi) - sss_rh = sss_rh + ( sum(csite%qmean_rh(t,:) * csite%area) & - * site_area_i) * cpoly%area(isi) + sss_rh = sss_rh + ( sum(csite%qmean_rh(t,:) * csite%area) & + * site_area_i) * cpoly%area(isi) + sss_cwd_rh = sss_cwd_rh + ( sum(csite%qmean_cwd_rh(t,:) * csite%area) & + * site_area_i) * cpoly%area(isi) !---------------------------------------------------------------------------! end do @@ -3596,6 +3712,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) + sss_fs_open * poly_area_i cgrid%qmean_rh (t,ipy) = cgrid%qmean_rh (t,ipy) & + sss_rh * poly_area_i + cgrid%qmean_cwd_rh (t,ipy) = cgrid%qmean_cwd_rh (t,ipy) & + + sss_cwd_rh * poly_area_i cgrid%qmean_leaf_energy (t,ipy) = cgrid%qmean_leaf_energy (t,ipy) & * ndaysi * dtlsm_o_frqfast @@ -3603,6 +3721,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) * ndaysi * dtlsm_o_frqfast cgrid%qmean_leaf_hcap (t,ipy) = cgrid%qmean_leaf_hcap (t,ipy) & * ndaysi * dtlsm_o_frqfast + cgrid%qmean_leaf_vpdef (t,ipy) = cgrid%qmean_leaf_vpdef (t,ipy) & + * ndaysi * dtlsm_o_frqfast cgrid%qmean_wood_energy (t,ipy) = cgrid%qmean_wood_energy (t,ipy) & * ndaysi * dtlsm_o_frqfast cgrid%qmean_wood_water (t,ipy) = cgrid%qmean_wood_water (t,ipy) & @@ -3613,6 +3733,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) * ndaysi * dtlsm_o_frqfast cgrid%qmean_can_theiv (t,ipy) = cgrid%qmean_can_theiv (t,ipy) & * ndaysi * dtlsm_o_frqfast + cgrid%qmean_can_vpdef (t,ipy) = cgrid%qmean_can_vpdef (t,ipy) & + * ndaysi * dtlsm_o_frqfast cgrid%qmean_can_shv (t,ipy) = cgrid%qmean_can_shv (t,ipy) & * ndaysi * dtlsm_o_frqfast cgrid%qmean_can_co2 (t,ipy) = cgrid%qmean_can_co2 (t,ipy) & @@ -3625,6 +3747,8 @@ subroutine normalize_ed_monthly_output_vars(cgrid) * ndaysi * dtlsm_o_frqfast cgrid%qmean_atm_temp (t,ipy) = cgrid%qmean_atm_temp (t,ipy) & * ndaysi * dtlsm_o_frqfast + cgrid%qmean_atm_vpdef (t,ipy) = cgrid%qmean_atm_vpdef (t,ipy) & + * ndaysi * dtlsm_o_frqfast cgrid%qmean_rshort (t,ipy) = cgrid%qmean_rshort (t,ipy) & * ndaysi * dtlsm_o_frqfast cgrid%qmean_rshort_diff (t,ipy) = cgrid%qmean_rshort_diff (t,ipy) & @@ -3645,6 +3769,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) cgrid%qmean_plresp (t,ipy) = cgrid%qmean_plresp (t,ipy) * ndaysi cgrid%qmean_nep (t,ipy) = cgrid%qmean_nep (t,ipy) * ndaysi cgrid%qmean_rh (t,ipy) = cgrid%qmean_rh (t,ipy) * ndaysi + cgrid%qmean_cwd_rh (t,ipy) = cgrid%qmean_cwd_rh (t,ipy) * ndaysi cgrid%qmean_sensible_lc (t,ipy) = cgrid%qmean_sensible_lc (t,ipy) * ndaysi cgrid%qmean_sensible_wc (t,ipy) = cgrid%qmean_sensible_wc (t,ipy) * ndaysi cgrid%qmean_sensible_gc (t,ipy) = cgrid%qmean_sensible_gc (t,ipy) * ndaysi @@ -3682,6 +3807,7 @@ subroutine normalize_ed_monthly_output_vars(cgrid) 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_cwd_rh (t,ipy) = cgrid%qmsqu_cwd_rh (t,ipy) * ndaysi cgrid%qmsqu_sensible_ac (t,ipy) = cgrid%qmsqu_sensible_ac (t,ipy) * ndaysi cgrid%qmsqu_sensible_lc (t,ipy) = cgrid%qmsqu_sensible_lc (t,ipy) * ndaysi cgrid%qmsqu_sensible_wc (t,ipy) = cgrid%qmsqu_sensible_wc (t,ipy) * ndaysi @@ -3801,6 +3927,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmean_nep (ipy) = 0. cgrid%mmean_plresp (ipy) = 0. cgrid%mmean_rh (ipy) = 0. + cgrid%mmean_cwd_rh (ipy) = 0. cgrid%mmean_leaf_resp (ipy) = 0. cgrid%mmean_root_resp (ipy) = 0. cgrid%mmean_growth_resp (ipy) = 0. @@ -3815,12 +3942,14 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmean_leaf_hcap (ipy) = 0. cgrid%mmean_leaf_water (ipy) = 0. cgrid%mmean_leaf_temp (ipy) = 0. + cgrid%mmean_leaf_vpdef (ipy) = 0. cgrid%mmean_wood_energy (ipy) = 0. cgrid%mmean_wood_hcap (ipy) = 0. cgrid%mmean_wood_water (ipy) = 0. cgrid%mmean_wood_temp (ipy) = 0. cgrid%mmean_can_theta (ipy) = 0. cgrid%mmean_can_theiv (ipy) = 0. + cgrid%mmean_can_vpdef (ipy) = 0. cgrid%mmean_can_prss (ipy) = 0. cgrid%mmean_can_temp (ipy) = 0. cgrid%mmean_can_shv (ipy) = 0. @@ -3829,6 +3958,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmean_gnd_temp (ipy) = 0. cgrid%mmean_gnd_shv (ipy) = 0. cgrid%mmean_atm_temp (ipy) = 0. + cgrid%mmean_atm_vpdef (ipy) = 0. cgrid%mmean_rshort (ipy) = 0. cgrid%mmean_rshort_diff (ipy) = 0. cgrid%mmean_rlong (ipy) = 0. @@ -3851,6 +3981,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%mmsqu_carbon_st (ipy) = 0. cgrid%mmsqu_nep (ipy) = 0. cgrid%mmsqu_rh (ipy) = 0. + cgrid%mmsqu_cwd_rh (ipy) = 0. cgrid%mmsqu_sensible_ac (ipy) = 0. cgrid%mmsqu_sensible_lc (ipy) = 0. cgrid%mmsqu_sensible_wc (ipy) = 0. @@ -3880,6 +4011,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) csite%mmean_energy_residual (ipa) = 0. csite%mmean_water_residual (ipa) = 0. csite%mmean_rh (ipa) = 0. + csite%mmean_cwd_rh (ipa) = 0. csite%mmean_rk4step (ipa) = 0. csite%mmean_A_decomp (ipa) = 0. csite%mmean_Af_decomp (ipa) = 0. @@ -3948,6 +4080,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) end do csite%qmean_rh (:,ipa) = 0.0 + csite%qmean_cwd_rh (:,ipa) = 0.0 csite%qmean_albedo (:,ipa) = 0.0 csite%qmean_albedo_beam (:,ipa) = 0.0 csite%qmean_albedo_diffuse (:,ipa) = 0.0 @@ -3960,17 +4093,20 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmean_leaf_energy (:,ipy) = 0.0 cgrid%qmean_leaf_water (:,ipy) = 0.0 cgrid%qmean_leaf_hcap (:,ipy) = 0.0 + cgrid%qmean_leaf_vpdef (:,ipy) = 0.0 cgrid%qmean_wood_energy (:,ipy) = 0.0 cgrid%qmean_wood_water (:,ipy) = 0.0 cgrid%qmean_wood_hcap (:,ipy) = 0.0 cgrid%qmean_can_theta (:,ipy) = 0.0 cgrid%qmean_can_theiv (:,ipy) = 0.0 + cgrid%qmean_can_vpdef (:,ipy) = 0.0 cgrid%qmean_can_shv (:,ipy) = 0.0 cgrid%qmean_can_co2 (:,ipy) = 0.0 cgrid%qmean_can_prss (:,ipy) = 0.0 cgrid%qmean_gnd_temp (:,ipy) = 0.0 cgrid%qmean_gnd_shv (:,ipy) = 0.0 cgrid%qmean_atm_temp (:,ipy) = 0.0 + cgrid%qmean_atm_vpdef (:,ipy) = 0.0 cgrid%qmean_rshort (:,ipy) = 0.0 cgrid%qmean_rshort_diff (:,ipy) = 0.0 cgrid%qmean_rlong (:,ipy) = 0.0 @@ -3984,6 +4120,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmean_plresp (:,ipy) = 0.0 cgrid%qmean_nep (:,ipy) = 0.0 cgrid%qmean_rh (:,ipy) = 0.0 + cgrid%qmean_cwd_rh (:,ipy) = 0.0 cgrid%qmean_sensible_lc (:,ipy) = 0.0 cgrid%qmean_sensible_wc (:,ipy) = 0.0 cgrid%qmean_sensible_gc (:,ipy) = 0.0 @@ -4021,6 +4158,7 @@ subroutine zero_ed_monthly_output_vars(cgrid) cgrid%qmsqu_carbon_st (:,ipy) = 0.0 cgrid%qmsqu_nep (:,ipy) = 0.0 cgrid%qmsqu_rh (:,ipy) = 0.0 + cgrid%qmsqu_cwd_rh (:,ipy) = 0.0 cgrid%qmsqu_sensible_ac (:,ipy) = 0.0 cgrid%qmsqu_sensible_lc (:,ipy) = 0.0 cgrid%qmsqu_sensible_wc (:,ipy) = 0.0 diff --git a/ED/src/io/ed_init_full_history.F90 b/ED/src/io/ed_init_full_history.F90 index c2bc9f3e2..57c91a193 100644 --- a/ED/src/io/ed_init_full_history.F90 +++ b/ED/src/io/ed_init_full_history.F90 @@ -253,7 +253,6 @@ subroutine init_full_history_restart() ! We check the distance between the expected coordinates and the retrieved ones, and ! ! they ought to be less than 250 metres apart, otherwise we can't use the polygon. ! !------------------------------------------------------------------------------------! - polyloop: do ipy = 1,cgrid%npolygons cpoly => cgrid%polygon(ipy) @@ -446,36 +445,41 @@ subroutine fill_history_grid(cgrid,ipy,py_index) #if USE_INTERF interface - subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_r - subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_d - subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_i end interface #endif type(edtype),target :: cgrid - integer,intent(in) :: ipy,py_index - integer :: iparallel,dsetrank - integer(SIZE_T) :: sz - integer :: hdferr + integer,intent(in) :: ipy,py_index + integer :: iparallel + integer :: dsetrank + integer(SIZE_T) :: sz + integer :: hdferr + logical :: foundvar iparallel = 0 @@ -510,681 +514,713 @@ end subroutine hdf_getslab_i memsize(1) = 1_8 - call hdf_getslab_d(cgrid%walltime_py(ipy:ipy),'WALLTIME_PY ',dsetrank,iparallel,.false.) + call hdf_getslab_d(cgrid%walltime_py(ipy:ipy),'WALLTIME_PY ',dsetrank,iparallel,.false.,foundvar) - call hdf_getslab_i(cgrid%lsl(ipy:ipy),'LSL ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cgrid%lsl(ipy:ipy),'LSL ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_i(cgrid%ncol_soil(ipy:ipy),'NCOL_SOIL ',dsetrank,iparallel,.false.) + call hdf_getslab_i(cgrid%ncol_soil(ipy:ipy),'NCOL_SOIL ',dsetrank,iparallel,.false.,foundvar) - call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%Te(ipy:ipy),'TE ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%Te(ipy:ipy),'TE ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%zbar(ipy:ipy),'ZBAR ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%zbar(ipy:ipy),'ZBAR ',dsetrank,iparallel,.true.,foundvar) -!! call hdf_getslab_r(cgrid%tau(ipy:ipy),'TAU ',dsetrank,iparallel,.true.) +!! call hdf_getslab_r(cgrid%tau(ipy:ipy),'TAU ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%sheat(ipy:ipy),'SHEAT ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%sheat(ipy:ipy),'SHEAT ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%baseflow(ipy:ipy),'BASEFLOW ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%baseflow(ipy:ipy),'BASEFLOW ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_i(cgrid%load_adjacency(ipy:ipy),'LOAD_ADJACENCY ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cgrid%load_adjacency(ipy:ipy),'LOAD_ADJACENCY ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%swliq(ipy:ipy),'SWLIQ ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%swliq(ipy:ipy),'SWLIQ ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%cosz(ipy:ipy),'COSZ ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%cosz(ipy:ipy),'COSZ ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cgrid%lai (ipy:ipy),'LAI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cgrid%wai (ipy:ipy),'WAI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cgrid%avg_lma(ipy:ipy),'AVG_LMA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cgrid%lai (ipy:ipy),'LAI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cgrid%wai (ipy:ipy),'WAI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cgrid%avg_lma(ipy:ipy),'AVG_LMA ',dsetrank,iparallel,.false.,foundvar) - call hdf_getslab_r(cgrid%runoff(ipy:ipy),'RUNOFF ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cgrid%runoff(ipy:ipy),'RUNOFF ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%cbudget_initialstorage (ipy:ipy),'CBUDGET_INITIALSTORAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%cbudget_nep (ipy:ipy),'CBUDGET_NEP ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%nbudget_initialstorage (ipy:ipy),'NBUDGET_INITIALSTORAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_agb (ipy:ipy),'TOTAL_AGB ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_agb_growth (ipy:ipy),'TOTAL_AGB_GROWTH ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_agb_mort (ipy:ipy),'TOTAL_AGB_MORT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_agb_recruit (ipy:ipy),'TOTAL_AGB_RECRUIT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_basal_area (ipy:ipy),'TOTAL_BASAL_AREA ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_basal_area_growth (ipy:ipy),'TOTAL_BASAL_AREA_GROWTH ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_basal_area_mort (ipy:ipy),'TOTAL_BASAL_AREA_MORT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cgrid%total_basal_area_recruit (ipy:ipy),'TOTAL_BASAL_AREA_RECRUIT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) ! All daily and monthly variables need to be retrieved if you are loading there... if (associated(cgrid%dmean_pcpg )) & call hdf_getslab_r(cgrid%dmean_pcpg (ipy:ipy) ,'DMEAN_PCPG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_runoff )) & call hdf_getslab_r(cgrid%dmean_runoff (ipy:ipy) ,'DMEAN_RUNOFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_drainage )) & call hdf_getslab_r(cgrid%dmean_drainage (ipy:ipy) ,'DMEAN_DRAINAGE ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_gpp )) & call hdf_getslab_r(cgrid%dmean_gpp (ipy:ipy) ,'DMEAN_GPP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppleaf )) & call hdf_getslab_r(cgrid%dmean_nppleaf (ipy:ipy) ,'DMEAN_NPPLEAF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppfroot )) & call hdf_getslab_r(cgrid%dmean_nppfroot (ipy:ipy) ,'DMEAN_NPPFROOT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppsapwood )) & call hdf_getslab_r(cgrid%dmean_nppsapwood (ipy:ipy) ,'DMEAN_NPPSAPWOOD ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppcroot )) & call hdf_getslab_r(cgrid%dmean_nppcroot (ipy:ipy) ,'DMEAN_NPPCROOT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppseeds )) & call hdf_getslab_r(cgrid%dmean_nppseeds (ipy:ipy) ,'DMEAN_NPPSEEDS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppwood )) & call hdf_getslab_r(cgrid%dmean_nppwood (ipy:ipy) ,'DMEAN_NPPWOOD ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nppdaily )) & call hdf_getslab_r(cgrid%dmean_nppdaily (ipy:ipy) ,'DMEAN_NPPDAILY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_evap )) & call hdf_getslab_r(cgrid%dmean_evap (ipy:ipy) ,'DMEAN_EVAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_transp )) & call hdf_getslab_r(cgrid%dmean_transp (ipy:ipy) ,'DMEAN_TRANSP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_sensible_lc )) & call hdf_getslab_r(cgrid%dmean_sensible_lc (ipy:ipy) ,'DMEAN_SENSIBLE_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_sensible_wc )) & call hdf_getslab_r(cgrid%dmean_sensible_wc (ipy:ipy) ,'DMEAN_SENSIBLE_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_sensible_gc )) & call hdf_getslab_r(cgrid%dmean_sensible_gc (ipy:ipy) ,'DMEAN_SENSIBLE_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_sensible_ac )) & call hdf_getslab_r(cgrid%dmean_sensible_ac (ipy:ipy) ,'DMEAN_SENSIBLE_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_vapor_lc )) & call hdf_getslab_r(cgrid%dmean_vapor_lc (ipy:ipy) ,'DMEAN_VAPOR_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_vapor_wc )) & call hdf_getslab_r(cgrid%dmean_vapor_wc (ipy:ipy) ,'DMEAN_VAPOR_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_vapor_gc )) & call hdf_getslab_r(cgrid%dmean_vapor_gc (ipy:ipy) ,'DMEAN_VAPOR_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_vapor_ac )) & call hdf_getslab_r(cgrid%dmean_vapor_ac (ipy:ipy) ,'DMEAN_VAPOR_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_ustar )) & call hdf_getslab_r(cgrid%dmean_ustar (ipy:ipy) ,'DMEAN_USTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_tstar )) & call hdf_getslab_r(cgrid%dmean_tstar (ipy:ipy) ,'DMEAN_TSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_qstar )) & call hdf_getslab_r(cgrid%dmean_qstar (ipy:ipy) ,'DMEAN_QSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_cstar )) & call hdf_getslab_r(cgrid%dmean_cstar (ipy:ipy) ,'DMEAN_CSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_nep )) & call hdf_getslab_r(cgrid%dmean_nep (ipy:ipy) ,'DMEAN_NEP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_carbon_ac )) & call hdf_getslab_r(cgrid%dmean_carbon_ac (ipy:ipy) ,'DMEAN_CARBON_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_carbon_st )) & call hdf_getslab_r(cgrid%dmean_carbon_st (ipy:ipy) ,'DMEAN_CARBON_ST ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_plresp )) & call hdf_getslab_r(cgrid%dmean_plresp (ipy:ipy) ,'DMEAN_PLRESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rh )) & call hdf_getslab_r(cgrid%dmean_rh (ipy:ipy) ,'DMEAN_RH ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_cwd_rh )) & + call hdf_getslab_r(cgrid%dmean_cwd_rh (ipy:ipy) ,'DMEAN_CWD_RH ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_leaf_resp )) & call hdf_getslab_r(cgrid%dmean_leaf_resp (ipy:ipy) ,'DMEAN_LEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_root_resp )) & call hdf_getslab_r(cgrid%dmean_root_resp (ipy:ipy) ,'DMEAN_ROOT_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_growth_resp )) & call hdf_getslab_r(cgrid%dmean_growth_resp (ipy:ipy) ,'DMEAN_GROWTH_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_storage_resp )) & call hdf_getslab_r(cgrid%dmean_storage_resp (ipy:ipy) ,'DMEAN_STORAGE_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_vleaf_resp )) & call hdf_getslab_r(cgrid%dmean_vleaf_resp (ipy:ipy) ,'DMEAN_VLEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_fs_open )) & call hdf_getslab_r(cgrid%dmean_fs_open (ipy:ipy) ,'DMEAN_FS_OPEN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_fsw )) & call hdf_getslab_r(cgrid%dmean_fsw (ipy:ipy) ,'DMEAN_FSW ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_fsn )) & call hdf_getslab_r(cgrid%dmean_fsn (ipy:ipy) ,'DMEAN_FSN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_temp )) & call hdf_getslab_r(cgrid%dmean_can_temp (ipy:ipy) ,'DMEAN_CAN_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_shv )) & call hdf_getslab_r(cgrid%dmean_can_shv (ipy:ipy) ,'DMEAN_CAN_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_prss )) & call hdf_getslab_r(cgrid%dmean_can_prss (ipy:ipy) ,'DMEAN_CAN_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_theta )) & call hdf_getslab_r(cgrid%dmean_can_theta (ipy:ipy) ,'DMEAN_CAN_THETA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_theiv )) & call hdf_getslab_r(cgrid%dmean_can_theiv (ipy:ipy) ,'DMEAN_CAN_THEIV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_can_vpdef )) & + call hdf_getslab_r(cgrid%dmean_can_vpdef (ipy:ipy) ,'DMEAN_CAN_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_co2 )) & call hdf_getslab_r(cgrid%dmean_can_co2 (ipy:ipy) ,'DMEAN_CAN_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_can_rhos )) & call hdf_getslab_r(cgrid%dmean_can_rhos (ipy:ipy) ,'DMEAN_CAN_RHOS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_gnd_temp )) & call hdf_getslab_r(cgrid%dmean_gnd_temp (ipy:ipy) ,'DMEAN_GND_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_gnd_shv )) & call hdf_getslab_r(cgrid%dmean_gnd_shv (ipy:ipy) ,'DMEAN_GND_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_leaf_energy )) & call hdf_getslab_r(cgrid%dmean_leaf_energy (ipy:ipy) ,'DMEAN_LEAF_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_leaf_water )) & call hdf_getslab_r(cgrid%dmean_leaf_water (ipy:ipy) ,'DMEAN_LEAF_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_leaf_hcap )) & call hdf_getslab_r(cgrid%dmean_leaf_hcap (ipy:ipy) ,'DMEAN_LEAF_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_leaf_temp )) & call hdf_getslab_r(cgrid%dmean_leaf_temp (ipy:ipy) ,'DMEAN_LEAF_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_leaf_vpdef )) & + call hdf_getslab_r(cgrid%dmean_leaf_vpdef (ipy:ipy) ,'DMEAN_LEAF_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_wood_energy )) & call hdf_getslab_r(cgrid%dmean_wood_energy (ipy:ipy) ,'DMEAN_WOOD_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_wood_water )) & call hdf_getslab_r(cgrid%dmean_wood_water (ipy:ipy) ,'DMEAN_WOOD_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_wood_hcap )) & call hdf_getslab_r(cgrid%dmean_wood_hcap (ipy:ipy) ,'DMEAN_WOOD_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_wood_temp )) & call hdf_getslab_r(cgrid%dmean_wood_temp (ipy:ipy) ,'DMEAN_WOOD_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_atm_temp )) & call hdf_getslab_r(cgrid%dmean_atm_temp (ipy:ipy) ,'DMEAN_ATM_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%dmean_atm_vpdef )) & + call hdf_getslab_r(cgrid%dmean_atm_vpdef (ipy:ipy) ,'DMEAN_ATM_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rshort )) & call hdf_getslab_r(cgrid%dmean_rshort (ipy:ipy) ,'DMEAN_RSHORT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rshort_diff )) & call hdf_getslab_r(cgrid%dmean_rshort_diff (ipy:ipy) ,'DMEAN_RSHORT_DIFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rlong )) & call hdf_getslab_r(cgrid%dmean_rlong (ipy:ipy) ,'DMEAN_RLONG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rshort_gnd )) & call hdf_getslab_r(cgrid%dmean_rshort_gnd (ipy:ipy) ,'DMEAN_RSHORT_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_rlong_gnd )) & call hdf_getslab_r(cgrid%dmean_rlong_gnd (ipy:ipy) ,'DMEAN_RLONG_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_atm_shv )) & call hdf_getslab_r(cgrid%dmean_atm_shv (ipy:ipy) ,'DMEAN_ATM_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_atm_co2 )) & call hdf_getslab_r(cgrid%dmean_atm_co2 (ipy:ipy) ,'DMEAN_ATM_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_atm_prss )) & call hdf_getslab_r(cgrid%dmean_atm_prss (ipy:ipy) ,'DMEAN_ATM_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_atm_vels )) & call hdf_getslab_r(cgrid%dmean_atm_vels (ipy:ipy) ,'DMEAN_ATM_VELS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_co2_residual )) & call hdf_getslab_r(cgrid%dmean_co2_residual (ipy:ipy) ,'DMEAN_CO2_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_energy_residual)) & call hdf_getslab_r(cgrid%dmean_energy_residual(ipy:ipy) ,'DMEAN_ENERGY_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%dmean_water_residual )) & call hdf_getslab_r(cgrid%dmean_water_residual (ipy:ipy) ,'DMEAN_WATER_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_co2_residual )) & call hdf_getslab_r(cgrid%mmean_co2_residual (ipy:ipy) ,'MMEAN_CO2_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_energy_residual)) & call hdf_getslab_r(cgrid%mmean_energy_residual(ipy:ipy) ,'MMEAN_ENERGY_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_water_residual )) & call hdf_getslab_r(cgrid%mmean_water_residual (ipy:ipy) ,'MMEAN_WATER_RESIDUAL ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_gpp )) & call hdf_getslab_r(cgrid%mmean_gpp (ipy:ipy) ,'MMEAN_GPP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppleaf )) & call hdf_getslab_r(cgrid%mmean_nppleaf (ipy:ipy) ,'MMEAN_NPPLEAF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppfroot )) & call hdf_getslab_r(cgrid%mmean_nppfroot (ipy:ipy) ,'MMEAN_NPPFROOT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppsapwood )) & call hdf_getslab_r(cgrid%mmean_nppsapwood (ipy:ipy) ,'MMEAN_NPPSAPWOOD ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppcroot )) & call hdf_getslab_r(cgrid%mmean_nppcroot (ipy:ipy) ,'MMEAN_NPPCROOT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppseeds )) & call hdf_getslab_r(cgrid%mmean_nppseeds (ipy:ipy) ,'MMEAN_NPPSEEDS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppwood )) & call hdf_getslab_r(cgrid%mmean_nppwood (ipy:ipy) ,'MMEAN_NPPWOOD ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nppdaily )) & call hdf_getslab_r(cgrid%mmean_nppdaily (ipy:ipy) ,'MMEAN_NPPDAILY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_evap )) & call hdf_getslab_r(cgrid%mmean_evap (ipy:ipy) ,'MMEAN_EVAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_transp )) & call hdf_getslab_r(cgrid%mmean_transp (ipy:ipy) ,'MMEAN_TRANSP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_sensible_lc )) & call hdf_getslab_r(cgrid%mmean_sensible_lc (ipy:ipy) ,'MMEAN_SENSIBLE_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_sensible_wc )) & call hdf_getslab_r(cgrid%mmean_sensible_wc (ipy:ipy) ,'MMEAN_SENSIBLE_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_sensible_gc )) & call hdf_getslab_r(cgrid%mmean_sensible_gc (ipy:ipy) ,'MMEAN_SENSIBLE_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_sensible_ac )) & call hdf_getslab_r(cgrid%mmean_sensible_ac (ipy:ipy) ,'MMEAN_SENSIBLE_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_vapor_lc )) & call hdf_getslab_r(cgrid%mmean_vapor_lc (ipy:ipy) ,'MMEAN_VAPOR_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_vapor_wc )) & call hdf_getslab_r(cgrid%mmean_vapor_wc (ipy:ipy) ,'MMEAN_VAPOR_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_vapor_gc )) & call hdf_getslab_r(cgrid%mmean_vapor_gc (ipy:ipy) ,'MMEAN_VAPOR_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_vapor_ac )) & call hdf_getslab_r(cgrid%mmean_vapor_ac (ipy:ipy) ,'MMEAN_VAPOR_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_nep )) & call hdf_getslab_r(cgrid%mmean_nep (ipy:ipy) ,'MMEAN_NEP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_ustar )) & call hdf_getslab_r(cgrid%mmean_ustar (ipy:ipy) ,'MMEAN_USTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_tstar )) & call hdf_getslab_r(cgrid%mmean_tstar (ipy:ipy) ,'MMEAN_TSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_qstar )) & call hdf_getslab_r(cgrid%mmean_qstar (ipy:ipy) ,'MMEAN_QSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_cstar )) & call hdf_getslab_r(cgrid%mmean_cstar (ipy:ipy) ,'MMEAN_CSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_carbon_ac )) & call hdf_getslab_r(cgrid%mmean_carbon_ac (ipy:ipy) ,'MMEAN_CARBON_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_carbon_st )) & call hdf_getslab_r(cgrid%mmean_carbon_st (ipy:ipy) ,'MMEAN_CARBON_ST ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_plresp )) & call hdf_getslab_r(cgrid%mmean_plresp (ipy:ipy) ,'MMEAN_PLRESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rh )) & call hdf_getslab_r(cgrid%mmean_rh (ipy:ipy) ,'MMEAN_RH ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_cwd_rh )) & + call hdf_getslab_r(cgrid%mmean_cwd_rh (ipy:ipy) ,'MMEAN_CWD_RH ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_leaf_resp )) & call hdf_getslab_r(cgrid%mmean_leaf_resp (ipy:ipy) ,'MMEAN_LEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_root_resp )) & call hdf_getslab_r(cgrid%mmean_root_resp (ipy:ipy) ,'MMEAN_ROOT_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_growth_resp )) & call hdf_getslab_r(cgrid%mmean_growth_resp (ipy:ipy) ,'MMEAN_GROWTH_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_storage_resp )) & call hdf_getslab_r(cgrid%mmean_storage_resp (ipy:ipy) ,'MMEAN_STORAGE_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_vleaf_resp )) & call hdf_getslab_r(cgrid%mmean_vleaf_resp (ipy:ipy) ,'MMEAN_VLEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_temp )) & call hdf_getslab_r(cgrid%mmean_can_temp (ipy:ipy) ,'MMEAN_CAN_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_shv )) & call hdf_getslab_r(cgrid%mmean_can_shv (ipy:ipy) ,'MMEAN_CAN_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_co2 )) & call hdf_getslab_r(cgrid%mmean_can_co2 (ipy:ipy) ,'MMEAN_CAN_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_rhos )) & call hdf_getslab_r(cgrid%mmean_can_rhos (ipy:ipy) ,'MMEAN_CAN_RHOS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_prss )) & call hdf_getslab_r(cgrid%mmean_can_prss (ipy:ipy) ,'MMEAN_CAN_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_theta )) & call hdf_getslab_r(cgrid%mmean_can_theta (ipy:ipy) ,'MMEAN_CAN_THETA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_can_theiv )) & call hdf_getslab_r(cgrid%mmean_can_theiv (ipy:ipy) ,'MMEAN_CAN_THEIV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_can_vpdef )) & + call hdf_getslab_r(cgrid%mmean_can_vpdef (ipy:ipy) ,'MMEAN_CAN_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_gnd_temp )) & call hdf_getslab_r(cgrid%mmean_gnd_temp (ipy:ipy) ,'MMEAN_GND_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_gnd_shv )) & call hdf_getslab_r(cgrid%mmean_gnd_shv (ipy:ipy) ,'MMEAN_GND_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_leaf_energy )) & call hdf_getslab_r(cgrid%mmean_leaf_energy (ipy:ipy) ,'MMEAN_LEAF_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_leaf_water )) & call hdf_getslab_r(cgrid%mmean_leaf_water (ipy:ipy) ,'MMEAN_LEAF_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_leaf_temp )) & call hdf_getslab_r(cgrid%mmean_leaf_temp (ipy:ipy) ,'MMEAN_LEAF_TEMP ' & - ,dsetrank,iparallel,.false.) - + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_leaf_vpdef )) & + call hdf_getslab_r(cgrid%mmean_leaf_vpdef (ipy:ipy) ,'MMEAN_LEAF_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) + if (associated(cgrid%mmean_leaf_hcap )) & call hdf_getslab_r(cgrid%mmean_leaf_hcap (ipy:ipy) ,'MMEAN_LEAF_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_wood_energy )) & call hdf_getslab_r(cgrid%mmean_wood_energy (ipy:ipy) ,'MMEAN_WOOD_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_wood_water )) & call hdf_getslab_r(cgrid%mmean_wood_water (ipy:ipy) ,'MMEAN_WOOD_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_wood_temp )) & call hdf_getslab_r(cgrid%mmean_wood_temp (ipy:ipy) ,'MMEAN_WOOD_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_wood_hcap )) & call hdf_getslab_r(cgrid%mmean_wood_hcap (ipy:ipy) ,'MMEAN_WOOD_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rshort )) & call hdf_getslab_r(cgrid%mmean_rshort (ipy:ipy) ,'MMEAN_RSHORT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rshort_diff )) & call hdf_getslab_r(cgrid%mmean_rshort_diff (ipy:ipy) ,'MMEAN_RSHORT_DIFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rlong )) & call hdf_getslab_r(cgrid%mmean_rlong (ipy:ipy) ,'MMEAN_RLONG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rshort_gnd )) & call hdf_getslab_r(cgrid%mmean_rshort_gnd (ipy:ipy) ,'MMEAN_RSHORT_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_rlong_gnd )) & call hdf_getslab_r(cgrid%mmean_rlong_gnd (ipy:ipy) ,'MMEAN_RLONG_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_atm_temp )) & call hdf_getslab_r(cgrid%mmean_atm_temp (ipy:ipy) ,'MMEAN_ATM_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%mmean_atm_vpdef )) & + call hdf_getslab_r(cgrid%mmean_atm_vpdef (ipy:ipy) ,'MMEAN_ATM_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_atm_shv )) & call hdf_getslab_r(cgrid%mmean_atm_shv (ipy:ipy) ,'MMEAN_ATM_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_atm_co2 )) & call hdf_getslab_r(cgrid%mmean_atm_co2 (ipy:ipy) ,'MMEAN_ATM_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_atm_prss )) & call hdf_getslab_r(cgrid%mmean_atm_prss (ipy:ipy) ,'MMEAN_ATM_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_atm_vels )) & call hdf_getslab_r(cgrid%mmean_atm_vels (ipy:ipy) ,'MMEAN_ATM_VELS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_pcpg )) & call hdf_getslab_r(cgrid%mmean_pcpg (ipy:ipy) ,'MMEAN_PCPG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_runoff )) & call hdf_getslab_r(cgrid%mmean_runoff (ipy:ipy) ,'MMEAN_RUNOFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_drainage )) & call hdf_getslab_r(cgrid%mmean_drainage (ipy:ipy) ,'MMEAN_DRAINAGE ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_fs_open )) & call hdf_getslab_r(cgrid%mmean_fs_open (ipy:ipy) ,'MMEAN_FS_OPEN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_fsw )) & call hdf_getslab_r(cgrid%mmean_fsw (ipy:ipy) ,'MMEAN_FSW ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmean_fsn )) & call hdf_getslab_r(cgrid%mmean_fsn (ipy:ipy) ,'MMEAN_FSN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_gpp )) & call hdf_getslab_r(cgrid%mmsqu_gpp (ipy:ipy) ,'MMSQU_GPP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_leaf_resp )) & call hdf_getslab_r(cgrid%mmsqu_leaf_resp (ipy:ipy) ,'MMSQU_LEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_root_resp )) & call hdf_getslab_r(cgrid%mmsqu_root_resp (ipy:ipy) ,'MMSQU_ROOT_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_plresp )) & call hdf_getslab_r(cgrid%mmsqu_plresp (ipy:ipy) ,'MMSQU_PLRESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_carbon_ac )) & call hdf_getslab_r(cgrid%mmsqu_carbon_ac (ipy:ipy) ,'MMSQU_CARBON_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_carbon_st )) & call hdf_getslab_r(cgrid%mmsqu_carbon_st (ipy:ipy) ,'MMSQU_CARBON_ST ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_nep )) & call hdf_getslab_r(cgrid%mmsqu_nep (ipy:ipy) ,'MMSQU_NEP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_rh )) & call hdf_getslab_r(cgrid%mmsqu_rh (ipy:ipy) ,'MMSQU_RH ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_sensible_ac )) & call hdf_getslab_r(cgrid%mmsqu_sensible_ac (ipy:ipy) ,'MMSQU_SENSIBLE_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_sensible_lc )) & call hdf_getslab_r(cgrid%mmsqu_sensible_lc (ipy:ipy) ,'MMSQU_SENSIBLE_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_sensible_wc )) & call hdf_getslab_r(cgrid%mmsqu_sensible_wc (ipy:ipy) ,'MMSQU_SENSIBLE_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_sensible_gc )) & call hdf_getslab_r(cgrid%mmsqu_sensible_gc (ipy:ipy) ,'MMSQU_SENSIBLE_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_evap )) & call hdf_getslab_r(cgrid%mmsqu_evap (ipy:ipy) ,'MMSQU_EVAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_transp )) & call hdf_getslab_r(cgrid%mmsqu_transp (ipy:ipy) ,'MMSQU_TRANSP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_vapor_ac )) & call hdf_getslab_r(cgrid%mmsqu_vapor_ac (ipy:ipy) ,'MMSQU_VAPOR_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_vapor_lc )) & call hdf_getslab_r(cgrid%mmsqu_vapor_lc (ipy:ipy) ,'MMSQU_VAPOR_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_vapor_wc )) & call hdf_getslab_r(cgrid%mmsqu_vapor_wc (ipy:ipy) ,'MMSQU_VAPOR_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%mmsqu_vapor_gc )) & call hdf_getslab_r(cgrid%mmsqu_vapor_gc (ipy:ipy) ,'MMSQU_VAPOR_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) ! Variables with 2 dimensions (nzg,npolygons) dsetrank = 2 @@ -1203,39 +1239,39 @@ end subroutine hdf_getslab_i memoffs(2) = 0_8 call hdf_getslab_i(cgrid%ntext_soil(:,ipy) ,'NTEXT_SOIL ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%dmean_soil_temp)) & call hdf_getslab_r(cgrid%dmean_soil_temp(:,ipy) ,'DMEAN_SOIL_TEMP ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%dmean_soil_water)) & call hdf_getslab_r(cgrid%dmean_soil_water(:,ipy) ,'DMEAN_SOIL_WATER ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%dmean_soil_mstpot)) & call hdf_getslab_r(cgrid%dmean_soil_mstpot(:,ipy),'DMEAN_SOIL_MSTPOT ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%dmean_transloss)) & call hdf_getslab_r(cgrid%dmean_transloss(:,ipy) ,'DMEAN_TRANSLOSS ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_soil_temp)) & call hdf_getslab_r(cgrid%mmean_soil_temp(:,ipy) ,'MMEAN_SOIL_TEMP ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_soil_water)) & call hdf_getslab_r(cgrid%mmean_soil_water(:,ipy) ,'MMEAN_SOIL_WATER ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_soil_mstpot)) & call hdf_getslab_r(cgrid%mmean_soil_mstpot(:,ipy),'MMEAN_SOIL_MSTPOT ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_transloss)) & call hdf_getslab_r(cgrid%mmean_transloss(:,ipy) ,'MMEAN_TRANSLOSS ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) ! Variables with 2 dimensions (ndcycle,npolygons) dsetrank = 2 @@ -1255,295 +1291,311 @@ end subroutine hdf_getslab_i if (associated(cgrid%qmean_pcpg )) & call hdf_getslab_r(cgrid%qmean_pcpg (:,ipy) ,'QMEAN_PCPG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_runoff )) & call hdf_getslab_r(cgrid%qmean_runoff (:,ipy) ,'QMEAN_RUNOFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_drainage )) & call hdf_getslab_r(cgrid%qmean_drainage (:,ipy) ,'QMEAN_DRAINAGE ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_gpp )) & call hdf_getslab_r(cgrid%qmean_gpp (:,ipy) ,'QMEAN_GPP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_evap )) & call hdf_getslab_r(cgrid%qmean_evap (:,ipy) ,'QMEAN_EVAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_transp )) & call hdf_getslab_r(cgrid%qmean_transp (:,ipy) ,'QMEAN_TRANSP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_sensible_lc )) & call hdf_getslab_r(cgrid%qmean_sensible_lc (:,ipy) ,'QMEAN_SENSIBLE_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_sensible_wc )) & call hdf_getslab_r(cgrid%qmean_sensible_wc (:,ipy) ,'QMEAN_SENSIBLE_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_sensible_gc )) & call hdf_getslab_r(cgrid%qmean_sensible_gc (:,ipy) ,'QMEAN_SENSIBLE_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_sensible_ac )) & call hdf_getslab_r(cgrid%qmean_sensible_ac (:,ipy) ,'QMEAN_SENSIBLE_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_vapor_lc )) & call hdf_getslab_r(cgrid%qmean_vapor_lc (:,ipy) ,'QMEAN_VAPOR_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_vapor_wc )) & call hdf_getslab_r(cgrid%qmean_vapor_wc (:,ipy) ,'QMEAN_VAPOR_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_vapor_gc )) & call hdf_getslab_r(cgrid%qmean_vapor_gc (:,ipy) ,'QMEAN_VAPOR_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_vapor_ac )) & call hdf_getslab_r(cgrid%qmean_vapor_ac (:,ipy) ,'QMEAN_VAPOR_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_ustar )) & call hdf_getslab_r(cgrid%qmean_ustar (:,ipy) ,'QMEAN_USTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_tstar )) & call hdf_getslab_r(cgrid%qmean_tstar (:,ipy) ,'QMEAN_TSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_qstar )) & call hdf_getslab_r(cgrid%qmean_qstar (:,ipy) ,'QMEAN_QSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_cstar )) & call hdf_getslab_r(cgrid%qmean_cstar (:,ipy) ,'QMEAN_CSTAR ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_nep )) & call hdf_getslab_r(cgrid%qmean_nep (:,ipy) ,'QMEAN_NEP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_carbon_ac )) & call hdf_getslab_r(cgrid%qmean_carbon_ac (:,ipy) ,'QMEAN_CARBON_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_carbon_st )) & call hdf_getslab_r(cgrid%qmean_carbon_st (:,ipy) ,'QMEAN_CARBON_ST ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_plresp )) & call hdf_getslab_r(cgrid%qmean_plresp (:,ipy) ,'QMEAN_PLRESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rh )) & call hdf_getslab_r(cgrid%qmean_rh (:,ipy) ,'QMEAN_RH ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_cwd_rh )) & + call hdf_getslab_r(cgrid%qmean_cwd_rh (:,ipy) ,'QMEAN_CWD_RH ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_leaf_resp )) & call hdf_getslab_r(cgrid%qmean_leaf_resp (:,ipy) ,'QMEAN_LEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_root_resp )) & call hdf_getslab_r(cgrid%qmean_root_resp (:,ipy) ,'QMEAN_ROOT_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_fs_open )) & call hdf_getslab_r(cgrid%qmean_fs_open (:,ipy) ,'QMEAN_FS_OPEN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_fsw )) & call hdf_getslab_r(cgrid%qmean_fsw (:,ipy) ,'QMEAN_FSW ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_fsn )) & call hdf_getslab_r(cgrid%qmean_fsn (:,ipy) ,'QMEAN_FSN ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_temp )) & call hdf_getslab_r(cgrid%qmean_can_temp (:,ipy) ,'QMEAN_CAN_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_shv )) & call hdf_getslab_r(cgrid%qmean_can_shv (:,ipy) ,'QMEAN_CAN_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_prss )) & call hdf_getslab_r(cgrid%qmean_can_prss (:,ipy) ,'QMEAN_CAN_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_theta )) & call hdf_getslab_r(cgrid%qmean_can_theta (:,ipy) ,'QMEAN_CAN_THETA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_theiv )) & call hdf_getslab_r(cgrid%qmean_can_theiv (:,ipy) ,'QMEAN_CAN_THEIV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_can_vpdef )) & + call hdf_getslab_r(cgrid%qmean_can_vpdef (:,ipy) ,'QMEAN_CAN_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_co2 )) & call hdf_getslab_r(cgrid%qmean_can_co2 (:,ipy) ,'QMEAN_CAN_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_can_rhos )) & call hdf_getslab_r(cgrid%qmean_can_rhos (:,ipy) ,'QMEAN_CAN_RHOS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_gnd_temp )) & call hdf_getslab_r(cgrid%qmean_gnd_temp (:,ipy) ,'QMEAN_GND_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_gnd_shv )) & call hdf_getslab_r(cgrid%qmean_gnd_shv (:,ipy) ,'QMEAN_GND_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_leaf_energy )) & call hdf_getslab_r(cgrid%qmean_leaf_energy (:,ipy) ,'QMEAN_LEAF_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_leaf_water )) & call hdf_getslab_r(cgrid%qmean_leaf_water (:,ipy) ,'QMEAN_LEAF_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_leaf_hcap )) & call hdf_getslab_r(cgrid%qmean_leaf_hcap (:,ipy) ,'QMEAN_LEAF_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_leaf_temp )) & call hdf_getslab_r(cgrid%qmean_leaf_temp (:,ipy) ,'QMEAN_LEAF_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_leaf_vpdef )) & + call hdf_getslab_r(cgrid%qmean_leaf_vpdef (:,ipy) ,'QMEAN_LEAF_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_wood_energy )) & call hdf_getslab_r(cgrid%qmean_wood_energy (:,ipy) ,'QMEAN_WOOD_ENERGY ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_wood_water )) & call hdf_getslab_r(cgrid%qmean_wood_water (:,ipy) ,'QMEAN_WOOD_WATER ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_wood_hcap )) & call hdf_getslab_r(cgrid%qmean_wood_hcap (:,ipy) ,'QMEAN_WOOD_HCAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_wood_temp )) & call hdf_getslab_r(cgrid%qmean_wood_temp (:,ipy) ,'QMEAN_WOOD_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_atm_temp )) & call hdf_getslab_r(cgrid%qmean_atm_temp (:,ipy) ,'QMEAN_ATM_TEMP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) + + if (associated(cgrid%qmean_atm_vpdef )) & + call hdf_getslab_r(cgrid%qmean_atm_vpdef (:,ipy) ,'QMEAN_ATM_VPDEF ' & + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rshort )) & call hdf_getslab_r(cgrid%qmean_rshort (:,ipy) ,'QMEAN_RSHORT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rshort_diff )) & call hdf_getslab_r(cgrid%qmean_rshort_diff (:,ipy) ,'QMEAN_RSHORT_DIFF ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rlong )) & call hdf_getslab_r(cgrid%qmean_rlong (:,ipy) ,'QMEAN_RLONG ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rshort_gnd )) & call hdf_getslab_r(cgrid%qmean_rshort_gnd (:,ipy) ,'QMEAN_RSHORT_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_rlong_gnd )) & call hdf_getslab_r(cgrid%qmean_rlong_gnd (:,ipy) ,'QMEAN_RLONG_GND ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_atm_shv )) & call hdf_getslab_r(cgrid%qmean_atm_shv (:,ipy) ,'QMEAN_ATM_SHV ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_atm_co2 )) & call hdf_getslab_r(cgrid%qmean_atm_co2 (:,ipy) ,'QMEAN_ATM_CO2 ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_atm_prss )) & call hdf_getslab_r(cgrid%qmean_atm_prss (:,ipy) ,'QMEAN_ATM_PRSS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmean_atm_vels )) & call hdf_getslab_r(cgrid%qmean_atm_vels (:,ipy) ,'QMEAN_ATM_VELS ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_gpp )) & call hdf_getslab_r(cgrid%qmsqu_gpp (:,ipy) ,'QMSQU_GPP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_leaf_resp )) & call hdf_getslab_r(cgrid%qmsqu_leaf_resp (:,ipy) ,'QMSQU_LEAF_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_root_resp )) & call hdf_getslab_r(cgrid%qmsqu_root_resp (:,ipy) ,'QMSQU_ROOT_RESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_plresp )) & call hdf_getslab_r(cgrid%qmsqu_plresp (:,ipy) ,'QMSQU_PLRESP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_carbon_ac)) & call hdf_getslab_r(cgrid%qmsqu_carbon_ac (:,ipy) ,'QMSQU_CARBON_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_carbon_st)) & call hdf_getslab_r(cgrid%qmsqu_carbon_st (:,ipy) ,'QMSQU_CARBON_ST ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_nep )) & call hdf_getslab_r(cgrid%qmsqu_nep (:,ipy) ,'QMSQU_NEP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_rh )) & call hdf_getslab_r(cgrid%qmsqu_rh (:,ipy) ,'QMSQU_RH ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_sensible_ac)) & call hdf_getslab_r(cgrid%qmsqu_sensible_ac (:,ipy) ,'QMSQU_SENSIBLE_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_sensible_lc)) & call hdf_getslab_r(cgrid%qmsqu_sensible_lc (:,ipy) ,'QMSQU_SENSIBLE_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_sensible_wc)) & call hdf_getslab_r(cgrid%qmsqu_sensible_wc (:,ipy) ,'QMSQU_SENSIBLE_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_sensible_gc)) & call hdf_getslab_r(cgrid%qmsqu_sensible_gc (:,ipy) ,'QMSQU_SENSIBLE_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_evap )) & call hdf_getslab_r(cgrid%qmsqu_evap (:,ipy) ,'QMSQU_EVAP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_transp )) & call hdf_getslab_r(cgrid%qmsqu_transp (:,ipy) ,'QMSQU_TRANSP ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_vapor_ac)) & call hdf_getslab_r(cgrid%qmsqu_vapor_ac (:,ipy) ,'QMSQU_VAPOR_AC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_vapor_lc)) & call hdf_getslab_r(cgrid%qmsqu_vapor_lc (:,ipy) ,'QMSQU_VAPOR_LC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_vapor_wc)) & call hdf_getslab_r(cgrid%qmsqu_vapor_wc (:,ipy) ,'QMSQU_VAPOR_WC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cgrid%qmsqu_vapor_gc)) & call hdf_getslab_r(cgrid%qmsqu_vapor_gc (:,ipy) ,'QMSQU_VAPOR_GC ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) ! Variables with 2 dimensions (n_pft,npolygons) @@ -1563,19 +1615,19 @@ end subroutine hdf_getslab_i memoffs(2) = 0_8 if(associated(cgrid%bseeds_pft)) call hdf_getslab_r(cgrid%bseeds_pft(:,ipy) ,'BSEEDS_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%lai_pft)) call hdf_getslab_r(cgrid%lai_pft(:,ipy) ,'LAI_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%wai_pft)) call hdf_getslab_r(cgrid%wai_pft(:,ipy) ,'WAI_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_lai_pft)) call hdf_getslab_r(cgrid%mmean_lai_pft(:,ipy) ,'MMEAN_LAI_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_wai_pft)) call hdf_getslab_r(cgrid%mmean_wai_pft(:,ipy) ,'MMEAN_WAI_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%agb_pft)) call hdf_getslab_r(cgrid%agb_pft(:,ipy) ,'AGB_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%ba_pft)) call hdf_getslab_r(cgrid%ba_pft(:,ipy) ,'BA_PFT ' , & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) ! Variables with 2 dimensions (n_dbh,npolygons) @@ -1595,9 +1647,9 @@ end subroutine hdf_getslab_i memoffs(2) = 0_8 if(associated(cgrid%dmean_gpp_dbh)) call hdf_getslab_r(cgrid%dmean_gpp_dbh(:,ipy) , & - 'DMEAN_GPP_DBH ' ,dsetrank,iparallel,.false.) + 'DMEAN_GPP_DBH ' ,dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%mmean_gpp_dbh)) call hdf_getslab_r(cgrid%mmean_gpp_dbh(:,ipy) , & - 'MMEAN_GPP_DBH ' ,dsetrank,iparallel,.false.) + 'MMEAN_GPP_DBH ' ,dsetrank,iparallel,.false.,foundvar) ! Variables with 2 dimensions (13,npolygons) dsetrank = 2 @@ -1616,7 +1668,7 @@ end subroutine hdf_getslab_i memoffs(2) = 0_8 if(associated(cgrid%workload)) call hdf_getslab_r(cgrid%workload(:,ipy) , & - 'WORKLOAD ' ,dsetrank,iparallel,.true.) + 'WORKLOAD ' ,dsetrank,iparallel,.true.,foundvar) ! Variables with three dimensions(n_dist_types,n_dist_types,npolygons) @@ -1643,7 +1695,7 @@ end subroutine hdf_getslab_i memoffs(3) = 0_8 if (associated(cgrid%disturbance_rates)) & call hdf_getslab_r(cgrid%disturbance_rates(:,:,ipy),'DISTURBANCE_RATES ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) ! Variables with three dimensions(nzg,ndcycle,npolygons) @@ -1671,15 +1723,15 @@ end subroutine hdf_getslab_i if(associated(cgrid%qmean_soil_temp)) & call hdf_getslab_r(cgrid%qmean_soil_temp(:,:,ipy) ,'QMEAN_SOIL_TEMP ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%qmean_soil_water)) & call hdf_getslab_r(cgrid%qmean_soil_water(:,:,ipy) ,'QMEAN_SOIL_WATER ' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if(associated(cgrid%qmean_soil_mstpot)) & call hdf_getslab_r(cgrid%qmean_soil_mstpot(:,:,ipy),'QMEAN_SOIL_MSTPOT' ,& - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) dsetrank = 3 @@ -1703,10 +1755,10 @@ end subroutine hdf_getslab_i memsize(3) = 1_8 memoffs(3) = 0_8 - call hdf_getslab_r(cgrid%basal_area(:,:,ipy),'BASAL_AREA ',dsetrank,iparallel,.false.) - call hdf_getslab_r(cgrid%agb (:,:,ipy),'AGB ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cgrid%pldens (:,:,ipy),'PLDENS ' ,dsetrank,iparallel,.false.) - call hdf_getslab_r(cgrid%bseeds (:,:,ipy),'BSEEDS ' ,dsetrank,iparallel,.false.) + call hdf_getslab_r(cgrid%basal_area(:,:,ipy),'BASAL_AREA ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cgrid%agb (:,:,ipy),'AGB ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cgrid%pldens (:,:,ipy),'PLDENS ' ,dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cgrid%bseeds (:,:,ipy),'BSEEDS ' ,dsetrank,iparallel,.false.,foundvar) return @@ -1735,29 +1787,32 @@ subroutine fill_history_polygon(cpoly,pysi_index,nsites_global) implicit none #if USE_INTERF - interface - subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in):: required - end subroutine hdf_getslab_r - subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in) :: required - end subroutine hdf_getslab_d - subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in) :: required - end subroutine hdf_getslab_i - end interface + interface + subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_r + subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_d + subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_i + end interface #endif type(polygontype),target :: cpoly @@ -1765,6 +1820,7 @@ end subroutine hdf_getslab_i integer,intent(in) :: nsites_global integer :: iparallel integer :: dsetrank + logical :: foundvar iparallel = 0 @@ -1783,81 +1839,81 @@ end subroutine hdf_getslab_i memsize(1) = int(cpoly%nsites,8) memoffs(1) = 0_8 - call hdf_getslab_i(cpoly%patch_count,'PATCH_COUNT ',dsetrank,iparallel,.true.) - 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.) - call hdf_getslab_r(cpoly%slope,'SLOPE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%aspect,'ASPECT ',dsetrank,iparallel,.true.) - - call hdf_getslab_i(cpoly%num_landuse_years,'NUM_LANDUSE_YEARS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%TCI,'TCI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%pptweight,'pptweight ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpoly%hydro_next,'HYDRO_NEXT ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpoly%hydro_prev,'HYDRO_PREV ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_W,'MOIST_W ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_f,'MOIST_F ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_tau,'MOIST_TAU ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%moist_zi,'MOIST_ZI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%baseflow,'BASEFLOW_SI ',dsetrank,iparallel,.true.) -! call hdf_getslab_i(cpoly%metplex_beg_month,'METPLEX_BEG_MONTH ',dsetrank,iparallel,.true.) -! call hdf_getslab_i(cpoly%metplex_beg_year,'METPLEX_BEG_YEAR ',dsetrank,iparallel,.true.) -! call hdf_getslab_i(cpoly%metplex_end_year,'METPLEX_END_YEAR ',dsetrank,iparallel,.true.) - - call hdf_getslab_r(cpoly%min_monthly_temp,'MIN_MONTHLY_TEMP ',dsetrank,iparallel,.true.) -! call hdf_getslab_r(cpoly%removed_biomass,'REMOVED_BIOMASS ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%patch_count,'PATCH_COUNT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%sitenum,'SITENUM ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_i(cpoly%lsl,'LSL_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%ncol_soil,'NCOL_SOIL_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%area,'AREA_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%patch_area,'PATCH_AREA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%elevation,'ELEVATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%slope,'SLOPE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%aspect,'ASPECT ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_i(cpoly%num_landuse_years,'NUM_LANDUSE_YEARS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%TCI,'TCI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%pptweight,'pptweight ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%hydro_next,'HYDRO_NEXT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%hydro_prev,'HYDRO_PREV ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_W,'MOIST_W ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_f,'MOIST_F ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_tau,'MOIST_TAU ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_zi,'MOIST_ZI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%baseflow,'BASEFLOW_SI ',dsetrank,iparallel,.true.,foundvar) +! call hdf_getslab_i(cpoly%metplex_beg_month,'METPLEX_BEG_MONTH ',dsetrank,iparallel,.true.,foundvar) +! call hdf_getslab_i(cpoly%metplex_beg_year,'METPLEX_BEG_YEAR ',dsetrank,iparallel,.true.,foundvar) +! call hdf_getslab_i(cpoly%metplex_end_year,'METPLEX_END_YEAR ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_r(cpoly%min_monthly_temp,'MIN_MONTHLY_TEMP ',dsetrank,iparallel,.true.,foundvar) +! call hdf_getslab_r(cpoly%removed_biomass,'REMOVED_BIOMASS ',dsetrank,iparallel,.true.,foundvar) ! call hdf_getslab_r(cpoly%harvested_biomass,'HARVESTED_BIOMASS ', & -! dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%rad_avg,'RAD_AVG ',dsetrank,iparallel,.true.) +! dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%rad_avg,'RAD_AVG ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_i(cpoly%plantation,'PLANTATION_SI ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%plantation,'PLANTATION_SI ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(cpoly%agri_stocking_pft,'AGRI_STOCKING_PFT ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%agri_stocking_density,'AGRI_STOCKING_DENSITY ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(cpoly%plantation_stocking_pft,'PLANTATION_STOCKING_PFT ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%plantation_stocking_density,'PLANTATION_STOCKING_DENSITY ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%primary_harvest_memory,'PRIMARY_HARVEST_MEMORY ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%secondary_harvest_memory,'SECONDARY_HARVEST_MEMORY ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%fire_disturbance_rate,'FIRE_DISTURBANCE_RATE ', & - dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%ignition_rate,'IGNITION_RATE ',dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%ignition_rate,'IGNITION_RATE ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%nat_disturbance_rate,'NAT_DISTURBANCE_RATE ', & - dsetrank,iparallel,.true.) - call hdf_getslab_i(cpoly%nat_dist_type,'NAT_DIST_TYPE ',dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%nat_dist_type,'NAT_DIST_TYPE ',dsetrank,iparallel,.true.,foundvar) if (associated(cpoly%dmean_co2_residual)) & call hdf_getslab_r(cpoly%dmean_co2_residual , 'DMEAN_CO2_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%dmean_water_residual)) & call hdf_getslab_r(cpoly%dmean_water_residual , 'DMEAN_WATER_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%dmean_energy_residual)) & call hdf_getslab_r(cpoly%dmean_energy_residual, 'DMEAN_ENERGY_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%mmean_co2_residual)) & call hdf_getslab_r(cpoly%mmean_co2_residual , 'MMEAN_CO2_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%mmean_water_residual)) & call hdf_getslab_r(cpoly%mmean_water_residual , 'MMEAN_WATER_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%mmean_energy_residual)) & call hdf_getslab_r(cpoly%mmean_energy_residual, 'MMEAN_ENERGY_RESIDUAL_SI ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) dsetrank = 2_8 globdims(1) = int(n_pft,8) @@ -1874,13 +1930,13 @@ end subroutine hdf_getslab_i memoffs(2) = 0_8 if (associated(cpoly%lai_pft)) call hdf_getslab_r(cpoly%lai_pft,'LAI_PFT_SI ', & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) if (associated(cpoly%wai_pft)) call hdf_getslab_r(cpoly%wai_pft,'WAI_PFT_SI ', & - dsetrank,iparallel,.false.) + dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(cpoly%green_leaf_factor,'GREEN_LEAF_FACTOR ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%leaf_aging_factor,'LEAF_AGING_FACTOR ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) dsetrank = 2_8 globdims(1) = int(nzg,8) @@ -1896,7 +1952,7 @@ end subroutine hdf_getslab_i memsize(2) = int(cpoly%nsites,8) memoffs(2) = 0_8 - call hdf_getslab_i(cpoly%ntext_soil,'NTEXT_SOIL_SI ',dsetrank,iparallel,.true.) + call hdf_getslab_i(cpoly%ntext_soil,'NTEXT_SOIL_SI ',dsetrank,iparallel,.true.,foundvar) dsetrank = 2_8 globdims(1) = 12_8 @@ -1912,7 +1968,7 @@ end subroutine hdf_getslab_i memsize(2) = int(cpoly%nsites,8) memoffs(2) = 0_8 - call hdf_getslab_r(cpoly%lambda_fire,'LAMBDA_FIRE ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpoly%lambda_fire,'LAMBDA_FIRE ',dsetrank,iparallel,.true.,foundvar) dsetrank = 3_8 globdims(1:2) = int(n_dist_types,8) @@ -1929,9 +1985,9 @@ end subroutine hdf_getslab_i memoffs(3) = 0 call hdf_getslab_r(cpoly%disturbance_memory,'DISTURBANCE_MEMORY ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpoly%disturbance_rates,'DISTURBANCE_RATES_SI ', & - dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) dsetrank = 3 globdims(3) = int(nsites_global,8) @@ -1953,17 +2009,17 @@ end subroutine hdf_getslab_i chnkoffs(1) = 0 memoffs(1) = 0 - call hdf_getslab_r(cpoly%basal_area,'BASAL_AREA_SI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%agb,'AGB_SI ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%bseeds,'BSEEDS_SI ',dsetrank,iparallel,.false.) - call hdf_getslab_r(cpoly%pldens,'PLDENS_SI ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpoly%basal_area,'BASAL_AREA_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%agb,'AGB_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%bseeds,'BSEEDS_SI ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cpoly%pldens,'PLDENS_SI ',dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(cpoly%basal_area_growth,'BASAL_AREA_GROWTH ', & - dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%agb_growth,'AGB_GROWTH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%basal_area_mort,'BASAL_AREA_MORT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%basal_area_cut,'BASAL_AREA_CUT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%agb_mort,'AGB_MORT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpoly%agb_cut,'AGB_CUT ',dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%agb_growth,'AGB_GROWTH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%basal_area_mort,'BASAL_AREA_MORT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%basal_area_cut,'BASAL_AREA_CUT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%agb_mort,'AGB_MORT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%agb_cut,'AGB_CUT ',dsetrank,iparallel,.true.,foundvar) return @@ -1993,29 +2049,32 @@ subroutine fill_history_site(csite,sipa_index,npatches_global) implicit none #if USE_INTERF - interface - subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in) :: required - end subroutine hdf_getslab_r - subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in) :: required - end subroutine hdf_getslab_d - subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required) - use hdf5_coms,only:memsize - integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: dsetrank,iparallel - character(len=*),intent(in) :: varn - logical,intent(in) :: required - end subroutine hdf_getslab_i - end interface + interface + subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_r + subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_d + subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required,foundvar) + use hdf5_coms,only:memsize + integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff + integer :: dsetrank,iparallel + character(len=*),intent(in) :: varn + logical,intent(in) :: required + logical,intent(out) :: foundvar + end subroutine hdf_getslab_i + end interface #endif type(sitetype),target :: csite @@ -2026,6 +2085,7 @@ end subroutine hdf_getslab_i integer :: hdferr integer :: ipa,ipft real(kind=8),allocatable, dimension(:,:) :: buff + logical :: foundvar iparallel = 0 @@ -2051,141 +2111,148 @@ end subroutine hdf_getslab_i memsize(1) = int(csite%npatches,8) memoffs(1) = 0 - call hdf_getslab_i(csite%dist_type,'DIST_TYPE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%age,'AGE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%area,'AREA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%fast_soil_C,'FAST_SOIL_C ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%slow_soil_C,'SLOW_SOIL_C ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%structural_soil_C,'STRUCTURAL_SOIL_C ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%structural_soil_L,'STRUCTURAL_SOIL_L ',dsetrank,iparallel,.true.) + call hdf_getslab_i(csite%dist_type,'DIST_TYPE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%age,'AGE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%area,'AREA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%fast_soil_C,'FAST_SOIL_C ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%slow_soil_C,'SLOW_SOIL_C ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%structural_soil_C,'STRUCTURAL_SOIL_C ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%structural_soil_L,'STRUCTURAL_SOIL_L ',dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%mineralized_soil_N,'MINERALIZED_SOIL_N ', & - dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%fast_soil_N,'FAST_SOIL_N ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sum_dgd,'SUM_DGD ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sum_chd,'SUM_CHD ',dsetrank,iparallel,.true.) - call hdf_getslab_i(csite%plantation,'PLANTATION ',dsetrank,iparallel,.true.) + dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%fast_soil_N,'FAST_SOIL_N ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sum_dgd,'SUM_DGD ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sum_chd,'SUM_CHD ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(csite%plantation,'PLANTATION ',dsetrank,iparallel,.true.,foundvar) ! call hdf_getslab_i(csite%cohort_count,'COHORT_COUNT ',dsetrank,iparallel) - call hdf_getslab_r(csite%can_theiv,'CAN_THEIV ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_prss,'CAN_PRSS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_theta,'CAN_THETA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_temp,'CAN_TEMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_temp_pv,'CAN_TEMP_PV ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%can_shv,'CAN_SHV ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_co2,'CAN_CO2 ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_rhos,'CAN_RHOS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%can_depth,'CAN_DEPTH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ggbare,'GGBARE ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ggveg,'GGVEG ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ggnet,'GGNET ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ggsoil,'GGSOIL ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%opencan_frac,'OPENCAN_FRAC ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%can_theiv,'CAN_THEIV ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_vpdef,'CAN_VPDEF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_prss,'CAN_PRSS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_theta,'CAN_THETA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_temp,'CAN_TEMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_temp_pv,'CAN_TEMP_PV ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%can_shv,'CAN_SHV ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_co2,'CAN_CO2 ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_rhos,'CAN_RHOS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%can_depth,'CAN_DEPTH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ggbare,'GGBARE ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ggveg,'GGVEG ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ggnet,'GGNET ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ggsoil,'GGSOIL ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%opencan_frac,'OPENCAN_FRAC ',dsetrank,iparallel,.false.,foundvar) ! call hdf_getslab_i(csite%pname,'PNAME ',dsetrank,iparallel) - call hdf_getslab_r(csite%lai,'LAI_PA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wai,'WAI_PA ',dsetrank,iparallel,.false.) - call hdf_getslab_i(csite%nlev_sfcwater,'NLEV_SFCWATER ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ground_shv ,'GROUND_SHV ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ground_ssh ,'GROUND_SSH ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ground_temp,'GROUND_TEMP ',dsetrank,iparallel,.false.) - 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.) + call hdf_getslab_r(csite%lai,'LAI_PA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wai,'WAI_PA ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_i(csite%nlev_sfcwater,'NLEV_SFCWATER ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ground_shv ,'GROUND_SHV ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ground_ssh ,'GROUND_SSH ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ground_temp,'GROUND_TEMP ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ground_fliq,'GROUND_FLIQ ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%rough,'ROUGH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%avg_daily_temp,'AVG_DAILY_TEMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%avg_monthly_gndwater,'AVG_MONTHLY_GNDWATER ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%avg_monthly_waterdef,'AVG_MONTHLY_WATERDEF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_rh,'MEAN_RH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_cwd_rh,'MEAN_CWD_RH ',dsetrank,iparallel,.true.,foundvar) if (associated(csite%dmean_rh )) & - call hdf_getslab_r(csite%dmean_rh,'DMEAN_RH_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_rh,'DMEAN_RH_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_rh )) & - call hdf_getslab_r(csite%mmean_rh,'MMEAN_RH_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%mmean_rh,'MMEAN_RH_PA ',dsetrank,iparallel,.false.,foundvar) + if (associated(csite%dmean_cwd_rh )) & + call hdf_getslab_r(csite%dmean_cwd_rh,'DMEAN_CWD_RH_PA ',dsetrank,iparallel,.false.,foundvar) + if (associated(csite%mmean_cwd_rh )) & + call hdf_getslab_r(csite%mmean_cwd_rh,'MMEAN_CWD_RH_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_albedo )) & - call hdf_getslab_r(csite%dmean_albedo,'DMEAN_ALBEDO_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_albedo,'DMEAN_ALBEDO_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_albedo_beam )) & - call hdf_getslab_r(csite%dmean_albedo_beam,'DMEAN_ALBEDO_BEAM_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_albedo_beam,'DMEAN_ALBEDO_BEAM_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_albedo_diffuse )) & - call hdf_getslab_r(csite%dmean_albedo_diffuse,'DMEAN_ALBEDO_DIFFUSE_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_albedo_diffuse,'DMEAN_ALBEDO_DIFFUSE_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_albedo )) & - call hdf_getslab_r(csite%mmean_albedo,'MMEAN_ALBEDO_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%mmean_albedo,'MMEAN_ALBEDO_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_albedo_beam )) & - call hdf_getslab_r(csite%mmean_albedo_beam,'MMEAN_ALBEDO_BEAM_PA ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%mmean_albedo_beam,'MMEAN_ALBEDO_BEAM_PA ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_albedo_diffuse )) & - call hdf_getslab_r(csite%mmean_albedo_diffuse,'MMEAN_ALBEDO_DIFFUSE_PA ',dsetrank,iparallel,.false.) - - call hdf_getslab_r(csite%mean_nep,'MEAN_NEP ',dsetrank,iparallel,.true.) - - call hdf_getslab_r(csite%wbudget_loss2atm,'WBUDGET_LOSS2ATM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wbudget_denseffect,'WBUDGET_DENSEFFECT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wbudget_precipgain,'WBUDGET_PRECIPGAIN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wbudget_loss2runoff,'WBUDGET_LOSS2RUNOFF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wbudget_initialstorage,'WBUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_loss2atm,'EBUDGET_LOSS2ATM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_denseffect,'EBUDGET_DENSEFFECT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_prsseffect,'EBUDGET_PRSSEFFECT ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%ebudget_loss2runoff,'EBUDGET_LOSS2RUNOFF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_netrad,'EBUDGET_NETRAD ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_precipgain,'EBUDGET_PRECIPGAIN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ebudget_initialstorage,'EBUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_initialstorage,'CO2BUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_loss2atm,'CO2BUDGET_LOSS2ATM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_denseffect,'CO2BUDGET_DENSEFFECT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_gpp,'CO2BUDGET_GPP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_plresp,'CO2BUDGET_PLRESP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%co2budget_rh,'CO2BUDGET_RH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%today_A_decomp,'TODAY_A_DECOMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%today_Af_decomp,'TODAY_AF_DECOMP ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%mmean_albedo_diffuse,'MMEAN_ALBEDO_DIFFUSE_PA ',dsetrank,iparallel,.false.,foundvar) + + call hdf_getslab_r(csite%mean_nep,'MEAN_NEP ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_r(csite%wbudget_loss2atm,'WBUDGET_LOSS2ATM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wbudget_denseffect,'WBUDGET_DENSEFFECT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wbudget_precipgain,'WBUDGET_PRECIPGAIN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wbudget_loss2runoff,'WBUDGET_LOSS2RUNOFF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wbudget_initialstorage,'WBUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_loss2atm,'EBUDGET_LOSS2ATM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_denseffect,'EBUDGET_DENSEFFECT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_prsseffect,'EBUDGET_PRSSEFFECT ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%ebudget_loss2runoff,'EBUDGET_LOSS2RUNOFF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_netrad,'EBUDGET_NETRAD ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_precipgain,'EBUDGET_PRECIPGAIN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ebudget_initialstorage,'EBUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_initialstorage,'CO2BUDGET_INITIALSTORAGE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_loss2atm,'CO2BUDGET_LOSS2ATM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_denseffect,'CO2BUDGET_DENSEFFECT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_gpp,'CO2BUDGET_GPP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_plresp,'CO2BUDGET_PLRESP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%co2budget_rh,'CO2BUDGET_RH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%today_A_decomp,'TODAY_A_DECOMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%today_Af_decomp,'TODAY_AF_DECOMP ',dsetrank,iparallel,.true.,foundvar) if (associated(csite%dmean_A_decomp )) & - call hdf_getslab_r(csite%dmean_A_decomp,'DMEAN_A_DECOMP ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_A_decomp,'DMEAN_A_DECOMP ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_Af_decomp )) & - call hdf_getslab_r(csite%dmean_Af_decomp,'DMEAN_AF_DECOMP ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_Af_decomp,'DMEAN_AF_DECOMP ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_A_decomp )) & - call hdf_getslab_r(csite%mmean_A_decomp,'MMEAN_A_DECOMP ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%mmean_A_decomp,'MMEAN_A_DECOMP ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_Af_decomp )) & - call hdf_getslab_r(csite%mmean_Af_decomp,'MMEAN_AF_DECOMP ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%veg_rough,'VEG_ROUGH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%veg_height ,'VEG_HEIGHT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%veg_displace ,'VEG_DISPLACE ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%fsc_in,'FSC_IN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ssc_in,'SSC_IN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ssl_in,'SSL_IN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%fsn_in,'FSN_IN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%total_plant_nitrogen_uptake,'TOTAL_PLANT_NITROGEN_UPTAKE ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%mmean_Af_decomp,'MMEAN_AF_DECOMP ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%veg_rough,'VEG_ROUGH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%veg_height ,'VEG_HEIGHT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%veg_displace ,'VEG_DISPLACE ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%fsc_in,'FSC_IN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ssc_in,'SSC_IN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ssl_in,'SSL_IN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%fsn_in,'FSN_IN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%total_plant_nitrogen_uptake,'TOTAL_PLANT_NITROGEN_UPTAKE ',dsetrank,iparallel,.true.,foundvar) - 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.) - call hdf_getslab_r(csite%rlong_s,'RLONG_S ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rlong_s_surf,'RLONG_S_SURF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rlong_s_incid,'RLONG_S_INCID ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%rshort_g,'RSHORT_G ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rshort_g_beam,'RSHORT_G_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rshort_g_diffuse,'RSHORT_G_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%par_b,'PAR_B ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%par_b_beam,'PAR_B_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%par_b_diffuse,'PAR_B_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%nir_b,'NIR_B ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%nir_b_beam,'NIR_B_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%nir_b_diffuse,'NIR_B_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_g,'RLONG_G ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_g_surf,'RLONG_G_SURF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_g_incid,'RLONG_G_INCID ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_s,'RLONG_S ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_s_surf,'RLONG_S_SURF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_s_incid,'RLONG_S_INCID ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(csite%albedo,'ALBEDO ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%albedo_beam,'ALBEDO_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%albedo_diffuse,'ALBEDO_DIFFUSE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rlongup,'RLONGUP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rlong_albedo,'RLONG_ALBEDO ',dsetrank,iparallel,.true.) - - call hdf_getslab_r(csite%total_sfcw_depth,'TOTAL_SFCW_DEPTH ',dsetrank,iparallel,.false.) - call hdf_getslab_r(csite%snowfac,'SNOWFAC ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%A_decomp,'A_DECOMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%f_decomp,'F_DECOMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rh,'RH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%cwd_rh,'CWD_RH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%plant_ag_biomass,'PLANT_AG_BIOMASS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mean_wflux,'MEAN_WFLUX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mean_latflux,'MEAN_LATFLUX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mean_hflux,'MEAN_HFLUX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mean_runoff,'MEAN_RUNOFF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mean_qrunoff,'MEAN_QRUNOFF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%htry,'HTRY ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%hprev,'HPREV ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%albedo,'ALBEDO ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%albedo_beam,'ALBEDO_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%albedo_diffuse,'ALBEDO_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlongup,'RLONGUP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rlong_albedo,'RLONG_ALBEDO ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_r(csite%total_sfcw_depth,'TOTAL_SFCW_DEPTH ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(csite%snowfac,'SNOWFAC ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%A_decomp,'A_DECOMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%f_decomp,'F_DECOMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rh,'RH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%cwd_rh,'CWD_RH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%plant_ag_biomass,'PLANT_AG_BIOMASS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_wflux,'MEAN_WFLUX ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_latflux,'MEAN_LATFLUX ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_hflux,'MEAN_HFLUX ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_runoff,'MEAN_RUNOFF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mean_qrunoff,'MEAN_QRUNOFF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%htry,'HTRY ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%hprev,'HPREV ',dsetrank,iparallel,.false.,foundvar) if(csite%hprev(1) < 1.0d-10)then csite%hprev=csite%htry @@ -2193,106 +2260,106 @@ end subroutine hdf_getslab_i if (associated(csite%dmean_rk4step)) & - call hdf_getslab_r(csite%dmean_rk4step,'DMEAN_RK4STEP ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%dmean_rk4step,'DMEAN_RK4STEP ',dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_rk4step)) & - call hdf_getslab_r(csite%mmean_rk4step,'MMEAN_RK4STEP ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%mmean_rk4step,'MMEAN_RK4STEP ',dsetrank,iparallel,.false.,foundvar) - call hdf_getslab_r(csite%mineralized_N_loss ,'NMIN_LOSS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%mineralized_N_input,'NMIN_INPUT ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%mineralized_N_loss ,'NMIN_LOSS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mineralized_N_input,'NMIN_INPUT ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(csite%ustar ,'USTAR ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%tstar ,'TSTAR ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%qstar ,'QSTAR ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%qstar ,'CSTAR ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%zeta ,'ZETA ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%ribulk ,'RIBULK ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%upwp ,'UPWP ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%tpwp ,'TPWP ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%qpwp ,'QPWP ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%cpwp ,'CPWP ' ,dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%wpwp ,'WPWP ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%ustar ,'USTAR ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%tstar ,'TSTAR ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%qstar ,'QSTAR ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%qstar ,'CSTAR ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%zeta ,'ZETA ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%ribulk ,'RIBULK ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%upwp ,'UPWP ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%tpwp ,'TPWP ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%qpwp ,'QPWP ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%cpwp ,'CPWP ' ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%wpwp ,'WPWP ' ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%par_l_max ,'PAR_L_MAX ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%par_l_beam_max ,'PAR_L_BEAM_MAX ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%par_l_diffuse_max,'PAR_L_DIFFUSE_MAX ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%co2budget_initialstorage ,'CO2BUDGET_INITIALSTORAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_residual ,'CO2BUDGET_RESIDUAL ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_loss2atm ,'CO2BUDGET_LOSS2ATM ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_denseffect ,'CO2BUDGET_DENSEFFECT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_gpp ,'CO2BUDGET_GPP ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_plresp ,'CO2BUDGET_PLRESP ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%co2budget_rh ,'CO2BUDGET_RH ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_initialstorage ,'EBUDGET_INITIALSTORAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_residual ,'EBUDGET_RESIDUAL ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_loss2atm ,'EBUDGET_LOSS2ATM ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_denseffect ,'EBUDGET_DENSEFFECT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_prsseffect ,'EBUDGET_PRSSEFFECT ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) call hdf_getslab_r(csite%ebudget_loss2runoff ,'EBUDGET_LOSS2RUNOFF ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_loss2drainage ,'EBUDGET_LOSS2DRAINAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_netrad ,'EBUDGET_NETRAD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%ebudget_precipgain ,'EBUDGET_PRECIPGAIN ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_initialstorage ,'WBUDGET_INITIALSTORAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_residual ,'WBUDGET_RESIDUAL ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_loss2atm ,'WBUDGET_LOSS2ATM ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_denseffect ,'WBUDGET_DENSEFFECT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_loss2runoff ,'WBUDGET_LOSS2RUNOFF ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_loss2drainage ,'WBUDGET_LOSS2DRAINAGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%wbudget_precipgain ,'WBUDGET_PRECIPGAIN ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(csite%dmean_co2_residual)) & call hdf_getslab_r(csite%dmean_co2_residual , 'DMEAN_CO2_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_water_residual)) & call hdf_getslab_r(csite%dmean_water_residual , 'DMEAN_WATER_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%dmean_energy_residual)) & call hdf_getslab_r(csite%dmean_energy_residual, 'DMEAN_ENERGY_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_co2_residual)) & call hdf_getslab_r(csite%mmean_co2_residual , 'MMEAN_CO2_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_water_residual)) & call hdf_getslab_r(csite%mmean_water_residual , 'MMEAN_WATER_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%mmean_energy_residual)) & call hdf_getslab_r(csite%mmean_energy_residual, 'MMEAN_ENERGY_RESIDUAL_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) @@ -2313,17 +2380,21 @@ end subroutine hdf_getslab_i memoffs(2) = 0 if (associated(csite%qmean_rh)) & - call hdf_getslab_r(csite%qmean_rh,'QMEAN_RH_PA ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%qmean_rh ,'QMEAN_RH_PA ' & + ,dsetrank,iparallel,.true.,foundvar) + if (associated(csite%qmean_cwd_rh)) & + call hdf_getslab_r(csite%qmean_cwd_rh,'QMEAN_CWD_RH_PA ' & + ,dsetrank,iparallel,.true.,foundvar) if (associated(csite%qmean_albedo )) & call hdf_getslab_r(csite%qmean_albedo,'QMEAN_ALBEDO_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%qmean_albedo_beam )) & call hdf_getslab_r(csite%qmean_albedo_beam,'QMEAN_ALBEDO_BEAM_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) if (associated(csite%qmean_albedo_diffuse )) & call hdf_getslab_r(csite%qmean_albedo_diffuse,'QMEAN_ALBEDO_DIFFUSE_PA ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) dsetrank = 2 globdims(1) = int(nzs,8) @@ -2339,14 +2410,14 @@ end subroutine hdf_getslab_i memsize(2) = int(csite%npatches,8) memoffs(2) = 0 - call hdf_getslab_r(csite%sfcwater_mass,'SFCWATER_MASS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sfcwater_energy,'SFCWATER_ENERGY ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sfcwater_depth,'SFCWATER_DEPTH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rshort_s,'RSHORT_S ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rshort_s_beam,'RSHORT_S_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rshort_s_diffuse,'RSHORT_S_DIFFUSE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sfcwater_tempk,'SFCWATER_TEMPK ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%sfcwater_fracliq,'SFCWATER_FRACLIQ ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%sfcwater_mass,'SFCWATER_MASS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sfcwater_energy,'SFCWATER_ENERGY ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sfcwater_depth,'SFCWATER_DEPTH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rshort_s,'RSHORT_S ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rshort_s_beam,'RSHORT_S_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rshort_s_diffuse,'RSHORT_S_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sfcwater_tempk,'SFCWATER_TEMPK ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sfcwater_fracliq,'SFCWATER_FRACLIQ ',dsetrank,iparallel,.true.,foundvar) dsetrank = 2 globdims(1) = int(nzg,8) @@ -2361,12 +2432,12 @@ end subroutine hdf_getslab_i memdims(2) = int(csite%npatches,8) memsize(2) = int(csite%npatches,8) memoffs(2) = 0 - call hdf_getslab_r(csite%soil_energy,'SOIL_ENERGY_PA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%soil_water,'SOIL_WATER_PA ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%soil_energy,'SOIL_ENERGY_PA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%soil_water,'SOIL_WATER_PA ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(csite%soil_tempk,'SOIL_TEMPK_PA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%soil_fracliq,'SOIL_FRACLIQ_PA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%rootdense,'PATCH_ROOT_DENSITY ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%soil_tempk,'SOIL_TEMPK_PA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%soil_fracliq,'SOIL_FRACLIQ_PA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%rootdense,'PATCH_ROOT_DENSITY ',dsetrank,iparallel,.false.,foundvar) !-----------------------------------------------------------------------------------! ! Soil water is double precision, although it may not be DP in the dataset @@ -2390,13 +2461,13 @@ end subroutine hdf_getslab_i ! HELPFUL IF WE CHANGE DATA TYPES ! --------------------------------------------------------------------------------------------- ! if (setsize==4_8) then !Old precision -! call hdf_getslab_r(csite%soil_water,'SOIL_WATER_PA ',dsetrank,iparallel,.true.) +! call hdf_getslab_r(csite%soil_water,'SOIL_WATER_PA ',dsetrank,iparallel,.true.,foundvar) ! else if (setsize==8_8) then ! Newer precision ! allocate(buff(nzg,csite%npatches)) ! write (unit=*,fmt='(a)') '-------------------------------------------------------------------' ! write (unit=*,fmt='(a)') ' Loading 8-byte precision soil water and converting to 4-byte' ! write (unit=*,fmt='(a)') '-------------------------------------------------------------------' -! call hdf_getslab_d(buff,'SOIL_WATER_PA ',dsetrank,iparallel,.true.) +! call hdf_getslab_d(buff,'SOIL_WATER_PA ',dsetrank,iparallel,.true.,foundvar) ! csite%soil_water(1:nzg,1:csite%npatches) = sngl(buff(1:nzg,1:csite%npatches)) ! deallocate(buff) ! else @@ -2420,9 +2491,9 @@ end subroutine hdf_getslab_i memsize(2) = int(csite%npatches,8) memoffs(2) = 0_8 - call hdf_getslab_r(csite%A_o_max,'A_O_MAX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%A_c_max,'A_C_MAX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(csite%repro,'REPRO_PA ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%A_o_max,'A_O_MAX ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%A_c_max,'A_C_MAX ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%repro,'REPRO_PA ',dsetrank,iparallel,.true.,foundvar) dsetrank = 2 @@ -2438,7 +2509,7 @@ end subroutine hdf_getslab_i memdims(2) = int(csite%npatches,8) memsize(2) = int(csite%npatches,8) memoffs(2) = 0_8 - call hdf_getslab_r(csite%co2budget_gpp_dbh,'CO2BUDGET_GPP_DBH ',dsetrank,iparallel,.true.) + call hdf_getslab_r(csite%co2budget_gpp_dbh,'CO2BUDGET_GPP_DBH ',dsetrank,iparallel,.true.,foundvar) dsetrank = 3 globdims(3) = int(npatches_global,8) @@ -2463,7 +2534,7 @@ end subroutine hdf_getslab_i chnkoffs(1) = 0_8 memoffs(1) = 0_8 - call hdf_getslab_r(csite%cumlai_profile,'CUMLAI_PROFILE ',dsetrank,iparallel,.false.) + call hdf_getslab_r(csite%cumlai_profile,'CUMLAI_PROFILE ',dsetrank,iparallel,.false.,foundvar) return end subroutine fill_history_site @@ -2485,26 +2556,29 @@ subroutine fill_history_patch(cpatch,paco_index,ncohorts_global,green_leaf_facto #if USE_INTERF interface - subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_r - subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_d - subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required) + subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required,foundvar) use hdf5_coms,only:memsize integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff integer :: dsetrank,iparallel character(len=*),intent(in) :: varn logical,intent(in) :: required + logical,intent(out) :: foundvar end subroutine hdf_getslab_i end interface #endif @@ -2514,6 +2588,7 @@ end subroutine hdf_getslab_i integer,intent(in) :: ncohorts_global real, dimension(n_pft), intent(in) :: green_leaf_factor integer :: iparallel,dsetrank + logical :: foundvar ! Needed for reconstructing veg_energy if using an old restart ! ------------------------------------------------------------ @@ -2539,38 +2614,43 @@ end subroutine hdf_getslab_i memsize(1) = int(cpatch%ncohorts,8) memoffs(1) = 0_8 - if(cpatch%ncohorts>0) then - - call hdf_getslab_i(cpatch%pft,'PFT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%nplant,'NPLANT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%hite,'HITE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%dbh,'DBH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%agb,'AGB_CO ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%basarea,'BA_CO',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%dagb_dt,'DAGB_DT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%dba_dt,'DBA_DT',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%ddbh_dt,'DDBH_DT',dsetrank,iparallel,.true.) - - call hdf_getslab_r(cpatch%bdead,'BDEAD ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%bleaf,'BLEAF ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpatch%phenology_status,'PHENOLOGY_STATUS ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%balive,'BALIVE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%broot,'BROOT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%bsapwooda,'BSAPWOODA ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%bsapwoodb,'BSAPWOODB ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lai,'LAI_CO ',dsetrank,iparallel,.true.) + if (cpatch%ncohorts > 0) then + + call hdf_getslab_i(cpatch%pft,'PFT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%nplant,'NPLANT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%hite,'HITE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dbh,'DBH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%agb,'AGB_CO ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%basarea,'BA_CO',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dagb_dt,'DAGB_DT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dlnagb_dt,'DLNAGB_DT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dba_dt,'DBA_DT',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dlnba_dt,'DLNBA_DT',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%ddbh_dt,'DDBH_DT',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%dlndbh_dt,'DLNDBH_DT',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_r(cpatch%bdead,'BDEAD ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%bleaf,'BLEAF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%phenology_status,'PHENOLOGY_STATUS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%recruit_dbh,'RECRUIT_DBH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%census_status,'CENSUS_STATUS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%balive,'BALIVE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%broot,'BROOT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%bsapwooda,'BSAPWOODA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%bsapwoodb,'BSAPWOODB ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lai,'LAI_CO ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cpatch%llspan,'LLSPAN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%turnover_amp,'TURNOVER_AMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%vm_bar,'VM_BAR ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%sla,'SLA ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%llspan,'LLSPAN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%turnover_amp,'TURNOVER_AMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%vm_bar,'VM_BAR ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%sla,'SLA ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cpatch%bstorage,'BSTORAGE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%cbr_bar,'CBR_BAR ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%bstorage,'BSTORAGE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%cbr_bar,'CBR_BAR ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cpatch%wai,'WAI_CO ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%wai,'WAI_CO ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cpatch%crown_area,'CROWN_AREA_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%crown_area,'CROWN_AREA_CO ',dsetrank,iparallel,.false.,foundvar) if (all(cpatch%crown_area == 0.)) then do ico= 1,cpatch%ncohorts cpatch%crown_area(ico) = min(1.0, cpatch%nplant(ico) * dbh2ca(cpatch%dbh(ico) & @@ -2578,208 +2658,231 @@ end subroutine hdf_getslab_i end do end if - call hdf_getslab_r(cpatch%leaf_energy,'LEAF_ENERGY ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_hcap,'LEAF_HCAP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_temp,'LEAF_TEMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_temp_pv,'LEAF_TEMP_PV ',dsetrank,iparallel,.false.) - call hdf_getslab_r(cpatch%leaf_water,'LEAF_WATER ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_fliq,'LEAF_FLIQ ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_energy,'WOOD_ENERGY ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_hcap,'WOOD_HCAP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_temp,'WOOD_TEMP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_temp_pv,'WOOD_TEMP_PV ',dsetrank,iparallel,.false.) - call hdf_getslab_r(cpatch%wood_water,'WOOD_WATER ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_fliq,'WOOD_FLIQ ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%veg_wind,'VEG_WIND ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lsfc_co2_open,'LSFC_CO2_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lsfc_co2_closed,'LSFC_CO2_CLOSED ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lsfc_shv_open,'LSFC_SHV_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lsfc_shv_closed,'LSFC_SHV_CLOSED ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lint_shv,'LINT_SHV ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lint_co2_open,'LINT_CO2_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%lint_co2_closed,'LINT_CO2_CLOSED ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%leaf_energy,'LEAF_ENERGY ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_hcap,'LEAF_HCAP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_temp,'LEAF_TEMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_vpdef,'LEAF_VPDEF ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cpatch%leaf_temp_pv,'LEAF_TEMP_PV ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cpatch%leaf_water,'LEAF_WATER ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_fliq,'LEAF_FLIQ ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_energy,'WOOD_ENERGY ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_hcap,'WOOD_HCAP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_temp,'WOOD_TEMP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_temp_pv,'WOOD_TEMP_PV ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cpatch%wood_water,'WOOD_WATER ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_fliq,'WOOD_FLIQ ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%veg_wind,'VEG_WIND ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lsfc_co2_open,'LSFC_CO2_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lsfc_co2_closed,'LSFC_CO2_CLOSED ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lsfc_shv_open,'LSFC_SHV_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lsfc_shv_closed,'LSFC_SHV_CLOSED ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lint_shv,'LINT_SHV ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lint_co2_open,'LINT_CO2_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%lint_co2_closed,'LINT_CO2_CLOSED ',dsetrank,iparallel,.true.,foundvar) - call hdf_getslab_r(cpatch%mean_gpp,'MEAN_GPP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%mean_leaf_resp,'MEAN_LEAF_RESP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%mean_root_resp,'MEAN_ROOT_RESP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%today_leaf_resp,'TODAY_LEAF_RESP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%today_root_resp,'TODAY_ROOT_RESP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%today_gpp,'TODAY_GPP ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%mean_gpp,'MEAN_GPP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%mean_leaf_resp,'MEAN_LEAF_RESP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%mean_root_resp,'MEAN_ROOT_RESP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%today_leaf_resp,'TODAY_LEAF_RESP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%today_root_resp,'TODAY_ROOT_RESP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%today_gpp,'TODAY_GPP ',dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%today_nppleaf )) & - call hdf_getslab_r(cpatch%today_nppleaf ,'TODAY_NPPLEAF ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppleaf ,'TODAY_NPPLEAF ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppfroot )) & - call hdf_getslab_r(cpatch%today_nppfroot,'TODAY_NPPFROOT ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppfroot,'TODAY_NPPFROOT ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppsapwood )) & - call hdf_getslab_r(cpatch%today_nppsapwood ,'TODAY_NPPSAPWOOD ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppsapwood ,'TODAY_NPPSAPWOOD ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppcroot )) & - call hdf_getslab_r(cpatch%today_nppcroot,'TODAY_NPPCROOT ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppcroot,'TODAY_NPPCROOT ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppseeds )) & - call hdf_getslab_r(cpatch%today_nppseeds,'TODAY_NPPSEEDS ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppseeds,'TODAY_NPPSEEDS ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppwood )) & - call hdf_getslab_r(cpatch%today_nppwood ,'TODAY_NPPWOOD ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppwood ,'TODAY_NPPWOOD ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%today_nppdaily )) & - call hdf_getslab_r(cpatch%today_nppdaily,'TODAY_NPPDAILY ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%today_nppdaily,'TODAY_NPPDAILY ',dsetrank,iparallel,.false.,foundvar) - call hdf_getslab_r(cpatch%today_gpp_pot,'TODAY_GPP_POT ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%today_gpp_max,'TODAY_GPP_MAX ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%growth_respiration,'GROWTH_RESPIRATION ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%storage_respiration,'STORAGE_RESPIRATION ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%vleaf_respiration,'VLEAF_RESPIRATION ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%fsn,'FSN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%monthly_dndt,'MONTHLY_DNDT ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%today_gpp_pot,'TODAY_GPP_POT ',dsetrank,iparallel,.true.,foundvar) + + !-------------------------------------------------------------------------------------! + ! Check whether this is a new or old history file. Old history files don't have ! + ! the light and moisture distinction. ! + !-------------------------------------------------------------------------------------! + call hdf_getslab_r(cpatch%today_gpp_lightmax,'TODAY_GPP_MAX ',dsetrank,iparallel & + ,.false.,foundvar) + if (.not. foundvar) then + !---- New history, load the new variables. ----------------------------------------! + call hdf_getslab_r(cpatch%today_gpp_lightmax,'TODAY_GPP_LIGHTMAX ',dsetrank & + ,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%today_gpp_moistmax,'TODAY_GPP_MOISTMAX ',dsetrank & + ,iparallel,.true.,foundvar) + !----------------------------------------------------------------------------------! + else + !---- Old history, make up something for the moisture maximum. --------------------! + cpatch%today_gpp_moistmax(:) = cpatch%today_gpp(:) + !----------------------------------------------------------------------------------! + end if + !-------------------------------------------------------------------------------------! + + + call hdf_getslab_r(cpatch%growth_respiration,'GROWTH_RESPIRATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%storage_respiration,'STORAGE_RESPIRATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%vleaf_respiration,'VLEAF_RESPIRATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%fsn,'FSN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%monthly_dndt,'MONTHLY_DNDT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%monthly_dlnndt,'MONTHLY_DLNNDT ',dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%mmean_gpp )) & - call hdf_getslab_r(cpatch%mmean_gpp,'MMEAN_GPP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_gpp,'MMEAN_GPP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppleaf )) & - call hdf_getslab_r(cpatch%mmean_nppleaf ,'MMEAN_NPPLEAF_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppleaf ,'MMEAN_NPPLEAF_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppfroot )) & - call hdf_getslab_r(cpatch%mmean_nppfroot,'MMEAN_NPPFROOT_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppfroot,'MMEAN_NPPFROOT_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppsapwood )) & - call hdf_getslab_r(cpatch%mmean_nppsapwood ,'MMEAN_NPPSAPWOOD_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppsapwood ,'MMEAN_NPPSAPWOOD_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppcroot )) & - call hdf_getslab_r(cpatch%mmean_nppcroot,'MMEAN_NPPCROOT_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppcroot,'MMEAN_NPPCROOT_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppseeds )) & - call hdf_getslab_r(cpatch%mmean_nppseeds,'MMEAN_NPPSEEDS_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppseeds,'MMEAN_NPPSEEDS_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppwood )) & - call hdf_getslab_r(cpatch%mmean_nppwood ,'MMEAN_NPPWOOD_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppwood ,'MMEAN_NPPWOOD_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_nppdaily )) & - call hdf_getslab_r(cpatch%mmean_nppdaily,'MMEAN_NPPDAILY_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_nppdaily,'MMEAN_NPPDAILY_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_leaf_resp )) & - call hdf_getslab_r(cpatch%mmean_leaf_resp,'MMEAN_LEAF_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_leaf_resp,'MMEAN_LEAF_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_root_resp )) & - call hdf_getslab_r(cpatch%mmean_root_resp,'MMEAN_ROOT_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_root_resp,'MMEAN_ROOT_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_growth_resp )) & - call hdf_getslab_r(cpatch%mmean_growth_resp,'MMEAN_GROWTH_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_growth_resp,'MMEAN_GROWTH_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_storage_resp )) & - call hdf_getslab_r(cpatch%mmean_storage_resp,'MMEAN_STORAGE_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_storage_resp,'MMEAN_STORAGE_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_vleaf_resp )) & - call hdf_getslab_r(cpatch%mmean_vleaf_resp,'MMEAN_VLEAF_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_vleaf_resp,'MMEAN_VLEAF_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_leaf_resp )) & - call hdf_getslab_r(cpatch%dmean_leaf_resp,'DMEAN_LEAF_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_leaf_resp,'DMEAN_LEAF_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_root_resp )) & - call hdf_getslab_r(cpatch%dmean_root_resp,'DMEAN_ROOT_RESP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_root_resp,'DMEAN_ROOT_RESP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_gpp )) & - call hdf_getslab_r(cpatch%dmean_gpp,'DMEAN_GPP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_gpp,'DMEAN_GPP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppleaf )) & - call hdf_getslab_r(cpatch%dmean_nppleaf ,'DMEAN_NPPLEAF_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppleaf ,'DMEAN_NPPLEAF_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppfroot )) & - call hdf_getslab_r(cpatch%dmean_nppfroot,'DMEAN_NPPFROOT_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppfroot,'DMEAN_NPPFROOT_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppsapwood )) & - call hdf_getslab_r(cpatch%dmean_nppsapwood ,'DMEAN_NPPSAPWOOD_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppsapwood ,'DMEAN_NPPSAPWOOD_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppcroot )) & - call hdf_getslab_r(cpatch%dmean_nppcroot,'DMEAN_NPPCROOT_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppcroot,'DMEAN_NPPCROOT_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppseeds )) & - call hdf_getslab_r(cpatch%dmean_nppseeds,'DMEAN_NPPSEEDS_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppseeds,'DMEAN_NPPSEEDS_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppwood )) & - call hdf_getslab_r(cpatch%dmean_nppwood ,'DMEAN_NPPWOOD_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppwood ,'DMEAN_NPPWOOD_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_nppdaily )) & - call hdf_getslab_r(cpatch%dmean_nppdaily,'DMEAN_NPPDAILY_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_nppdaily,'DMEAN_NPPDAILY_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_fs_open )) & - call hdf_getslab_r(cpatch%dmean_fs_open,'DMEAN_FS_OPEN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_fs_open,'DMEAN_FS_OPEN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_fs_open )) & - call hdf_getslab_r(cpatch%mmean_fs_open,'MMEAN_FS_OPEN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_fs_open,'MMEAN_FS_OPEN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_fsw )) & - call hdf_getslab_r(cpatch%dmean_fsw,'DMEAN_FSW_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_fsw,'DMEAN_FSW_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_fsw )) & - call hdf_getslab_r(cpatch%mmean_fsw,'MMEAN_FSW_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_fsw,'MMEAN_FSW_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_fsn )) & - call hdf_getslab_r(cpatch%dmean_fsn,'DMEAN_FSN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_fsn,'DMEAN_FSN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_fsn )) & - call hdf_getslab_r(cpatch%mmean_fsn,'MMEAN_FSN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_fsn,'MMEAN_FSN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_psi_open )) & - call hdf_getslab_r(cpatch%dmean_psi_open,'DMEAN_PSI_OPEN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_psi_open,'DMEAN_PSI_OPEN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_psi_closed )) & - call hdf_getslab_r(cpatch%dmean_psi_closed,'DMEAN_PSI_CLOSED_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_psi_closed,'DMEAN_PSI_CLOSED_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_psi_open )) & - call hdf_getslab_r(cpatch%mmean_psi_open,'MMEAN_PSI_OPEN_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_psi_open,'MMEAN_PSI_OPEN_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_psi_closed )) & - call hdf_getslab_r(cpatch%mmean_psi_closed,'MMEAN_PSI_CLOSED_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_psi_closed,'MMEAN_PSI_CLOSED_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_water_supply )) & - call hdf_getslab_r(cpatch%dmean_water_supply,'DMEAN_WATER_SUPPLY_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_water_supply,'DMEAN_WATER_SUPPLY_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_water_supply )) & - call hdf_getslab_r(cpatch%mmean_water_supply,'MMEAN_WATER_SUPPLY_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_water_supply,'MMEAN_WATER_SUPPLY_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_leaf_maintenance )) & - call hdf_getslab_r(cpatch%mmean_leaf_maintenance,'MMEAN_LEAF_MAINTENANCE ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_leaf_maintenance,'MMEAN_LEAF_MAINTENANCE ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_root_maintenance )) & - call hdf_getslab_r(cpatch%mmean_root_maintenance,'MMEAN_ROOT_MAINTENANCE ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_root_maintenance,'MMEAN_ROOT_MAINTENANCE ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_leaf_drop )) & - call hdf_getslab_r(cpatch%mmean_leaf_drop,'MMEAN_LEAF_DROP_CO ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_leaf_drop,'MMEAN_LEAF_DROP_CO ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_cb )) & - call hdf_getslab_r(cpatch%mmean_cb,'MMEAN_CB ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_cb,'MMEAN_CB ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_light_level )) & - call hdf_getslab_r(cpatch%dmean_light_level,'DMEAN_LIGHT_LEVEL ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_light_level,'DMEAN_LIGHT_LEVEL ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_light_level )) & - call hdf_getslab_r(cpatch%mmean_light_level,'MMEAN_LIGHT_LEVEL ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_light_level,'MMEAN_LIGHT_LEVEL ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_light_level )) & - call hdf_getslab_r(cpatch%dmean_light_level_beam,'DMEAN_LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_light_level_beam,'DMEAN_LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_light_level_beam )) & - call hdf_getslab_r(cpatch%mmean_light_level_beam,'MMEAN_LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_light_level_beam,'MMEAN_LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_light_level_diff )) & - call hdf_getslab_r(cpatch%dmean_light_level_diff,'DMEAN_LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_light_level_diff,'DMEAN_LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_light_level_diff )) & - call hdf_getslab_r(cpatch%mmean_light_level_diff,'MMEAN_LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_light_level_diff,'MMEAN_LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_par_l )) & - call hdf_getslab_r(cpatch%dmean_par_l,'DMEAN_PAR_L ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_par_l,'DMEAN_PAR_L ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_par_l_beam )) & - call hdf_getslab_r(cpatch%dmean_par_l_beam,'DMEAN_PAR_L_BEAM ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_par_l_beam,'DMEAN_PAR_L_BEAM ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%dmean_par_l_diff )) & - call hdf_getslab_r(cpatch%dmean_par_l_diff,'DMEAN_PAR_L_DIFF ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%dmean_par_l_diff,'DMEAN_PAR_L_DIFF ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_par_l )) & - call hdf_getslab_r(cpatch%mmean_par_l,'MMEAN_PAR_L ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_par_l,'MMEAN_PAR_L ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_par_l_beam )) & - call hdf_getslab_r(cpatch%mmean_par_l_beam,'MMEAN_PAR_L_BEAM ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_par_l_beam,'MMEAN_PAR_L_BEAM ',dsetrank,iparallel,.false.,foundvar) if (associated(cpatch%mmean_par_l_diff )) & - call hdf_getslab_r(cpatch%mmean_par_l_diff,'MMEAN_PAR_L_DIFF ',dsetrank,iparallel,.false.) - call hdf_getslab_r(cpatch%Psi_open,'PSI_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpatch%krdepth,'KRDEPTH ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpatch%first_census,'FIRST_CENSUS ',dsetrank,iparallel,.true.) - call hdf_getslab_i(cpatch%new_recruit_flag,'NEW_RECRUIT_FLAG ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%light_level,'LIGHT_LEVEL ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%light_level_beam,'LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%light_level_diff,'LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%par_l,'PAR_L ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%par_l_beam,'PAR_L_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%par_l_diffuse,'PAR_L_DIFFUSE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_l,'RSHORT_L ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_l_beam,'RSHORT_L_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_l_diffuse,'RSHORT_L_DIFFUSE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_l,'RLONG_L ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_l_surf,'RLONG_L_SURF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_l_incid,'RLONG_L_INCID ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_w,'RSHORT_W ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_w_beam,'RSHORT_W_BEAM ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rshort_w_diffuse,'RSHORT_W_DIFFUSE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_w,'RLONG_W ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_w_surf,'RLONG_W_SURF ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%rlong_w_incid,'RLONG_W_INCID ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_gbh,'LEAF_GBH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_gbw,'LEAF_GBW ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_gbh,'WOOD_GBH ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%wood_gbw,'WOOD_GBW ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%A_open,'A_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%A_closed,'A_CLOSED ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%Psi_closed,'PSI_CLOSED ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%gsw_open,'GSW_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%gsw_closed,'GSW_CLOSED ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%fsw,'FSW ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%fs_open,'FS_OPEN ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%water_supply,'WATER_SUPPLY ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%stomatal_conductance,'STOMATAL_CONDUCTANCE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_maintenance,'LEAF_MAINTENANCE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%root_maintenance,'ROOT_MAINTENANCE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_drop,'LEAF_DROP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%bseeds,'BSEEDS_CO ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%leaf_respiration,'LEAF_RESPIRATION ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%root_respiration,'ROOT_RESPIRATION ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%gpp,'GPP ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%paw_avg,'PAW_AVG ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%elongf,'ELONGF ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cpatch%mmean_par_l_diff,'MMEAN_PAR_L_DIFF ',dsetrank,iparallel,.false.,foundvar) + call hdf_getslab_r(cpatch%Psi_open,'PSI_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%krdepth,'KRDEPTH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%first_census,'FIRST_CENSUS ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%new_recruit_flag,'NEW_RECRUIT_FLAG ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%light_level,'LIGHT_LEVEL ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%light_level_beam,'LIGHT_LEVEL_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%light_level_diff,'LIGHT_LEVEL_DIFF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%par_l,'PAR_L ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%par_l_beam,'PAR_L_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%par_l_diffuse,'PAR_L_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_l,'RSHORT_L ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_l_beam,'RSHORT_L_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_l_diffuse,'RSHORT_L_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_l,'RLONG_L ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_l_surf,'RLONG_L_SURF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_l_incid,'RLONG_L_INCID ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_w,'RSHORT_W ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_w_beam,'RSHORT_W_BEAM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rshort_w_diffuse,'RSHORT_W_DIFFUSE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_w,'RLONG_W ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_w_surf,'RLONG_W_SURF ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%rlong_w_incid,'RLONG_W_INCID ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_gbh,'LEAF_GBH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_gbw,'LEAF_GBW ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_gbh,'WOOD_GBH ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%wood_gbw,'WOOD_GBW ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%A_open,'A_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%A_closed,'A_CLOSED ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%Psi_closed,'PSI_CLOSED ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%gsw_open,'GSW_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%gsw_closed,'GSW_CLOSED ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%fsw,'FSW ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%fs_open,'FS_OPEN ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%water_supply,'WATER_SUPPLY ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%stomatal_conductance,'STOMATAL_CONDUCTANCE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_maintenance,'LEAF_MAINTENANCE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%root_maintenance,'ROOT_MAINTENANCE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_drop,'LEAF_DROP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%bseeds,'BSEEDS_CO ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%leaf_respiration,'LEAF_RESPIRATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%root_respiration,'ROOT_RESPIRATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%gpp,'GPP ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%paw_avg,'PAW_AVG ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%elongf,'ELONGF ',dsetrank,iparallel,.false.,foundvar) !----- 13-month dimension (12 previous months + current month). ----------------------! dsetrank = 2 @@ -2798,8 +2901,32 @@ end subroutine hdf_getslab_i memsize(2) = int(cpatch%ncohorts,8) memoffs(2) = 0_8 - call hdf_getslab_r(cpatch%cb,'CB ',dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%cb_max,'CB_MAX ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%cb,'CB ',dsetrank,iparallel,.true.,foundvar) + !-------------------------------------------------------------------------------------! + ! Maximum Carbon balance has changed, so check whether this is an old history. ! + ! In case it is, we copy cb_max to lightmax, and assume cb_moistmax to be 1.0. ! + ! Otherwise, we read in both maxima. ! + !-------------------------------------------------------------------------------------! + call hdf_getslab_r(cpatch%cb_lightmax,'CB_MAX ',dsetrank,iparallel,.false.,foundvar) + if (.not. foundvar) then + !----- New file, both light and moisture are present. Read them instead. ---------! + call hdf_getslab_r(cpatch%cb_lightmax,'CB_LIGHTMAX ',dsetrank,iparallel & + ,.true.,foundvar) + call hdf_getslab_r(cpatch%cb_moistmax,'CB_MOISTMAX ',dsetrank,iparallel & + ,.true.,foundvar) + !----------------------------------------------------------------------------------! + else + !----------------------------------------------------------------------------------! + ! Old file, make up some initial condition to moisture. The only reason why ! + ! the 13th element is not set to 0 is because history files may be from the middle ! + ! of the month, which could mess things up. ! + !----------------------------------------------------------------------------------! + cpatch%cb_moistmax(1:12,:) = 1.0 + cpatch%cb_moistmax( 13,:) = cpatch%cb(13,:) + !----------------------------------------------------------------------------------! + end if + !-------------------------------------------------------------------------------------! + !----- 2-D, dimensioned by the number of mortality rates. ----------------------------! dsetrank = 2 @@ -2818,11 +2945,11 @@ end subroutine hdf_getslab_i memsize(2) = int(cpatch%ncohorts,8) memoffs(2) = 0_8 - call hdf_getslab_r(cpatch%mort_rate,'MORT_RATE_CO ',dsetrank,iparallel,.true.) + call hdf_getslab_r(cpatch%mort_rate,'MORT_RATE_CO ',dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%mmean_mort_rate)) & call hdf_getslab_r(cpatch%mmean_mort_rate,'MMEAN_MORT_RATE_CO ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) !----- 2-D, dimensioned by the number of diurnal cycle times. ------------------------! dsetrank = 2 @@ -2842,51 +2969,51 @@ end subroutine hdf_getslab_i if (associated(cpatch%qmean_gpp)) & call hdf_getslab_r(cpatch%qmean_gpp ,'QMEAN_GPP_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_leaf_resp)) & call hdf_getslab_r(cpatch%qmean_leaf_resp ,'QMEAN_LEAF_RESP_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_root_resp)) & call hdf_getslab_r(cpatch%qmean_root_resp ,'QMEAN_ROOT_RESP_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_par_l)) & call hdf_getslab_r(cpatch%qmean_par_l ,'QMEAN_PAR_L ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_par_l_beam)) & call hdf_getslab_r(cpatch%qmean_par_l_beam ,'QMEAN_PAR_L_BEAM ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_par_l_diff)) & call hdf_getslab_r(cpatch%qmean_par_l_diff ,'QMEAN_PAR_L_DIFF ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_fs_open)) & call hdf_getslab_r(cpatch%qmean_fs_open ,'QMEAN_FS_OPEN_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_fsn)) & call hdf_getslab_r(cpatch%qmean_fsn ,'QMEAN_FSN_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_fsw)) & call hdf_getslab_r(cpatch%qmean_fsw ,'QMEAN_FSW_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_psi_open)) & call hdf_getslab_r(cpatch%qmean_psi_open ,'QMEAN_PSI_OPEN_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_psi_closed)) & call hdf_getslab_r(cpatch%qmean_psi_closed ,'QMEAN_PSI_CLOSED_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) if (associated(cpatch%qmean_water_supply)) & call hdf_getslab_r(cpatch%qmean_water_supply,'QMEAN_WATER_SUPPLY_CO ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) endif @@ -2903,248 +3030,333 @@ end subroutine fill_history_patch !==========================================================================================! !==========================================================================================! -subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required) - - use hdf5 - use hdf5_coms,only:file_id,dset_id,dspace_id,plist_id, & - filespace,memspace, & - globdims,chnkdims,chnkoffs,cnt,stride, & - memdims,memoffs,memsize - - - implicit none - - real,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff +! This routine reads in real variables from HDF5 files. ! +! BUFF -- Where the dataset should be loaded to ! +! VARN -- Variable name as in the HDF5 file ! +! DSETRANK -- Number of dimensions. ! +! IPARALLEL -- Should fortran read data in parallel? (0 = no, 1 = yes) ! +! REQUIRED -- Is this variable required? (.true. = yes, .false. = no) ! +! If a variable is missing and required is set to true, then the model will ! +! crash. If it is missing but required is false, then we initialise the ! +! variable with zeroes and print a big banner to the standard output to ! +! warn the user. ! +! FOUNDVAR -- Output flag that tells whether the variable was found or not. ! +!------------------------------------------------------------------------------------------! +subroutine hdf_getslab_r(buff,varn,dsetrank,iparallel,required,foundvar) + + use hdf5 + use hdf5_coms, only : file_id & ! intent(inout) + , dset_id & ! intent(inout) + , dspace_id & ! intent(inout) + , plist_id & ! intent(inout) + , filespace & ! intent(inout) + , memspace & ! intent(inout) + , globdims & ! intent(inout) + , chnkdims & ! intent(inout) + , chnkoffs & ! intent(inout) + , cnt & ! intent(inout) + , stride & ! intent(inout) + , memdims & ! intent(inout) + , memoffs & ! intent(inout) + , memsize ! intent(inout) + + use ed_misc_coms,only: suppress_h5_warnings - integer :: hdferr,dsetrank - integer :: iparallel - character(len=*),intent(in) :: varn - - ! Some datasets are required during model initialization, such as the state - ! variables like soil, canopy and vegetation energy and mass, although some variables - ! are involved only in diagnostics. If they are missing from the restart dataset, - ! that may compromise diagnostic variables that are being averaged over the current time - ! period, but they will not compromise the transition of the prognostic model state from one - ! simulation to the next. - ! If the dataset is not required, pass it in as a .true. argument - - logical,intent(in) :: required - - ! If the the optional argument is not present, take the conservative stance - ! and make sure that it is "not-not-not-not-required", "not-not-required", or "required". - - call h5dopen_f(file_id,trim(varn), dset_id, hdferr) - if (hdferr /= 0 .and. required ) then - - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - - else if (hdferr /= 0 .and. .not.required ) then - - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' - write (unit=*,fmt='(a)') ' ' - write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' - write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' - write (unit=*,fmt='(a)') ' + his may cause some of your diagnostic output related' - write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' - write (unit=*,fmt='(a)') '' - write (unit=*,fmt='(a)') ' This variable has been specified as:' - write (unit=*,fmt='(a)') ' NOT ABSOUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') '' - - buff=0. - return - - else - - call h5dget_space_f(dset_id,filespace,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & - chnkdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) - if (hdferr /= 0) then - write(unit=*,fmt=*) 'Chnkdims = ',chnkdims - write(unit=*,fmt=*) 'Dsetrank = ',dsetrank - call fatal_error('Could not create the hyperslabs memspace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & - memdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - if (iparallel == 1) then - - call h5dread_f(dset_id, H5T_NATIVE_REAL,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace, & - xfer_prp = plist_id) - - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if + implicit none + !----- Arguments. ----------------------------------------------------------------------! + real(kind=4) , dimension(memsize(1),memsize(2),memsize(3),memsize(4)) & + , intent(inout) :: buff + character(len=*) , intent(in) :: varn + integer , intent(in) :: dsetrank + integer , intent(in) :: iparallel + logical , intent(in) :: required + logical , intent(out) :: foundvar + !----- Local variables. ----------------------------------------------------------------! + integer :: hdferr + !---------------------------------------------------------------------------------------! - else - call h5dread_f(dset_id, H5T_NATIVE_REAL,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace ) - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if + !---------------------------------------------------------------------------------------! + ! Try to open dataset, and save the success/failure flag. ! + !---------------------------------------------------------------------------------------! + call h5dopen_f(file_id,trim(varn), dset_id, hdferr) + foundvar = hdferr == 0 + !---------------------------------------------------------------------------------------! - endif - - ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' - - call h5sclose_f(filespace, hdferr) - call h5sclose_f(memspace , hdferr) - call h5dclose_f(dset_id , hdferr) - - endif - - - return + + !---------------------------------------------------------------------------------------! + ! Check whether the dataset was opened before continuing. ! + !---------------------------------------------------------------------------------------! + if ((.not. foundvar) .and. required ) then + !------------------------------------------------------------------------------------! + ! Variable is required but wasn't found; stop the run. ! + !------------------------------------------------------------------------------------! + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + !------------------------------------------------------------------------------------! + + else if ((.not. foundvar) .and. (.not.required) ) then + !------------------------------------------------------------------------------------! + ! Variable wasn't found but it wasn't required either; initialise buffer with ! + ! zeroes, and warn the user that we are doing this. ! + !------------------------------------------------------------------------------------! + + if(.not.suppress_h5_warnings)then + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' + write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' + write (unit=*,fmt='(a)') ' + his may cause some of your diagnostic output related' + write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' + write (unit=*,fmt='(a)') '' + write (unit=*,fmt='(a)') ' This variable has been specified as:' + write (unit=*,fmt='(a)') ' NOT ABSOUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') '' + end if + + buff(:,:,:,:) = 0. + return + !------------------------------------------------------------------------------------! + + else + !------------------------------------------------------------------------------------! + ! Found the variable, read in the data, checking that every step was success- ! + ! fully done before moving to the next. ! + !------------------------------------------------------------------------------------! + call h5dget_space_f(dset_id,filespace,hdferr) + if (hdferr /= 0) then + call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & + chnkdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) + if (hdferr /= 0) then + write(unit=*,fmt=*) 'Chnkdims = ',chnkdims + write(unit=*,fmt=*) 'Dsetrank = ',dsetrank + call fatal_error('Couldn''t create the hyperslab memspace for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & + memdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + if (iparallel == 1) then + + call h5dread_f(dset_id, H5T_NATIVE_REAL,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace, & + xfer_prp = plist_id) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + else + + call h5dread_f(dset_id, H5T_NATIVE_REAL,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace ) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_r','ed_init_full_history.F90') + end if + + end if + + ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' + + call h5sclose_f(filespace, hdferr) + call h5sclose_f(memspace , hdferr) + call h5dclose_f(dset_id , hdferr) + + end if + return end subroutine hdf_getslab_r +!==========================================================================================! +!==========================================================================================! + + + + + !==========================================================================================! !==========================================================================================! +! This routine reads in double precision variables from HDF5 files. ! +! BUFF -- Where the dataset should be loaded to ! +! VARN -- Variable name as in the HDF5 file ! +! DSETRANK -- Number of dimensions. ! +! IPARALLEL -- Should fortran read data in parallel? (0 = no, 1 = yes) ! +! REQUIRED -- Is this variable required? (.true. = yes, .false. = no) ! +! If a variable is missing and required is set to true, then the model will ! +! crash. If it is missing but required is false, then we initialise the ! +! variable with zeroes and print a big banner to the standard output to ! +! warn the user. ! +! FOUNDVAR -- Output flag that tells whether the variable was found or not. ! +!------------------------------------------------------------------------------------------! +subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required,foundvar) + + use hdf5 + use hdf5_coms, only : file_id & ! intent(inout) + , dset_id & ! intent(inout) + , dspace_id & ! intent(inout) + , plist_id & ! intent(inout) + , filespace & ! intent(inout) + , memspace & ! intent(inout) + , globdims & ! intent(inout) + , chnkdims & ! intent(inout) + , chnkoffs & ! intent(inout) + , cnt & ! intent(inout) + , stride & ! intent(inout) + , memdims & ! intent(inout) + , memoffs & ! intent(inout) + , memsize ! ! intent(inout) + + use ed_misc_coms,only: suppress_h5_warnings + + implicit none + !----- Arguments. ----------------------------------------------------------------------! + real(kind=8) , dimension(memsize(1),memsize(2),memsize(3),memsize(4)) & + , intent(inout) :: buff + character(len=*) , intent(in) :: varn + integer , intent(in) :: dsetrank + integer , intent(in) :: iparallel + logical , intent(in) :: required + logical , intent(out) :: foundvar + !----- Local variables. ----------------------------------------------------------------! + integer :: hdferr + !---------------------------------------------------------------------------------------! -subroutine hdf_getslab_d(buff,varn,dsetrank,iparallel,required) - - use hdf5 - use hdf5_coms,only:file_id,dset_id,dspace_id,plist_id, & - filespace,memspace, & - globdims,chnkdims,chnkoffs,cnt,stride, & - memdims,memoffs,memsize - - - implicit none - - real(kind=8),dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - integer :: hdferr,dsetrank - integer :: iparallel - character(len=*),intent(in) :: varn - ! Some datasets are required during model initialization, such as the state - ! variables like soil, canopy and vegetation energy and mass, although some variables - ! are involved only in diagnostics. If they are missing from the restart dataset, - ! that may compromise diagnostic variables that are being averaged over the current time - ! period, but they will not compromise the transition of the prognostic model state from one - ! simulation to the next. - ! If the dataset is not required, pass it in as a .true. argument + !---------------------------------------------------------------------------------------! + ! Try to open dataset, and save the success/failure flag. ! + !---------------------------------------------------------------------------------------! + call h5dopen_f(file_id,trim(varn), dset_id, hdferr) + foundvar = hdferr == 0 + !---------------------------------------------------------------------------------------! - logical,intent(in) :: required + !---------------------------------------------------------------------------------------! + ! Check whether the dataset was opened before continuing. ! + !---------------------------------------------------------------------------------------! + if ((.not. foundvar) .and. required ) then + !------------------------------------------------------------------------------------! + ! Variable is required but wasn't found; stop the run. ! + !------------------------------------------------------------------------------------! + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + !------------------------------------------------------------------------------------! - call h5dopen_f(file_id,trim(varn), dset_id, hdferr) - if (hdferr /= 0 .and. required ) then + else if ((.not. foundvar) .and. (.not.required) ) then + !------------------------------------------------------------------------------------! + ! Variable wasn't found but it wasn't required either; initialise buffer with ! + ! zeroes, and warn the user that we are doing this. ! + !------------------------------------------------------------------------------------! + if(.not.suppress_h5_warnings)then + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' + write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' + write (unit=*,fmt='(a)') ' + his may cause some of your diagnostic output related' + write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' + write (unit=*,fmt='(a)') '' + write (unit=*,fmt='(a)') ' This variable has been specified as:' + write (unit=*,fmt='(a)') ' NOT ABSOUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') '' + end if + buff(:,:,:,:) = 0.d0 + return + !------------------------------------------------------------------------------------! - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_d','ed_init_full_history.F90') - - else if (hdferr /= 0 .and. .not.required ) then - - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' - write (unit=*,fmt='(a)') ' ' - write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' - write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' - write (unit=*,fmt='(a)') ' + This may cause some of your diagnostic output related' - write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' - write (unit=*,fmt='(a)') '' - write (unit=*,fmt='(a)') ' This variable has been specified as:' - write (unit=*,fmt='(a)') ' NOT ABSOLUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') '' - - buff=0.d0 - return - - else - - call h5dget_space_f(dset_id,filespace,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & - chnkdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) - if (hdferr /= 0) then - write(unit=*,fmt=*) 'Chnkdims = ',chnkdims - write(unit=*,fmt=*) 'Dsetrank = ',dsetrank - call fatal_error('Could not create the hyperslabs memspace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & - memdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - if (iparallel == 1) then - - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace, & - xfer_prp = plist_id) - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - - else - call h5dread_f(dset_id, H5T_NATIVE_DOUBLE,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace ) - - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - endif - - ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' - - call h5sclose_f(filespace, hdferr) - call h5sclose_f(memspace , hdferr) - call h5dclose_f(dset_id , hdferr) + else + !------------------------------------------------------------------------------------! + ! Found the variable, read in the data, checking that every step was success- ! + ! fully done before moving to the next. ! + !------------------------------------------------------------------------------------! + call h5dget_space_f(dset_id,filespace,hdferr) + if (hdferr /= 0) then + call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & + chnkdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if + + call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) + if (hdferr /= 0) then + write(unit=*,fmt=*) 'Chnkdims = ',chnkdims + write(unit=*,fmt=*) 'Dsetrank = ',dsetrank + call fatal_error('Couldn''t create the hyperslab memspace for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & + memdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if + + if (iparallel == 1) then + + call h5dread_f(dset_id, H5T_NATIVE_DOUBLE,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace, & + xfer_prp = plist_id) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if - endif - + else - return + call h5dread_f(dset_id, H5T_NATIVE_DOUBLE,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace ) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_d','ed_init_full_history.F90') + end if + + end if + + ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' + + call h5sclose_f(filespace, hdferr) + call h5sclose_f(memspace , hdferr) + call h5dclose_f(dset_id , hdferr) + + end if + return end subroutine hdf_getslab_d !==========================================================================================! !==========================================================================================! @@ -3152,119 +3364,166 @@ end subroutine hdf_getslab_d + + !==========================================================================================! !==========================================================================================! -subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required) - - use hdf5 - use hdf5_coms,only:file_id,dset_id,dspace_id,plist_id, & - filespace,memspace, & - globdims,chnkdims,chnkoffs,cnt,stride, & - memdims,memoffs,memsize - - implicit none - - integer,dimension(memsize(1),memsize(2),memsize(3),memsize(4)) :: buff - - integer :: hdferr,dsetrank - integer :: iparallel - character(len=*),intent(in) :: varn - ! Some datasets are required during model initialization, such as the state - ! variables like soil, canopy and vegetation energy and mass, although some variables - ! are involved only in diagnostics. If they are missing from the restart dataset, - ! that may compromise diagnostic variables that are being averaged over the current time - ! period, but they will not compromise the transition of the prognostic model state from one - ! simulation to the next. - ! If the dataset is not required, pass it in as a .true. argument - - logical,intent(in) :: required - - call h5dopen_f(file_id,trim(varn), dset_id, hdferr) - if (hdferr /= 0 .and. required ) then - - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - - else if (hdferr /= 0 .and. .not.required ) then - - write(unit=*,fmt=*) 'File_ID = ',file_id - write(unit=*,fmt=*) 'Dset_ID = ',dset_id - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' - write (unit=*,fmt='(a)') ' ' - write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' - write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' - write (unit=*,fmt='(a)') ' + This may cause some of your diagnostic output related' - write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' - write (unit=*,fmt='(a)') '' - write (unit=*,fmt='(a)') ' This variable has been specified as:' - write (unit=*,fmt='(a)') ' NOT ABSOLUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' - write (unit=*,fmt='(a)') '-----------------------------------------------------------' - write (unit=*,fmt='(a)') '' - - buff=0 - return - - else - - call h5dget_space_f(dset_id,filespace,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - endif - - call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & - chnkdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - endif - - call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) - if (hdferr /= 0) then - write(unit=*,fmt=*) 'Chnkdims = ',chnkdims - write(unit=*,fmt=*) 'Dsetrank = ',dsetrank - call fatal_error('Could not create the hyperslabs memspace for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - endif - - call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & - memdims,hdferr) - if (hdferr /= 0) then - call fatal_error('Could not assign the hyperslabs filespace for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - end if +! This routine reads in integer variables from HDF5 files. ! +! BUFF -- Where the dataset should be loaded to ! +! VARN -- Variable name as in the HDF5 file ! +! DSETRANK -- Number of dimensions. ! +! IPARALLEL -- Should fortran read data in parallel? (0 = no, 1 = yes) ! +! REQUIRED -- Is this variable required? (.true. = yes, .false. = no) ! +! If a variable is missing and required is set to true, then the model will ! +! crash. If it is missing but required is false, then we initialise the ! +! variable with zeroes and print a big banner to the standard output to ! +! warn the user. ! +! FOUNDVAR -- Output flag that tells whether the variable was found or not. ! +!------------------------------------------------------------------------------------------! +subroutine hdf_getslab_i(buff,varn,dsetrank,iparallel,required,foundvar) + + use hdf5 + use hdf5_coms, only : file_id & ! intent(inout) + , dset_id & ! intent(inout) + , dspace_id & ! intent(inout) + , plist_id & ! intent(inout) + , filespace & ! intent(inout) + , memspace & ! intent(inout) + , globdims & ! intent(inout) + , chnkdims & ! intent(inout) + , chnkoffs & ! intent(inout) + , cnt & ! intent(inout) + , stride & ! intent(inout) + , memdims & ! intent(inout) + , memoffs & ! intent(inout) + , memsize ! ! intent(inout) + + use ed_misc_coms,only: suppress_h5_warnings + implicit none + !----- Arguments. ----------------------------------------------------------------------! + integer , dimension(memsize(1),memsize(2),memsize(3),memsize(4)) & + , intent(inout) :: buff + character(len=*) , intent(in) :: varn + integer , intent(in) :: dsetrank + integer , intent(in) :: iparallel + logical , intent(in) :: required + logical , intent(out) :: foundvar + !----- Local variables. ----------------------------------------------------------------! + integer :: hdferr + !---------------------------------------------------------------------------------------! - if (iparallel == 1) then - - call h5dread_f(dset_id, H5T_NATIVE_INTEGER,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace, & - xfer_prp = plist_id) - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_i','ed_init_full_history.F90') - end if - - else - call h5dread_f(dset_id, H5T_NATIVE_INTEGER,buff,globdims, hdferr, & - mem_space_id = memspace, file_space_id = filespace ) - if (hdferr /= 0) then - call fatal_error('Could not read in the hyperslab dataset for '//trim(varn)//'!!!' & - ,'hdf_getslab_r','ed_init_full_history.F90') - end if - end if - - ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' - - call h5sclose_f(filespace, hdferr) - call h5sclose_f(memspace, hdferr) - call h5dclose_f(dset_id, hdferr) - endif - - return + + !---------------------------------------------------------------------------------------! + ! Try to open dataset, and save the success/failure flag. ! + !---------------------------------------------------------------------------------------! + call h5dopen_f(file_id,trim(varn), dset_id, hdferr) + foundvar = hdferr == 0 + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Check whether the dataset was opened before continuing. ! + !---------------------------------------------------------------------------------------! + if ((.not. foundvar) .and. required ) then + !------------------------------------------------------------------------------------! + ! Variable is required but wasn't found; stop the run. ! + !------------------------------------------------------------------------------------! + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + call fatal_error('Could not get the dataset for '//trim(varn)//'!!!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + !------------------------------------------------------------------------------------! + + else if ((.not. foundvar) .and. (.not.required) ) then + !------------------------------------------------------------------------------------! + ! Variable wasn't found but it wasn't required either; initialise buffer with ! + ! zeroes, and warn the user that we are doing this. ! + !------------------------------------------------------------------------------------! + if(.not.suppress_h5_warnings)then + write(unit=*,fmt=*) 'File_ID = ',file_id + write(unit=*,fmt=*) 'Dset_ID = ',dset_id + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' ' + write (unit=*,fmt='(a)') ' + Variable '//trim(varn)//' not found in your history.' + write (unit=*,fmt='(a)') ' + Initializing this variable with zero. ' + write (unit=*,fmt='(a)') ' + his may cause some of your diagnostic output related' + write (unit=*,fmt='(a)') ' to this variable to be incorrect the current period.' + write (unit=*,fmt='(a)') '' + write (unit=*,fmt='(a)') ' This variable has been specified as:' + write (unit=*,fmt='(a)') ' NOT ABSOUTELY NECESSARY TO RESTART THE PROGNOSTIC STATE' + write (unit=*,fmt='(a)') '----------------------------------------------------------' + write (unit=*,fmt='(a)') '' + end if + buff(:,:,:,:) = 0 + return + !------------------------------------------------------------------------------------! + + else + !------------------------------------------------------------------------------------! + ! Found the variable, read in the data, checking that every step was success- ! + ! fully done before moving to the next. ! + !------------------------------------------------------------------------------------! + call h5dget_space_f(dset_id,filespace,hdferr) + if (hdferr /= 0) then + call fatal_error('Could not get the hyperslabs filespace for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(filespace,H5S_SELECT_SET_F,chnkoffs, & + chnkdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + call h5screate_simple_f(dsetrank,memsize,memspace,hdferr) + if (hdferr /= 0) then + write(unit=*,fmt=*) 'Chnkdims = ',chnkdims + write(unit=*,fmt=*) 'Dsetrank = ',dsetrank + call fatal_error('Couldn''t create the hyperslab memspace for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + call h5sselect_hyperslab_f(memspace,H5S_SELECT_SET_F,memoffs, & + memdims,hdferr) + if (hdferr /= 0) then + call fatal_error('Couldn''t assign the hyperslab filespace for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + if (iparallel == 1) then + + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace, & + xfer_prp = plist_id) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + else + + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,buff,globdims, hdferr, & + mem_space_id = memspace, file_space_id = filespace ) + + if (hdferr /= 0) then + call fatal_error('Couldn''t read in hyperslab dataset for '//trim(varn)//'!' & + ,'hdf_getslab_i','ed_init_full_history.F90') + end if + + end if + + ! write(unit=*,fmt='(a)') 'History start: Loading '//trim(varn)//'...' + + call h5sclose_f(filespace, hdferr) + call h5sclose_f(memspace , hdferr) + call h5dclose_f(dset_id , hdferr) + + end if + return end subroutine hdf_getslab_i !==========================================================================================! !==========================================================================================! diff --git a/ED/src/io/ed_load_namelist.f90 b/ED/src/io/ed_load_namelist.f90 index 7bc8f07ab..324dc573a 100644 --- a/ED/src/io/ed_load_namelist.f90 +++ b/ED/src/io/ed_load_namelist.f90 @@ -60,6 +60,7 @@ subroutine copy_nl(copy_type) , isoilstateinit & ! intent(out) , isoildepthflg & ! intent(out) , isoilbc & ! intent(out) + , sldrain & ! intent(out) , soilstate_db & ! intent(out) , soildepth_db & ! intent(out) , runoff_time & ! intent(out) @@ -91,6 +92,8 @@ subroutine copy_nl(copy_type) , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) , h2o_plant_lim & ! intent(out) + , iddmort_scheme & ! intent(out) + , ddmort_const & ! intent(out) , n_plant_lim & ! intent(out) , vmfact_c3 & ! intent(out) , vmfact_c4 & ! intent(out) @@ -116,7 +119,6 @@ subroutine copy_nl(copy_type) , lwidth_nltree & ! intent(out) , q10_c3 & ! intent(out) , q10_c4 & ! intent(out) - , lturnover_grass & ! intent(out) , quantum_efficiency_T ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -129,7 +131,7 @@ subroutine copy_nl(copy_type) , radslp & ! intent(out) , thetacrit ! ! intent(out) use decomp_coms , only : n_decomp_lim & ! intent(out) - , LloydTaylor ! ! intent(out) + , decomp_scheme ! ! intent(out) use disturb_coms , only : include_fire & ! intent(out) , fire_parameter & ! intent(out) , ianth_disturb & ! intent(out) @@ -239,7 +241,11 @@ subroutine copy_nl(copy_type) , ipercol & ! intent(out) , rk4_tolerance ! ! intent(out) use ed_para_coms , only : loadmeth ! ! intent(out) - use detailed_coms , only : idetailed & ! intent(out) + use detailed_coms , only : dt_census & ! intent(out) + , yr1st_census & ! intent(out) + , mon1st_census & ! intent(out) + , min_recruit_dbh & ! intent(out) + , idetailed & ! intent(out) , patch_keep ! ! intent(out) use consts_coms , only : vonk & ! intent(in) , day_sec & ! intent(in) @@ -324,6 +330,7 @@ subroutine copy_nl(copy_type) isoilstateinit = nl%isoilstateinit isoildepthflg = nl%isoildepthflg isoilbc = nl%isoilbc + sldrain = nl%sldrain n_poi = nl%n_poi n_ed_region = nl%n_ed_region @@ -359,6 +366,8 @@ subroutine copy_nl(copy_type) clump_tree = nl%clump_tree clump_grass = nl%clump_grass h2o_plant_lim = nl%h2o_plant_lim + iddmort_scheme = nl%iddmort_scheme + ddmort_const = nl%ddmort_const vmfact_c3 = nl%vmfact_c3 vmfact_c4 = nl%vmfact_c4 mphoto_trc3 = nl%mphoto_trc3 @@ -383,7 +392,6 @@ subroutine copy_nl(copy_type) lwidth_nltree = nl%lwidth_nltree q10_c3 = nl%q10_c3 q10_c4 = nl%q10_c4 - lturnover_grass = nl%lturnover_grass thetacrit = nl%thetacrit quantum_efficiency_T = nl%quantum_efficiency_T radint = nl%radint @@ -394,10 +402,8 @@ subroutine copy_nl(copy_type) fire_parameter = nl%fire_parameter sm_fire = nl%sm_fire ianth_disturb = nl%ianth_disturb + decomp_scheme = nl%decomp_scheme - !----- Decomp_scheme is not a true ED variable, we save it in LloydTaylor instead. --! - LloydTaylor = nl%decomp_scheme == 1 - icanturb = nl%icanturb isfclyrm = nl%isfclyrm ied_grndvap = nl%ied_grndvap @@ -452,6 +458,10 @@ subroutine copy_nl(copy_type) ioptinpt = nl%ioptinpt zrough = nl%zrough + dt_census = nl%dt_census + yr1st_census = nl%yr1st_census + mon1st_census = nl%mon1st_census + min_recruit_dbh = nl%min_recruit_dbh idetailed = nl%idetailed patch_keep = nl%patch_keep diff --git a/ED/src/io/ed_opspec.F90 b/ED/src/io/ed_opspec.F90 index 019f08da5..0e5414866 100644 --- a/ED/src/io/ed_opspec.F90 +++ b/ED/src/io/ed_opspec.F90 @@ -1138,12 +1138,15 @@ subroutine ed_opspec_misc , isoilstateinit & ! intent(in) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) + , sldrain & ! intent(in) , zrough & ! 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) , h2o_plant_lim & ! intent(in) + , iddmort_scheme & ! intent(in) + , ddmort_const & ! intent(in) , n_plant_lim & ! intent(in) , vmfact_c3 & ! intent(in) , vmfact_c4 & ! intent(in) @@ -1170,7 +1173,8 @@ subroutine ed_opspec_misc , q10_c3 & ! intent(in) , q10_c4 & ! intent(in) , quantum_efficiency_T ! ! intent(in) - use decomp_coms , only : n_decomp_lim ! ! intent(in) + use decomp_coms , only : n_decomp_lim & ! intent(in) + , decomp_scheme ! ! intent(in) use disturb_coms , only : include_fire & ! intent(in) , fire_parameter & ! intent(in) , ianth_disturb & ! intent(in) @@ -1202,7 +1206,11 @@ subroutine ed_opspec_misc , rk4_tolerance ! ! intent(in) use mem_polygons , only : n_ed_region & ! intent(in) , n_poi ! ! intent(in) - use detailed_coms , only : idetailed & ! intent(in) + use detailed_coms , only : dt_census & ! intent(in) + , yr1st_census & ! intent(in) + , mon1st_census & ! intent(in) + , min_recruit_dbh & ! intent(in) + , idetailed & ! intent(in) , patch_keep ! ! intent(in) use met_driver_coms , only : imetrad ! ! intent(in) @@ -1334,7 +1342,8 @@ subroutine ed_opspec_misc write (unit=*,fmt='(a)') ' simulations only. If that''s not what you wanted, change ' write (unit=*,fmt='(a)') ' your IED_INIT_MODE variable on your ED2IN. ' write (unit=*,fmt='(a)') '===========================================================' - elseif ((ied_init_mode < -1 .or. ied_init_mode > 6) .and. ied_init_mode /= 99 ) then + elseif ((ied_init_mode < -1 .or. ied_init_mode > 6) .and. & + (ied_init_mode /= 99 )) then write (reason,fmt='(a,1x,i4,a)') & 'Invalid IED_INIT_MODE, it must be between -1 and 6. Yours is set to' & ,ied_init_mode,'...' @@ -1342,6 +1351,16 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if + + + if (ied_init_mode == 7 .and. isoilstateinit>0 ) then + write (reason,fmt='(a)') & + 'Please set ISOILSTATEINIT=0 if using IED_INIT_MODE=7' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + #if defined(COUPLED) do ifm=1,ngrids if (isoilflg(ifm) < 0 .or. isoilflg(ifm) > 3) then @@ -1473,9 +1492,14 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if - if (isoilbc < 0 .or. isoilbc > 4) then + if (isoilbc < 0 .or. isoilbc > 3) then write (reason,fmt='(a,1x,i4,a)') & - 'Invalid ISOILBC, it must be between 0 and 4. Yours is set to',isoilbc,'...' + 'Invalid ISOILBC, it must be between 0 and 3. Yours is set to',isoilbc,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + else if(isoilbc == 2 .and. (sldrain < 0. .or. sldrain > 90.)) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid SLDRAIN, it must be between 0 and 90. Yours is set to',sldrain,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 end if @@ -1559,6 +1583,13 @@ subroutine ed_opspec_misc ,igrass,'...' call opspec_fatal(reason,'opspec_misc') ifaterr = ifaterr +1 + elseif (igrass == 1 .and. ibigleaf == 1) then + write (reason,fmt='(a,1x,a)') & + 'Invalid setting. New grass allometry (IGRASS = 1) is not supported' & + ,'in big leaf ED (IBIGLEAF = 1)...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if if (iphen_scheme < -1 .or. iphen_scheme > 3) then @@ -1600,6 +1631,22 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if + if (iddmort_scheme < 0 .or. iddmort_scheme > 1) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid IDDMORT_SCHEME, it must be between 0 and 1. Yours is set to' & + ,iddmort_scheme,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + + if (ddmort_const < 0. .or. ddmort_const > 1.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid DDMORT_CONST, it must be between 0 and 1. Yours is set to' & + ,ddmort_const,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + if (vmfact_c3 < 0.01 .or. vmfact_c3 > 100.) then write (reason,fmt='(a,1x,es12.5,a)') & 'Invalid VMFACT_C3, it must be between 0.01 and 100. Yours is set to' & @@ -1824,6 +1871,14 @@ subroutine ed_opspec_misc ifaterr = ifaterr +1 end if + if (decomp_scheme < 0 .or. decomp_scheme > 2) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid DECOMP_SCHEME, it must be between 0 and 2. Yours is set to' & + ,decomp_scheme,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + if (include_fire < 0 .or. include_fire > 3) then write (reason,fmt='(a,1x,i4,a)') & 'Invalid INCLUDE_FIRE, it must be between 0 and 3. Yours is set to' & @@ -1840,14 +1895,26 @@ subroutine ed_opspec_misc end if end if - - 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 -3.1 and 1. Yours is set to' & - ,sm_fire,'...' - call opspec_fatal(reason,'opspec_misc') - ifaterr = ifaterr +1 - end if + select case (include_fire) + case(3) + if (sm_fire < 0.) then + write (reason,fmt='(a,1x,a,1x,i4,a,1x,es12.5,a)') & + 'Invalid SM_FIRE, it must be non-negative' & + ,'when INLCUDE_FIRE is ',include_fire,'. Your SM_FIRE is set to' & + ,sm_fire,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + case(0:2) + if (sm_fire < -3.1 .or. sm_fire > 1.) then + write (reason,fmt='(a,1x,a,1x,i4,a,1x,es12.5,a)') & + 'Invalid SM_FIRE, it must be between -3.1 and 1.0' & + ,'when INLCUDE_FIRE is ',include_fire,'. Your SM_FIRE is set to' & + ,sm_fire,'...' + call opspec_fatal(reason,'opspec_misc') + ifaterr = ifaterr +1 + end if + end select if (ianth_disturb < 0 .or. ianth_disturb > 1) then write (reason,fmt='(a,1x,i4,a)') & @@ -2210,6 +2277,38 @@ subroutine ed_opspec_misc call opspec_fatal(reason,'opspec_misc') end if + if (dt_census < 1 .or. dt_census > 120) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid DT_CENSUS, it must be between 1 and 120. Yours is set to' & + ,dt_census,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (yr1st_census < 1200 .or. yr1st_census > 3200) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid YR1ST_CENSUS, it must be between 1200 and 3200. Yours is set to' & + ,yr1st_census,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (mon1st_census < 1 .or. mon1st_census > 12) then + write (reason,fmt='(a,1x,i4,a)') & + 'Invalid MON1ST_CENSUS, it must be between 1 and 12. Yours is set to' & + ,mon1st_census,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + + if (min_recruit_dbh < 0 .or. min_recruit_dbh > 100.) then + write (reason,fmt='(a,1x,es12.5,a)') & + 'Invalid MIN_RECRUIT_DBH, it must be between 0 and 100. Yours is set to' & + ,min_recruit_dbh,'...' + ifaterr = ifaterr +1 + call opspec_fatal(reason,'opspec_misc') + end if + if (idetailed < 0 .or. idetailed > 63) then write (reason,fmt='(a,1x,i4,a)') & diff --git a/ED/src/io/ed_read_ed10_20_history.f90 b/ED/src/io/ed_read_ed10_20_history.f90 index d12ab20f0..1f964549e 100644 --- a/ED/src/io/ed_read_ed10_20_history.f90 +++ b/ED/src/io/ed_read_ed10_20_history.f90 @@ -44,9 +44,7 @@ subroutine read_ed10_ed20_history_file use grid_coms , only : ngrids ! ! intent(in) use allometry , only : bd2dbh & ! function , dbh2h & ! function - , h2dbh & ! function , dbh2bd & ! function - , dbh2bl & ! function , size2bl & ! function , ed_biomass & ! function , area_indices ! ! subroutine @@ -541,7 +539,7 @@ subroutine read_ed10_ed20_history_file !----- No carbon balance information. Assign 1. ---------------------------! cb(1:12,ic) = 1.0 - cb_max(1:12,ic) = 1.0 + cb_max(1:12,ic) = 1.0 end select !------------------------------------------------------------------------------! @@ -729,11 +727,18 @@ subroutine read_ed10_ed20_history_file ,cpatch%lai(ic2), cpatch%wai(ic2) & ,cpatch%crown_area(ic2),cpatch%bsapwooda(ic2)) - !----- Initialise the carbon balance. -----------------------------! - cpatch%cb (1:12,ic2) = cb(1:12,ic) - cpatch%cb_max(1:12,ic2) = cb_max(1:12,ic) - cpatch%cb ( 13,ic2) = 0.0 - cpatch%cb_max( 13,ic2) = 0.0 + !------------------------------------------------------------------! + ! Initialise the carbon balance. We ignore the carbon balance ! + ! even for ED-1.0, the models are so different that there is no ! + ! reason to use the stored value. ! + !------------------------------------------------------------------! + cpatch%cb (1:12,ic2) = 1.0 + cpatch%cb_lightmax(1:12,ic2) = 1.0 + cpatch%cb_moistmax(1:12,ic2) = 1.0 + cpatch%cb ( 13,ic2) = 0.0 + cpatch%cb_lightmax( 13,ic2) = 0.0 + cpatch%cb_moistmax( 13,ic2) = 0.0 + !------------------------------------------------------------------! !----- Above ground biomass, use the allometry. -------------------! cpatch%agb(ic2) = ed_biomass(cpatch%bdead(ic2),cpatch%bleaf(ic2) & @@ -741,9 +746,12 @@ subroutine read_ed10_ed20_history_file cpatch%basarea(ic2) = pio4 * cpatch%dbh(ic2) * cpatch%dbh(ic2) !----- Growth rates, start with zero. -----------------------------! - cpatch%dagb_dt(ic2) = 0. - cpatch%dba_dt(ic2) = 0. - cpatch%ddbh_dt(ic2) = 0. + cpatch%dagb_dt (ic2) = 0. + cpatch%dlnagb_dt(ic2) = 0. + cpatch%dba_dt (ic2) = 0. + cpatch%dlnba_dt (ic2) = 0. + cpatch%ddbh_dt (ic2) = 0. + cpatch%dlndbh_dt(ic2) = 0. !------------------------------------------------------------------! ! Initialise other cohort variables. Some of them won't be ! diff --git a/ED/src/io/ed_read_ed21_history.F90 b/ED/src/io/ed_read_ed21_history.F90 index cf31d5671..936ffe803 100644 --- a/ED/src/io/ed_read_ed21_history.F90 +++ b/ED/src/io/ed_read_ed21_history.F90 @@ -29,6 +29,7 @@ subroutine read_ed21_history_file , imonthh & ! intent(in) , iyearh & ! intent(in) , idateh & ! intent(in) + , igrass & ! intent(in) , itimeh ! ! intent(in) use ed_state_vars , only : polygontype & ! variable type , sitetype & ! variable type @@ -56,8 +57,7 @@ subroutine read_ed21_history_file , bd2dbh & ! function , size2bl & ! function , dbh2h & ! function - , dbh2bd & ! function - , dbh2bl ! ! function + , dbh2bd ! ! function use fuse_fiss_utils, only : terminate_cohorts ! ! subroutine implicit none @@ -110,6 +110,7 @@ subroutine read_ed21_history_file real :: elim_lai real :: salloc real :: salloci + logical :: foundvar !----- Local constants. ----------------------------------------------------------------! real , parameter :: tiny_biomass = 1.e-20 !----- External function. --------------------------------------------------------------! @@ -328,9 +329,9 @@ subroutine read_ed21_history_file memsize(1) = 1_8 !---- 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.) + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cgrid%ncol_soil(ipy:ipy),'NCOL_SOIL ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.,foundvar) !----- Load the workload (2D). ---------------------------------------------------! dsetrank = 2 @@ -346,7 +347,8 @@ subroutine read_ed21_history_file memdims(2) = 1_8 memsize(2) = 1_8 memoffs(2) = 0_8 - call hdf_getslab_r(cgrid%workload(:,ipy),'WORKLOAD ',dsetrank,iparallel,.false.) + call hdf_getslab_r(cgrid%workload(:,ipy),'WORKLOAD ',dsetrank,iparallel,.false. & + ,foundvar) !---------------------------------------------------------------------------------! @@ -366,7 +368,7 @@ subroutine read_ed21_history_file 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.) + ,iparallel,.true.,foundvar) !----- Now fill the soil column based on the top layer data. ---------------------! do k=1,nzg-1 cgrid%ntext_soil(k,ipy) = cgrid%ntext_soil(nzg,ipy) @@ -385,7 +387,7 @@ subroutine read_ed21_history_file memdims(1) = int(pysi_n(py_index),8) memsize(1) = int(pysi_n(py_index),8) memoffs(1) = 0_8 - call hdf_getslab_i(islakesite,'ISLAKESITE ',dsetrank,iparallel,.false.) + call hdf_getslab_i(islakesite,'ISLAKESITE ',dsetrank,iparallel,.false.,foundvar) ndry_sites = int(pysi_n(py_index))-sum(islakesite) !---------------------------------------------------------------------------------! @@ -425,23 +427,23 @@ subroutine read_ed21_history_file memoffs(1) = 0_8 call hdf_getslab_r( cpoly%area (is:is), 'AREA_SI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%moist_f (is:is), 'MOIST_F ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%moist_W (is:is), 'MOIST_W ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%elevation (is:is), 'ELEVATION ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%slope (is:is), 'SLOPE ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%aspect (is:is), 'ASPECT ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( cpoly%TCI (is:is), 'TCI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_i( cpoly%patch_count(is:is), 'PATCH_COUNT ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_i( cpoly%ncol_soil (is:is), 'NCOL_SOIL_SI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) !----- Load 2D dataset. ----------------------------------------------------! dsetrank = 2_8 @@ -459,7 +461,7 @@ subroutine read_ed21_history_file memsize(2) = int(1,8) memoffs(2) = 0_8 call hdf_getslab_i(cpoly%ntext_soil(nzg:nzg,is:is),'NTEXT_SOIL_SI ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) @@ -502,30 +504,30 @@ subroutine read_ed21_history_file memoffs(1) = 0 call hdf_getslab_i(csite%dist_type ,'DIST_TYPE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%age ,'AGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%area ,'AREA ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%sum_dgd ,'SUM_DGD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%sum_chd ,'SUM_CHD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(csite%plantation,'PLANTATION ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%fast_soil_C ,'FAST_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%slow_soil_C ,'SLOW_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%fast_soil_N ,'FAST_SOIL_N ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%structural_soil_C ,'STRUCTURAL_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%structural_soil_L ,'STRUCTURAL_SOIL_L ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%mineralized_soil_N,'MINERALIZED_SOIL_N ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) !------------------------------------------------------------------------! @@ -572,13 +574,13 @@ subroutine read_ed21_history_file memoffs(1) = 0_8 call hdf_getslab_r(cpatch%dbh ,'DBH ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpatch%bdead ,'BDEAD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(cpatch%pft ,'PFT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpatch%nplant,'NPLANT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) !------------------------------------------------------------------! ! Find derived properties from Bdead. In the unlikely case ! @@ -588,16 +590,29 @@ subroutine read_ed21_history_file do ico=1,cpatch%ncohorts ipft = cpatch%pft(ico) - if (cpatch%bdead(ico) > 0.0) then + if (igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdead(ico)>0.0) then + !-- if the initial file was running with igrass = 0, bdead ! + ! should be nonzero. If the new run has igrass = 1, bdead ! + ! is set to zero and that biomass is discarded ! + cpatch%dbh(ico) = max(cpatch%dbh(ico),min_dbh(ipft)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdead(ico) = 0.0 + + else if (cpatch%bdead(ico) > 0.0 .and. igrass == 0) then + ! grasses have bdead in both input and current run (igrass=0) 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) = bd2dbh(ipft,cpatch%bdead(ico)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + else + ! it is either a new grass (igrass=1) in the initial file, ! + ! or the value for bdead is missing from the files ! 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)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdead(ico) = dbh2bd(cpatch%dbh (ico),ipft) end if + cpatch%bleaf(ico) = size2bl(cpatch%dbh(ico),cpatch%hite(ico) & ,cpatch%pft(ico)) @@ -613,38 +628,52 @@ subroutine read_ed21_history_file * (1.-agf_bs(ipft)) cpatch%bstorage(ico) = 0.0 cpatch%phenology_status(ico) = 0 + + end do - !----- Then the 2-D variables. ------------------------------------! - dsetrank = 2 - globdims(1) = 13_8 - chnkdims(1) = 13_8 - chnkoffs(1) = 0_8 - memdims(1) = 13_8 - memsize(1) = 13_8 - memoffs(2) = 0_8 - globdims(2) = int(dset_ncohorts_global,8) - chnkdims(2) = int(cpatch%ncohorts,8) - chnkoffs(2) = int(paco_id(pa_index) - 1,8) - memdims(2) = int(cpatch%ncohorts,8) - memsize(2) = int(cpatch%ncohorts,8) - memoffs(2) = 0_8 - - call hdf_getslab_r(cpatch%cb ,'CB ' & - ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%cb_max,'CB_MAX ' & - ,dsetrank,iparallel,.true.) - + + !------------------------------------------------------------------! + ! Carbon balance variables. ! + ! MLO. I commented this out because a restart is likely to have ! + ! different settings and different environment, so it's ! + ! likely that the system will reach a different equilibrium. ! + ! For simplicity, we just use the typical initialisation in ! + ! which we give plants one year to adjust to the new ! + ! conditions. ! !------------------------------------------------------------------! - ! The following variables are initialised with default values. ! + ! dsetrank = 2 + ! globdims(1) = 13_8 + ! chnkdims(1) = 13_8 + ! chnkoffs(1) = 0_8 + ! memdims(1) = 13_8 + ! memsize(1) = 13_8 + ! memoffs(2) = 0_8 + ! globdims(2) = int(dset_ncohorts_global,8) + ! chnkdims(2) = int(cpatch%ncohorts,8) + ! chnkoffs(2) = int(paco_id(pa_index) - 1,8) + ! memdims(2) = int(cpatch%ncohorts,8) + ! memsize(2) = int(cpatch%ncohorts,8) + ! memoffs(2) = 0_8 + + ! call hdf_getslab_r(cpatch%cb ,'CB ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_lightmax,'CB_LIGHTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_moistmax,'CB_MOISTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + do ico = 1, cpatch%ncohorts + cpatch%cb (1:12,ico) = 1.0 + cpatch%cb_lightmax (1:12,ico) = 1.0 + cpatch%cb_moistmax (1:12,ico) = 1.0 + cpatch%cb ( 13,ico) = 0.0 + cpatch%cb_lightmax ( 13,ico) = 0.0 + cpatch%cb_moistmax ( 13,ico) = 0.0 + end do !------------------------------------------------------------------! - cpatch%dagb_dt = 0. - cpatch%dba_dt = 0. - cpatch%ddbh_dt = 0. - cpatch%fsw = 1.0 - cpatch%gpp = 0.0 - cpatch%par_l = 0.0 - + + + cohortloop: do ico=1,cpatch%ncohorts !---------------------------------------------------------------! ! We will now check the PFT of each cohort, so we determine ! @@ -771,7 +800,6 @@ subroutine read_ed21_history_file !----- Initialise the other patch-level variables. -------------------------! call init_ed_patch_vars(csite,1,csite%npatches,cpoly%lsl(isi)) - end if !------------------------------------------------------------------------------! end do siteloop @@ -872,6 +900,7 @@ subroutine read_ed21_history_unstruct , idateh & ! intent(in) , itimeh & ! intent(in) , ied_init_mode & ! intent(in) + , igrass & ! intent(in) , max_poi99_dist ! ! intent(in) use ed_state_vars , only : polygontype & ! variable type , sitetype & ! variable type @@ -898,7 +927,7 @@ subroutine read_ed21_history_unstruct , bd2dbh & ! function , dbh2h & ! function , dbh2bd & ! function - , dbh2bl ! ! function + , size2bl ! ! function use fuse_fiss_utils, only : terminate_cohorts ! ! subroutine use disturb_coms , only : ianth_disturb & ! intent(in) , lu_rescale_file & ! intent(in) @@ -985,7 +1014,7 @@ subroutine read_ed21_history_unstruct logical :: exists logical :: rescale_glob logical :: rescale_loc - real , dimension(huge_polygon) :: pdist + real , dimension( :) , allocatable :: pdist real , dimension(huge_polygon) :: plon_list real , dimension(huge_polygon) :: plat_list real , dimension(huge_polygon) :: dist_rscl @@ -1004,6 +1033,7 @@ subroutine read_ed21_history_unstruct real :: elim_lai real :: salloc real :: salloci + logical :: foundvar !----- Local constants. ----------------------------------------------------------------! real , parameter :: tiny_biomass = 1.e-20 !----- External functions. -------------------------------------------------------------! @@ -1167,10 +1197,13 @@ subroutine read_ed21_history_unstruct ! polygon is the closest one to each polygon. ! !------------------------------------------------------------------------------------! allocate (pclosest(cgrid%npolygons),psrcfile(cgrid%npolygons)) - + allocate(pdist(total_grid_py)) nneighloop: do ipy=1,cgrid%npolygons + + !----- Reset pdist to a very large number. ---------------------------------------! - pdist(:) = 1.e20 + + pdist(1:total_grid_py) = 1.e20 do ifpy=1,total_grid_py pdist(ifpy) = dist_gc(plon_list(ifpy),cgrid%lon(ipy) & @@ -1200,7 +1233,7 @@ subroutine read_ed21_history_unstruct end select end do nneighloop - + deallocate(pdist) !------------------------------------------------------------------------------------! ! Now that we have all polygons matched with their nearest neighbours, we will ! ! loop over all files instead of all polygons. This is to avoid opening and closing ! @@ -1375,8 +1408,9 @@ subroutine read_ed21_history_unstruct !---- 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_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true. & + ,foundvar) !----- Load the workload (2D). ------------------------------------------------! dsetrank = 2 @@ -1393,7 +1427,7 @@ subroutine read_ed21_history_unstruct memsize(2) = 1_8 memoffs(2) = 0_8 call hdf_getslab_r(cgrid%workload(:,ipy),'WORKLOAD ',dsetrank & - ,iparallel,.false.) + ,iparallel,.false.,foundvar) !------------------------------------------------------------------------------! @@ -1411,7 +1445,7 @@ subroutine read_ed21_history_unstruct memdims(1) = int(pysi_n(py_index),8) memsize(1) = int(pysi_n(py_index),8) memoffs(1) = 0_8 - call hdf_getslab_i(islakesite,'ISLAKESITE ',dsetrank,iparallel,.false.) + call hdf_getslab_i(islakesite,'ISLAKESITE ',dsetrank,iparallel,.false.,foundvar) ndry_sites = int(pysi_n(py_index))-sum(islakesite) !------------------------------------------------------------------------------! @@ -1472,23 +1506,23 @@ subroutine read_ed21_history_unstruct memoffs (1) = 0_8 call hdf_getslab_r( tpoly_area (is:is) , 'AREA_SI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_moist_f (is:is) , 'MOIST_F ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_moist_W (is:is) , 'MOIST_W ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_elevation (is:is) , 'ELEVATION ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_slope (is:is) , 'SLOPE ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_aspect (is:is) , 'ASPECT ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_r( tpoly_TCI (is:is) , 'TCI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_i( tpoly_patch_count(is:is) , 'PATCH_COUNT ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) call hdf_getslab_i( tpoly_lsl (is:is) ,'LSL_SI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) !------------------------------------------------------------------------! @@ -1507,7 +1541,7 @@ subroutine read_ed21_history_unstruct memsize(2) = int(1,8) memoffs(2) = 0_8 call hdf_getslab_i( this_ntext (:,is) , 'NTEXT_SOIL_SI ' & - , dsetrank, iparallel, .true.) + , dsetrank, iparallel, .true.,foundvar) !------------------------------------------------------------------------! @@ -1618,29 +1652,29 @@ subroutine read_ed21_history_unstruct memoffs(1) = 0 call hdf_getslab_i(csite%dist_type ,'DIST_TYPE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%age ,'AGE ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%area ,'AREA ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%sum_dgd ,'SUM_DGD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%sum_chd ,'SUM_CHD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(csite%plantation ,'PLANTATION ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%fast_soil_C ,'FAST_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%slow_soil_C ,'SLOW_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%fast_soil_N ,'FAST_SOIL_N ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%structural_soil_C ,'STRUCTURAL_SOIL_C ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%structural_soil_L ,'STRUCTURAL_SOIL_L ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(csite%mineralized_soil_N,'MINERALIZED_SOIL_N ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) !------------------------------------------------------------------------! ! Check whether area should be re-scaled. ! @@ -1726,13 +1760,13 @@ subroutine read_ed21_history_unstruct memoffs(1) = 0_8 call hdf_getslab_r(cpatch%dbh ,'DBH ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpatch%bdead ,'BDEAD ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_i(cpatch%pft ,'PFT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) call hdf_getslab_r(cpatch%nplant ,'NPLANT ' & - ,dsetrank,iparallel,.true.) + ,dsetrank,iparallel,.true.,foundvar) !------------------------------------------------------------------! ! Find derived properties from Bdead. In the unlikely case ! @@ -1742,23 +1776,37 @@ subroutine read_ed21_history_unstruct do ico=1,cpatch%ncohorts ipft = cpatch%pft(ico) - if (cpatch%bdead(ico) > 0.0) then + if (igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdead(ico)>0.0) then + !-- if the initial file was running with igrass = 0, bdead ! + ! should be nonzero. If the new run has igrass = 1, bdead ! + ! is set to zero and the mass is discarded ! + cpatch%dbh(ico) = max(cpatch%dbh(ico),min_dbh(ipft)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdead(ico) = 0.0 + + else if (cpatch%bdead(ico) > 0.0 .and. igrass == 0) then + ! grasses have bdead in both input and current run (igrass=0) 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 + else + ! it is either a new grass (igrass=1) in the initial file, ! + ! or the value for bdead is missing from the files ! 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),ipft) + cpatch%bleaf(ico) = size2bl( cpatch%dbh (ico) & + , cpatch%hite(ico) & + , ipft ) !----- Find the other pools. -----------------------------------! salloc = (1.0 + q(ipft) + qsw(ipft) * cpatch%hite(ico)) salloci = 1.0 / salloc - cpatch%balive (ico) = cpatch%bleaf(ico) * salloc - cpatch%broot (ico) = cpatch%balive(ico) * q(ipft) * salloci + cpatch%balive (ico) = cpatch%bleaf(ico) * salloc + cpatch%broot (ico) = cpatch%balive(ico) * q(ipft) * salloci cpatch%bsapwooda(ico) = cpatch%balive(ico) * qsw(ipft) & * cpatch%hite(ico) * salloci * agf_bs(ipft) cpatch%bsapwoodb(ico) = cpatch%balive(ico) * qsw(ipft) & @@ -1766,37 +1814,47 @@ subroutine read_ed21_history_unstruct * (1.-agf_bs(ipft)) cpatch%bstorage(ico) = 0.0 cpatch%phenology_status(ico) = 0 + end do - !----- Then the 2-D variables. ------------------------------------! - dsetrank = 2 - globdims(1) = 13_8 - chnkdims(1) = 13_8 - chnkoffs(1) = 0_8 - memdims(1) = 13_8 - memsize(1) = 13_8 - memoffs(2) = 0_8 - globdims(2) = int(dset_ncohorts_global,8) - chnkdims(2) = int(cpatch%ncohorts,8) - chnkoffs(2) = int(paco_id(pa_index) - 1,8) - memdims(2) = int(cpatch%ncohorts,8) - memsize(2) = int(cpatch%ncohorts,8) - memoffs(2) = 0_8 - - call hdf_getslab_r(cpatch%cb ,'CB ' & - ,dsetrank,iparallel,.true.) - call hdf_getslab_r(cpatch%cb_max,'CB_MAX ' & - ,dsetrank,iparallel,.true.) - !------------------------------------------------------------------! - ! The following variables are initialised with default values. ! + ! Carbon balance variables. ! + ! MLO. I commented this out because a restart is likely to have ! + ! different settings and different environment, so it's ! + ! likely that the system will reach a different equilibrium. ! + ! For simplicity, we just use the typical initialisation in ! + ! which we give plants one year to adjust to the new ! + ! conditions. ! + !------------------------------------------------------------------! + ! dsetrank = 2 + ! globdims(1) = 13_8 + ! chnkdims(1) = 13_8 + ! chnkoffs(1) = 0_8 + ! memdims(1) = 13_8 + ! memsize(1) = 13_8 + ! memoffs(2) = 0_8 + ! globdims(2) = int(dset_ncohorts_global,8) + ! chnkdims(2) = int(cpatch%ncohorts,8) + ! chnkoffs(2) = int(paco_id(pa_index) - 1,8) + ! memdims(2) = int(cpatch%ncohorts,8) + ! memsize(2) = int(cpatch%ncohorts,8) + ! memoffs(2) = 0_8 + + ! call hdf_getslab_r(cpatch%cb ,'CB ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_lightmax,'CB_LIGHTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_moistmax,'CB_MOISTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + do ico = 1, cpatch%ncohorts + cpatch%cb (1:12,ico) = 1.0 + cpatch%cb_lightmax (1:12,ico) = 1.0 + cpatch%cb_moistmax (1:12,ico) = 1.0 + cpatch%cb ( 13,ico) = 0.0 + cpatch%cb_lightmax ( 13,ico) = 0.0 + cpatch%cb_moistmax ( 13,ico) = 0.0 + end do !------------------------------------------------------------------! - cpatch%dagb_dt = 0. - cpatch%dba_dt = 0. - cpatch%ddbh_dt = 0. - cpatch%fsw = 1.0 - cpatch%gpp = 0.0 - cpatch%par_l = 0.0 cohortloop: do ico=1,cpatch%ncohorts !---------------------------------------------------------------! @@ -1983,5 +2041,1221 @@ subroutine read_ed21_history_unstruct return end subroutine read_ed21_history_unstruct + !==========================================================================================! !==========================================================================================! +! This subroutine will read the ED-2.1 restart files via IED_INIT_MODE=10 ! +! With this specification, the user wants all site data from the closest polygon. This ! +! method also transfers soils information, geophysical information and soil moisture ! +! information along with the vegetation structure and composition from the donor polygon. ! +! Aside from doing a history restart, this is the closest method to getting exact clones ! +! of the donor polygons. ! +!==========================================================================================! + +subroutine read_ed21_polyclone + +#if USE_HDF5 + use hdf5 +#endif + use ed_max_dims , only : n_pft & ! intent(in) + , huge_polygon & ! intent(in) + , str_len & ! intent(in) + , n_dist_types & ! intent(in) + , maxfiles & ! intent(in) + , maxlist ! ! intent(in) + use pft_coms , only : SLA & ! intent(in) + , 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) + , pft_1st_check & ! intent(in) + , include_these_pft & ! intent(in) + , agf_bs & ! intent(in) + , min_cohort_size ! ! intent(in) + use ed_misc_coms , only : sfilin & ! intent(in) + , current_time & ! intent(in) + , imonthh & ! intent(in) + , iyearh & ! intent(in) + , idateh & ! intent(in) + , itimeh & ! intent(in) + , ied_init_mode & ! intent(in) + , max_poi99_dist & ! intent(in) + , igrass + use ed_state_vars , only : polygontype & ! variable type + , sitetype & ! variable type + , patchtype & ! variable type + , edtype & ! variable type + , edgrid_g & ! subroutine + , allocate_polygontype & ! subroutine + , allocate_sitetype & ! subroutine + , allocate_patchtype ! ! subroutine + use grid_coms , only : ngrids & ! intent(in) + , nzg ! ! intent(in) + use consts_coms , only : pio4 ! ! intent(in) + use hdf5_coms , only : file_id & ! intent(in) + , dset_id & ! intent(in) + , dspace_id & ! intent(in) + , plist_id & ! intent(in) + , globdims & ! intent(in) + , chnkdims & ! intent(in) + , chnkoffs & ! intent(in) + , memdims & ! intent(in) + , memoffs & ! intent(in) + , memsize ! ! intent(in) + use allometry , only : area_indices & ! function + , ed_biomass & ! function + , bd2dbh & ! function + , dbh2h & ! function + , dbh2bd & ! function + , size2bl ! ! function + use fuse_fiss_utils, only : terminate_cohorts ! ! subroutine + use disturb_coms , only : ianth_disturb & ! intent(in) + , lu_rescale_file & ! intent(in) + , min_patch_area ! ! intent(in) + use soil_coms , only : soil & ! intent(in) + , slzt & + , isoilcol + + implicit none + +#if (USE_HDF5) + !----- Local variables. ----------------------------------------------------------------! + type(edtype) , pointer :: cgrid + type(polygontype) , pointer :: cpoly + type(sitetype) , pointer :: csite + type(patchtype) , pointer :: cpatch + character(len=str_len), dimension(maxlist) :: full_list + character(len=str_len), dimension(maxfiles) :: histo_list + character(len=1) :: vnam + character(len=3) :: cgr + character(len=str_len) :: hnamel + integer , dimension(maxfiles) :: ngridpoly + integer , dimension(huge_polygon) :: pyfile_list + integer , dimension(huge_polygon) :: pyindx_list + integer , dimension( :) , allocatable :: pclosest + integer , dimension( :) , allocatable :: psrcfile + integer , dimension( :) , allocatable :: pysi_n + integer , dimension( :) , allocatable :: pysi_id + integer , dimension( :) , allocatable :: sipa_n + integer , dimension( :) , allocatable :: sipa_id + integer , dimension( :) , allocatable :: paco_n + integer , dimension( :) , allocatable :: paco_id + integer , dimension( :) , allocatable :: this_ntext + integer , dimension( :) , allocatable :: islakesite + real :: mindist + integer :: minind + real , dimension(:, :) , allocatable :: this_soil_water + real , dimension( :) , allocatable :: dset_slzm + integer , dimension( :) , allocatable :: slz_match + integer :: year + integer :: igr + integer :: ipy + integer :: isi + integer :: is + integer :: ipa + integer :: ico + integer :: nsoil + integer :: nsites_inp + integer :: xclosest + integer :: nflist + integer :: nhisto + integer :: nrescale + integer :: k,kd,km + integer :: nf + integer :: dset_npolygons_global + integer :: dset_nsites_global + integer :: dset_npatches_global + integer :: dset_ncohorts_global + integer :: dset_nzg + integer :: ngr + integer :: ifpy + integer :: ipft + integer :: ipya + integer :: ipyz + integer :: ierr + integer :: ilu + integer :: py_index + integer :: si_index + integer :: pa_index + integer :: dsetrank,iparallel + integer :: hdferr + integer :: total_grid_py + integer :: poi_minloc + integer :: ngp1 + integer :: ndry_sites + logical :: exists + logical :: rescale_glob + logical :: rescale_loc + logical :: foundvar + real , dimension( :) , allocatable :: pdist + !real , dimension(huge_polygon) :: pdist + real , dimension(huge_polygon) :: plon_list + real , dimension(huge_polygon) :: plat_list + real , dimension(huge_polygon) :: dist_rscl + real , dimension(huge_polygon) :: wlon_rscl + real , dimension(huge_polygon) :: clon_rscl + real , dimension(huge_polygon) :: elon_rscl + real , dimension(huge_polygon) :: slat_rscl + real , dimension(huge_polygon) :: clat_rscl + real , dimension(huge_polygon) :: nlat_rscl + real , dimension(n_dist_types,huge_polygon) :: newarea + real , dimension(n_dist_types) :: oldarea + real :: textdist_try + real :: textdist_min + real :: dummy + real :: elim_nplant + real :: elim_lai + real :: salloc + real :: salloci + real :: sum_poly_area + real :: zmin + real :: fa + real :: fb + real :: te + real :: t0 + real :: k0 + integer :: sc + + + !----- Local constants. ----------------------------------------------------------------! + real , parameter :: tiny_biomass = 1.e-20 + !----- External functions. -------------------------------------------------------------! + real , external :: dist_gc + !---------------------------------------------------------------------------------------! + + !----- Open the HDF environment. -------------------------------------------------------! + call h5open_f(hdferr) + + !----- Turn off automatic error printing. ----------------------------------------------! + call h5eset_auto_f(0,hdferr) + !---------------------------------------------------------------------------------------! + ! Big loop over all grids. ! + !---------------------------------------------------------------------------------------! + gridloop: do igr = 1,ngrids + + + !----- Retrieve all files with the specified prefix. --------------------------------! + call ed_filelist(full_list,sfilin(igr),nflist) + !----- Check every file and save only those that are actually history files. --------! + call ed21_fileinfo(nflist,full_list,nhisto,histo_list) + + !----- Initialize the dimensional control variables for the H5 slabs. ---------------! + globdims = 0_8 + chnkdims = 0_8 + chnkoffs = 0_8 + memoffs = 0_8 + memdims = 0_8 + memsize = 1_8 + + !------------------------------------------------------------------------------------! + ! First thing, we go through every file, open, and retrieve only some polygon- ! + ! level information. This will be used for mapping the files later. ! + !------------------------------------------------------------------------------------! + ngridpoly (:) = 0 + pyfile_list(:) = 0 + pyindx_list(:) = 0 + ipyz = 0 + lonlatloop: do nf=1,nhisto + hnamel = histo_list(nf) + + !----- Open the HDF5 file. -------------------------------------------------------! + call h5fopen_f(hnamel, H5F_ACC_RDONLY_F, file_id, hdferr) + if (hdferr < 0) then + write(unit=*,fmt='(a,1x,i4)') ' - Error opening HDF5 file - error - ',hdferr + write(unit=*,fmt='(a,1x,a)') ' - File name: ',trim(hnamel) + call fatal_error('Error opening HDF5 file - error - '//trim(hnamel) & + ,'read_ed21_history_file','ed_read_ed21_history.F90') + end if + + !----- Retrieve the number of polygons in this file. -----------------------------! + call h5dopen_f(file_id,'NPOLYGONS_GLOBAL', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_npolygons_global,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + !----- Determine the global position of these polygons. --------------------------! + ipya = ipyz + 1 + ipyz = ipyz + dset_npolygons_global + + !----- In case we are meshing grids ----------------------------------------------! + ngridpoly(nf) = dset_npolygons_global + + !------ Here we save the file where we can find these polygons. ------------------! + do ipy=ipya,ipyz + pyfile_list(ipy) = nf + pyindx_list(ipy) = ipy-ipya+1 + end do + + !---------------------------------------------------------------------------------! + ! Retrieve the polygon coordinates data. ! + !---------------------------------------------------------------------------------! + globdims(1) = int(dset_npolygons_global,8) + + call h5dopen_f(file_id,'LONGITUDE', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_REAL,plon_list(ipya:ipyz),globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'LATITUDE', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_REAL,plat_list(ipya:ipyz),globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5fclose_f(file_id, hdferr) + if (hdferr /= 0) then + write (unit=*,fmt='(a,1x,a)') 'File: ',trim(hnamel) + write (unit=*,fmt='(a)' ) 'Problem: Failed closing the HDF5 dataset.' + write (unit=*,fmt='(a,1x,i4)') 'HDFerr: ',hdferr + call fatal_error('Could not close the HDF file' & + ,'read_ed21_history_unstruct','ed_read_ed21_history.F90') + end if + end do lonlatloop + + total_grid_py = ipyz + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! If this is a simulation with anthropogenic disturbance, check and read the re- ! + ! scale file if it exists. ! + !------------------------------------------------------------------------------------! + + wlon_rscl(:) = 190. + elon_rscl(:) = -190. + slat_rscl(:) = 100. + nlat_rscl(:) = -100. + inquire(file=trim(lu_rescale_file(igr)),exist=exists) + rescale_glob = ianth_disturb == 1 .and. exists + nrescale = 0 + if (rescale_glob) then + open (unit=13,file=trim(lu_rescale_file(igr)),status='old',action='read') + read (unit=13,fmt=*) + readrescale: do + nrescale = nrescale + 1 + read (unit=13,fmt=*,iostat=ierr) wlon_rscl(nrescale),elon_rscl(nrescale) & + ,slat_rscl(nrescale),nlat_rscl(nrescale) & + ,clon_rscl(nrescale),clat_rscl(nrescale) & + ,dummy,(newarea(ilu,nrescale),ilu=1 & + ,n_dist_types) + + if (ierr /= 0) then + nrescale = nrescale - 1 + exit readrescale + end if + end do readrescale + rescale_glob = nrescale > 0 + close (unit=13,status='keep') + elseif (ianth_disturb == 1 .and. len_trim(lu_rescale_file(igr)) > 0) then + write (unit=*,fmt='(a)') '-------------------------------------------------------' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') ' WARNING! WARNING! WARNING! WARNING! WARNING! WARNING! ' + write (unit=*,fmt='(a)') '-------------------------------------------------------' + write (unit=*,fmt='(a)') ' In subroutine read_ed21_history_unstruct:' + write (unit=*,fmt='(a,1x,i5)') ' - Grid: ',igr + write (unit=*,fmt='(a)') ' In subroutine read_ed21_history_unstruct:' + write (unit=*,fmt='(a)') ' - File '//trim(lu_rescale_file(igr))// & + ' wasn''t found...' + write (unit=*,fmt='(a)') ' - Assuming no rescaling...' + write (unit=*,fmt='(a)') '-------------------------------------------------------' + end if + !------------------------------------------------------------------------------------! + + cgrid => edgrid_g(igr) + + !------------------------------------------------------------------------------------! + ! Now, we will go through all polygons, and we will determine which input ! + ! polygon is the closest one to each polygon. ! + !------------------------------------------------------------------------------------! + allocate (pclosest(cgrid%npolygons),psrcfile(cgrid%npolygons)) + allocate (pdist(total_grid_py)) + nneighloop: do ipy=1,cgrid%npolygons + !----- Reset pdist to a very large number. ---------------------------------------! + pdist(1:total_grid_py) = 1.e20 + + do ifpy=1,total_grid_py + pdist(ifpy) = dist_gc(plon_list(ifpy),cgrid%lon(ipy) & + ,plat_list(ifpy),cgrid%lat(ipy)) + end do + + pclosest(ipy) = pyindx_list(minloc(pdist,dim=1)) + psrcfile(ipy) = pyfile_list(minloc(pdist,dim=1)) + + + end do nneighloop + deallocate(pdist) + + !------------------------------------------------------------------------------------! + ! Now that we have all polygons matched with their nearest neighbours, we will ! + ! loop over all files instead of all polygons. This is to avoid opening and closing ! + ! the files too many times. ! + !------------------------------------------------------------------------------------! + rstfileloop: do nf=1, nhisto + + !---------------------------------------------------------------------------------! + ! Before anything else, we check whether this file needs to be opened, i.e., ! + ! whether any polygon has its nearest neighbour in this file. If not, we move ! + ! to the next one. ! + !---------------------------------------------------------------------------------! + if (.not. (any(psrcfile == nf))) cycle rstfileloop + + !---------------------------------------------------------------------------------! + ! If we are here, at least one polygon closest source is in this file, open ! + ! it and load all fill in all polygons whose nearest neighbour is in this file. ! + !---------------------------------------------------------------------------------! + hnamel = histo_list(nf) + + !----- Open file. ----------------------------------------------------------------! + call h5fopen_f(hnamel, H5F_ACC_RDONLY_F, file_id, hdferr) + if (hdferr < 0) then + write(unit=*,fmt='(a,1x,i4)') ' - Error opening HDF5 file - error - ',hdferr + write(unit=*,fmt='(a,1x,a)') ' - File name: ',trim(hnamel) + call fatal_error('Error opening HDF5 file - error - '//trim(hnamel) & + ,'read_ed21_history_file','ed_read_ed21_history.F90') + end if + + !---------------------------------------------------------------------------------! + ! Retrieve global vector sizes and mapping tree. ! + !---------------------------------------------------------------------------------! + globdims = 0_8 + chnkdims = 0_8 + chnkoffs = 0_8 + + globdims(1) = 1_8 + + call h5dopen_f(file_id,'NZG', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_nzg,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'NPOLYGONS_GLOBAL', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_npolygons_global,globdims,hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'NSITES_GLOBAL', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_nsites_global,globdims,hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'NPATCHES_GLOBAL', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_npatches_global,globdims,hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'NCOHORTS_GLOBAL', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,dset_ncohorts_global,globdims,hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + globdims(1) = int(dset_npolygons_global,8) + + allocate(pysi_n(dset_npolygons_global)) + allocate(pysi_id(dset_npolygons_global)) + + call h5dopen_f(file_id,'PYSI_N', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,pysi_n,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'PYSI_ID', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,pysi_id,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + globdims(1) = int(dset_nsites_global,8) + + allocate(sipa_n(dset_nsites_global)) + allocate(sipa_id(dset_nsites_global)) + + call h5dopen_f(file_id,'SIPA_N', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,sipa_n,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'SIPA_ID', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,sipa_id,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + globdims(1) = int(dset_npatches_global,8) + allocate(paco_n(dset_npatches_global)) + allocate(paco_id(dset_npatches_global)) + + call h5dopen_f(file_id,'PACO_N', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,paco_n,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + call h5dopen_f(file_id,'PACO_ID', dset_id, hdferr) + call h5dget_space_f(dset_id, dspace_id, hdferr) + call h5dread_f(dset_id, H5T_NATIVE_INTEGER,paco_id,globdims, hdferr) + call h5sclose_f(dspace_id, hdferr) + call h5dclose_f(dset_id, hdferr) + + dsetrank = 1 + globdims(1) = dset_nzg + chnkdims(1) = dset_nzg + chnkoffs(1) = 0_8 + memdims(1) = dset_nzg + memsize(1) = dset_nzg + memoffs(1) = 0_8 + + + allocate(this_ntext(dset_nzg)) + allocate(dset_slzm(dset_nzg)) + + call hdf_getslab_r(dset_slzm,'SLZ',dsetrank & + ,iparallel,.true.,foundvar) + + ! Calculate the mid-points of the dataset soil-layers + do kd=1,dset_nzg-1 + dset_slzm(kd) = 0.5*(dset_slzm(kd)+dset_slzm(kd+1)) + end do + dset_slzm(dset_nzg) = 0.5*(dset_slzm(dset_nzg)+0.0) + + + polyloop: do ipy = 1,cgrid%npolygons + cpoly => cgrid%polygon(ipy) + + !----- We skip the polygon if its source polygon is not in this file. ---------! + if (psrcfile(ipy) /= nf) cycle polyloop + + !------------------------------------------------------------------------------! + ! Use the index corresponding to the relative position of the input polygon ! + ! in the source file to which the polygon belongs. Use these values, and its ! + ! children values in sites, patchs and cohorts. ! + !------------------------------------------------------------------------------! + py_index = pclosest(ipy) + + + !------------------------------------------------------------------------------! + ! In case we seek to rescale, we must first check whether a scale for the ! + ! current polygon. ! + !------------------------------------------------------------------------------! + !----- Initialise distance and co-ordinates to non-sense numbers. -------------! + dist_rscl(:) = 1.e+20 ! Initialise to a large distance and non-sense + if (rescale_glob) then + neighbour: do k=1,nrescale + dist_rscl(k) = dist_gc(clon_rscl(k),cgrid%lon(ipy) & + ,clat_rscl(k),cgrid%lat(ipy)) + end do neighbour + xclosest = minloc(dist_rscl,dim=1) + + rescale_loc = cgrid%lon(ipy) > wlon_rscl(xclosest) .and. & + cgrid%lon(ipy) < elon_rscl(xclosest) .and. & + cgrid%lat(ipy) > slat_rscl(xclosest) .and. & + cgrid%lat(ipy) < nlat_rscl(xclosest) + else + rescale_loc = .false. + end if + + + iparallel = 0 + + !------------------------------------------------------------------------------! + ! POLYGON level variables. ! + !------------------------------------------------------------------------------! + !----- Load 1D dataset. -------------------------------------------------------! + dsetrank = 1 + globdims(1) = int(dset_npolygons_global,8) + chnkdims(1) = 1_8 + chnkoffs(1) = int(py_index - 1,8) + memdims(1) = 1_8 + memoffs(1) = 0_8 + memsize(1) = 1_8 + + + !---- 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.,foundvar) + call hdf_getslab_r(cgrid%wbar(ipy:ipy),'WBAR ',dsetrank,iparallel,.true.,foundvar) + + !----- Load the workload (2D). ------------------------------------------------! + dsetrank = 2 + globdims(1) = int(13,8) + chnkdims(1) = int(13,8) + memdims(1) = int(13,8) + memsize(1) = int(13,8) + chnkoffs(1) = 0_8 + memoffs(1) = 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.,foundvar) + !------------------------------------------------------------------------------! + + + + !------------------------------------------------------------------------------! + ! Check whether the input data had lakes or not. ! + !------------------------------------------------------------------------------! + allocate(islakesite(pysi_n(py_index))) + islakesite = 0 + !----- Load the lakesite data--------------------------------------------------! + dsetrank = 1_8 + globdims(1) = int(dset_nsites_global,8) + chnkdims(1) = int(pysi_n(py_index),8) + chnkoffs(1) = int(pysi_id(py_index) - 1,8) + memdims(1) = int(pysi_n(py_index),8) + memsize(1) = int(pysi_n(py_index),8) + memoffs(1) = 0_8 + call hdf_getslab_i(islakesite,'ISLAKESITE ',dsetrank,iparallel,.false.,foundvar) + ndry_sites = int(pysi_n(py_index))-sum(islakesite) + !------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------! + ! Allocate the destination polygon with site level vector data ! + !------------------------------------------------------------------------------! + + call allocate_polygontype(cpoly,ndry_sites) + + + !------------------------------------------------------------------------------! + ! Loop over the sites, seeking only those that are land sites. ! + !------------------------------------------------------------------------------! + is = 0 + sum_poly_area = 0. + siteloop: do isi=1,pysi_n(py_index) + if (islakesite(isi) == 0) then + is = is + 1 + + csite => cpoly%site(is) + + si_index = pysi_id(py_index)+isi-1 + + iparallel = 0 + + dsetrank = 1_8 + globdims = 0_8 + chnkdims = 0_8 + chnkoffs = 0_8 + memoffs = 0_8 + memdims = 0_8 + memsize = 1_8 + + globdims(1) = int(dset_nsites_global,8) + chnkdims(1) = int(1,8) + chnkoffs(1) = int(si_index-1,8) + memdims(1) = int(1,8) + memsize(1) = int(1,8) + memoffs(1) = 0_8 + + call hdf_getslab_i(cpoly%patch_count(is:is),'PATCH_COUNT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%sitenum(is:is),'SITENUM ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%lsl(is:is),'LSL_SI ',dsetrank,iparallel,.true.,foundvar) + + call hdf_getslab_i(cpoly%ncol_soil(is:is),'NCOL_SOIL_SI ',dsetrank,iparallel,.false.,foundvar) + + ! If this data is not available in the dataset, we should really just use + ! a default value. It is probably not a good idea to use values derived from + ! a soils dataset earlier in the code, if we are no longer using the associated + ! textures. + + if (cpoly%ncol_soil(is).eq.0) then + write (unit=*,fmt='(a,i3)') & + 'Soil color info not in ED2.1 state file, using ISOILCOL=',isoilcol + cpoly%ncol_soil(is) = isoilcol + cgrid%ncol_soil(ipy) = isoilcol + end if + + + call hdf_getslab_r(cpoly%area(is:is),'AREA_SI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%patch_area(is:is),'PATCH_AREA ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%elevation(is:is),'ELEVATION ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%slope(is:is),'SLOPE ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%aspect(is:is),'ASPECT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%TCI(is:is),'TCI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%hydro_next(is:is),'HYDRO_NEXT ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpoly%hydro_prev(is:is),'HYDRO_PREV ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_W(is:is),'MOIST_W ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_f(is:is),'MOIST_F ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_tau(is:is),'MOIST_TAU ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%moist_zi(is:is),'MOIST_ZI ',dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpoly%baseflow(is:is),'BASEFLOW_SI ',dsetrank,iparallel,.true.,foundvar) + + sum_poly_area = sum_poly_area+cpoly%area(is) + + !----- Load 2D data soil texture + dsetrank = 2_8 + globdims(1) = int(dset_nzg,8) + chnkdims(1) = int(dset_nzg,8) + memdims(1) = int(dset_nzg,8) + memsize(1) = int(dset_nzg,8) + chnkoffs(1) = 0_8 + memoffs(1) = 0_8 + globdims(2) = int(dset_nsites_global,8) + chnkdims(2) = int(1,8) + chnkoffs(2) = int(si_index-1,8) + memdims(2) = int(1,8) + memsize(2) = int(1,8) + memoffs(2) = 0_8 + + call hdf_getslab_i( this_ntext(:), & + 'NTEXT_SOIL_SI ',dsetrank, iparallel, .true.,foundvar) + + + + !------------------------------------------------------------------------! + ! The input file may have different number of soil layers than this ! + ! simulation. This is not a problem at this point because the soil maps ! + ! don't have soil texture profiles, but it may become an issue for sites ! + ! with different soil types along the profile. Feel free to improve the ! + ! code... For the time being, we assume here that there is only one ! + ! soil type, so all that we need is to save one layer for each site. ! + !------------------------------------------------------------------------! + + allocate(slz_match(nzg)) + do km=1,nzg !km is k-model + mindist = 1.e10 + minind = -1 + do kd=1,dset_nzg !kd is k-dset + if (abs(slzt(km)-dset_slzm(kd))0)then + slz_match(km)=minind + else + call fatal_error('Could not find soil layer match!',& + 'ed_read_polyclone','ed_read_ed21_history.F90') + end if + cpoly%ntext_soil(km,is) = this_ntext(slz_match(km)) + end do + + ! ALSO, LETS RE-ASSIGN THE LSL + + if (cpoly%lsl(is)>dset_nzg .or. cpoly%lsl(is)<1)then + print*,"FUNKY LSL:",cpoly%lsl(is) + stop + else + cpoly%lsl(is) = slz_match(cpoly%lsl(is)) + end if + + + ! We also need to set all the default properties because they were bypassed + ! in ed_init + + if (sipa_n(si_index) > 0) then + + !----- Fill 1D polygon (site unique) level variables. -------------------! + call allocate_sitetype(csite,sipa_n(si_index)) + + iparallel = 0 + + dsetrank = 1 + globdims(1) = int(dset_npatches_global,8) + chnkdims(1) = int(csite%npatches,8) + chnkoffs(1) = int(sipa_id(si_index) - 1,8) + memdims(1) = int(csite%npatches,8) + memsize(1) = int(csite%npatches,8) + memoffs(1) = 0 + + call hdf_getslab_i(csite%dist_type ,'DIST_TYPE ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%age ,'AGE ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%area ,'AREA ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sum_dgd ,'SUM_DGD ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%sum_chd ,'SUM_CHD ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(csite%plantation ,'PLANTATION ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%fast_soil_C ,'FAST_SOIL_C ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%slow_soil_C ,'SLOW_SOIL_C ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%fast_soil_N ,'FAST_SOIL_N ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%structural_soil_C ,'STRUCTURAL_SOIL_C ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%structural_soil_L ,'STRUCTURAL_SOIL_L ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(csite%mineralized_soil_N,'MINERALIZED_SOIL_N ' & + ,dsetrank,iparallel,.true.,foundvar) + + !----- Load 2D soil water + dsetrank = 2_8 + globdims(1) = int(dset_nzg,8) + chnkdims(1) = int(dset_nzg,8) + memdims(1) = int(dset_nzg,8) + memsize(1) = int(dset_nzg,8) + chnkoffs(1) = 0_8 + memoffs(1) = 0_8 + globdims(2) = int(dset_npatches_global,8) + chnkdims(2) = int(csite%npatches,8) + chnkoffs(2) = int(sipa_id(si_index)-1,8) + memdims(2) = int(csite%npatches,8) + memsize(2) = int(csite%npatches,8) + memoffs(2) = 0_8 + + allocate(this_soil_water(dset_nzg,csite%npatches)) + call hdf_getslab_r(this_soil_water,'SOIL_WATER_PA ' & + ,dsetrank,iparallel,.true.,foundvar) + + ! ---------------------------------------------------------- + ! Go through the layer centers of the model layers + ! Find the layer in the dataset that matches it most closely + ! and copy soil-water from that dataset to the model + ! ---------------------------------------------------------- + do ipa=1,csite%npatches + do km=1,nzg + +! if( this_soil_water(slz_match(km),ipa) .gt. & +! soil(cpoly%ntext_soil(km,is))%slmsts .or. & +! this_soil_water(slz_match(km),ipa).le.0.0 ) then +! +! call fatal_error('Soil moisture is greater than porosity' & +! ,'read_ed21_polyclone','ed_read_ed21_history.F90') +! end if + csite%soil_water(km,ipa) = & + min(this_soil_water(slz_match(km),ipa), & + soil(cpoly%ntext_soil(km,is))%slmsts) + end do + end do + deallocate(this_soil_water) + + !------------------------------------------------------------------------! + ! Check whether area should be re-scaled. ! + !------------------------------------------------------------------------! + if (rescale_loc) then + !---------------------------------------------------------------------! + ! Now we loop over all land use types. ! + !---------------------------------------------------------------------! + do ilu=1,n_dist_types + !---- The original (old) area. ------------------------------------! + oldarea(ilu) = sum(csite%area,mask=csite%dist_type == ilu) + + !------------------------------------------------------------------! + ! Make sure that no area is going to be zero for a given land ! + ! use type when the counter part is not. ! + !------------------------------------------------------------------! + oldarea(ilu) = max( 0.5 * min_patch_area,oldarea(ilu)) + newarea(ilu,xclosest) = max( 0.5 * min_patch_area & + , newarea(ilu,xclosest)) + !------------------------------------------------------------------! + end do + + !---- Re-scale the total areas so they are both equal to one. --------! + oldarea(:) = oldarea(:) / sum(oldarea) + newarea(:,xclosest) = newarea(:,xclosest) & + / sum(newarea(:,xclosest:xclosest)) + + !----- Re-scale the areas of every patch. ----------------------------! + do ipa=1,csite%npatches + ilu = csite%dist_type(ipa) + csite%area(ipa) = csite%area(ipa) * newarea(ilu,xclosest) & + / oldarea(ilu) + end do + + !----- Just to make sure we preserve unity. --------------------------! + csite%area(:) = csite%area(:) / sum(csite%area) + + end if + + !------------------------------------------------------------------------! + ! Loop over all sites and fill the patch-level variables. ! + !------------------------------------------------------------------------! + patchloop: do ipa = 1,csite%npatches + cpatch => csite%patch(ipa) + + !---------------------------------------------------------------------! + ! Reset the HDF5 auxiliary variables before moving to the next ! + ! level. ! + !---------------------------------------------------------------------! + globdims = 0_8 + chnkdims = 0_8 + chnkoffs = 0_8 + memoffs = 0_8 + memdims = 0_8 + memsize = 1_8 + !---------------------------------------------------------------------! + + + + !---------------------------------------------------------------------! + ! Initialise patch-level variables that depend on the cohort ! + ! ones. ! + !---------------------------------------------------------------------! + csite%lai(ipa) = 0.0 + csite%wai(ipa) = 0.0 + csite%plant_ag_biomass(ipa) = 0.0 + + pa_index = sipa_id(si_index) + ipa - 1 + call allocate_patchtype(cpatch,paco_n(pa_index)) + + !---------------------------------------------------------------------! + ! Empty patches may exist, so make sure that this part is called ! + ! only when there are cohorts. ! + !---------------------------------------------------------------------! + if (cpatch%ncohorts > 0) then + !----- First the 1-D variables. -----------------------------------! + dsetrank = 1 + globdims(1) = int(dset_ncohorts_global,8) + chnkdims(1) = int(cpatch%ncohorts,8) + chnkoffs(1) = int(paco_id(pa_index) - 1,8) + memdims(1) = int(cpatch%ncohorts,8) + memsize(1) = int(cpatch%ncohorts,8) + memoffs(1) = 0_8 + + call hdf_getslab_r(cpatch%dbh ,'DBH ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%bdead ,'BDEAD ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_i(cpatch%pft ,'PFT ' & + ,dsetrank,iparallel,.true.,foundvar) + call hdf_getslab_r(cpatch%nplant ,'NPLANT ' & + ,dsetrank,iparallel,.true.,foundvar) + + !------------------------------------------------------------------! + ! Find derived properties from Bdead. In the unlikely case ! + ! that bdead is zero, then we use DBH as the starting point. In ! + ! both cases we assume that plants are in allometry. ! + !------------------------------------------------------------------! + do ico=1,cpatch%ncohorts + ipft = cpatch%pft(ico) + + if (igrass == 1 .and. is_grass(ipft) & + .and. cpatch%bdead(ico)>0.0) then + !-- if the initial file was running with igrass = 0, bdead ! + ! should be nonzero. If the new run has igrass = 1, bdead ! + ! is set to zero and that biomass is discarded ! + cpatch%dbh(ico) = max(cpatch%dbh(ico),min_dbh(ipft)) + cpatch%hite(ico) = dbh2h (ipft,cpatch%dbh (ico)) + cpatch%bdead(ico) = 0.0 + + else if (cpatch%bdead(ico) > 0.0 .and. igrass == 0) then + ! grasses have bdead in both input and current run (igrass=0) + 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 + ! it is either a new grass (igrass=1) in the initial file, ! + ! or the value for bdead is missing from the files ! + 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) = size2bl( cpatch%dbh (ico) & + , cpatch%hite(ico) & + , ipft ) + + !----- Find the other pools. -----------------------------------! + salloc = (1.0 + q(ipft) + qsw(ipft) * cpatch%hite(ico)) + salloci = 1.0 / salloc + cpatch%balive (ico) = cpatch%bleaf(ico) * salloc + cpatch%broot (ico) = cpatch%balive(ico) * q(ipft) * salloci + cpatch%bsapwooda(ico) = cpatch%balive(ico) * qsw(ipft) & + * cpatch%hite(ico) * salloci * agf_bs(ipft) + cpatch%bsapwoodb(ico) = cpatch%balive(ico) * qsw(ipft) & + * cpatch%hite(ico) * salloci & + * (1.-agf_bs(ipft)) + cpatch%bstorage(ico) = 0.0 + cpatch%phenology_status(ico) = 0 + end do + + !------------------------------------------------------------------! + ! Carbon balance variables. ! + ! MLO. I commented this out because a restart is likely to have ! + ! different settings and different environment, so it's ! + ! likely that the system will reach a different equilibrium. ! + ! For simplicity, we just use the typical initialisation in ! + ! which we give plants one year to adjust to the new ! + ! conditions. ! + !------------------------------------------------------------------! + ! dsetrank = 2 + ! globdims(1) = 13_8 + ! chnkdims(1) = 13_8 + ! chnkoffs(1) = 0_8 + ! memdims(1) = 13_8 + ! memsize(1) = 13_8 + ! memoffs(2) = 0_8 + ! globdims(2) = int(dset_ncohorts_global,8) + ! chnkdims(2) = int(cpatch%ncohorts,8) + ! chnkoffs(2) = int(paco_id(pa_index) - 1,8) + ! memdims(2) = int(cpatch%ncohorts,8) + ! memsize(2) = int(cpatch%ncohorts,8) + ! memoffs(2) = 0_8 + + ! call hdf_getslab_r(cpatch%cb ,'CB ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_lightmax,'CB_LIGHTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + ! call hdf_getslab_r(cpatch%cb_moistmax,'CB_MOISTMAX ' & + ! ,dsetrank,iparallel,.true.,foundvar) + do ico = 1, cpatch%ncohorts + cpatch%cb (1:12,ico) = 1.0 + cpatch%cb_lightmax (1:12,ico) = 1.0 + cpatch%cb_moistmax (1:12,ico) = 1.0 + cpatch%cb ( 13,ico) = 0.0 + cpatch%cb_lightmax ( 13,ico) = 0.0 + cpatch%cb_moistmax ( 13,ico) = 0.0 + end do + !------------------------------------------------------------------! + + + cohortloop: do ico=1,cpatch%ncohorts + !---------------------------------------------------------------! + ! We will now check the PFT of each cohort, so we determine ! + ! if this is a valid PFT. If not, then we must decide what we ! + ! should do... ! + !---------------------------------------------------------------! + if (.not. include_pft(cpatch%pft(ico))) then + select case(pft_1st_check) + case (0) + !----- Stop the run. -------------------------------------! + write (unit=*,fmt='(a,1x,i5,1x,a)') & + 'I found a cohort with PFT=',cpatch%pft(ico) & + ,' and it is not in your include_these_pft...' + call fatal_error('Invalid PFT in history file' & + ,'read_ed21_history_file' & + ,'ed_read_ed21_history.F90') + + case (1) + !----- Include the unexpected PFT in the list. -----------! + write (unit=*,fmt='(a,1x,i5,1x,a)') & + 'I found a cohort with PFT=',cpatch%pft(ico) & + ,'... Including this PFT in your include_these_pft...' + include_pft(cpatch%pft(ico)) = .true. + include_these_pft(count(include_pft)) = cpatch%pft(ico) + + call sort_up(include_these_pft,n_pft) + + if (is_grass(cpatch%pft(ico))) then + include_pft_ag(cpatch%pft(ico)) = .true. + end if + + case (2) + !----- Ignore the unexpect PFT. --------------------------! + write (unit=*,fmt='(a,1x,i5,1x,a)') & + 'I found a cohort with PFT=',cpatch%pft(ico) & + ,'... Ignoring it...' + !---------------------------------------------------------! + ! The way we will ignore this cohort is by setting its ! + ! nplant to zero, and calling the "terminate_cohorts" ! + ! subroutine right after this. ! + !---------------------------------------------------------! + cpatch%nplant(ico) = 0. + end select + end if + + !---------------------------------------------------------------! + ! Make sure that the biomass won't lead to FPE. This ! + ! should never happen when using a stable ED-2.1 version, but ! + ! older versions had "zombie" cohorts. Here we ensure that ! + ! the model initialises with stable numbers whilst ensuring ! + ! that the cohorts will be eliminated. ! + !---------------------------------------------------------------! + if (cpatch%balive(ico) > 0. .and. & + cpatch%balive(ico) < tiny_biomass) then + cpatch%balive(ico) = tiny_biomass + end if + if (cpatch%bleaf(ico) > 0. .and. & + cpatch%bleaf(ico) < tiny_biomass) then + cpatch%bleaf(ico) = tiny_biomass + end if + if (cpatch%broot(ico) > 0. .and. & + cpatch%broot(ico) < tiny_biomass) then + cpatch%broot(ico) = tiny_biomass + end if + if (cpatch%bsapwooda(ico) > 0. .and. & + cpatch%bsapwooda(ico) < tiny_biomass) then + cpatch%bsapwooda(ico) = tiny_biomass + end if + if (cpatch%bsapwoodb(ico) > 0. .and. & + cpatch%bsapwoodb(ico) < tiny_biomass) then + cpatch%bsapwoodb(ico) = tiny_biomass + end if + if (cpatch%bdead(ico) > 0. .and. & + cpatch%bdead(ico) < tiny_biomass) then + cpatch%bdead(ico) = tiny_biomass + end if + if (cpatch%bstorage(ico) > 0. .and. & + cpatch%bstorage(ico) < tiny_biomass) then + cpatch%bstorage(ico) = tiny_biomass + end if + !---------------------------------------------------------------! + + + !----- Compute the above-ground biomass. -----------------------! + cpatch%agb(ico) = ed_biomass(cpatch%bdead(ico),cpatch%bleaf(ico)& + ,cpatch%bsapwooda(ico),cpatch%pft(ico)) + + cpatch%basarea(ico) = pio4 * cpatch%dbh(ico) * cpatch%dbh(ico) + + !----- Assign LAI, WAI, and CAI --------------------------------! + call area_indices(cpatch%nplant(ico),cpatch%bleaf(ico) & + ,cpatch%bdead(ico),cpatch%balive(ico) & + ,cpatch%dbh(ico),cpatch%hite(ico) & + ,cpatch%pft(ico),SLA(cpatch%pft(ico)) & + ,cpatch%lai(ico),cpatch%wai(ico) & + ,cpatch%crown_area(ico),cpatch%bsapwooda(ico)) + + + !----- Update the derived patch-level variables. ---------------! + csite%lai(ipa) = csite%lai(ipa) + cpatch%lai(ico) + csite%wai(ipa) = csite%wai(ipa) + cpatch%wai(ico) + csite%plant_ag_biomass(ipa) = csite%plant_ag_biomass(ipa) & + + cpatch%agb(ico)*cpatch%nplant(ico) + + !----- Initialise the other cohort level variables. ------------! + call init_ed_cohort_vars(cpatch,ico,cpoly%lsl(isi)) + end do cohortloop + + !------------------------------------------------------------------! + ! Eliminate any "unwanted" cohort (i.e., those which nplant was ! + ! set to zero so it would be removed). ! + !------------------------------------------------------------------! + call terminate_cohorts(csite,ipa,elim_nplant,elim_lai) + + end if + end do patchloop + else + !----- This should never happen, but, just in case... -------------------! + call fatal_error('A site with no patches was found...' & + ,'read_ed21_history_file','ed_read_ed21_history.F90') + end if + + !----- Initialise the other patch-level variables. -------------------------! + call init_ed_patch_vars(csite,1,csite%npatches,cpoly%lsl(isi)) + + deallocate(slz_match) + + end if + + end do siteloop + + + !---------------------------------------------------------------------------------! + ! Not sure what these things do, just copying from hydrology... ! + !---------------------------------------------------------------------------------! + !----- Part 1. -------------------------------------------------------------------! + Te = 0.0 + do isi = 1,cpoly%nsites + sc = cpoly%ntext_soil(nzg-1,isi) + K0 = soil(sc)%slcons0 + T0 = K0 / cpoly%moist_f(isi) + Te = Te + T0*cpoly%area(isi) + end do + cgrid%Te(ipy) = Te + !----- Part 2. -------------------------------------------------------------------! + cgrid%wbar(ipy) = 0.0 + do isi = 1,cpoly%nsites + sc = cpoly%ntext_soil(nzg-1,isi) + K0 = soil(sc)%slcons0 + T0 = K0 / cpoly%moist_f(isi) + cpoly%moist_W(isi) = cpoly%TCI(isi) + log(Te) - log(T0) + cgrid%wbar(ipy) = cgrid%wbar(ipy) + cpoly%moist_W(isi) * cpoly%area(isi) + end do + !---------------------------------------------------------------------------------! + + ! Normalize the site area in-case not all sites were read in + + if (sum_poly_area>0.) then + cpoly%area = cpoly%area/sum_poly_area + else + call fatal_error('Site Areas Are Nill' & + ,'read_ed21_polyclone','ed_read_ed21_history.F90') + end if + + !----- Initialise some site-level variables. ----------------------------------! + call init_ed_site_vars(cpoly,cgrid%lat(ipy)) + !------------------------------------------------------------------------------! + + deallocate (islakesite ) + !------------------------------------------------------------------------------! + + end do polyloop + + !----- Close the dataset. --------------------------------------------------------! + call h5fclose_f(file_id, hdferr) + if (hdferr /= 0) then + write (unit=*,fmt='(a,1x,a)') 'File: ',trim(hnamel) + write (unit=*,fmt='(a)' ) 'Problem: Failed closing the HDF5 dataset.' + write (unit=*,fmt='(a,1x,i4)') 'HDFerr: ',hdferr + call fatal_error('Could not close the HDF file' & + ,'read_ed21_history_file','ed_read_ed21_history.F90') + end if + + deallocate(paco_n ,paco_id ) + deallocate(sipa_n ,sipa_id ) + deallocate(pysi_n ,pysi_id ) + deallocate(this_ntext ) + deallocate(dset_slzm ) + + end do rstfileloop + + !----- Initialise the other polygon-level variables. --------------------------------! + call init_ed_poly_vars(cgrid) + + + !----- Deallocate the closest index vector. -----------------------------------------! + deallocate(pclosest,psrcfile) +end do gridloop + +!----- Turn off automatic error printing. ----------------------------------------------! +call h5eset_auto_f(1,hdferr) + +!----- Close the HDF5 environment. -----------------------------------------------------! +call h5close_f(hdferr) + +#else + call fatal_error ('You cannot restart with ED-2.1 without using HDF5...' & + ,'read_ed21_history_unstruct','ed_read_ed21_history.F90') +#endif + + + return + end subroutine read_ed21_polyclone + + + + subroutine check_rescale() + + + implicit none + + + + + + + + + + + + + + + + + + + end subroutine check_rescale diff --git a/ED/src/io/ed_xml_config.f90 b/ED/src/io/ed_xml_config.f90 index 097d3b03f..497aa3d3c 100644 --- a/ED/src/io/ed_xml_config.f90 +++ b/ED/src/io/ed_xml_config.f90 @@ -603,11 +603,17 @@ recursive subroutine read_ed_xml_config(filename) call getConfigREAL ('r_ssc','decomposition',i,rval,texist) if(texist) r_ssc = real(rval) call getConfigREAL ('K1','decomposition',i,rval,texist) - if(texist) K1 = real(rval) + if(texist) decay_rate_stsc = real(rval) call getConfigREAL ('K2','decomposition',i,rval,texist) - if(texist) K2 = real(rval) + if(texist) decay_rate_fsc = real(rval) call getConfigREAL ('K3','decomposition',i,rval,texist) - if(texist) K3 = real(rval) + if(texist) decay_rate_ssc = real(rval) + call getConfigREAL ('decay_rate_stsc','decomposition',i,rval,texist) + if(texist) decay_rate_stsc = real(rval) + call getConfigREAL ('decay_rate_fsc','decomposition',i,rval,texist) + if(texist) decay_rate_fsc = real(rval) + call getConfigREAL ('decay_rate_ssc','decomposition',i,rval,texist) + if(texist) decay_rate_ssc = real(rval) call getConfigINT ('N_decomp_lim','decomposition',i,ival,texist) if(texist) N_decomp_lim= ival diff --git a/ED/src/io/edio.f90 b/ED/src/io/edio.f90 index 243e455ca..2611159b2 100644 --- a/ED/src/io/edio.f90 +++ b/ED/src/io/edio.f90 @@ -338,7 +338,6 @@ subroutine spatial_averages integer :: k,ksn integer :: lai_index integer :: nsoil - real :: lai_patch real :: site_area_i real :: poly_area_i real :: frqsumi @@ -414,6 +413,7 @@ subroutine spatial_averages cgrid%avg_vleaf_resp (ipy) = 0.0 cgrid%avg_plant_resp (ipy) = 0.0 cgrid%avg_htroph_resp (ipy) = 0.0 + cgrid%avg_cwd_resp (ipy) = 0.0 cgrid%avg_leaf_drop (ipy) = 0.0 cgrid%avg_leaf_maintenance(ipy) = 0.0 cgrid%avg_root_maintenance(ipy) = 0.0 @@ -580,23 +580,11 @@ subroutine spatial_averages ! potential and soil moisture consistent with the boundary condition. ! !------------------------------------------------------------------------------! select case (isoilbc) - case (0,1) + case (0,1,2) !----- Copy the potential from bottommost layer ----------------------------! do k=1,cpoly%lsl(isi)-1 cpoly%avg_soil_mstpot(k,isi) = cpoly%avg_soil_mstpot(cpoly%lsl(isi),isi) end do - - case (2) - !----- Super-drainage, assume dry air soil beneath. ------------------------! - do k=1,cpoly%lsl(isi)-1 - nsoil = cpoly%ntext_soil(k,isi) - if (nsoil /= 13) then - cpoly%avg_soil_mstpot(k,isi) = soil(nsoil)%slpots & - * ( soil(nsoil)%slmsts & - / soil(nsoil)%soilcp ) & - ** soil(nsoil)%slbs - end if - end do case (3) !----- Aquifer, assume saturated soil moisture. ----------------------------! do k=1,cpoly%lsl(isi)-1 @@ -673,7 +661,6 @@ subroutine spatial_averages ! scaled by nplant. Just make sure that we have at least one cohort. ! !---------------------------------------------------------------------------! if (cpatch%ncohorts > 0) then - lai_patch = sum(cpatch%lai, cpatch%leaf_resolvable) !------------------------------------------------------------------------! ! Leaf water and energy properties. ! @@ -687,6 +674,10 @@ subroutine spatial_averages call uextcm2tl(csite%avg_leaf_energy(ipa),csite%avg_leaf_water(ipa) & ,csite%avg_leaf_hcap(ipa),csite%avg_leaf_temp(ipa) & ,csite%avg_leaf_fliq(ipa)) + + !----- Find the mean vapour pressure deficit. ------------------------! + csite%avg_leaf_vpdef(ipa) = sum(cpatch%leaf_vpdef * cpatch%lai) & + / sum(cpatch%lai) else !----- No, copy the canopy air properties. ---------------------------! csite%avg_leaf_temp(ipa) = csite%can_temp(ipa) @@ -697,6 +688,7 @@ subroutine spatial_averages else csite%avg_leaf_fliq(ipa) = 0.0 end if + csite%avg_leaf_vpdef (ipa) = csite%can_vpdef(ipa) end if !------------------------------------------------------------------------! ! Stem water and energy properties. @@ -864,11 +856,11 @@ subroutine spatial_averages cgrid%min_leaf_temp(ipy) = minval(cpatch%leaf_temp) end if else - lai_patch = 0. csite%avg_leaf_energy(ipa) = 0. csite%avg_leaf_water(ipa) = 0. csite%avg_leaf_hcap(ipa) = 0. csite%avg_leaf_temp(ipa) = csite%can_temp(ipa) + csite%avg_leaf_vpdef (ipa) = csite%can_vpdef(ipa) csite%avg_wood_energy(ipa) = 0. csite%avg_wood_water(ipa) = 0. csite%avg_wood_hcap(ipa) = 0. @@ -889,6 +881,10 @@ subroutine spatial_averages + csite%mean_rh(ipa) & * csite%area(ipa)*cpoly%area(isi) & * site_area_i * poly_area_i + cgrid%avg_cwd_resp (ipy) = cgrid%avg_cwd_resp(ipy) & + + csite%mean_cwd_rh(ipa) & + * csite%area(ipa)*cpoly%area(isi) & + * site_area_i * poly_area_i !----- Not sure what these variables do. -----------------------------------! lai_index = min(3,max(1, floor(csite%lai(ipa)/2.0) + 1) ) @@ -969,6 +965,7 @@ subroutine spatial_averages cpoly%avg_can_depth (isi) = sum(csite%can_depth * csite%area) * site_area_i cpoly%avg_can_theta (isi) = sum(csite%can_theta * csite%area) * site_area_i cpoly%avg_can_theiv (isi) = sum(csite%can_theiv * csite%area) * site_area_i + cpoly%avg_can_vpdef (isi) = sum(csite%can_vpdef * csite%area) * site_area_i cpoly%avg_can_shv (isi) = sum(csite%can_shv * csite%area) * site_area_i cpoly%avg_can_co2 (isi) = sum(csite%can_co2 * csite%area) * site_area_i cpoly%avg_can_prss (isi) = sum(csite%can_prss * csite%area) * site_area_i @@ -988,6 +985,8 @@ subroutine spatial_averages * site_area_i cpoly%avg_leaf_hcap (isi) = sum(csite%avg_leaf_hcap * csite%area) & * site_area_i + cpoly%avg_leaf_vpdef (isi) = sum(csite%avg_leaf_vpdef * csite%area) & + * site_area_i cpoly%avg_wood_energy(isi) = sum(csite%avg_wood_energy * csite%area) & * site_area_i cpoly%avg_wood_water (isi) = sum(csite%avg_wood_water * csite%area) & @@ -1162,6 +1161,7 @@ subroutine spatial_averages !---------------------------------------------------------------------------------! cgrid%avg_can_depth (ipy) = sum(cpoly%avg_can_depth * cpoly%area) * poly_area_i cgrid%avg_can_theiv (ipy) = sum(cpoly%avg_can_theiv * cpoly%area) * poly_area_i + cgrid%avg_can_vpdef (ipy) = sum(cpoly%avg_can_vpdef * cpoly%area) * poly_area_i cgrid%avg_can_theta (ipy) = sum(cpoly%avg_can_theta * cpoly%area) * poly_area_i cgrid%avg_can_shv (ipy) = sum(cpoly%avg_can_shv * cpoly%area) * poly_area_i cgrid%avg_can_co2 (ipy) = sum(cpoly%avg_can_co2 * cpoly%area) * poly_area_i @@ -1234,6 +1234,7 @@ subroutine spatial_averages cgrid%avg_leaf_energy(ipy) = sum(cpoly%avg_leaf_energy * cpoly%area) * poly_area_i cgrid%avg_leaf_water(ipy) = sum(cpoly%avg_leaf_water * cpoly%area) * poly_area_i cgrid%avg_leaf_hcap(ipy) = sum(cpoly%avg_leaf_hcap * cpoly%area) * poly_area_i + cgrid%avg_leaf_vpdef(ipy) = sum(cpoly%avg_leaf_vpdef * cpoly%area) * poly_area_i cgrid%avg_wood_energy(ipy) = sum(cpoly%avg_wood_energy * cpoly%area) * poly_area_i cgrid%avg_wood_water(ipy) = sum(cpoly%avg_wood_water * cpoly%area) * poly_area_i cgrid%avg_wood_hcap(ipy) = sum(cpoly%avg_wood_hcap * cpoly%area) * poly_area_i diff --git a/ED/src/io/h5_output.F90 b/ED/src/io/h5_output.F90 index ad1631ba7..04d53ae10 100644 --- a/ED/src/io/h5_output.F90 +++ b/ED/src/io/h5_output.F90 @@ -181,11 +181,11 @@ subroutine h5_output(vtype) !------------------------------------------------------------------------------------! ! Print a check about the file status. ! !------------------------------------------------------------------------------------! - if (verbose) then - write (unit=*,fmt='(a,1x,a,2(a,1x,i6),a,1x,l,a)') & - ' * HDF5. Type:',trim(vtype),'. Node:',mynum,'. Grid: ',ngr & - ,'. New File:',new_file,'...' - end if +! if (verbose) then +! write (unit=*,fmt='(a,1x,a,2(a,1x,i6),a,1x,l,a)') & +! ' * HDF5. Type:',trim(vtype),'. Node:',mynum,'. Grid: ',ngr & +! ,'. New File:',new_file,'...' +! end if !------------------------------------------------------------------------------------! @@ -284,7 +284,8 @@ subroutine h5_output(vtype) outhour = itimea*100 case default - if (nrec_fast == 1) then + if (nrec_fast == 1 .or. nrec_fast == 0 ) then + !----- Single file per output. ---------------------------------------------! call makefnam(anamel,ffilout,time,iyeara,imontha,idatea,itimea*100,vnam & ,cgrid,'h5 ') @@ -317,8 +318,6 @@ subroutine h5_output(vtype) end select !---------------------------------------------------------------------------------! - - !---------------------------------------------------------------------------------! ! Check whether the file exists, and stop the run if the user doesn't want ! ! the files to be over-written. ! diff --git a/ED/src/memory/decomp_coms.f90 b/ED/src/memory/decomp_coms.f90 index 745299372..bbd48b59a 100644 --- a/ED/src/memory/decomp_coms.f90 +++ b/ED/src/memory/decomp_coms.f90 @@ -1,45 +1,139 @@ +!==========================================================================================! +!==========================================================================================! +! Module decomp_coms. These variables control the heterotrophic respiration. ! +! ! +! IMPORTANT: do not initialise parameters in the module unless they are constants ! +! (defined with the "parameter" attribute"). Not all compilers will assign ! +! the values here. The proper location to assign the initial values is in ! +! ed_params.f90. ! +!------------------------------------------------------------------------------------------! Module decomp_coms - - ! DO NOT INITIALIZE PARAMETERS IN THEIR MODULES - NOT ALL COMPILERS WILL ACTUALLY INITIALIZE THEM - - use ed_max_dims, only: n_pft - - implicit none - - real :: resp_opt_water ! Optimal soil porosity, as a fraction of total porosity, for heterotrophic respiration (dimensionless). - - real :: resp_water_below_opt ! Determines rate at which heterotrophic respiration declines for relative porosities below resp_opt_water (dimensionless). - - real :: resp_water_above_opt ! Determines rate at which heterotrophic respiration declines for relative porosities above resp_opt_water (dimensionless). - - real :: resp_temperature_increase ! Determines how rapidly heterotrophic respiration increases with increasing temperature (1/K). - - real :: N_immobil_supply_scale ! Supply coefficient for nitrogen immobilization (1/day) - - real :: cwd_frac ! Fraction of structural material that goes to coarse woody debris upon mortality. Note that currently CWD decomposed at a rate identical to structural soil C. - - real :: r_fsc ! Fraction of structural pool decomposition going to heterotrophic respiration - - real :: r_stsc ! Fraction of structural pool decomposition going to heterotrophic respiration instead of the slow pool. - - real :: r_ssc ! Fraction of structural pool decomposition going to heterotrophic respiration - - real :: K1 ! Intrinsic decay rate of fast pool soil carbon (1/days); this is modulated by Lc - - real :: K2 ! Intrinsic decay rate of fast pool soil carbon (1/days) - - real :: K3 ! Intrinsic decay rate of slow pool soil carbon (1/days). This pool has already decayed from the structural pool. - - ! Labile fraction of leaves, fine roots and sapwood. - real, dimension(n_pft) :: f_labile - !! moved setting of values to initialize_pft_resp_params [[MCD]] - - ! Flag specifying whether or not decomposition is to be limited by - ! nitrogen availability. - integer :: n_decomp_lim - - ! Specifies whether to use Lloyd and Taylor (1994) temperature dependence - logical :: LloydTaylor + use ed_max_dims, only: n_pft + + implicit none + + !=======================================================================================! + !=======================================================================================! + ! Parameters that will be read in the namelist. ! + !---------------------------------------------------------------------------------------! + !---------------------------------------------------------------------------------------! + ! N_DECOMP_LIM -- This controls whether decomposition can be limited by nitrogen. ! + ! 0. No limitation ! + ! 1. ED-2.1 nitrogen limitation model. ! + !---------------------------------------------------------------------------------------! + integer :: n_decomp_lim + !---------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! DECOMP_SCHEME -- This specifies the dependence of soil decomposition on temperature. ! + ! 0. ED-2.1 default, the original exponential (low temperature ! + ! limitation only). ! + ! 1. Lloyd and Taylor (1994) model ! + ! [[option 1 requires parameters to be set in xml]] ! + ! 2. Similar to ED-1.0 and CENTURY model, heterotrophic respiration ! + ! reaches a maximum at around 38C (using the default parameters), ! + ! then quickly falls to zero at around 50C. ! + !---------------------------------------------------------------------------------------! + integer :: decomp_scheme + !---------------------------------------------------------------------------------------! + !=======================================================================================! + !=======================================================================================! + + + + + !=======================================================================================! + !=======================================================================================! + ! Other variables. ! + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! Optimal soil porosity, as a fraction of total porosity, for heterotrophic ! + ! respiration (dimensionless). ! + !---------------------------------------------------------------------------------------! + real :: resp_opt_water + !---------------------------------------------------------------------------------------! + ! Determines rate at which heterotrophic respiration declines for relative ! + ! porosities below resp_opt_water (dimensionless). ! + !---------------------------------------------------------------------------------------! + real :: resp_water_below_opt + !---------------------------------------------------------------------------------------! + ! Determines rate at which heterotrophic respiration declines for relative ! + ! porosities above resp_opt_water (dimensionless). ! + !---------------------------------------------------------------------------------------! + real :: resp_water_above_opt + !---------------------------------------------------------------------------------------! + ! When DECOMP_SCHEME is set to 0 or 1, it determines how rapidly heterotrophic ! + ! respiration increases with increasing temperature (1/K). Notice that between 0 and 1 ! + ! there is a significant change in the functional form, so they don't necessarily have ! + ! the same meaning... ! + !---------------------------------------------------------------------------------------! + real :: resp_temperature_increase + !---------------------------------------------------------------------------------------! + ! The following variables are used when DECOMP_SCHEME is 1. (LLoyd and Taylor 1994) ! + !---------------------------------------------------------------------------------------! + real :: rh_lloyd_1 + real :: rh_lloyd_2 + real :: rh_lloyd_3 + !---------------------------------------------------------------------------------------! + ! The following variables are used when DECOMP_SCHEME is 2. (based on CENTURY model ! + ! and ED-1.0). ! + !---------------------------------------------------------------------------------------! + real :: rh_decay_low ! Low temperature decay rate [ 1/K] + real :: rh_decay_high ! High temperature decay rate [ 1/K] + real :: rh_low_temp ! Low temperature reference [ K] + real :: rh_high_temp ! High temperature reference [ K] + real :: rh_decay_dry ! Decay rate for dry soil [ --] + real :: rh_decay_wet ! Decay rate for wet soil [ --] + real :: rh_dry_smoist ! Dry relative soil moisture threshold [ --] + real :: rh_wet_smoist ! Wet relative soil moisture threshold [ --] + real :: rh_active_depth ! Maximum depth for avg. temperature and moisture [ m] + integer :: k_rh_active ! Index of the bottommost layer [ --] + !---------------------------------------------------------------------------------------! + ! Supply coefficient for nitrogen immobilization (1/day). ! + !---------------------------------------------------------------------------------------! + real :: N_immobil_supply_scale + !---------------------------------------------------------------------------------------! + ! Fraction of structural material that goes to coarse woody debris upon mortality. ! + ! Note that currently CWD decomposed at a rate identical to structural soil C. ! + !---------------------------------------------------------------------------------------! + real :: cwd_frac + !---------------------------------------------------------------------------------------! + ! Fraction of structural pool decomposition going to heterotrophic respiration. ! + !---------------------------------------------------------------------------------------! + real :: r_fsc + !---------------------------------------------------------------------------------------! + ! Fraction of structural pool decomposition going to heterotrophic respiration ! + ! instead of the slow pool. ! + !---------------------------------------------------------------------------------------! + real :: r_stsc + !---------------------------------------------------------------------------------------! + ! Fraction of structural pool decomposition going to heterotrophic respiration ! + !---------------------------------------------------------------------------------------! + real :: r_ssc + !---------------------------------------------------------------------------------------! + ! Intrinsic decay rate of structural pool soil carbon (1/days); this is modulated ! + ! by Lc. ! + !---------------------------------------------------------------------------------------! + real :: decay_rate_stsc + !---------------------------------------------------------------------------------------! + ! Intrinsic decay rate of fast pool soil carbon (1/days). ! + !---------------------------------------------------------------------------------------! + real :: decay_rate_fsc + !---------------------------------------------------------------------------------------! + ! Intrinsic decay rate of slow pool soil carbon (1/days). This pool has already ! + ! decayed from the structural pool. ! + !---------------------------------------------------------------------------------------! + real :: decay_rate_ssc + !---------------------------------------------------------------------------------------! + ! Labile fraction of leaves, fine roots and sapwood. ! + ! ([[MCD]]. Moved setting of values to initialize_pft_resp_params) ! + !---------------------------------------------------------------------------------------! + real, dimension(n_pft) :: f_labile + !---------------------------------------------------------------------------------------! end Module decomp_coms +!==========================================================================================! +!==========================================================================================! diff --git a/ED/src/memory/detailed_coms.f90 b/ED/src/memory/detailed_coms.f90 index 535fd8a7f..98d4c05c4 100644 --- a/ED/src/memory/detailed_coms.f90 +++ b/ED/src/memory/detailed_coms.f90 @@ -1,12 +1,36 @@ !==========================================================================================! !==========================================================================================! ! Module detailed_coms: this module contains variables used to control some ED detailed ! -! output, which can be used for debugging. ! +! output, which can be used for debugging and to control census dynamics. ! !------------------------------------------------------------------------------------------! module detailed_coms implicit none + + + !---------------------------------------------------------------------------------------! + ! Census variables. This is going to create unique census statuses to cohorts, to ! + ! better compare the model with census observations. In case you don't intend to ! + ! compare the model with census data, set up DT_CENSUS to 1., otherwise you may reduce ! + ! cohort fusion. ! + ! DT_CENSUS -- Time between census, in months. Currently the maximum is 60 ! + ! months, to avoid excessive memory allocation. Every time the ! + ! simulation reaches the census time step, all census tags will be ! + ! reset. ! + ! YR1ST_CENSUS -- In which year was the first census conducted? ! + ! MON1ST_CENSUS -- In which month was the first census conducted? ! + ! MIN_RECRUIT_DBH -- Minimum DBH that is measured in the census, in cm. ! + !---------------------------------------------------------------------------------------! + integer :: dt_census + integer :: yr1st_census + integer :: mon1st_census + real :: min_recruit_dbh + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! IDETAILED -- This flag controls the possible detailed outputs, mostly used for ! ! debugging purposes. Notice that this doesn't replace the normal debug- ! diff --git a/ED/src/memory/disturb_coms.f90 b/ED/src/memory/disturb_coms.f90 index 754c208be..d06600879 100644 --- a/ED/src/memory/disturb_coms.f90 +++ b/ED/src/memory/disturb_coms.f90 @@ -160,9 +160,17 @@ module disturb_coms real :: fire_dryness_threshold !---------------------------------------------------------------------------------------! - ! Fire may occur when the total water (ground + underground) converted to ! - ! equivalent average soil moisture is below this threshold and include_fire is 2. ! - ! Units: relative fraction. ! + ! SM_FIRE -- This is used only when INCLUDE_FIRE = 2 or 3, and it has different ! + ! meanings. The sign here matters. ! + ! When INCLUDE_FIRE = 2: ! + ! >= 0. - Minimum relative soil moisture above dry air of the top ! + ! 1m that will prevent fires to happen. ! + ! < 0. - Minimum mean soil moisture potential in MPa of the top ! + ! 1m 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. ! + ! When INCLUDE_FIRE = 3, only positive values are allowed. This is ! + ! the minimum water deficit, in kg/m2/30 days, to trigger fires. ! !---------------------------------------------------------------------------------------! real :: sm_fire diff --git a/ED/src/memory/ed_max_dims.F90 b/ED/src/memory/ed_max_dims.F90 index 29b6c1302..1e9e2ca4d 100644 --- a/ED/src/memory/ed_max_dims.F90 +++ b/ED/src/memory/ed_max_dims.F90 @@ -189,14 +189,11 @@ module ed_max_dims ! 2. Negative carbon balance; ! ! 3. Treefall mortality; ! ! 4. Mortality due to cold weather. ! + ! 5. Disturbance mortality. This is not directly applied to the cohort population, ! + ! because this mortality is associated with the creation of a new patch, but it is ! + ! saved here for posterior analysis. ! !---------------------------------------------------------------------------------------! - integer, parameter :: n_mort = 4 - !---------------------------------------------------------------------------------------! - - - - !----- Maximum number of model variables. ----------------------------------------------! - integer, parameter :: maxvars = 250 + integer, parameter :: n_mort = 5 !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ed_mem_alloc.f90 b/ED/src/memory/ed_mem_alloc.f90 index ad54b3326..c1f315f7a 100644 --- a/ED/src/memory/ed_mem_alloc.f90 +++ b/ED/src/memory/ed_mem_alloc.f90 @@ -5,7 +5,6 @@ subroutine ed_mem_alloc(proc_type) use ed_max_dims , only : n_pft & ! intent(in) , n_dist_types & ! intent(in) , n_dbh & ! intent(in) - , maxvars & ! intent(in) , maxgrds ! ! intent(in) use ed_mem_grid_dim_defs, only : define_grid_dim_pointer ! ! subroutine use ed_state_vars , only : gdpy & ! intent(in) diff --git a/ED/src/memory/ed_misc_coms.f90 b/ED/src/memory/ed_misc_coms.f90 index a4893d611..97c65e415 100644 --- a/ED/src/memory/ed_misc_coms.f90 +++ b/ED/src/memory/ed_misc_coms.f90 @@ -225,4 +225,10 @@ Module ed_misc_coms ! growth occurs daily !---------------------------------------------------------------------------------------! + !----- Namelist option to suppress warnings when HDF5 data is not in the + ! initialization file. Errors will still report and halt the run. + + logical :: suppress_h5_warnings + + end module ed_misc_coms diff --git a/ED/src/memory/ed_state_vars.f90 b/ED/src/memory/ed_state_vars.f90 index e314d272e..852335796 100644 --- a/ED/src/memory/ed_state_vars.f90 +++ b/ED/src/memory/ed_state_vars.f90 @@ -76,11 +76,20 @@ module ed_state_vars ! Rate of change in agb (kgC/plant/yr) real, pointer, dimension(:) :: dagb_dt + ! Rate of change in agb (1/yr) + real, pointer, dimension(:) :: dlnagb_dt + ! Rate of change in basal area (cm2/yr) real, pointer, dimension(:) :: dba_dt + ! Rate of change in basal area (1/yr) + real, pointer, dimension(:) :: dlnba_dt + ! Rate of change in dbh (cm/yr) real, pointer, dimension(:) :: ddbh_dt + + ! Rate of change in dbh ( 1/yr) + real, pointer, dimension(:) :: dlndbh_dt ! Plant diameter at breast height (cm) real ,pointer,dimension(:) :: dbh @@ -94,13 +103,24 @@ module ed_state_vars ! phenology_status codes: ! 0 - plant has the maximum LAI, given its size - ! 1 - plant has an LAI between 0 and its maximum + ! 1 - plant is growing leaves ! -1 - plant is actively dropping leaves ! 2 - plant has no leaves - - integer ,pointer,dimension(:) :: phenology_status + ! recruit_dbh codes (updated every month): + ! 0 - new plant + ! 1 - first month with DBH > 10cm + ! 2 - established as DBH > 10cm + integer, pointer, dimension(:) :: recruit_dbh + + ! census_status codes (updated every census): + ! 0 - this cohort has never been with DBH > 10 cm at census times + ! 1 - New recruit (DBH > 10 cm for the first census) + ! 2 - Established (DBH > 10 cm for at least two censuses + integer, pointer, dimension(:) :: census_status + + ! Biomass of live tissue (kgC/plant) real ,pointer,dimension(:) :: balive @@ -130,15 +150,24 @@ module ed_state_vars real ,pointer,dimension(:) :: bstorage ! Monthly carbon balance for past 12 months and the current month - ! (kgC/plant/yr) - 13th column will have the partial month integration - real, pointer,dimension(:,:) :: cb !(13,ncohorts) - + ! (kgC/plant/yr) - 13th column holds the partial month integration + real, pointer,dimension(:,:) :: cb !(13,ncohorts) + ! Maximum monthly carbon balance for past 12 months and the current - ! month if cohort were at the top of the canopy (kgC/plant, over one month) - ! 13th column will have the partial month integration. - real, pointer,dimension(:,:) :: cb_max !(13,ncohorts) - - ! Annual average ratio of cb/cb_max + ! month if cohort were at the top of the canopy (maximum light). + ! (kgC/plant/yr) - 13th column holds the partial month integration. + real, pointer,dimension(:,:) :: cb_lightmax !(13,ncohorts) + + ! Maximum monthly carbon balance for past 12 months and the current + ! month if cohort had access to all soil moisture needed (maximum moisture/fsw). + ! (kgC/plant/yr) - 13th column holds the partial month integration. + real, pointer,dimension(:,:) :: cb_moistmax !(13,ncohorts) + + ! Relative carbon balance: + ! CB CB + ! cr = k ------------- + (1 - k) ------------- + ! CB_lightmax CB_watermax + ! k is the ddmort_const given on the namelist real ,pointer,dimension(:) :: cbr_bar ! Monthly mean of cb. The only difference from cb is the way it is scaled, so @@ -151,6 +180,9 @@ module ed_state_vars ! Leaf temperature (K) real ,pointer,dimension(:) :: leaf_temp + ! Leaf vapour pressure deficit (Pa) + real ,pointer,dimension(:) :: leaf_vpdef + ! Leaf temperature of the previous step (K) real, pointer,dimension(:) :: leaf_temp_pv @@ -245,9 +277,13 @@ module ed_state_vars ! averaged over 1 day real ,pointer,dimension(:) :: today_gpp_pot - ! Maximum GPP if cohort were at the top of the canopy + ! Maximum GPP if cohort were at the top of the canopy (maximum light) ! [umol/m2 ground/s], averaged over 1 day - real ,pointer,dimension(:) :: today_gpp_max + real ,pointer,dimension(:) :: today_gpp_lightmax + + ! Maximum GPP if cohort had all soil moisture needed (maximum soil moisture) + ! [umol/m2 ground/s], averaged over 1 day + real ,pointer,dimension(:) :: today_gpp_moistmax ! Plant growth respiration (kgC/plant/day) real ,pointer,dimension(:) :: growth_respiration @@ -292,6 +328,9 @@ module ed_state_vars ! Plant density tendency [plants/m2/month] real ,pointer,dimension(:) :: monthly_dndt + ! Plant density tendency [1/month] + real ,pointer,dimension(:) :: monthly_dlnndt + ! Mortality rate [yr-1] real , pointer, dimension(:,:) :: mort_rate @@ -567,6 +606,9 @@ module ed_state_vars ! Ice-vapour equivalent potential temperature of canopy air space [K] real , pointer,dimension(:) :: can_theiv + ! Vapour pressure deficit [Pa] + real , pointer,dimension(:) :: can_vpdef + ! Temperature (K) of canopy air real , pointer,dimension(:) :: can_temp @@ -685,13 +727,20 @@ module ed_state_vars ! Average monthly ground water [kg/m2], used for fire ignition real , pointer,dimension(:) :: avg_monthly_gndwater - ! average of rh [umol/m2/s] over FRQSTATE + ! Average monthly water deficit [kg/m2], used for fire ignition + real , pointer,dimension(:) :: avg_monthly_waterdef + + ! average of rh and cwd_rh [umol/m2/s] over FRQSTATE real , pointer,dimension(:) :: mean_rh + real , pointer,dimension(:) :: mean_cwd_rh - ! average of rh [umol/m2/s] over a day and a month, respectively + ! average of rh and cwd_rh [kgC/m2/yr] over a day and a month, respectively real , pointer,dimension(: ) :: dmean_rh real , pointer,dimension(:,:) :: qmean_rh real , pointer,dimension(: ) :: mmean_rh + real , pointer,dimension(: ) :: dmean_cwd_rh + real , pointer,dimension(:,:) :: qmean_cwd_rh + real , pointer,dimension(: ) :: mmean_cwd_rh ! average of net ecosystem productivity (NEP) [umol/m2/s] over FRQSTATE real , pointer,dimension(:) :: mean_nep @@ -784,6 +833,9 @@ module ed_state_vars ! Average heterotrophic respiration [umol_CO2/m2/s] real , pointer,dimension(:) :: co2budget_rh + ! Average coarse woody debris respiration [umol_CO2/m2/s] + real , pointer,dimension(:) :: co2budget_cwd_rh + ! Daily average residuals real, pointer, dimension(:) :: dmean_co2_residual ! [umol_CO2/m2] real, pointer, dimension(:) :: dmean_energy_residual ! [J/m2] @@ -1053,6 +1105,7 @@ module ed_state_vars !----- Mass and Energy ---------------------------------------------------------------! real,pointer,dimension(:) :: avg_leaf_energy ! Average leaf internal energy [ J/m2] real,pointer,dimension(:) :: avg_leaf_temp ! Average leaf temperature [ K] + real,pointer,dimension(:) :: avg_leaf_vpdef ! Average leaf VPD [ Pa] real,pointer,dimension(:) :: avg_leaf_fliq ! Avg. liq. frac. of leaf water [ ---] real,pointer,dimension(:) :: avg_leaf_water ! Avg. water on top of leaves [ kg/m2] real,pointer,dimension(:) :: avg_leaf_hcap ! Avg. leaf heat capacity [J/m2/K] @@ -1325,6 +1378,7 @@ module ed_state_vars !----- Mass and Energy ---------------------------------------------------------------! real,pointer,dimension(:) :: avg_leaf_energy ! Average leaf internal energy [ J/m2] real,pointer,dimension(:) :: avg_leaf_temp ! Average leaf temperature [ K] + real,pointer,dimension(:) :: avg_leaf_vpdef ! Average leaf VPD [ Pa] real,pointer,dimension(:) :: avg_leaf_fliq ! Avg. liq. frac. of leaf water [ ---] real,pointer,dimension(:) :: avg_leaf_water ! Avg. water on top of leaves [ kg/m2] real,pointer,dimension(:) :: avg_leaf_hcap ! Avg. leaf heat capacity [J/m2/K] @@ -1341,6 +1395,7 @@ module ed_state_vars real,pointer,dimension(:) :: avg_can_prss real,pointer,dimension(:) :: avg_can_theta real,pointer,dimension(:) :: avg_can_theiv + real,pointer,dimension(:) :: avg_can_vpdef real,pointer,dimension(:) :: avg_can_depth real,pointer,dimension(:,:) :: avg_soil_energy @@ -1363,6 +1418,7 @@ module ed_state_vars real,pointer,dimension(:) :: avg_atm_tmp real,pointer,dimension(:) :: avg_atm_shv real,pointer,dimension(:) :: avg_atm_prss + real,pointer,dimension(:) :: avg_atm_vpdef !----- NACP intercomparison ---------------------------------------------! @@ -1620,6 +1676,7 @@ module ed_state_vars !----- Mass and Energy ---------------------------------------------------------------! real,pointer,dimension(:) :: avg_leaf_energy ! Average leaf internal energy [ J/m2] real,pointer,dimension(:) :: avg_leaf_temp ! Average leaf temperature [ K] + real,pointer,dimension(:) :: avg_leaf_vpdef ! Average leaf VPD [ Pa] real,pointer,dimension(:) :: avg_leaf_fliq ! Avg. liq. frac. of leaf water [ ---] real,pointer,dimension(:) :: avg_leaf_water ! Avg. water on top of leaves [ kg/m2] real,pointer,dimension(:) :: avg_leaf_hcap ! Avg. leaf heat capacity [J/m2/K] @@ -1636,6 +1693,7 @@ module ed_state_vars real,pointer,dimension(:) :: avg_can_prss real,pointer,dimension(:) :: avg_can_theta real,pointer,dimension(:) :: avg_can_theiv + real,pointer,dimension(:) :: avg_can_vpdef real,pointer,dimension(:) :: avg_can_depth real,pointer,dimension(:,:) :: avg_soil_energy @@ -1709,6 +1767,7 @@ module ed_state_vars real,pointer,dimension(:) :: avg_par_beam real,pointer,dimension(:) :: avg_par_diffuse real,pointer,dimension(:) :: avg_atm_tmp + real,pointer,dimension(:) :: avg_atm_vpdef real,pointer,dimension(:) :: avg_atm_shv real,pointer,dimension(:) :: avg_rshort real,pointer,dimension(:) :: avg_rshort_diffuse @@ -1740,6 +1799,7 @@ module ed_state_vars real,pointer,dimension(:) :: avg_vleaf_resp real,pointer,dimension(:) :: avg_plant_resp real,pointer,dimension(:) :: avg_htroph_resp + real,pointer,dimension(:) :: avg_cwd_resp real,pointer,dimension(:) :: avg_leaf_drop real,pointer,dimension(:) :: avg_leaf_maintenance real,pointer,dimension(:) :: avg_root_maintenance @@ -1784,6 +1844,7 @@ module ed_state_vars real, pointer, dimension(:) :: dmean_nep ! [ kgC/m²/yr] real, pointer, dimension(:) :: dmean_plresp ! [ kgC/m²/yr] real, pointer, dimension(:) :: dmean_rh ! [ kgC/m²/yr] + real, pointer, dimension(:) :: dmean_cwd_rh ! [ kgC/m²/yr] real, pointer, dimension(:) :: dmean_leaf_resp ! [ kgC/m²/yr] real, pointer, dimension(:) :: dmean_root_resp ! [ kgC/m²/yr] real, pointer, dimension(:) :: dmean_growth_resp ! [ kgC/m²/yr] @@ -1812,17 +1873,20 @@ module ed_state_vars real, pointer, dimension(:) :: dmean_can_prss ! (npolygons) real, pointer, dimension(:) :: dmean_can_theta ! (npolygons) real, pointer, dimension(:) :: dmean_can_theiv ! (npolygons) + real, pointer, dimension(:) :: dmean_can_vpdef ! (npolygons) real, pointer, dimension(:) :: dmean_gnd_temp ! (npolygons) real, pointer, dimension(:) :: dmean_gnd_shv ! (npolygons) real, pointer, dimension(:) :: dmean_leaf_energy ! (npolygons) real, pointer, dimension(:) :: dmean_leaf_water ! (npolygons) real, pointer, dimension(:) :: dmean_leaf_hcap ! (npolygons) real, pointer, dimension(:) :: dmean_leaf_temp ! (npolygons) + real, pointer, dimension(:) :: dmean_leaf_vpdef ! (npolygons) real, pointer, dimension(:) :: dmean_wood_energy ! (npolygons) real, pointer, dimension(:) :: dmean_wood_water ! (npolygons) real, pointer, dimension(:) :: dmean_wood_hcap ! (npolygons) real, pointer, dimension(:) :: dmean_wood_temp ! (npolygons) real, pointer, dimension(:) :: dmean_atm_temp ! (npolygons) + real, pointer, dimension(:) :: dmean_atm_vpdef ! (npolygons) real, pointer, dimension(:) :: dmean_atm_shv ! (npolygons) real, pointer, dimension(:) :: dmean_atm_co2 ! (npolygons) real, pointer, dimension(:) :: dmean_atm_prss ! (npolygons) @@ -1861,6 +1925,7 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmean_nep ! [ kgC/m²/yr] real, pointer, dimension(:,:) :: qmean_plresp ! [ kgC/m²/yr] real, pointer, dimension(:,:) :: qmean_rh ! [ kgC/m²/yr] + real, pointer, dimension(:,:) :: qmean_cwd_rh ! [ kgC/m²/yr] real, pointer, dimension(:,:) :: qmean_leaf_resp ! [ kgC/m²/yr] real, pointer, dimension(:,:) :: qmean_root_resp ! [ kgC/m²/yr] @@ -1877,17 +1942,20 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmean_can_prss ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_can_theta ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_can_theiv ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_can_vpdef ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_gnd_temp ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_gnd_shv ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_leaf_energy ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_leaf_water ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_leaf_hcap ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_leaf_temp ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_leaf_vpdef ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_wood_energy ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_wood_water ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_wood_hcap ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_wood_temp ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_atm_temp ! (ndcycle,npolygons) + real, pointer, dimension(:,:) :: qmean_atm_vpdef ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_atm_shv ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_atm_co2 ! (ndcycle,npolygons) real, pointer, dimension(:,:) :: qmean_atm_prss ! (ndcycle,npolygons) @@ -1915,6 +1983,7 @@ module ed_state_vars real, pointer, dimension(:,:) :: qmsqu_carbon_st real, pointer, dimension(:,:) :: qmsqu_nep real, pointer, dimension(:,:) :: qmsqu_rh + real, pointer, dimension(:,:) :: qmsqu_cwd_rh real, pointer, dimension(:,:) :: qmsqu_sensible_ac real, pointer, dimension(:,:) :: qmsqu_sensible_lc real, pointer, dimension(:,:) :: qmsqu_sensible_wc @@ -1994,6 +2063,7 @@ module ed_state_vars real, pointer, dimension(:) :: mmean_nep ! [ kgC/m²/yr] real, pointer, dimension(:) :: mmean_plresp ! [ kgC/m²/yr] real, pointer, dimension(:) :: mmean_rh ! [ kgC/m²/yr] + real, pointer, dimension(:) :: mmean_cwd_rh ! [ kgC/m²/yr] real, pointer, dimension(:) :: mmean_leaf_resp ! [ kgC/m²/yr] real, pointer, dimension(:) :: mmean_root_resp ! [ kgC/m²/yr] real, pointer, dimension(:) :: mmean_growth_resp ! [ kgC/m²/yr] @@ -2014,17 +2084,20 @@ module ed_state_vars real, pointer, dimension(:) :: mmean_can_prss ! (npolygons) real, pointer, dimension(:) :: mmean_can_theta ! (npolygons) real, pointer, dimension(:) :: mmean_can_theiv ! (npolygons) + real, pointer, dimension(:) :: mmean_can_vpdef ! (npolygons) real, pointer, dimension(:) :: mmean_gnd_temp ! (npolygons) real, pointer, dimension(:) :: mmean_gnd_shv ! (npolygons) real, pointer, dimension(:) :: mmean_leaf_energy ! (npolygons) real, pointer, dimension(:) :: mmean_leaf_water ! (npolygons) real, pointer, dimension(:) :: mmean_leaf_temp ! (npolygons) + real, pointer, dimension(:) :: mmean_leaf_vpdef ! (npolygons) real, pointer, dimension(:) :: mmean_leaf_hcap ! (npolygons) real, pointer, dimension(:) :: mmean_wood_energy ! (npolygons) real, pointer, dimension(:) :: mmean_wood_water ! (npolygons) real, pointer, dimension(:) :: mmean_wood_temp ! (npolygons) real, pointer, dimension(:) :: mmean_wood_hcap ! (npolygons) real, pointer, dimension(:) :: mmean_atm_temp ! (npolygons) + real, pointer, dimension(:) :: mmean_atm_vpdef ! (npolygons) real, pointer, dimension(:) :: mmean_rshort ! (npolygons) real, pointer, dimension(:) :: mmean_rshort_diff ! (npolygons) real, pointer, dimension(:) :: mmean_rlong ! (npolygons) @@ -2052,6 +2125,7 @@ module ed_state_vars real, pointer, dimension(:) :: mmsqu_carbon_st real, pointer, dimension(:) :: mmsqu_nep real, pointer, dimension(:) :: mmsqu_rh + real, pointer, dimension(:) :: mmsqu_cwd_rh real, pointer, dimension(:) :: mmsqu_sensible_ac real, pointer, dimension(:) :: mmsqu_sensible_lc real, pointer, dimension(:) :: mmsqu_sensible_wc @@ -2326,6 +2400,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%avg_leaf_energy (npolygons)) allocate(cgrid%avg_leaf_hcap (npolygons)) allocate(cgrid%avg_leaf_temp (npolygons)) + allocate(cgrid%avg_leaf_vpdef (npolygons)) allocate(cgrid%avg_leaf_fliq (npolygons)) allocate(cgrid%avg_leaf_water (npolygons)) allocate(cgrid%avg_wood_energy (npolygons)) @@ -2339,7 +2414,8 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%avg_can_rhos (npolygons)) allocate(cgrid%avg_can_prss (npolygons)) allocate(cgrid%avg_can_theta (npolygons)) - allocate(cgrid%avg_can_theiv(npolygons)) + allocate(cgrid%avg_can_theiv (npolygons)) + allocate(cgrid%avg_can_vpdef (npolygons)) allocate(cgrid%avg_can_depth (npolygons)) allocate(cgrid%avg_soil_energy(nzg,npolygons)) allocate(cgrid%avg_soil_mstpot(nzg,npolygons)) @@ -2365,6 +2441,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%avg_storage_resp (npolygons)) allocate(cgrid%avg_vleaf_resp (npolygons)) allocate(cgrid%avg_htroph_resp (npolygons)) + allocate(cgrid%avg_cwd_resp (npolygons)) allocate(cgrid%avg_leaf_drop (npolygons)) allocate(cgrid%avg_leaf_maintenance(npolygons)) allocate(cgrid%avg_root_maintenance(npolygons)) @@ -2432,6 +2509,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%avg_par_beam (npolygons)) allocate(cgrid%avg_par_diffuse (npolygons)) allocate(cgrid%avg_atm_tmp (npolygons)) + allocate(cgrid%avg_atm_vpdef (npolygons)) allocate(cgrid%avg_atm_shv (npolygons)) allocate(cgrid%avg_rshort (npolygons)) allocate(cgrid%avg_rshort_diffuse (npolygons)) @@ -2489,6 +2567,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%dmean_sensible_gc ( npolygons)) allocate(cgrid%dmean_plresp ( npolygons)) allocate(cgrid%dmean_rh ( npolygons)) + allocate(cgrid%dmean_cwd_rh ( npolygons)) allocate(cgrid%dmean_leaf_resp ( npolygons)) allocate(cgrid%dmean_root_resp ( npolygons)) allocate(cgrid%dmean_growth_resp ( npolygons)) @@ -2510,17 +2589,20 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%dmean_can_prss ( npolygons)) allocate(cgrid%dmean_can_theta ( npolygons)) allocate(cgrid%dmean_can_theiv ( npolygons)) + allocate(cgrid%dmean_can_vpdef ( npolygons)) allocate(cgrid%dmean_gnd_temp ( npolygons)) allocate(cgrid%dmean_gnd_shv ( npolygons)) allocate(cgrid%dmean_leaf_energy ( npolygons)) allocate(cgrid%dmean_leaf_water ( npolygons)) allocate(cgrid%dmean_leaf_hcap ( npolygons)) allocate(cgrid%dmean_leaf_temp ( npolygons)) + allocate(cgrid%dmean_leaf_vpdef ( npolygons)) allocate(cgrid%dmean_wood_energy ( npolygons)) allocate(cgrid%dmean_wood_water ( npolygons)) allocate(cgrid%dmean_wood_hcap ( npolygons)) allocate(cgrid%dmean_wood_temp ( npolygons)) allocate(cgrid%dmean_atm_temp ( npolygons)) + allocate(cgrid%dmean_atm_vpdef ( npolygons)) allocate(cgrid%dmean_atm_shv ( npolygons)) allocate(cgrid%dmean_atm_co2 ( npolygons)) allocate(cgrid%dmean_atm_prss ( npolygons)) @@ -2581,6 +2663,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmean_nep ( npolygons)) allocate(cgrid%mmean_plresp ( npolygons)) allocate(cgrid%mmean_rh ( npolygons)) + allocate(cgrid%mmean_cwd_rh ( npolygons)) allocate(cgrid%mmean_leaf_resp ( npolygons)) allocate(cgrid%mmean_root_resp ( npolygons)) allocate(cgrid%mmean_growth_resp ( npolygons)) @@ -2603,17 +2686,20 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmean_can_prss ( npolygons)) allocate(cgrid%mmean_can_theta ( npolygons)) allocate(cgrid%mmean_can_theiv ( npolygons)) + allocate(cgrid%mmean_can_vpdef ( npolygons)) allocate(cgrid%mmean_gnd_temp ( npolygons)) allocate(cgrid%mmean_gnd_shv ( npolygons)) allocate(cgrid%mmean_leaf_energy ( npolygons)) allocate(cgrid%mmean_leaf_water ( npolygons)) allocate(cgrid%mmean_leaf_temp ( npolygons)) + allocate(cgrid%mmean_leaf_vpdef ( npolygons)) allocate(cgrid%mmean_leaf_hcap ( npolygons)) allocate(cgrid%mmean_wood_energy ( npolygons)) allocate(cgrid%mmean_wood_water ( npolygons)) allocate(cgrid%mmean_wood_temp ( npolygons)) allocate(cgrid%mmean_wood_hcap ( npolygons)) allocate(cgrid%mmean_atm_temp ( npolygons)) + allocate(cgrid%mmean_atm_vpdef ( npolygons)) allocate(cgrid%mmean_rshort ( npolygons)) allocate(cgrid%mmean_rshort_diff ( npolygons)) allocate(cgrid%mmean_rlong ( npolygons)) @@ -2642,6 +2728,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%mmsqu_carbon_st ( npolygons)) allocate(cgrid%mmsqu_nep ( npolygons)) allocate(cgrid%mmsqu_rh ( npolygons)) + allocate(cgrid%mmsqu_cwd_rh ( npolygons)) allocate(cgrid%mmsqu_sensible_ac ( npolygons)) allocate(cgrid%mmsqu_sensible_lc ( npolygons)) allocate(cgrid%mmsqu_sensible_wc ( npolygons)) @@ -2689,6 +2776,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmean_nep ( ndcycle, npolygons)) allocate(cgrid%qmean_plresp ( ndcycle, npolygons)) allocate(cgrid%qmean_rh ( ndcycle, npolygons)) + allocate(cgrid%qmean_cwd_rh ( ndcycle, npolygons)) allocate(cgrid%qmean_leaf_resp ( ndcycle, npolygons)) allocate(cgrid%qmean_root_resp ( ndcycle, npolygons)) allocate(cgrid%qmean_soil_temp (nzg, ndcycle, npolygons)) @@ -2704,17 +2792,20 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmean_can_prss ( ndcycle, npolygons)) allocate(cgrid%qmean_can_theta ( ndcycle, npolygons)) allocate(cgrid%qmean_can_theiv ( ndcycle, npolygons)) + allocate(cgrid%qmean_can_vpdef ( ndcycle, npolygons)) allocate(cgrid%qmean_gnd_temp ( ndcycle, npolygons)) allocate(cgrid%qmean_gnd_shv ( ndcycle, npolygons)) allocate(cgrid%qmean_leaf_energy ( ndcycle, npolygons)) allocate(cgrid%qmean_leaf_water ( ndcycle, npolygons)) allocate(cgrid%qmean_leaf_temp ( ndcycle, npolygons)) + allocate(cgrid%qmean_leaf_vpdef ( ndcycle, npolygons)) allocate(cgrid%qmean_leaf_hcap ( ndcycle, npolygons)) allocate(cgrid%qmean_wood_energy ( ndcycle, npolygons)) allocate(cgrid%qmean_wood_water ( ndcycle, npolygons)) allocate(cgrid%qmean_wood_temp ( ndcycle, npolygons)) allocate(cgrid%qmean_wood_hcap ( ndcycle, npolygons)) allocate(cgrid%qmean_atm_temp ( ndcycle, npolygons)) + allocate(cgrid%qmean_atm_vpdef ( ndcycle, npolygons)) allocate(cgrid%qmean_rshort ( ndcycle, npolygons)) allocate(cgrid%qmean_rshort_diff ( ndcycle, npolygons)) allocate(cgrid%qmean_rlong ( ndcycle, npolygons)) @@ -2737,6 +2828,7 @@ subroutine allocate_edtype(cgrid,npolygons) allocate(cgrid%qmsqu_carbon_st ( ndcycle, npolygons)) allocate(cgrid%qmsqu_nep ( ndcycle, npolygons)) allocate(cgrid%qmsqu_rh ( ndcycle, npolygons)) + allocate(cgrid%qmsqu_cwd_rh ( ndcycle, npolygons)) allocate(cgrid%qmsqu_sensible_ac ( ndcycle, npolygons)) allocate(cgrid%qmsqu_sensible_lc ( ndcycle, npolygons)) allocate(cgrid%qmsqu_sensible_wc ( ndcycle, npolygons)) @@ -2892,6 +2984,7 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%avg_leaf_energy (nsites)) allocate(cpoly%avg_leaf_hcap (nsites)) allocate(cpoly%avg_leaf_temp (nsites)) + allocate(cpoly%avg_leaf_vpdef (nsites)) allocate(cpoly%avg_leaf_fliq (nsites)) allocate(cpoly%avg_leaf_water (nsites)) allocate(cpoly%avg_wood_energy (nsites)) @@ -2906,6 +2999,7 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%avg_can_prss (nsites)) allocate(cpoly%avg_can_theta (nsites)) allocate(cpoly%avg_can_theiv (nsites)) + allocate(cpoly%avg_can_vpdef (nsites)) allocate(cpoly%avg_can_depth (nsites)) allocate(cpoly%avg_soil_energy (nzg,nsites)) allocate(cpoly%avg_soil_mstpot (nzg,nsites)) @@ -2921,6 +3015,7 @@ subroutine allocate_polygontype(cpoly,nsites) allocate(cpoly%rad_avg (nsites)) ! Meteorological data allocate(cpoly%avg_atm_tmp (nsites)) + allocate(cpoly%avg_atm_vpdef (nsites)) allocate(cpoly%avg_atm_shv (nsites)) allocate(cpoly%avg_atm_prss (nsites)) @@ -2998,6 +3093,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%sum_chd(npatches)) allocate(csite%plantation(npatches)) allocate(csite%can_theiv(npatches)) + allocate(csite%can_vpdef(npatches)) allocate(csite%can_temp(npatches)) allocate(csite%can_temp_pv(npatches)) allocate(csite%can_shv(npatches)) @@ -3041,7 +3137,9 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%avg_daily_temp(npatches)) allocate(csite%avg_monthly_gndwater(npatches)) + allocate(csite%avg_monthly_waterdef(npatches)) allocate(csite%mean_rh(npatches)) + allocate(csite%mean_cwd_rh(npatches)) allocate(csite%mean_nep(npatches)) allocate(csite%wbudget_loss2atm(npatches)) allocate(csite%wbudget_denseffect(npatches)) @@ -3067,6 +3165,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%co2budget_gpp_dbh(n_dbh,npatches)) allocate(csite%co2budget_plresp(npatches)) allocate(csite%co2budget_rh(npatches)) + allocate(csite%co2budget_cwd_rh(npatches)) allocate(csite%today_A_decomp(npatches)) allocate(csite%today_Af_decomp(npatches)) allocate(csite%repro(n_pft,npatches)) @@ -3180,6 +3279,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%avg_leaf_energy(npatches)) allocate(csite%avg_leaf_temp (npatches)) + allocate(csite%avg_leaf_vpdef (npatches)) allocate(csite%avg_leaf_hcap (npatches)) allocate(csite%avg_leaf_fliq (npatches)) allocate(csite%avg_leaf_water (npatches)) @@ -3207,6 +3307,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%dmean_energy_residual (npatches)) allocate(csite%dmean_water_residual (npatches)) allocate(csite%dmean_rh (npatches)) + allocate(csite%dmean_cwd_rh (npatches)) allocate(csite%dmean_A_decomp (npatches)) allocate(csite%dmean_Af_decomp (npatches)) allocate(csite%dmean_albedo (npatches)) @@ -3219,6 +3320,7 @@ subroutine allocate_sitetype(csite,npatches) allocate(csite%mmean_energy_residual (npatches)) allocate(csite%mmean_water_residual (npatches)) allocate(csite%mmean_rh (npatches)) + allocate(csite%mmean_cwd_rh (npatches)) allocate(csite%mmean_A_decomp (npatches)) allocate(csite%mmean_Af_decomp (npatches)) allocate(csite%mmean_albedo (npatches)) @@ -3227,6 +3329,7 @@ subroutine allocate_sitetype(csite,npatches) end if if (iqoutput > 0) then allocate(csite%qmean_rh (ndcycle,npatches)) + allocate(csite%qmean_cwd_rh (ndcycle,npatches)) allocate(csite%qmean_albedo (ndcycle,npatches)) allocate(csite%qmean_albedo_beam (ndcycle,npatches)) allocate(csite%qmean_albedo_diffuse(ndcycle,npatches)) @@ -3262,12 +3365,17 @@ subroutine allocate_patchtype(cpatch,ncohorts) allocate(cpatch%agb(ncohorts)) allocate(cpatch%basarea(ncohorts)) allocate(cpatch%dagb_dt(ncohorts)) + allocate(cpatch%dlnagb_dt(ncohorts)) allocate(cpatch%dba_dt(ncohorts)) + allocate(cpatch%dlnba_dt(ncohorts)) allocate(cpatch%ddbh_dt(ncohorts)) + allocate(cpatch%dlndbh_dt(ncohorts)) allocate(cpatch%dbh(ncohorts)) allocate(cpatch%bdead(ncohorts)) allocate(cpatch%bleaf(ncohorts)) allocate(cpatch%phenology_status(ncohorts)) + allocate(cpatch%recruit_dbh(ncohorts)) + allocate(cpatch%census_status(ncohorts)) allocate(cpatch%balive(ncohorts)) allocate(cpatch%broot(ncohorts)) allocate(cpatch%bsapwooda(ncohorts)) @@ -3279,10 +3387,12 @@ subroutine allocate_patchtype(cpatch,ncohorts) allocate(cpatch%wood_resolvable(ncohorts)) allocate(cpatch%bstorage(ncohorts)) allocate(cpatch%cb(13,ncohorts)) - allocate(cpatch%cb_max(13,ncohorts)) + allocate(cpatch%cb_lightmax(13,ncohorts)) + allocate(cpatch%cb_moistmax(13,ncohorts)) allocate(cpatch%cbr_bar(ncohorts)) allocate(cpatch%leaf_energy(ncohorts)) allocate(cpatch%leaf_temp (ncohorts)) + allocate(cpatch%leaf_vpdef (ncohorts)) allocate(cpatch%leaf_temp_pv(ncohorts)) allocate(cpatch%leaf_hcap (ncohorts)) allocate(cpatch%leaf_fliq (ncohorts)) @@ -3318,12 +3428,14 @@ subroutine allocate_patchtype(cpatch,ncohorts) allocate(cpatch%today_nppwood(ncohorts)) allocate(cpatch%today_nppdaily(ncohorts)) allocate(cpatch%today_gpp_pot(ncohorts)) - allocate(cpatch%today_gpp_max(ncohorts)) + allocate(cpatch%today_gpp_lightmax(ncohorts)) + allocate(cpatch%today_gpp_moistmax(ncohorts)) allocate(cpatch%growth_respiration(ncohorts)) allocate(cpatch%storage_respiration(ncohorts)) allocate(cpatch%vleaf_respiration(ncohorts)) allocate(cpatch%fsn(ncohorts)) allocate(cpatch%monthly_dndt(ncohorts)) + allocate(cpatch%monthly_dlnndt(ncohorts)) allocate(cpatch%mort_rate(n_mort,ncohorts)) allocate(cpatch%Psi_open(ncohorts)) @@ -3564,6 +3676,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%avg_leaf_energy ) nullify(cgrid%avg_leaf_hcap ) nullify(cgrid%avg_leaf_temp ) + nullify(cgrid%avg_leaf_vpdef ) nullify(cgrid%avg_leaf_fliq ) nullify(cgrid%avg_leaf_water ) nullify(cgrid%avg_wood_energy ) @@ -3578,6 +3691,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%avg_can_prss ) nullify(cgrid%avg_can_theta ) nullify(cgrid%avg_can_theiv ) + nullify(cgrid%avg_can_vpdef ) nullify(cgrid%avg_can_depth ) nullify(cgrid%avg_soil_energy ) nullify(cgrid%avg_soil_mstpot ) @@ -3599,6 +3713,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%avg_vleaf_resp ) nullify(cgrid%avg_plant_resp ) nullify(cgrid%avg_htroph_resp ) + nullify(cgrid%avg_cwd_resp ) nullify(cgrid%avg_leaf_drop ) nullify(cgrid%avg_leaf_maintenance) nullify(cgrid%avg_root_maintenance) @@ -3674,6 +3789,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%avg_par_beam ) nullify(cgrid%avg_par_diffuse ) nullify(cgrid%avg_atm_tmp ) + nullify(cgrid%avg_atm_vpdef ) nullify(cgrid%avg_atm_shv ) nullify(cgrid%avg_rshort ) nullify(cgrid%avg_rshort_diffuse ) @@ -3720,6 +3836,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%dmean_sensible_ac ) nullify(cgrid%dmean_plresp ) nullify(cgrid%dmean_rh ) + nullify(cgrid%dmean_cwd_rh ) nullify(cgrid%dmean_leaf_resp ) nullify(cgrid%dmean_root_resp ) nullify(cgrid%dmean_growth_resp ) @@ -3741,17 +3858,20 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%dmean_can_prss ) nullify(cgrid%dmean_can_theta ) nullify(cgrid%dmean_can_theiv ) + nullify(cgrid%dmean_can_vpdef ) nullify(cgrid%dmean_gnd_temp ) nullify(cgrid%dmean_gnd_shv ) nullify(cgrid%dmean_leaf_energy ) nullify(cgrid%dmean_leaf_water ) nullify(cgrid%dmean_leaf_hcap ) nullify(cgrid%dmean_leaf_temp ) + nullify(cgrid%dmean_leaf_vpdef ) nullify(cgrid%dmean_wood_energy ) nullify(cgrid%dmean_wood_water ) nullify(cgrid%dmean_wood_hcap ) nullify(cgrid%dmean_wood_temp ) nullify(cgrid%dmean_atm_temp ) + nullify(cgrid%dmean_atm_vpdef ) nullify(cgrid%dmean_atm_shv ) nullify(cgrid%dmean_atm_co2 ) nullify(cgrid%dmean_atm_prss ) @@ -3805,6 +3925,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmean_fsn ) nullify(cgrid%mmean_plresp ) nullify(cgrid%mmean_rh ) + nullify(cgrid%mmean_cwd_rh ) nullify(cgrid%mmean_leaf_resp ) nullify(cgrid%mmean_root_resp ) nullify(cgrid%mmean_growth_resp ) @@ -3820,17 +3941,20 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmean_can_prss ) nullify(cgrid%mmean_can_theta ) nullify(cgrid%mmean_can_theiv ) + nullify(cgrid%mmean_can_vpdef ) nullify(cgrid%mmean_gnd_temp ) nullify(cgrid%mmean_gnd_shv ) nullify(cgrid%mmean_leaf_energy ) nullify(cgrid%mmean_leaf_water ) nullify(cgrid%mmean_leaf_hcap ) nullify(cgrid%mmean_leaf_temp ) + nullify(cgrid%mmean_leaf_vpdef ) nullify(cgrid%mmean_wood_energy ) nullify(cgrid%mmean_wood_water ) nullify(cgrid%mmean_wood_hcap ) nullify(cgrid%mmean_wood_temp ) nullify(cgrid%mmean_atm_temp ) + nullify(cgrid%mmean_atm_vpdef ) nullify(cgrid%mmean_rshort ) nullify(cgrid%mmean_rshort_diff ) nullify(cgrid%mmean_rlong ) @@ -3863,6 +3987,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%mmsqu_carbon_st ) nullify(cgrid%mmsqu_nep ) nullify(cgrid%mmsqu_rh ) + nullify(cgrid%mmsqu_cwd_rh ) nullify(cgrid%mmsqu_sensible_ac ) nullify(cgrid%mmsqu_sensible_lc ) nullify(cgrid%mmsqu_sensible_wc ) @@ -3900,6 +4025,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmean_nep ) nullify(cgrid%qmean_plresp ) nullify(cgrid%qmean_rh ) + nullify(cgrid%qmean_cwd_rh ) nullify(cgrid%qmean_leaf_resp ) nullify(cgrid%qmean_root_resp ) nullify(cgrid%qmean_soil_temp ) @@ -3915,17 +4041,20 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmean_can_prss ) nullify(cgrid%qmean_can_theta ) nullify(cgrid%qmean_can_theiv ) + nullify(cgrid%qmean_can_vpdef ) nullify(cgrid%qmean_gnd_temp ) nullify(cgrid%qmean_gnd_shv ) nullify(cgrid%qmean_leaf_energy ) nullify(cgrid%qmean_leaf_water ) nullify(cgrid%qmean_leaf_temp ) + nullify(cgrid%qmean_leaf_vpdef ) nullify(cgrid%qmean_leaf_hcap ) nullify(cgrid%qmean_wood_energy ) nullify(cgrid%qmean_wood_water ) nullify(cgrid%qmean_wood_temp ) nullify(cgrid%qmean_wood_hcap ) nullify(cgrid%qmean_atm_temp ) + nullify(cgrid%qmean_atm_vpdef ) nullify(cgrid%qmean_rshort ) nullify(cgrid%qmean_rshort_diff ) nullify(cgrid%qmean_rlong ) @@ -3948,6 +4077,7 @@ subroutine nullify_edtype(cgrid) nullify(cgrid%qmsqu_carbon_st ) nullify(cgrid%qmsqu_nep ) nullify(cgrid%qmsqu_rh ) + nullify(cgrid%qmsqu_cwd_rh ) nullify(cgrid%qmsqu_sensible_ac ) nullify(cgrid%qmsqu_sensible_lc ) nullify(cgrid%qmsqu_sensible_wc ) @@ -4091,6 +4221,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%avg_leaf_energy) nullify(cpoly%avg_leaf_hcap ) nullify(cpoly%avg_leaf_temp ) + nullify(cpoly%avg_leaf_vpdef ) nullify(cpoly%avg_leaf_fliq ) nullify(cpoly%avg_leaf_water ) nullify(cpoly%avg_wood_energy) @@ -4105,6 +4236,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%avg_can_prss ) nullify(cpoly%avg_can_theta ) nullify(cpoly%avg_can_theiv ) + nullify(cpoly%avg_can_vpdef ) nullify(cpoly%avg_can_depth ) nullify(cpoly%avg_soil_energy) nullify(cpoly%avg_soil_mstpot) @@ -4120,6 +4252,7 @@ subroutine nullify_polygontype(cpoly) nullify(cpoly%rad_avg ) ! Meteorological conditions nullify(cpoly%avg_atm_tmp ) + nullify(cpoly%avg_atm_vpdef ) nullify(cpoly%avg_atm_shv ) nullify(cpoly%avg_atm_prss ) ! NACP @@ -4184,6 +4317,7 @@ subroutine nullify_sitetype(csite) nullify(csite%plantation) nullify(csite%cohort_count) nullify(csite%can_theiv) + nullify(csite%can_vpdef) nullify(csite%can_temp) nullify(csite%can_temp_pv) nullify(csite%can_shv) @@ -4226,10 +4360,15 @@ subroutine nullify_sitetype(csite) nullify(csite%A_c_max) nullify(csite%avg_daily_temp) nullify(csite%avg_monthly_gndwater) + nullify(csite%avg_monthly_waterdef) nullify(csite%mean_rh) nullify(csite%dmean_rh) nullify(csite%mmean_rh) nullify(csite%qmean_rh) + nullify(csite%mean_cwd_rh) + nullify(csite%dmean_cwd_rh) + nullify(csite%mmean_cwd_rh) + nullify(csite%qmean_cwd_rh) nullify(csite%dmean_albedo) nullify(csite%dmean_albedo_beam) nullify(csite%dmean_albedo_diffuse) @@ -4264,6 +4403,7 @@ subroutine nullify_sitetype(csite) nullify(csite%co2budget_gpp_dbh) nullify(csite%co2budget_plresp) nullify(csite%co2budget_rh) + nullify(csite%co2budget_cwd_rh) nullify(csite%today_A_decomp) nullify(csite%today_Af_decomp) nullify(csite%dmean_A_decomp) @@ -4382,6 +4522,7 @@ subroutine nullify_sitetype(csite) ! ---------------------------------------------- nullify(csite%avg_leaf_energy) nullify(csite%avg_leaf_temp ) + nullify(csite%avg_leaf_vpdef ) nullify(csite%avg_leaf_hcap ) nullify(csite%avg_leaf_fliq ) nullify(csite%avg_leaf_water ) @@ -4433,12 +4574,17 @@ subroutine nullify_patchtype(cpatch) nullify(cpatch%agb) nullify(cpatch%basarea) nullify(cpatch%dagb_dt) + nullify(cpatch%dlnagb_dt) nullify(cpatch%dba_dt) + nullify(cpatch%dlnba_dt) nullify(cpatch%ddbh_dt) + nullify(cpatch%dlndbh_dt) nullify(cpatch%dbh) nullify(cpatch%bdead) nullify(cpatch%bleaf) nullify(cpatch%phenology_status) + nullify(cpatch%recruit_dbh) + nullify(cpatch%census_status) nullify(cpatch%balive) nullify(cpatch%broot) nullify(cpatch%bsapwooda) @@ -4450,11 +4596,13 @@ subroutine nullify_patchtype(cpatch) nullify(cpatch%wood_resolvable) nullify(cpatch%bstorage) nullify(cpatch%cb) - nullify(cpatch%cb_max) + nullify(cpatch%cb_lightmax) + nullify(cpatch%cb_moistmax) nullify(cpatch%cbr_bar) nullify(cpatch%mmean_cb) nullify(cpatch%leaf_energy) nullify(cpatch%leaf_temp ) + nullify(cpatch%leaf_vpdef ) nullify(cpatch%leaf_temp_pv) nullify(cpatch%leaf_hcap ) nullify(cpatch%leaf_fliq ) @@ -4490,7 +4638,8 @@ subroutine nullify_patchtype(cpatch) nullify(cpatch%today_nppwood) nullify(cpatch%today_nppdaily) nullify(cpatch%today_gpp_pot) - nullify(cpatch%today_gpp_max) + nullify(cpatch%today_gpp_lightmax) + nullify(cpatch%today_gpp_moistmax) nullify(cpatch%dmean_gpp ) nullify(cpatch%dmean_nppleaf ) nullify(cpatch%dmean_nppfroot ) @@ -4519,6 +4668,7 @@ subroutine nullify_patchtype(cpatch) nullify(cpatch%vleaf_respiration) nullify(cpatch%fsn) nullify(cpatch%monthly_dndt) + nullify(cpatch%monthly_dlnndt) nullify(cpatch%mort_rate) nullify(cpatch%mmean_mort_rate) nullify(cpatch%Psi_open) @@ -4731,6 +4881,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%avg_leaf_energy )) deallocate(cgrid%avg_leaf_energy ) if(associated(cgrid%avg_leaf_hcap )) deallocate(cgrid%avg_leaf_hcap ) if(associated(cgrid%avg_leaf_temp )) deallocate(cgrid%avg_leaf_temp ) + if(associated(cgrid%avg_leaf_vpdef )) deallocate(cgrid%avg_leaf_vpdef ) if(associated(cgrid%avg_leaf_fliq )) deallocate(cgrid%avg_leaf_fliq ) if(associated(cgrid%avg_leaf_water )) deallocate(cgrid%avg_leaf_water ) if(associated(cgrid%avg_wood_energy )) deallocate(cgrid%avg_wood_energy ) @@ -4745,6 +4896,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%avg_can_prss )) deallocate(cgrid%avg_can_prss ) if(associated(cgrid%avg_can_theta )) deallocate(cgrid%avg_can_theta ) if(associated(cgrid%avg_can_theiv )) deallocate(cgrid%avg_can_theiv ) + if(associated(cgrid%avg_can_vpdef )) deallocate(cgrid%avg_can_vpdef ) if(associated(cgrid%avg_can_depth )) deallocate(cgrid%avg_can_depth ) if(associated(cgrid%avg_soil_energy )) deallocate(cgrid%avg_soil_energy ) if(associated(cgrid%avg_soil_mstpot )) deallocate(cgrid%avg_soil_mstpot ) @@ -4766,6 +4918,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%avg_vleaf_resp )) deallocate(cgrid%avg_vleaf_resp ) if(associated(cgrid%avg_plant_resp )) deallocate(cgrid%avg_plant_resp ) if(associated(cgrid%avg_htroph_resp )) deallocate(cgrid%avg_htroph_resp ) + if(associated(cgrid%avg_cwd_resp )) deallocate(cgrid%avg_cwd_resp ) if(associated(cgrid%avg_leaf_drop )) deallocate(cgrid%avg_leaf_drop ) if(associated(cgrid%avg_leaf_maintenance )) deallocate(cgrid%avg_leaf_maintenance ) if(associated(cgrid%avg_root_maintenance )) deallocate(cgrid%avg_root_maintenance ) @@ -4844,6 +4997,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%avg_par_beam )) deallocate(cgrid%avg_par_beam ) if(associated(cgrid%avg_par_diffuse )) deallocate(cgrid%avg_par_diffuse ) if(associated(cgrid%avg_atm_tmp )) deallocate(cgrid%avg_atm_tmp ) + if(associated(cgrid%avg_atm_vpdef )) deallocate(cgrid%avg_atm_vpdef ) if(associated(cgrid%avg_atm_shv )) deallocate(cgrid%avg_atm_shv ) if(associated(cgrid%avg_rshort )) deallocate(cgrid%avg_rshort ) if(associated(cgrid%avg_rshort_diffuse )) deallocate(cgrid%avg_rshort_diffuse ) @@ -4894,6 +5048,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%dmean_sensible_ac )) deallocate(cgrid%dmean_sensible_ac ) if(associated(cgrid%dmean_plresp )) deallocate(cgrid%dmean_plresp ) if(associated(cgrid%dmean_rh )) deallocate(cgrid%dmean_rh ) + if(associated(cgrid%dmean_cwd_rh )) deallocate(cgrid%dmean_cwd_rh ) if(associated(cgrid%dmean_leaf_resp )) deallocate(cgrid%dmean_leaf_resp ) if(associated(cgrid%dmean_root_resp )) deallocate(cgrid%dmean_root_resp ) if(associated(cgrid%dmean_growth_resp )) deallocate(cgrid%dmean_growth_resp ) @@ -4915,17 +5070,20 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%dmean_can_prss )) deallocate(cgrid%dmean_can_prss ) if(associated(cgrid%dmean_can_theta )) deallocate(cgrid%dmean_can_theta ) if(associated(cgrid%dmean_can_theiv )) deallocate(cgrid%dmean_can_theiv ) + if(associated(cgrid%dmean_can_vpdef )) deallocate(cgrid%dmean_can_vpdef ) if(associated(cgrid%dmean_gnd_temp )) deallocate(cgrid%dmean_gnd_temp ) if(associated(cgrid%dmean_gnd_shv )) deallocate(cgrid%dmean_gnd_shv ) if(associated(cgrid%dmean_leaf_energy )) deallocate(cgrid%dmean_leaf_energy ) if(associated(cgrid%dmean_leaf_water )) deallocate(cgrid%dmean_leaf_water ) if(associated(cgrid%dmean_leaf_hcap )) deallocate(cgrid%dmean_leaf_hcap ) if(associated(cgrid%dmean_leaf_temp )) deallocate(cgrid%dmean_leaf_temp ) + if(associated(cgrid%dmean_leaf_vpdef )) deallocate(cgrid%dmean_leaf_vpdef ) if(associated(cgrid%dmean_wood_energy )) deallocate(cgrid%dmean_wood_energy ) if(associated(cgrid%dmean_wood_water )) deallocate(cgrid%dmean_wood_water ) if(associated(cgrid%dmean_wood_hcap )) deallocate(cgrid%dmean_wood_hcap ) if(associated(cgrid%dmean_wood_temp )) deallocate(cgrid%dmean_wood_temp ) if(associated(cgrid%dmean_atm_temp )) deallocate(cgrid%dmean_atm_temp ) + if(associated(cgrid%dmean_atm_vpdef )) deallocate(cgrid%dmean_atm_vpdef ) if(associated(cgrid%dmean_atm_shv )) deallocate(cgrid%dmean_atm_shv ) if(associated(cgrid%dmean_atm_co2 )) deallocate(cgrid%dmean_atm_co2 ) if(associated(cgrid%dmean_atm_prss )) deallocate(cgrid%dmean_atm_prss ) @@ -4980,6 +5138,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmean_fsn )) deallocate(cgrid%mmean_fsn ) if(associated(cgrid%mmean_plresp )) deallocate(cgrid%mmean_plresp ) if(associated(cgrid%mmean_rh )) deallocate(cgrid%mmean_rh ) + if(associated(cgrid%mmean_cwd_rh )) deallocate(cgrid%mmean_cwd_rh ) if(associated(cgrid%mmean_leaf_resp )) deallocate(cgrid%mmean_leaf_resp ) if(associated(cgrid%mmean_root_resp )) deallocate(cgrid%mmean_root_resp ) if(associated(cgrid%mmean_growth_resp )) deallocate(cgrid%mmean_growth_resp ) @@ -4995,17 +5154,20 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%mmean_can_prss )) deallocate(cgrid%mmean_can_prss ) if(associated(cgrid%mmean_can_theta )) deallocate(cgrid%mmean_can_theta ) if(associated(cgrid%mmean_can_theiv )) deallocate(cgrid%mmean_can_theiv ) + if(associated(cgrid%mmean_can_vpdef )) deallocate(cgrid%mmean_can_vpdef ) if(associated(cgrid%mmean_gnd_temp )) deallocate(cgrid%mmean_gnd_temp ) if(associated(cgrid%mmean_gnd_shv )) deallocate(cgrid%mmean_gnd_shv ) if(associated(cgrid%mmean_leaf_energy )) deallocate(cgrid%mmean_leaf_energy ) if(associated(cgrid%mmean_leaf_water )) deallocate(cgrid%mmean_leaf_water ) if(associated(cgrid%mmean_leaf_hcap )) deallocate(cgrid%mmean_leaf_hcap ) if(associated(cgrid%mmean_leaf_temp )) deallocate(cgrid%mmean_leaf_temp ) + if(associated(cgrid%mmean_leaf_vpdef )) deallocate(cgrid%mmean_leaf_vpdef ) if(associated(cgrid%mmean_wood_energy )) deallocate(cgrid%mmean_wood_energy ) if(associated(cgrid%mmean_wood_water )) deallocate(cgrid%mmean_wood_water ) if(associated(cgrid%mmean_wood_hcap )) deallocate(cgrid%mmean_wood_hcap ) if(associated(cgrid%mmean_wood_temp )) deallocate(cgrid%mmean_wood_temp ) if(associated(cgrid%mmean_atm_temp )) deallocate(cgrid%mmean_atm_temp ) + if(associated(cgrid%mmean_atm_vpdef )) deallocate(cgrid%mmean_atm_vpdef ) if(associated(cgrid%mmean_rshort )) deallocate(cgrid%mmean_rshort ) if(associated(cgrid%mmean_rshort_diff )) deallocate(cgrid%mmean_rshort_diff ) if(associated(cgrid%mmean_rlong )) deallocate(cgrid%mmean_rlong ) @@ -5039,6 +5201,7 @@ subroutine deallocate_edtype(cgrid) 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_cwd_rh )) deallocate(cgrid%mmsqu_cwd_rh ) if(associated(cgrid%mmsqu_sensible_ac )) deallocate(cgrid%mmsqu_sensible_ac ) if(associated(cgrid%mmsqu_sensible_lc )) deallocate(cgrid%mmsqu_sensible_lc ) if(associated(cgrid%mmsqu_sensible_wc )) deallocate(cgrid%mmsqu_sensible_wc ) @@ -5076,6 +5239,7 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmean_nep )) deallocate(cgrid%qmean_nep ) if(associated(cgrid%qmean_plresp )) deallocate(cgrid%qmean_plresp ) if(associated(cgrid%qmean_rh )) deallocate(cgrid%qmean_rh ) + if(associated(cgrid%qmean_cwd_rh )) deallocate(cgrid%qmean_cwd_rh ) if(associated(cgrid%qmean_leaf_resp )) deallocate(cgrid%qmean_leaf_resp ) if(associated(cgrid%qmean_root_resp )) deallocate(cgrid%qmean_root_resp ) if(associated(cgrid%qmean_soil_temp )) deallocate(cgrid%qmean_soil_temp ) @@ -5091,17 +5255,20 @@ subroutine deallocate_edtype(cgrid) if(associated(cgrid%qmean_can_prss )) deallocate(cgrid%qmean_can_prss ) if(associated(cgrid%qmean_can_theta )) deallocate(cgrid%qmean_can_theta ) if(associated(cgrid%qmean_can_theiv )) deallocate(cgrid%qmean_can_theiv ) + if(associated(cgrid%qmean_can_vpdef )) deallocate(cgrid%qmean_can_vpdef ) if(associated(cgrid%qmean_gnd_temp )) deallocate(cgrid%qmean_gnd_temp ) if(associated(cgrid%qmean_gnd_shv )) deallocate(cgrid%qmean_gnd_shv ) if(associated(cgrid%qmean_leaf_energy )) deallocate(cgrid%qmean_leaf_energy ) if(associated(cgrid%qmean_leaf_water )) deallocate(cgrid%qmean_leaf_water ) if(associated(cgrid%qmean_leaf_temp )) deallocate(cgrid%qmean_leaf_temp ) + if(associated(cgrid%qmean_leaf_vpdef )) deallocate(cgrid%qmean_leaf_vpdef ) if(associated(cgrid%qmean_leaf_hcap )) deallocate(cgrid%qmean_leaf_hcap ) if(associated(cgrid%qmean_wood_energy )) deallocate(cgrid%qmean_wood_energy ) if(associated(cgrid%qmean_wood_water )) deallocate(cgrid%qmean_wood_water ) if(associated(cgrid%qmean_wood_temp )) deallocate(cgrid%qmean_wood_temp ) if(associated(cgrid%qmean_wood_hcap )) deallocate(cgrid%qmean_wood_hcap ) if(associated(cgrid%qmean_atm_temp )) deallocate(cgrid%qmean_atm_temp ) + if(associated(cgrid%qmean_atm_vpdef )) deallocate(cgrid%qmean_atm_vpdef ) if(associated(cgrid%qmean_rshort )) deallocate(cgrid%qmean_rshort ) if(associated(cgrid%qmean_rshort_diff )) deallocate(cgrid%qmean_rshort_diff ) if(associated(cgrid%qmean_rlong )) deallocate(cgrid%qmean_rlong ) @@ -5123,6 +5290,7 @@ subroutine deallocate_edtype(cgrid) 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_cwd_rh )) deallocate(cgrid%qmsqu_cwd_rh ) if(associated(cgrid%qmsqu_sensible_ac )) deallocate(cgrid%qmsqu_sensible_ac ) if(associated(cgrid%qmsqu_sensible_lc )) deallocate(cgrid%qmsqu_sensible_lc ) if(associated(cgrid%qmsqu_sensible_wc )) deallocate(cgrid%qmsqu_sensible_wc ) @@ -5273,6 +5441,7 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%avg_leaf_energy )) deallocate(cpoly%avg_leaf_energy ) if(associated(cpoly%avg_leaf_hcap )) deallocate(cpoly%avg_leaf_hcap ) if(associated(cpoly%avg_leaf_temp )) deallocate(cpoly%avg_leaf_temp ) + if(associated(cpoly%avg_leaf_vpdef )) deallocate(cpoly%avg_leaf_vpdef ) if(associated(cpoly%avg_leaf_fliq )) deallocate(cpoly%avg_leaf_fliq ) if(associated(cpoly%avg_leaf_water )) deallocate(cpoly%avg_leaf_water ) if(associated(cpoly%avg_wood_energy )) deallocate(cpoly%avg_wood_energy ) @@ -5287,6 +5456,7 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%avg_can_prss )) deallocate(cpoly%avg_can_prss ) if(associated(cpoly%avg_can_theta )) deallocate(cpoly%avg_can_theta ) if(associated(cpoly%avg_can_theiv )) deallocate(cpoly%avg_can_theiv ) + if(associated(cpoly%avg_can_vpdef )) deallocate(cpoly%avg_can_vpdef ) if(associated(cpoly%avg_can_depth )) deallocate(cpoly%avg_can_depth ) if(associated(cpoly%avg_soil_energy )) deallocate(cpoly%avg_soil_energy ) if(associated(cpoly%avg_soil_mstpot )) deallocate(cpoly%avg_soil_mstpot ) @@ -5301,6 +5471,7 @@ subroutine deallocate_polygontype(cpoly) if(associated(cpoly%rad_avg )) deallocate(cpoly%rad_avg ) ! Meteorological information if(associated(cpoly%avg_atm_tmp )) deallocate(cpoly%avg_atm_tmp ) + if(associated(cpoly%avg_atm_vpdef )) deallocate(cpoly%avg_atm_vpdef ) if(associated(cpoly%avg_atm_shv )) deallocate(cpoly%avg_atm_shv ) if(associated(cpoly%avg_atm_prss )) deallocate(cpoly%avg_atm_prss ) ! NACP @@ -5373,6 +5544,7 @@ subroutine deallocate_sitetype(csite) if(associated(csite%plantation )) deallocate(csite%plantation ) if(associated(csite%cohort_count )) deallocate(csite%cohort_count ) if(associated(csite%can_theiv )) deallocate(csite%can_theiv ) + if(associated(csite%can_vpdef )) deallocate(csite%can_vpdef ) if(associated(csite%can_temp )) deallocate(csite%can_temp ) if(associated(csite%can_temp_pv )) deallocate(csite%can_temp_pv ) if(associated(csite%can_shv )) deallocate(csite%can_shv ) @@ -5416,10 +5588,15 @@ subroutine deallocate_sitetype(csite) 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%avg_monthly_waterdef )) deallocate(csite%avg_monthly_waterdef ) 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 ) if(associated(csite%mmean_rh )) deallocate(csite%mmean_rh ) + if(associated(csite%mean_cwd_rh )) deallocate(csite%mean_cwd_rh ) + if(associated(csite%dmean_cwd_rh )) deallocate(csite%dmean_cwd_rh ) + if(associated(csite%qmean_cwd_rh )) deallocate(csite%qmean_cwd_rh ) + if(associated(csite%mmean_cwd_rh )) deallocate(csite%mmean_cwd_rh ) if(associated(csite%dmean_albedo )) deallocate(csite%dmean_albedo ) if(associated(csite%dmean_albedo_beam )) deallocate(csite%dmean_albedo_beam ) if(associated(csite%dmean_albedo_diffuse )) deallocate(csite%dmean_albedo_diffuse ) @@ -5454,6 +5631,7 @@ subroutine deallocate_sitetype(csite) if(associated(csite%co2budget_gpp_dbh )) deallocate(csite%co2budget_gpp_dbh ) if(associated(csite%co2budget_plresp )) deallocate(csite%co2budget_plresp ) if(associated(csite%co2budget_rh )) deallocate(csite%co2budget_rh ) + if(associated(csite%co2budget_cwd_rh )) deallocate(csite%co2budget_cwd_rh ) if(associated(csite%today_A_decomp )) deallocate(csite%today_A_decomp ) if(associated(csite%today_Af_decomp )) deallocate(csite%today_Af_decomp ) if(associated(csite%dmean_A_decomp )) deallocate(csite%dmean_A_decomp ) @@ -5567,6 +5745,7 @@ subroutine deallocate_sitetype(csite) if(associated(csite%avg_runoff_heat )) deallocate(csite%avg_runoff_heat ) if(associated(csite%avg_leaf_energy )) deallocate(csite%avg_leaf_energy ) if(associated(csite%avg_leaf_temp )) deallocate(csite%avg_leaf_temp ) + if(associated(csite%avg_leaf_vpdef )) deallocate(csite%avg_leaf_vpdef ) if(associated(csite%avg_leaf_hcap )) deallocate(csite%avg_leaf_hcap ) if(associated(csite%avg_leaf_fliq )) deallocate(csite%avg_leaf_fliq ) if(associated(csite%avg_leaf_water )) deallocate(csite%avg_leaf_water ) @@ -5624,12 +5803,17 @@ subroutine deallocate_patchtype(cpatch) if(associated(cpatch%agb)) deallocate(cpatch%agb) if(associated(cpatch%basarea)) deallocate(cpatch%basarea) if(associated(cpatch%dagb_dt)) deallocate(cpatch%dagb_dt) + if(associated(cpatch%dlnagb_dt)) deallocate(cpatch%dlnagb_dt) if(associated(cpatch%dba_dt)) deallocate(cpatch%dba_dt) + if(associated(cpatch%dlnba_dt)) deallocate(cpatch%dlnba_dt) if(associated(cpatch%ddbh_dt)) deallocate(cpatch%ddbh_dt) + if(associated(cpatch%dlndbh_dt)) deallocate(cpatch%dlndbh_dt) if(associated(cpatch%dbh)) deallocate(cpatch%dbh) if(associated(cpatch%bdead)) deallocate(cpatch%bdead) if(associated(cpatch%bleaf)) deallocate(cpatch%bleaf) if(associated(cpatch%phenology_status)) deallocate(cpatch%phenology_status) + if(associated(cpatch%recruit_dbh)) deallocate(cpatch%recruit_dbh) + if(associated(cpatch%census_status)) deallocate(cpatch%census_status) if(associated(cpatch%balive)) deallocate(cpatch%balive) if(associated(cpatch%broot)) deallocate(cpatch%broot) if(associated(cpatch%bsapwooda)) deallocate(cpatch%bsapwooda) @@ -5641,11 +5825,13 @@ subroutine deallocate_patchtype(cpatch) if(associated(cpatch%wood_resolvable)) deallocate(cpatch%wood_resolvable) if(associated(cpatch%bstorage)) deallocate(cpatch%bstorage) if(associated(cpatch%cb)) deallocate(cpatch%cb) - if(associated(cpatch%cb_max)) deallocate(cpatch%cb_max) + if(associated(cpatch%cb_lightmax)) deallocate(cpatch%cb_lightmax) + if(associated(cpatch%cb_moistmax)) deallocate(cpatch%cb_moistmax) if(associated(cpatch%cbr_bar)) deallocate(cpatch%cbr_bar) if(associated(cpatch%mmean_cb)) deallocate(cpatch%mmean_cb) if(associated(cpatch%leaf_energy)) deallocate(cpatch%leaf_energy) if(associated(cpatch%leaf_temp )) deallocate(cpatch%leaf_temp ) + if(associated(cpatch%leaf_vpdef )) deallocate(cpatch%leaf_vpdef ) if(associated(cpatch%leaf_temp_pv )) deallocate(cpatch%leaf_temp_pv ) if(associated(cpatch%leaf_hcap )) deallocate(cpatch%leaf_hcap ) if(associated(cpatch%leaf_fliq )) deallocate(cpatch%leaf_fliq ) @@ -5681,7 +5867,8 @@ subroutine deallocate_patchtype(cpatch) if(associated(cpatch%today_nppwood)) deallocate(cpatch%today_nppwood) if(associated(cpatch%today_nppdaily)) deallocate(cpatch%today_nppdaily) if(associated(cpatch%today_gpp_pot)) deallocate(cpatch%today_gpp_pot) - if(associated(cpatch%today_gpp_max)) deallocate(cpatch%today_gpp_max) + if(associated(cpatch%today_gpp_lightmax)) deallocate(cpatch%today_gpp_lightmax) + if(associated(cpatch%today_gpp_moistmax)) deallocate(cpatch%today_gpp_moistmax) if(associated(cpatch%growth_respiration)) deallocate(cpatch%growth_respiration) if(associated(cpatch%storage_respiration)) deallocate(cpatch%storage_respiration) if(associated(cpatch%vleaf_respiration)) deallocate(cpatch%vleaf_respiration) @@ -5710,6 +5897,7 @@ subroutine deallocate_patchtype(cpatch) if(associated(cpatch%mmean_vleaf_resp )) deallocate(cpatch%mmean_vleaf_resp ) if(associated(cpatch%fsn)) deallocate(cpatch%fsn) if(associated(cpatch%monthly_dndt)) deallocate(cpatch%monthly_dndt) + if(associated(cpatch%monthly_dlnndt)) deallocate(cpatch%monthly_dlnndt) if(associated(cpatch%mort_rate)) deallocate(cpatch%mort_rate) if(associated(cpatch%mmean_mort_rate)) deallocate(cpatch%mmean_mort_rate) @@ -5878,6 +6066,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%plantation(opa) = isite%plantation(ipa) osite%cohort_count(opa) = isite%cohort_count(ipa) osite%can_theiv(opa) = isite%can_theiv(ipa) + osite%can_vpdef(opa) = isite%can_vpdef(ipa) osite%can_temp(opa) = isite%can_temp(ipa) osite%can_temp_pv(opa) = isite%can_temp_pv(ipa) osite%can_shv(opa) = isite%can_shv(ipa) @@ -5895,7 +6084,9 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) 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%avg_monthly_waterdef(opa) = isite%avg_monthly_waterdef(ipa) osite%mean_rh(opa) = isite%mean_rh(ipa) + osite%mean_cwd_rh(opa) = isite%mean_cwd_rh(ipa) osite%mean_nep(opa) = isite%mean_nep(ipa) osite%wbudget_loss2atm(opa) = isite%wbudget_loss2atm(ipa) osite%wbudget_denseffect(opa) = isite%wbudget_denseffect(ipa) @@ -5920,6 +6111,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%co2budget_gpp(opa) = isite%co2budget_gpp(ipa) osite%co2budget_plresp(opa) = isite%co2budget_plresp(ipa) osite%co2budget_rh(opa) = isite%co2budget_rh(ipa) + osite%co2budget_cwd_rh(opa) = isite%co2budget_cwd_rh(ipa) osite%today_A_decomp(opa) = isite%today_A_decomp(ipa) osite%today_Af_decomp(opa) = isite%today_Af_decomp(ipa) osite%veg_rough(opa) = isite%veg_rough(ipa) @@ -6026,6 +6218,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) osite%avg_runoff_heat(opa) = isite%avg_runoff_heat(ipa) osite%avg_leaf_energy(opa) = isite%avg_leaf_energy(ipa) osite%avg_leaf_temp(opa) = isite%avg_leaf_temp(ipa) + osite%avg_leaf_vpdef(opa) = isite%avg_leaf_vpdef(ipa) osite%avg_leaf_hcap(opa) = isite%avg_leaf_hcap(ipa) osite%avg_leaf_fliq(opa) = isite%avg_leaf_fliq(ipa) osite%avg_leaf_water(opa) = isite%avg_leaf_water(ipa) @@ -6081,6 +6274,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) !----- Daily averages. -----------------------------------------------------------! if (idoutput > 0 .or. imoutput > 0 .or. iqoutput > 0) then osite%dmean_rh (opa) = isite%dmean_rh (ipa) + osite%dmean_cwd_rh (opa) = isite%dmean_cwd_rh (ipa) osite%dmean_co2_residual (opa) = isite%dmean_co2_residual (ipa) osite%dmean_energy_residual(opa) = isite%dmean_energy_residual(ipa) osite%dmean_water_residual (opa) = isite%dmean_water_residual (ipa) @@ -6094,6 +6288,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) if (imoutput > 0 .or. iqoutput > 0) then osite%mmean_rh (opa) = isite%mmean_rh (ipa) + osite%mmean_cwd_rh (opa) = isite%mmean_cwd_rh (ipa) osite%mmean_co2_residual (opa) = isite%mmean_co2_residual (ipa) osite%mmean_energy_residual(opa) = isite%mmean_energy_residual(ipa) osite%mmean_water_residual (opa) = isite%mmean_water_residual (ipa) @@ -6108,6 +6303,7 @@ subroutine copy_sitetype(isite,osite,ipaa,ipaz,opaa,opaz) if (iqoutput > 0) then do icyc=1,ndcycle osite%qmean_rh (icyc,opa) = isite%qmean_rh (icyc,ipa) + osite%qmean_cwd_rh (icyc,opa) = isite%qmean_cwd_rh (icyc,ipa) osite%qmean_albedo (icyc,opa) = isite%qmean_albedo (icyc,ipa) osite%qmean_albedo_beam (icyc,opa) = isite%qmean_albedo_beam (icyc,ipa) osite%qmean_albedo_diffuse (icyc,opa) = isite%qmean_albedo_diffuse (icyc,ipa) @@ -6179,6 +6375,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%plantation(1:inc) = pack(sitein%plantation,logmask) siteout%cohort_count(1:inc) = pack(sitein%cohort_count,logmask) siteout%can_theiv(1:inc) = pack(sitein%can_theiv,logmask) + siteout%can_vpdef(1:inc) = pack(sitein%can_vpdef,logmask) siteout%can_temp(1:inc) = pack(sitein%can_temp,logmask) siteout%can_temp_pv(1:inc) = pack(sitein%can_temp_pv,logmask) siteout%can_shv(1:inc) = pack(sitein%can_shv,logmask) @@ -6196,7 +6393,9 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) 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%avg_monthly_waterdef(1:inc) = pack(sitein%avg_monthly_waterdef,logmask) siteout%mean_rh(1:inc) = pack(sitein%mean_rh,logmask) + siteout%mean_cwd_rh(1:inc) = pack(sitein%mean_cwd_rh,logmask) siteout%mean_nep(1:inc) = pack(sitein%mean_nep,logmask) siteout%wbudget_loss2atm(1:inc) = pack(sitein%wbudget_loss2atm,logmask) siteout%wbudget_denseffect(1:inc) = pack(sitein%wbudget_denseffect,logmask) @@ -6221,6 +6420,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%co2budget_gpp(1:inc) = pack(sitein%co2budget_gpp,logmask) siteout%co2budget_plresp(1:inc) = pack(sitein%co2budget_plresp,logmask) siteout%co2budget_rh(1:inc) = pack(sitein%co2budget_rh,logmask) + siteout%co2budget_cwd_rh(1:inc) = pack(sitein%co2budget_cwd_rh,logmask) siteout%today_A_decomp(1:inc) = pack(sitein%today_A_decomp,logmask) siteout%today_Af_decomp(1:inc) = pack(sitein%today_Af_decomp,logmask) siteout%veg_rough(1:inc) = pack(sitein%veg_rough,logmask) @@ -6327,6 +6527,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) siteout%avg_runoff_heat(1:inc) = pack(sitein%avg_runoff_heat,logmask) siteout%avg_leaf_energy(1:inc) = pack(sitein%avg_leaf_energy,logmask) siteout%avg_leaf_temp(1:inc) = pack(sitein%avg_leaf_temp,logmask) + siteout%avg_leaf_vpdef(1:inc) = pack(sitein%avg_leaf_vpdef,logmask) siteout%avg_leaf_hcap(1:inc) = pack(sitein%avg_leaf_hcap,logmask) siteout%avg_leaf_fliq(1:inc) = pack(sitein%avg_leaf_fliq,logmask) siteout%avg_leaf_water(1:inc) = pack(sitein%avg_leaf_water,logmask) @@ -6391,6 +6592,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) if (idoutput > 0 .or. imoutput > 0 .or. iqoutput > 0) then siteout%dmean_rh (1:inc) = pack(sitein%dmean_rh ,logmask) + siteout%dmean_cwd_rh (1:inc) = pack(sitein%dmean_cwd_rh ,logmask) siteout%dmean_co2_residual (1:inc) = pack(sitein%dmean_co2_residual ,logmask) siteout%dmean_energy_residual(1:inc) = pack(sitein%dmean_energy_residual,logmask) siteout%dmean_water_residual (1:inc) = pack(sitein%dmean_water_residual ,logmask) @@ -6404,6 +6606,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) if (imoutput > 0 .or. iqoutput > 0) then siteout%mmean_rh (1:inc) = pack(sitein%mmean_rh ,logmask) + siteout%mmean_cwd_rh (1:inc) = pack(sitein%mmean_cwd_rh ,logmask) siteout%mmean_co2_residual (1:inc) = pack(sitein%mmean_co2_residual ,logmask) siteout%mmean_energy_residual(1:inc) = pack(sitein%mmean_energy_residual,logmask) siteout%mmean_water_residual (1:inc) = pack(sitein%mmean_water_residual ,logmask) @@ -6418,6 +6621,7 @@ subroutine copy_sitetype_mask(sitein,siteout,logmask,masksz,newsz) if (iqoutput > 0) then do icyc=1,ndcycle siteout%qmean_rh (icyc,1:inc) = pack(sitein%qmean_rh (icyc,:) ,logmask) + siteout%qmean_cwd_rh (icyc,1:inc) = pack(sitein%qmean_cwd_rh (icyc,:) ,logmask) siteout%qmean_albedo (icyc,1:inc) = pack(sitein%qmean_albedo (icyc,:) ,logmask) siteout%qmean_albedo_beam (icyc,1:inc) = pack(sitein%qmean_albedo_beam (icyc,:) ,logmask) siteout%qmean_albedo_diffuse (icyc,1:inc) = pack(sitein%qmean_albedo_diffuse(icyc,:) ,logmask) @@ -6474,12 +6678,17 @@ subroutine copy_patchtype_mask(patchin,patchout,mask,masksz,newsz) patchout%agb(1:inc) = pack(patchin%agb,mask) patchout%basarea(1:inc) = pack(patchin%basarea,mask) patchout%dagb_dt(1:inc) = pack(patchin%dagb_dt,mask) + patchout%dlnagb_dt(1:inc) = pack(patchin%dlnagb_dt,mask) patchout%dba_dt(1:inc) = pack(patchin%dba_dt,mask) + patchout%dlnba_dt(1:inc) = pack(patchin%dlnba_dt,mask) patchout%ddbh_dt(1:inc) = pack(patchin%ddbh_dt,mask) + patchout%dlndbh_dt(1:inc) = pack(patchin%dlndbh_dt,mask) patchout%dbh(1:inc) = pack(patchin%dbh,mask) patchout%bdead(1:inc) = pack(patchin%bdead,mask) patchout%bleaf(1:inc) = pack(patchin%bleaf,mask) patchout%phenology_status(1:inc) = pack(patchin%phenology_status,mask) + patchout%recruit_dbh(1:inc) = pack(patchin%recruit_dbh,mask) + patchout%census_status(1:inc) = pack(patchin%census_status,mask) patchout%balive(1:inc) = pack(patchin%balive,mask) patchout%broot(1:inc) = pack(patchin%broot,mask) patchout%bsapwooda(1:inc) = pack(patchin%bsapwooda,mask) @@ -6494,6 +6703,7 @@ subroutine copy_patchtype_mask(patchin,patchout,mask,masksz,newsz) patchout%leaf_energy(1:inc) = pack(patchin%leaf_energy,mask) patchout%leaf_hcap(1:inc) = pack(patchin%leaf_hcap,mask) patchout%leaf_temp(1:inc) = pack(patchin%leaf_temp,mask) + patchout%leaf_vpdef(1:inc) = pack(patchin%leaf_vpdef,mask) patchout%leaf_temp_pv(1:inc) = pack(patchin%leaf_temp_pv,mask) patchout%leaf_fliq(1:inc) = pack(patchin%leaf_fliq,mask) patchout%leaf_water(1:inc) = pack(patchin%leaf_water,mask) @@ -6528,12 +6738,14 @@ subroutine copy_patchtype_mask(patchin,patchout,mask,masksz,newsz) patchout%today_nppwood(1:inc) = pack(patchin%today_nppwood,mask) patchout%today_nppdaily(1:inc) = pack(patchin%today_nppdaily,mask) patchout%today_gpp_pot(1:inc) = pack(patchin%today_gpp_pot,mask) - patchout%today_gpp_max(1:inc) = pack(patchin%today_gpp_max,mask) - patchout%growth_respiration(1:inc) = pack(patchin%growth_respiration,mask) + patchout%today_gpp_lightmax(1:inc) = pack(patchin%today_gpp_lightmax,mask) + patchout%today_gpp_moistmax(1:inc) = pack(patchin%today_gpp_moistmax,mask) + patchout%growth_respiration(1:inc) = pack(patchin%growth_respiration,mask) patchout%storage_respiration(1:inc) = pack(patchin%storage_respiration,mask) patchout%vleaf_respiration(1:inc) = pack(patchin%vleaf_respiration,mask) patchout%fsn(1:inc) = pack(patchin%fsn,mask) patchout%monthly_dndt(1:inc) = pack(patchin%monthly_dndt,mask) + patchout%monthly_dlnndt(1:inc) = pack(patchin%monthly_dlnndt,mask) patchout%Psi_open(1:inc) = pack(patchin%Psi_open,mask) patchout%krdepth(1:inc) = pack(patchin%krdepth,mask) @@ -6587,8 +6799,9 @@ subroutine copy_patchtype_mask(patchin,patchout,mask,masksz,newsz) do m=1,inc k=incmask(m) do i = 1,13 - patchout%cb(i,m) = patchin%cb(i,k) - patchout%cb_max(i,m) = patchin%cb_max(i,k) + patchout%cb (i,m) = patchin%cb (i,k) + patchout%cb_lightmax(i,m) = patchin%cb_lightmax(i,k) + patchout%cb_moistmax(i,m) = patchin%cb_moistmax(i,k) end do do i = 1,n_mort patchout%mort_rate(i,m) = patchin%mort_rate(i,k) @@ -6715,12 +6928,17 @@ subroutine copy_patchtype(patchin,patchout,ipin1,ipin2,ipout1,ipout2) patchout%agb(iout) = patchin%agb(iin) patchout%basarea(iout) = patchin%basarea(iin) patchout%dagb_dt(iout) = patchin%dagb_dt(iin) + patchout%dlnagb_dt(iout) = patchin%dlnagb_dt(iin) patchout%dba_dt(iout) = patchin%dba_dt(iin) + patchout%dlnba_dt(iout) = patchin%dlnba_dt(iin) patchout%ddbh_dt(iout) = patchin%ddbh_dt(iin) + patchout%dlndbh_dt(iout) = patchin%dlndbh_dt(iin) patchout%dbh(iout) = patchin%dbh(iin) patchout%bdead(iout) = patchin%bdead(iin) patchout%bleaf(iout) = patchin%bleaf(iin) patchout%phenology_status(iout) = patchin%phenology_status(iin) + patchout%recruit_dbh(iout) = patchin%recruit_dbh(iin) + patchout%census_status(iout) = patchin%census_status(iin) patchout%balive(iout) = patchin%balive(iin) patchout%broot(iout) = patchin%broot(iin) patchout%bsapwooda(iout) = patchin%bsapwooda(iin) @@ -6732,11 +6950,13 @@ subroutine copy_patchtype(patchin,patchout,ipin1,ipin2,ipout1,ipout2) patchout%wood_resolvable(iout) = patchin%wood_resolvable(iin) patchout%bstorage(iout) = patchin%bstorage(iin) patchout%cb(:,iout) = patchin%cb(:,iin) - patchout%cb_max(:,iout) = patchin%cb_max(:,iin) + patchout%cb_lightmax(:,iout) = patchin%cb_lightmax(:,iin) + patchout%cb_moistmax(:,iout) = patchin%cb_moistmax(:,iin) patchout%cbr_bar(iout) = patchin%cbr_bar(iin) patchout%leaf_energy(iout) = patchin%leaf_energy(iin) patchout%leaf_hcap(iout) = patchin%leaf_hcap(iin) patchout%leaf_temp(iout) = patchin%leaf_temp(iin) + patchout%leaf_vpdef(iout) = patchin%leaf_vpdef(iin) patchout%leaf_temp_pv(iout) = patchin%leaf_temp_pv(iin) patchout%leaf_fliq(iout) = patchin%leaf_fliq(iin) patchout%leaf_water(iout) = patchin%leaf_water(iin) @@ -6771,12 +6991,14 @@ subroutine copy_patchtype(patchin,patchout,ipin1,ipin2,ipout1,ipout2) patchout%today_nppwood(iout) = patchin%today_nppwood(iin) patchout%today_nppdaily(iout) = patchin%today_nppdaily(iin) patchout%today_gpp_pot(iout) = patchin%today_gpp_pot(iin) - patchout%today_gpp_max(iout) = patchin%today_gpp_max(iin) + patchout%today_gpp_lightmax(iout) = patchin%today_gpp_lightmax(iin) + patchout%today_gpp_moistmax(iout) = patchin%today_gpp_moistmax(iin) patchout%growth_respiration(iout) = patchin%growth_respiration(iin) patchout%storage_respiration(iout) = patchin%storage_respiration(iin) patchout%vleaf_respiration(iout) = patchin%vleaf_respiration(iin) patchout%fsn(iout) = patchin%fsn(iin) patchout%monthly_dndt(iout) = patchin%monthly_dndt(iin) + patchout%monthly_dlnndt(iout) = patchin%monthly_dlnndt(iin) patchout%mort_rate(:,iout) = patchin%mort_rate(:,iin) patchout%Psi_open(iout) = patchin%Psi_open(iin) @@ -7066,7 +7288,6 @@ subroutine filltab_alltypes do igr = 1,ngrids cgrid => edgrid_g(igr) - if (num_var(igr)>0) then do nv=1,num_var(igr) call reset_vt_vector_pointers(vt_info(nv,igr)) @@ -8158,6 +8379,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon Average Heterotrohic Respiration','[umol/m2/s]','ipoly') end if + if (associated(cgrid%avg_cwd_resp)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_cwd_resp,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CWD_RESP :11:hist:anal:opti') + call metadata_edio(nvar,igr,'Polygon Avg. coarse woody debris Resp.','[umol/m2/s]','ipoly') + end if + if (associated(cgrid%avg_leaf_drop)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_leaf_drop,nvar,igr,init,cgrid%pyglob_id, & @@ -8500,6 +8728,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon Averaged Atmospheric Temperature at Reference Height','[K]','ipoly') end if + if (associated(cgrid%avg_atm_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_atm_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_ATM_VPDEF :11:hist:opti:anal') + call metadata_edio(nvar,igr,'Polygon Averaged Atmospheric VPD at Reference Height','[Pa]','ipoly') + end if + if (associated(cgrid%avg_atm_shv)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_atm_shv,nvar,igr,init,cgrid%pyglob_id, & @@ -8682,6 +8917,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon Average Temperature of Vegetation','[K]','ipoly') end if + if (associated(cgrid%avg_leaf_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_leaf_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_LEAF_VPDEF :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average VPD of Vegetation','[Pa]','ipoly') + end if + if (associated(cgrid%avg_leaf_fliq)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_leaf_fliq,nvar,igr,init,cgrid%pyglob_id, & @@ -8780,6 +9022,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Polygon Average Canopy Air ice-vapour equiv. pot. temp.','[K]','NA') end if + if (associated(cgrid%avg_can_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%avg_can_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'AVG_CAN_VPDEF :11:hist:anal') + call metadata_edio(nvar,igr,'Polygon Average Canopy Air VPD.','[Pa]','NA') + end if + if (associated(cgrid%avg_can_depth)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%avg_can_depth,nvar,igr,init,cgrid%pyglob_id, & @@ -9011,13 +9260,20 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva var_len,var_len_global,max_ptrs,'DMEAN_PLRESP :11:hist:dail') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if - + if(associated(cgrid%dmean_rh)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%dmean_rh,nvar,igr,init,cgrid%pyglob_id, & var_len,var_len_global,max_ptrs,'DMEAN_RH :11:hist:dail') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + + if(associated(cgrid%dmean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_cwd_rh,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CWD_RH :11:hist:dail') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if if(associated(cgrid%dmean_leaf_resp)) then nvar=nvar+1 @@ -9131,6 +9387,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Daily mean canopy air theta_Eiv','[K]','ipoly') end if + if(associated(cgrid%dmean_can_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_can_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CAN_VPDEF :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean canopy air VPD','[Pa]','ipoly') + end if + if(associated(cgrid%dmean_gnd_temp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%dmean_gnd_temp,nvar,igr,init,cgrid%pyglob_id, & @@ -9166,6 +9429,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Daily mean vegetation temperature','[K]','ipoly') end if + if(associated(cgrid%dmean_leaf_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_leaf_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_LEAF_VPDEF :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean vegetation VPD','[Pa]','ipoly') + end if + if(associated(cgrid%dmean_leaf_hcap)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%dmean_leaf_hcap,nvar,igr,init,cgrid%pyglob_id, & @@ -9208,6 +9478,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Daily mean air temperature','[K]','ipoly') end if + if(associated(cgrid%dmean_atm_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%dmean_atm_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_ATM_VPDEF :11:hist:dail') + call metadata_edio(nvar,igr,'Daily mean air VPD','[Pa]','ipoly') + end if + if(associated(cgrid%dmean_atm_shv)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%dmean_atm_shv,nvar,igr,init,cgrid%pyglob_id, & @@ -9537,6 +9814,13 @@ 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%mmean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_cwd_rh,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CWD_RH :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%mmean_leaf_resp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmean_leaf_resp,nvar,igr,init,cgrid%pyglob_id, & @@ -9621,6 +9905,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Monthly mean canopy air theta_Eiv','[K]','ipoly') end if + if(associated(cgrid%mmean_can_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_can_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CAN_VPDEF :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean canopy air VPD','[Pa]','ipoly') + end if + if(associated(cgrid%mmean_gnd_temp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmean_gnd_temp,nvar,igr,init,cgrid%pyglob_id, & @@ -9649,6 +9940,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Monthly mean leaf temperature','[K]','ipoly') end if + if(associated(cgrid%mmean_leaf_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_leaf_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_LEAF_VPDEF :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean leaf VPD','[Pa]','ipoly') + end if + if(associated(cgrid%mmean_leaf_water)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmean_leaf_water,nvar,igr,init,cgrid%pyglob_id, & @@ -9768,6 +10066,13 @@ subroutine filltab_edtype_p11(cgrid,igr,init,var_len,var_len_global,max_ptrs,nva call metadata_edio(nvar,igr,'Monthly mean air temperature','[K]','ipoly') end if + if(associated(cgrid%mmean_atm_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmean_atm_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_ATM_VPDEF :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean air VPD','[Pa]','ipoly') + end if + if(associated(cgrid%mmean_atm_shv)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmean_atm_shv,nvar,igr,init,cgrid%pyglob_id, & @@ -9889,6 +10194,13 @@ 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_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%mmsqu_cwd_rh,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'MMSQU_CWD_RH :11:hist:mont:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%mmsqu_sensible_ac)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%mmsqu_sensible_ac,nvar,igr,init,cgrid%pyglob_id, & @@ -10165,6 +10477,13 @@ 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_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_cwd_rh,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CWD_RH :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%qmean_leaf_resp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%qmean_leaf_resp,nvar,igr,init,cgrid%pyglob_id, & @@ -10249,6 +10568,13 @@ 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_can_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_can_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CAN_VPDEF :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%qmean_gnd_temp)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%qmean_gnd_temp,nvar,igr,init,cgrid%pyglob_id, & @@ -10284,6 +10610,13 @@ 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_leaf_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_leaf_vpdef,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_LEAF_VPDEF :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%qmean_leaf_hcap)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%qmean_leaf_hcap,nvar,igr,init,cgrid%pyglob_id, & @@ -10326,6 +10659,13 @@ 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_atm_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmean_atm_temp,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_ATM_VPDEF :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%qmean_rshort)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%qmean_rshort,nvar,igr,init,cgrid%pyglob_id, & @@ -10480,6 +10820,13 @@ 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_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,cgrid%qmsqu_cwd_rh,nvar,igr,init,cgrid%pyglob_id, & + var_len,var_len_global,max_ptrs,'QMSQU_CWD_RH :-11:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if(associated(cgrid%qmsqu_sensible_ac)) then nvar=nvar+1 call vtable_edio_r(npts,cgrid%qmsqu_sensible_ac,nvar,igr,init,cgrid%pyglob_id, & @@ -11911,42 +12258,42 @@ subroutine filltab_sitetype(igr,ipy,isi,init) if (associated(csite%fast_soil_C)) then nvar=nvar+1 call vtable_edio_r(npts,csite%fast_soil_C,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'FAST_SOIL_C :31:hist:year') + var_len,var_len_global,max_ptrs,'FAST_SOIL_C :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if if (associated(csite%slow_soil_C)) then nvar=nvar+1 call vtable_edio_r(npts,csite%slow_soil_C,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'SLOW_SOIL_C :31:hist:year') + var_len,var_len_global,max_ptrs,'SLOW_SOIL_C :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if if (associated(csite%structural_soil_C)) then nvar=nvar+1 call vtable_edio_r(npts,csite%structural_soil_C,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'STRUCTURAL_SOIL_C :31:hist:year') + var_len,var_len_global,max_ptrs,'STRUCTURAL_SOIL_C :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if if (associated(csite%structural_soil_L)) then nvar=nvar+1 call vtable_edio_r(npts,csite%structural_soil_L,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'STRUCTURAL_SOIL_L :31:hist:year') + var_len,var_len_global,max_ptrs,'STRUCTURAL_SOIL_L :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if if (associated(csite%mineralized_soil_N)) then nvar=nvar+1 call vtable_edio_r(npts,csite%mineralized_soil_N,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'MINERALIZED_SOIL_N :31:hist:year') + var_len,var_len_global,max_ptrs,'MINERALIZED_SOIL_N :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if if (associated(csite%fast_soil_N)) then nvar=nvar+1 call vtable_edio_r(npts,csite%fast_soil_N,nvar,igr,init,csite%paglob_id, & - var_len,var_len_global,max_ptrs,'FAST_SOIL_N :31:hist:year') + var_len,var_len_global,max_ptrs,'FAST_SOIL_N :31:hist:year:dcyc') call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if @@ -11973,6 +12320,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'Canopy air ice-vapour equivalent potential temperature','[K]','NA') end if + if (associated(csite%can_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%can_vpdef,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'CAN_VPDEF :31:hist') + call metadata_edio(nvar,igr,'Canopy air ice-vapour equivalent potential temperature','[K]','NA') + end if + if (associated(csite%can_temp)) then nvar=nvar+1 call vtable_edio_r(npts,csite%can_temp,nvar,igr,init,csite%paglob_id, & @@ -12121,18 +12475,39 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'Heterotrophic respiration','[umol/m2/s]','ipatch') end if + if (associated(csite%mean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%mean_cwd_rh,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'MEAN_CWD_RH :31:hist') + call metadata_edio(nvar,igr,'Coarse woody debris respiration','[umol/m2/s]','ipatch') + end if + if (associated(csite%dmean_rh)) then nvar=nvar+1 call vtable_edio_r(npts,csite%dmean_rh,nvar,igr,init,csite%paglob_id, & var_len,var_len_global,max_ptrs,'DMEAN_RH_PA :31:hist:dail') - call metadata_edio(nvar,igr,'Daily mean of heterotrophic respiration','[umol/m2/s]','ipatch') + call metadata_edio(nvar,igr,'Daily mean of heterotrophic respiration','[kgC/m2/yr]','ipatch') + end if + + if (associated(csite%dmean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%dmean_cwd_rh,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'DMEAN_CWD_RH_PA :31:hist:dail') + call metadata_edio(nvar,igr,'Daily mean of CWD respiration','[kgC/m2/yr]','ipatch') end if if (associated(csite%mmean_rh)) then nvar=nvar+1 call vtable_edio_r(npts,csite%mmean_rh,nvar,igr,init,csite%paglob_id, & var_len,var_len_global,max_ptrs,'MMEAN_RH_PA :31:hist:mont:dcyc') - call metadata_edio(nvar,igr,'Monthly mean of heterotrophic respiration','[umol/m2/s]','ipatch') + call metadata_edio(nvar,igr,'Monthly mean of heterotrophic respiration','[kgC/m2/yr]','ipatch') + end if + + if (associated(csite%mmean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%mmean_cwd_rh,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'MMEAN_CWD_RH_PA :31:hist:mont:dcyc') + call metadata_edio(nvar,igr,'Monthly mean of CWD respiration','[kgC/m2/yr]','ipatch') end if if (associated(csite%dmean_albedo)) then @@ -12346,6 +12721,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_waterdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%avg_monthly_waterdef,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'AVG_MONTHLY_WATERDEF :31:hist:anal:dail:mont:dcyc') + call metadata_edio(nvar,igr,'Running average of water deficit','[kg/m2/30days]','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, & @@ -12360,6 +12742,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%co2budget_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%co2budget_cwd_rh,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'CO2BUDGET_CWD_RH :31:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%today_A_decomp)) then nvar=nvar+1 call vtable_edio_r(npts,csite%today_A_decomp,nvar,igr,init,csite%paglob_id, & @@ -12996,6 +13385,13 @@ subroutine filltab_sitetype(igr,ipy,isi,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(csite%qmean_cwd_rh)) then + nvar=nvar+1 + call vtable_edio_r(npts,csite%qmean_cwd_rh,nvar,igr,init,csite%paglob_id, & + var_len,var_len_global,max_ptrs,'QMEAN_CWD_RH_PA :-31:hist:dcyc') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(csite%qmean_albedo)) then nvar=nvar+1 call vtable_edio_r(npts,csite%qmean_albedo,nvar,igr,init,csite%paglob_id, & @@ -13350,6 +13746,20 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(cpatch%recruit_dbh)) then + nvar=nvar+1 + call vtable_edio_i(npts,cpatch%recruit_dbh,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'RECRUIT_DBH :40:hist:dail:mont:dcyc:year') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + + if (associated(cpatch%census_status)) then + nvar=nvar+1 + call vtable_edio_i(npts,cpatch%census_status,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'CENSUS_STATUS :40:hist:dail:mont:dcyc:year') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(cpatch%krdepth)) then nvar=nvar+1 call vtable_edio_i(npts,cpatch%krdepth,nvar,igr,init,cpatch%coglob_id, & @@ -13407,6 +13817,13 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'Above-ground biomass growth','[kgC/plant/yr]','icohort') end if + if (associated(cpatch%dlnagb_dt)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%dlnagb_dt,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'DLNAGB_DT :41:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'Relative AGB growth','[1/yr]','icohort') + end if + if (associated(cpatch%dba_dt)) then nvar=nvar+1 call vtable_edio_r(npts,cpatch%dba_dt,nvar,igr,init,cpatch%coglob_id, & @@ -13414,6 +13831,13 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'Basal-area growth','[cm2/plant/yr]','icohort') end if + if (associated(cpatch%dlnba_dt)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%dlnba_dt,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'DLNBA_DT :41:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'Relative Basal-area growth','[1/yr]','icohort') + end if + if (associated(cpatch%ddbh_dt)) then nvar=nvar+1 call vtable_edio_r(npts,cpatch%ddbh_dt,nvar,igr,init,cpatch%coglob_id, & @@ -13421,6 +13845,13 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'DBH growth','[cm/plant/yr]','icohort') end if + if (associated(cpatch%dlndbh_dt)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%dlndbh_dt,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'DLNDBH_DT :41:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'Relative DBH growth','[1/yr]','icohort') + end if + if (associated(cpatch%dbh)) then nvar=nvar+1 call vtable_edio_r(npts,cpatch%dbh,nvar,igr,init,cpatch%coglob_id, & @@ -13502,7 +13933,7 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) nvar=nvar+1 call vtable_edio_r(npts,cpatch%cbr_bar,nvar,igr,init,cpatch%coglob_id, & var_len,var_len_global,max_ptrs,'CBR_BAR :41:hist:mont:year:dcyc') - call metadata_edio(nvar,igr,'Annual average ratio of cb/cb_max','[NA]','NA') + call metadata_edio(nvar,igr,'Relative carbon balance','[NA]','NA') end if if (associated(cpatch%mmean_cb)) then @@ -13533,6 +13964,13 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(cpatch%leaf_vpdef)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%leaf_vpdef,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'LEAF_VPDEF :41:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(cpatch%leaf_temp_pv)) then nvar=nvar+1 call vtable_edio_r(npts,cpatch%leaf_temp_pv,nvar,igr,init,cpatch%coglob_id, & @@ -13752,10 +14190,17 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'NOT A DIAGNOSTIC-WILL ZERO PRIOR TO DAILY WRITE OUT','[NA]','NA') end if - if (associated(cpatch%today_gpp_max)) then + if (associated(cpatch%today_gpp_lightmax)) then nvar=nvar+1 - call vtable_edio_r(npts,cpatch%today_gpp_max,nvar,igr,init,cpatch%coglob_id, & - var_len,var_len_global,max_ptrs,'TODAY_GPP_MAX :41:hist') + call vtable_edio_r(npts,cpatch%today_gpp_lightmax,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'TODAY_GPP_LIGHTMAX :41:hist') + call metadata_edio(nvar,igr,'NOT A DIANOSTIC-WILL ZERO PRIOR TO DAILY WRITE OUT','[NA]','NA') + end if + + if (associated(cpatch%today_gpp_moistmax)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%today_gpp_moistmax,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'TODAY_GPP_MOISTMAX :41:hist') call metadata_edio(nvar,igr,'NOT A DIANOSTIC-WILL ZERO PRIOR TO DAILY WRITE OUT','[NA]','NA') end if @@ -13958,6 +14403,13 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') end if + if (associated(cpatch%monthly_dlnndt)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%monthly_dlnndt,nvar,igr,init,cpatch%coglob_id, & + var_len,var_len_global,max_ptrs,'MONTHLY_DLNNDT :41:hist') + call metadata_edio(nvar,igr,'No metadata available','[NA]','NA') + end if + if (associated(cpatch%Psi_open)) then nvar=nvar+1 call vtable_edio_r(npts,cpatch%Psi_open,nvar,igr,init,cpatch%coglob_id, & @@ -14607,16 +15059,29 @@ subroutine filltab_patchtype(igr,ipy,isi,ipa,init) if (associated(cpatch%cb)) then nvar=nvar+1 - call vtable_edio_r(npts,cpatch%cb,nvar,igr,init,cpatch%coglob_id, & - var_len,var_len_global,max_ptrs,'CB :49:hist:mont:dcyc:year') - call metadata_edio(nvar,igr,'carbon balance previous 12 months+current','[kgC/plant]','13 - icohort') + call vtable_edio_r(npts,cpatch%cb,nvar,igr,init,cpatch%coglob_id & + ,var_len,var_len_global,max_ptrs & + ,'CB :49:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'carbon balance previous 12 months+current' & + ,'[kgC/plant]','13 - icohort') end if - if (associated(cpatch%cb_max)) then + if (associated(cpatch%cb_lightmax)) then nvar=nvar+1 - call vtable_edio_r(npts,cpatch%cb_max,nvar,igr,init,cpatch%coglob_id, & - var_len,var_len_global,max_ptrs,'CB_MAX :49:hist:mont:dcyc:year') - call metadata_edio(nvar,igr,'TOC carbon balance previous 12 months+current','[kgC/plant]','13 - icohort') + call vtable_edio_r(npts,cpatch%cb_lightmax,nvar,igr,init,cpatch%coglob_id & + ,var_len,var_len_global,max_ptrs & + ,'CB_LIGHTMAX :49:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'Full light carbon balance last 12 months+current' & + ,'[kgC/plant]','13 - icohort') + end if + + if (associated(cpatch%cb_moistmax)) then + nvar=nvar+1 + call vtable_edio_r(npts,cpatch%cb_moistmax,nvar,igr,init,cpatch%coglob_id & + ,var_len,var_len_global,max_ptrs & + ,'CB_MOISTMAX :49:hist:mont:dcyc:year') + call metadata_edio(nvar,igr,'Full moisture carbon balance last 12 months+current' & + ,'[kgC/plant]','13 - icohort') end if !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ed_var_tables.f90 b/ED/src/memory/ed_var_tables.f90 index 48b7e01e4..a87384bda 100644 --- a/ED/src/memory/ed_var_tables.f90 +++ b/ED/src/memory/ed_var_tables.f90 @@ -59,6 +59,7 @@ ! ! 44 : rank 2 : cohort, pft ! ! ! ! 46 : rank 2 : cohort, dbh ! ! ! ! 47 : rank 2 : cohort, age ! ! +! ! 48 : rank 2 : cohort, mort ! ! ! ! 49 : rank 2 : cohort, nmonths+1 ! ! ! !-----------------------------------------------------! ! ! ! @@ -123,7 +124,7 @@ module ed_var_tables character (len=64) :: dimlab logical :: vector_allocated !----- Multiple pointer defs (maxptrs) ----------------------------------------------! - type(var_table_vector), allocatable, dimension(:) :: vt_vector + type(var_table_vector), pointer, dimension(:) :: vt_vector end type var_table !---------------------------------------------------------------------------------------! @@ -1559,32 +1560,31 @@ subroutine reset_vt_vector_pointers(vt) ! I actually don't know why, but the typical "if (allocated(vt%vt_vector))" ! ! doesn't work here, so instead we save a logical test... ! !------------------------------------------------------------------------------------! - if (.not. vt%vector_allocated) return - !------------------------------------------------------------------------------------! - - - !------------------------------------------------------------------------------------! - ! Go through all pointer elements and nullify those associated with variables. ! - ! We must do that before we deallocate so only the pointers, not the true arrays, ! - ! are deallocated. ! - !------------------------------------------------------------------------------------! - do iptr=1,vt%nptrs - if (associated(vt%vt_vector(iptr)%var_rp)) nullify(vt%vt_vector(iptr)%var_rp) - if (associated(vt%vt_vector(iptr)%var_ip)) nullify(vt%vt_vector(iptr)%var_ip) - if (associated(vt%vt_vector(iptr)%var_cp)) nullify(vt%vt_vector(iptr)%var_cp) - if (associated(vt%vt_vector(iptr)%var_dp)) nullify(vt%vt_vector(iptr)%var_dp) - if (associated(vt%vt_vector(iptr)%sca_rp)) nullify(vt%vt_vector(iptr)%sca_rp) - if (associated(vt%vt_vector(iptr)%sca_ip)) nullify(vt%vt_vector(iptr)%sca_ip) - if (associated(vt%vt_vector(iptr)%sca_cp)) nullify(vt%vt_vector(iptr)%sca_cp) - if (associated(vt%vt_vector(iptr)%sca_dp)) nullify(vt%vt_vector(iptr)%sca_dp) - end do + if (vt%vector_allocated) then + !---------------------------------------------------------------------------------! + ! Go through all pointer elements and nullify those associated with vari- ! + ! ables. We must do that before we deallocate so only the pointers, not the true ! + ! arrays, are deallocated. ! + !---------------------------------------------------------------------------------! + do iptr=1,vt%nptrs + if (associated(vt%vt_vector(iptr)%var_rp)) nullify(vt%vt_vector(iptr)%var_rp) + if (associated(vt%vt_vector(iptr)%var_ip)) nullify(vt%vt_vector(iptr)%var_ip) + if (associated(vt%vt_vector(iptr)%var_cp)) nullify(vt%vt_vector(iptr)%var_cp) + if (associated(vt%vt_vector(iptr)%var_dp)) nullify(vt%vt_vector(iptr)%var_dp) + if (associated(vt%vt_vector(iptr)%sca_rp)) nullify(vt%vt_vector(iptr)%sca_rp) + if (associated(vt%vt_vector(iptr)%sca_ip)) nullify(vt%vt_vector(iptr)%sca_ip) + if (associated(vt%vt_vector(iptr)%sca_cp)) nullify(vt%vt_vector(iptr)%sca_cp) + if (associated(vt%vt_vector(iptr)%sca_dp)) nullify(vt%vt_vector(iptr)%sca_dp) + end do + deallocate(vt%vt_vector) + end if !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! - ! Now it's safe to deallocate, just remind to update the logical flag... ! + ! Now it's safe to nullify; we also update the logical flag... ! !------------------------------------------------------------------------------------! - deallocate(vt%vt_vector) + nullify(vt%vt_vector) vt%vector_allocated = .false. !------------------------------------------------------------------------------------! diff --git a/ED/src/memory/ename_coms.f90 b/ED/src/memory/ename_coms.f90 index 7dfa94691..642aaa076 100644 --- a/ED/src/memory/ename_coms.f90 +++ b/ED/src/memory/ename_coms.f90 @@ -99,6 +99,7 @@ module ename_coms integer :: isoilstateinit integer :: isoildepthflg integer :: isoilbc + real :: sldrain real , dimension(nzgmax) :: slz real , dimension(nzgmax) :: slmstr @@ -152,6 +153,8 @@ module ename_coms real :: clump_tree real :: clump_grass integer :: h2o_plant_lim + integer :: iddmort_scheme + real :: ddmort_const real :: vmfact_c3 real :: vmfact_c4 real :: mphoto_trc3 @@ -176,7 +179,6 @@ module ename_coms real :: lwidth_nltree real :: q10_c3 real :: q10_c4 - real :: lturnover_grass real :: thetacrit integer :: quantum_efficiency_T integer :: n_plant_lim @@ -237,6 +239,10 @@ module ename_coms character(len=str_len) :: event_file !----- Variables to control detailed output. ----------------------------------------! + integer :: dt_census + integer :: yr1st_census + integer :: mon1st_census + real :: min_recruit_dbh integer :: idetailed integer :: patch_keep @@ -356,6 +362,7 @@ subroutine init_ename_vars(enl) enl%isoilstateinit = undef_integer enl%isoildepthflg = undef_integer enl%isoilbc = undef_integer + enl%sldrain = undef_real enl%slz = (/ (-undef_real, i=1,nzgmax) /) enl%slmstr = (/ ( undef_real, i=1,nzgmax) /) @@ -408,6 +415,8 @@ subroutine init_ename_vars(enl) enl%clump_tree = undef_real enl%clump_grass = undef_real enl%h2o_plant_lim = undef_integer + enl%iddmort_scheme = undef_integer + enl%ddmort_const = undef_real enl%vmfact_c3 = undef_real enl%vmfact_c4 = undef_real enl%mphoto_trc3 = undef_real @@ -432,7 +441,6 @@ subroutine init_ename_vars(enl) enl%lwidth_nltree = undef_real enl%q10_c3 = undef_real enl%q10_c4 = undef_real - enl%lturnover_grass = undef_real enl%thetacrit = undef_real enl%quantum_efficiency_T = undef_integer enl%n_plant_lim = undef_integer @@ -489,6 +497,10 @@ subroutine init_ename_vars(enl) enl%phenpath = undef_path enl%event_file = undef_path + enl%dt_census = undef_integer + enl%yr1st_census = undef_integer + enl%mon1st_census = undef_integer + enl%min_recruit_dbh = undef_real enl%idetailed = undef_integer enl%patch_keep = undef_integer diff --git a/ED/src/memory/met_driver_coms.f90 b/ED/src/memory/met_driver_coms.f90 index ac2292119..2343ce810 100644 --- a/ED/src/memory/met_driver_coms.f90 +++ b/ED/src/memory/met_driver_coms.f90 @@ -133,6 +133,7 @@ module met_driver_coms real :: atm_tmp real :: atm_theta real :: atm_theiv + real :: atm_vpdef real :: atm_shv real :: theta real :: rshort diff --git a/ED/src/memory/pft_coms.f90 b/ED/src/memory/pft_coms.f90 index 0b644a906..43b40aa8a 100644 --- a/ED/src/memory/pft_coms.f90 +++ b/ED/src/memory/pft_coms.f90 @@ -279,6 +279,13 @@ module pft_coms !---------------------------------------------------------------------------------------! real, dimension(n_pft) :: mort3 + !---------------------------------------------------------------------------------------! + ! This variable sets up the relative carbon balance when plants are experiencing ! + ! severe stress (i.e., when the maximum carbon balance is negative due to severe light ! + ! or water stress). ! + !---------------------------------------------------------------------------------------! + real, dimension(n_pft) :: cbr_severe_stress + !---------------------------------------------------------------------------------------! ! This variable determines how rapidly trees die if it is too cold for them ! ! [1/years]. ! @@ -398,6 +405,8 @@ module pft_coms real , dimension(n_pft) :: min_dbh !----- Critical DBH for height/bdead, point in which plants stop growing vertically. ---! real , dimension(n_pft) :: dbh_crit + !----- Prescribed DBH for the big leaf model, that allows a reasonable LAI/biomass. ----! + real , dimension(n_pft) :: dbh_bigleaf !----- Minimum Bdead attainable by this PFT. -------------------------------------------! real , dimension(n_pft) :: min_bdead !----- Critical Bdead, point in which plants stop growing vertically. ------------------! @@ -509,7 +518,7 @@ module pft_coms !----- Fraction of seed dispersal that is gridcell-wide. -------------------------------! real , dimension(n_pft) :: nonlocal_dispersal ! !----- Minimum height plants need to attain before allocating to reproduction. ---------! - real , dimension(n_pft) :: repro_min_h + real , dimension(n_pft) :: repro_min_h !=======================================================================================! !=======================================================================================! @@ -587,6 +596,7 @@ module pft_coms real :: wood_temp real :: leaf_temp_pv real :: wood_temp_pv + real :: leaf_vpdef real :: hite real :: dbh real :: bdead @@ -629,6 +639,7 @@ subroutine zero_recruit(maxp,recruit) recruit(p)%wood_temp = 0. recruit(p)%leaf_temp_pv = 0. recruit(p)%wood_temp_pv = 0. + recruit(p)%leaf_vpdef = 0. recruit(p)%hite = 0. recruit(p)%dbh = 0. recruit(p)%bdead = 0. @@ -641,7 +652,7 @@ subroutine zero_recruit(maxp,recruit) recruit(p)%elongf = 0. recruit(p)%bstorage = 0. recruit(p)%nplant = 0. - end do + end do return end subroutine zero_recruit @@ -671,6 +682,7 @@ subroutine copy_recruit(recsource,rectarget) rectarget%wood_temp = recsource%wood_temp rectarget%leaf_temp_pv = recsource%leaf_temp_pv rectarget%wood_temp_pv = recsource%wood_temp_pv + rectarget%leaf_vpdef = recsource%leaf_vpdef rectarget%hite = recsource%hite rectarget%dbh = recsource%dbh rectarget%bdead = recsource%bdead diff --git a/ED/src/memory/phenology_coms.f90 b/ED/src/memory/phenology_coms.f90 index 3178f5f38..60e067c47 100644 --- a/ED/src/memory/phenology_coms.f90 +++ b/ED/src/memory/phenology_coms.f90 @@ -160,6 +160,15 @@ module phenology_coms + !---------------------------------------------------------------------------------------! + ! Minimum elongation factor that allows plants to start flushing out new leaves if ! + ! they are drought deciduous and have been losing leaves. ! + !---------------------------------------------------------------------------------------! + real :: elongf_flush + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! ! Leaf offset parameters are from: ! ! White et al. 1997, Global Biogeochemical Cycles 11(2) 217-234 ! diff --git a/ED/src/memory/physiology_coms.f90 b/ED/src/memory/physiology_coms.f90 index 401c91c84..6d4cc8224 100644 --- a/ED/src/memory/physiology_coms.f90 +++ b/ED/src/memory/physiology_coms.f90 @@ -39,32 +39,93 @@ module physiology_coms implicit none - !---------------------------------------------------------------------------------------! + !=======================================================================================! + !=======================================================================================! ! Variables that are defined by the user in the namelist. ! !---------------------------------------------------------------------------------------! - !----- This flag controls which physiology scheme we should use. -----------------------! - integer :: iphysiol ! 0 -- Original ED-2.1, with temperature functions - ! described as in F96 - ! 1 -- Original ED-2.1, but with compensation point - ! as a function of the Michaelis-Mentel - ! constants for CO2 and O2 (like in F80) - ! 2 -- Temperature response is based on C91/C92, - ! with temperature decay for Vm0 and leaf - ! respiration for both C3 and C4 as in C91 - ! 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 the plants should be limited by nitrogen. ------------! + + + !---------------------------------------------------------------------------------------! + ! IPHYSIOL -- This variable will determine the functional form that will control how ! + ! the various parameters will vary with temperature, and how the CO2 ! + ! compensation point for gross photosynthesis (Gamma*) will be found. ! + ! Options are: ! + ! ! + ! 0 -- Original ED-2.1, we use the "Arrhenius" function as in Foley et al. (1996) and ! + ! Moorcroft et al. (2001). Gamma* is found using the parameters for tau as in ! + ! Foley et al. (1996). ! + ! 1 -- Modified ED-2.1. In this case Gamma* is found using the Michaelis-Mentel ! + ! 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 ! + ! 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. ! + !---------------------------------------------------------------------------------------! + integer :: iphysiol + !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! N_PLANT_LIM -- This controls whether plant photosynthesis can be limited by nitrogen. ! + ! 0. No limitation ! + ! 1. ED-2.1 nitrogen limitation model. ! + !---------------------------------------------------------------------------------------! integer :: n_plant_lim !---------------------------------------------------------------------------------------! - ! This parameter will decide whether the fraction of open stomata should be ! - ! calculated through the original method or the new empirical relation. ! + + !---------------------------------------------------------------------------------------! - integer :: h2o_plant_lim ! 0 -- No plant limitation - ! 1 -- Original ED-2.1 model - ! 2 -- CLM-based function. + ! H2O_PLANT_LIM -- this determines whether plant photosynthesis can be limited by ! + ! 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. ! + !---------------------------------------------------------------------------------------! + integer :: h2o_plant_lim !---------------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------------! + ! IDDMORT_SCHEME -- This flag determines whether storage should be accounted in the ! + ! carbon balance. ! + ! 0 -- Carbon balance is done in terms of fluxes only. This is the ! + ! default in ED-2.1 ! + ! 1 -- Carbon balance is offset by the storage pool. Plants will be ! + ! in negative carbon balance only when they run out of storage ! + ! and are still losing more carbon than gaining. ! + ! ! + ! DDMORT_CONST -- This constant (k) determines the relative contribution of light ! + ! and soil moisture to the density-dependent mortality rate. Values ! + ! range from 0 (soil moisture only) to 1 (light only). ! + ! ! + ! mort1 ! + ! mu_DD = ------------------------- ! + ! 1 + exp [ mort2 * cr ] ! + ! ! + ! CB CB ! + ! cr = k ------------- + (1 - k) ------------- ! + ! CB_lightmax CB_watermax ! + !---------------------------------------------------------------------------------------! + integer :: iddmort_scheme + real :: ddmort_const + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! ! The following variables are factors that control photosynthesis and respiration. ! ! Notice that some of them are relative values whereas others are absolute. ! @@ -105,7 +166,6 @@ module physiology_coms ! 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). ! - ! LTURNOVER_GRASS- Leave turnover rate for grasses (1/yr) ! !---------------------------------------------------------------------------------------! real(kind=4) :: vmfact_c3 real(kind=4) :: vmfact_c4 @@ -131,7 +191,6 @@ module physiology_coms real(kind=4) :: lwidth_nltree real(kind=4) :: q10_c3 real(kind=4) :: q10_c4 - real(kind=4) :: lturnover_grass !---------------------------------------------------------------------------------------! !---------------------------------------------------------------------------------------! diff --git a/ED/src/memory/rk4_coms.f90 b/ED/src/memory/rk4_coms.f90 index 7b033a540..61dc12fcf 100644 --- a/ED/src/memory/rk4_coms.f90 +++ b/ED/src/memory/rk4_coms.f90 @@ -272,6 +272,8 @@ module rk4_coms real(kind=8),pointer,dimension(:) :: avg_sensible_gg ! Soil heat flux between layers real(kind=8) :: avg_drainage ! Drainage at the bottom. real(kind=8) :: avg_drainage_heat ! Drainage at the bottom. + !----- Water deficit. ---------------------------------------------------------------! + real(kind=8) :: water_deficit ! Step water deficit !------------------------------------------------------------------------------------! ! Fast time flux variables for each time step. These variables will be defined ! ! only when the user is debugging. ! @@ -355,6 +357,7 @@ module rk4_coms real(kind=8) :: atm_tmp real(kind=8) :: atm_theta real(kind=8) :: atm_theiv + real(kind=8) :: atm_vpdef real(kind=8) :: atm_shv real(kind=8) :: atm_rhv real(kind=8) :: atm_co2 @@ -1059,6 +1062,8 @@ subroutine zero_rk4_patch(y) y%avg_drainage = 0.d0 y%avg_drainage_heat = 0.d0 + y%water_deficit = 0.d0 + y%flx_carbon_ac = 0.d0 y%flx_carbon_st = 0.d0 y%flx_vapor_lc = 0.d0 @@ -1520,7 +1525,6 @@ subroutine reset_rk4_fluxes(y) type(rk4patchtype), target :: y !------------------------------------------------------------------------------------! - y%flx_carbon_ac = 0.d0 y%flx_vapor_lc = 0.d0 y%flx_vapor_wc = 0.d0 @@ -1586,7 +1590,6 @@ subroutine norm_rk4_fluxes(y,hdid) !----- Find the inverse of the time step. -------------------------------------------! hdidi = 1.d0 / 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 diff --git a/ED/src/memory/soil_coms.F90 b/ED/src/memory/soil_coms.F90 index 8c33c9ec2..ac71b1a31 100644 --- a/ED/src/memory/soil_coms.F90 +++ b/ED/src/memory/soil_coms.F90 @@ -34,29 +34,210 @@ module soil_coms integer, parameter :: ed_nvtyp = 21 #endif - !---------------------------------------------------------------------------------------! + !=======================================================================================! + !=======================================================================================! ! The following variables are assigned through the namelist. ! !---------------------------------------------------------------------------------------! - 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. - real, dimension(nzgmax) :: slmstr ! Initial soil moist. frac. - real, dimension(nzgmax) :: stgoff ! Initial soil temp. offset - real, dimension(nzgmax) :: slz ! Soil levels. - character(len=str_len), dimension(maxgrds) :: veg_database ! Land/sea mask database - character(len=str_len), dimension(maxgrds) :: soil_database ! Soil texture database - character(len=str_len) :: soilstate_db ! Soil state database. - character(len=str_len) :: soildepth_db ! Soil depth database. + !---------------------------------------------------------------------------------------! + ! ISOILBC -- This controls the soil moisture boundary condition at the bottom. Choose ! + ! the option according to the site characteristics. ! + ! 0. Flat bedrock. Flux from the bottom of the bottommost layer is zero. ! + ! 1. Gravitational flow (free drainage). The flux from the bottom of the ! + ! bottommost layer is due to gradient of height only. ! + ! 2. Lateral drainage. Similar to free drainage, but the gradient is ! + ! reduced by the slope not being completely vertical. The reduction is ! + ! controlled by variable SLDRAIN. In the future options 0, 1, and 2 may ! + ! be combined into a single option. ! + ! 3. Aquifer. Soil moisture of the ficticious layer beneath the bottom is ! + ! always at saturation. ! + !---------------------------------------------------------------------------------------! + integer :: isoilbc + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! SLDRAIN -- This is used only when ISOILBC is set to 2. In this case SLDRAIN is ! + ! the equivalent slope that will slow down drainage. If this is set to ! + ! zero, then lateral drainage reduces to flat bedrock, and if this is ! + ! set to 90, then lateral drainage becomes free drainage. SLDRAIN must ! + ! be between 0 and 90. ! + ! ! + ! SLDRAIN8 -- These are auxiliary variables derived from sldrain. SIN_SLDRAIN is ! + ! SIN_SLDRAIN the sine of the slope, and SLDRAIN8 and SIN_SLDRAIN8 are the double ! + ! SIN_SLDRAIN8 precision versions of SLDRAIN and SIN_SLDRAIN. ! + !---------------------------------------------------------------------------------------! + real :: sldrain + real(kind=8) :: sldrain8 + real :: sin_sldrain + real(kind=8) :: sin_sldrain8 + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! ISOILFLG -- this controls which soil type input you want to use. ! + ! 1. Read in from a dataset I will provide in the SOIL_DATABASE variable a ! + ! few lines below. ! + ! below. ! + ! 2. No data available, I will use constant values I will provide in ! + ! NSLCON or by prescribing the fraction of sand and clay (see SLXSAND ! + ! and SLXCLAY). ! + !---------------------------------------------------------------------------------------! + integer, dimension(maxgrds) :: isoilflg + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! NSLCON -- ED-2 Soil 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 ! + ! 5 -- loam | 11 -- clay | 17 -- clayey silt ! + ! 6 -- sandy clay loam | 12 -- peat ! + !---------------------------------------------------------------------------------------! + integer :: nslcon + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! 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. ! + !---------------------------------------------------------------------------------------! + integer :: isoilcol + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! These variables are used to define the soil properties when you don't want to use ! + ! the standard soil classes. ! + ! ! + ! SLXCLAY -- Prescribed fraction of clay [0-1] ! + ! SLXSAND -- Prescribed fraction of sand [0-1]. ! + ! ! + ! They are used only when ISOILFLG is 2, both values are between 0. and 1., and ! + ! theira sum doesn't exceed 1. Otherwise standard ED values will be used instead. ! + !---------------------------------------------------------------------------------------! + real :: slxclay + real :: slxsand + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! ZROUGH -- constant roughness, in metres, if for all domain ! + !---------------------------------------------------------------------------------------! + real :: zrough + !---------------------------------------------------------------------------------------! + + + + !---------------------------------------------------------------------------------------! + ! Soil grid and initial conditions if no file is provided: ! + ! ! + ! SLZ - soil depth in m. Values must be negative and go from the deepest layer to ! + ! the top. ! + ! SLMSTR - this is the initial soil moisture, now given as the soil moisture index. ! + ! Values can be fraction, in which case they will be linearly interpolated ! + ! between the special points (e.g. 0.5 will put soil moisture half way ! + ! between the wilting point and field capacity). ! + ! -1 = dry air soil moisture ! + ! 0 = wilting point ! + ! 1 = field capacity ! + ! 2 = porosity (saturation) ! + ! STGOFF - initial temperature offset (soil temperature = air temperature + offset) ! + !---------------------------------------------------------------------------------------! + real, dimension(nzgmax) :: slz + real, dimension(nzgmax) :: slmstr + real, dimension(nzgmax) :: stgoff + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! Input databases ! + ! VEG_DATABASE -- vegetation database, used only to determine the land/water mask. ! + ! Fill with the path and the prefix. ! + ! SOIL_DATABASE -- soil database, used to determine the soil type. Fill with the ! + ! path and the prefix. ! + ! SOILSTATE_DB -- Dataset in case you want to provide the initial conditions of ! + ! soil temperature and moisture. ! + ! SOILDEPTH_DB -- Dataset in case you want to read in soil depth information. ! + !---------------------------------------------------------------------------------------! + character(len=str_len), dimension(maxgrds) :: veg_database + character(len=str_len), dimension(maxgrds) :: soil_database + character(len=str_len) :: soilstate_db + character(len=str_len) :: soildepth_db + !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! ISOILSTATEINIT -- Variable controlling how to initialise the soil temperature and ! + ! moisture ! + ! 0. Use SLMSTR and STGOFF. ! + ! 1. Read from SOILSTATE_DB. ! + ! ISOILDEPTHFLG -- Variable controlling how to initialise soil depth ! + ! 0. Constant, always defined by the first SLZ layer. ! + ! 1. Read from SOILDEPTH_DB. ! + !---------------------------------------------------------------------------------------! integer :: isoilstateinit ! Soil state initial cond. integer :: isoildepthflg ! Soil depth initial cond. - real :: runoff_time ! Default runoff time scale. !---------------------------------------------------------------------------------------! + + + + + !---------------------------------------------------------------------------------------! + ! RUNOFF_TIME -- In case a temporary surface water (TSW) is created, this is the "e- ! + ! -folding lifetime" of the TSW in seconds due to runoff. If you don't ! + ! want runoff to happen, set this to 0. ! + !---------------------------------------------------------------------------------------! + real :: runoff_time + !---------------------------------------------------------------------------------------! + + !=======================================================================================! + !=======================================================================================! + + !---------------------------------------------------------------------------------------! ! These following variables will behave as parameters, but they are initialized at ! ! init_soil_coms (ed_params.f90), or through the XML config file. ! diff --git a/ED/src/mpi/ed_mpass_init.f90 b/ED/src/mpi/ed_mpass_init.f90 index 2ffe1db2b..876aae8c4 100644 --- a/ED/src/mpi/ed_mpass_init.f90 +++ b/ED/src/mpi/ed_mpass_init.f90 @@ -176,6 +176,7 @@ subroutine ed_masterput_nl(par_run) , isoilstateinit & ! intent(in) , isoildepthflg & ! intent(in) , isoilbc & ! intent(in) + , sldrain & ! intent(in) , runoff_time & ! intent(in) , zrough & ! intent(in) , layer_index & ! intent(in) @@ -207,6 +208,8 @@ subroutine ed_masterput_nl(par_run) , maxcohort ! ! intent(in) use physiology_coms , only : iphysiol & ! intent(in) , h2o_plant_lim & ! intent(in) + , iddmort_scheme & ! intent(in) + , ddmort_const & ! intent(in) , n_plant_lim & ! intent(in) , vmfact_c3 & ! intent(in) , vmfact_c4 & ! intent(in) @@ -232,7 +235,6 @@ subroutine ed_masterput_nl(par_run) , lwidth_nltree & ! intent(in) , q10_c3 & ! intent(in) , q10_c4 & ! intent(in) - , lturnover_grass & ! intent(in) , quantum_efficiency_T ! ! intent(in) use phenology_coms , only : iphen_scheme & ! intent(in) , iphenys1 & ! intent(in) @@ -244,7 +246,8 @@ subroutine ed_masterput_nl(par_run) , radint & ! intent(in) , radslp & ! intent(in) , thetacrit ! ! intent(in) - use decomp_coms , only : n_decomp_lim ! ! intent(in) + use decomp_coms , only : n_decomp_lim & ! intent(in) + , decomp_scheme ! ! intent(in) use pft_coms , only : include_these_pft & ! intent(in) , agri_stock & ! intent(in) , plantation_stock & ! intent(in) @@ -273,8 +276,12 @@ subroutine ed_masterput_nl(par_run) use rk4_coms , only : rk4_tolerance & ! intent(in) , ibranch_thermo & ! intent(in) , ipercol ! ! intent(in) - use detailed_coms , only : idetailed & ! intent(in) - , patch_keep ! ! intent(in) + use detailed_coms , only : dt_census & ! intent(in) + , yr1st_census & ! intent(in) + , mon1st_census & ! intent(in) + , min_recruit_dbh & ! intent(in) + , idetailed & ! intent(in) + , patch_keep ! ! intent(in) implicit none include 'mpif.h' integer :: ierr @@ -372,6 +379,7 @@ subroutine ed_masterput_nl(par_run) 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(sldrain,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_poi,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_ed_region,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -421,6 +429,8 @@ subroutine ed_masterput_nl(par_run) 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(iddmort_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ddmort_const,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) @@ -445,11 +455,11 @@ subroutine ed_masterput_nl(par_run) 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(lturnover_grass,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(thetacrit,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) + call MPI_Bcast(decomp_scheme,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(include_fire,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(fire_parameter,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(sm_fire,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) @@ -516,6 +526,10 @@ subroutine ed_masterput_nl(par_run) call MPI_Bcast(attach_metadata,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(dt_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(yr1st_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mon1st_census,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) + call MPI_Bcast(min_recruit_dbh,1,MPI_REAL,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(idetailed,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) call MPI_Bcast(patch_keep,1,MPI_INTEGER,mainnum,MPI_COMM_WORLD,ierr) @@ -1269,6 +1283,7 @@ subroutine ed_nodeget_nl , isoilstateinit & ! intent(out) , isoildepthflg & ! intent(out) , isoilbc & ! intent(out) + , sldrain & ! intent(out) , runoff_time & ! intent(out) , zrough & ! intent(out) , layer_index & ! intent(out) @@ -1300,6 +1315,8 @@ subroutine ed_nodeget_nl , maxcohort ! ! intent(out) use physiology_coms , only : iphysiol & ! intent(out) , h2o_plant_lim & ! intent(out) + , iddmort_scheme & ! intent(out) + , ddmort_const & ! intent(out) , n_plant_lim & ! intent(out) , vmfact_c3 & ! intent(out) , vmfact_c4 & ! intent(out) @@ -1325,7 +1342,6 @@ subroutine ed_nodeget_nl , lwidth_nltree & ! intent(out) , q10_c3 & ! intent(out) , q10_c4 & ! intent(out) - , lturnover_grass & ! intent(out) , quantum_efficiency_T ! ! intent(out) use phenology_coms , only : iphen_scheme & ! intent(out) , iphenys1 & ! intent(out) @@ -1337,7 +1353,8 @@ subroutine ed_nodeget_nl , radint & ! intent(out) , radslp & ! intent(out) , thetacrit ! ! intent(out) - use decomp_coms , only : n_decomp_lim ! ! intent(out) + use decomp_coms , only : n_decomp_lim & ! intent(out) + , decomp_scheme ! ! intent(out) use pft_coms , only : include_these_pft & ! intent(out) , agri_stock & ! intent(out) , plantation_stock & ! intent(out) @@ -1366,8 +1383,12 @@ subroutine ed_nodeget_nl use rk4_coms , only : rk4_tolerance & ! intent(out) , ibranch_thermo & ! intent(out) , ipercol ! ! intent(out) - use detailed_coms , only : idetailed & ! intent(out) - , patch_keep ! ! intent(out) + use detailed_coms , only : dt_census & ! intent(out) + , yr1st_census & ! intent(out) + , mon1st_census & ! intent(out) + , min_recruit_dbh & ! intent(out) + , idetailed & ! intent(out) + , patch_keep ! ! intent(out) implicit none include 'mpif.h' integer :: ierr @@ -1471,6 +1492,7 @@ subroutine ed_nodeget_nl 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(sldrain,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_poi,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(n_ed_region,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) @@ -1520,6 +1542,8 @@ subroutine ed_nodeget_nl 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(iddmort_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(ddmort_const,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) @@ -1544,11 +1568,11 @@ subroutine ed_nodeget_nl 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(lturnover_grass,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(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) + call MPI_Bcast(decomp_scheme,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(include_fire,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(fire_parameter,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(sm_fire,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) @@ -1613,18 +1637,24 @@ subroutine ed_nodeget_nl call MPI_Bcast(edres,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(attach_metadata,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - + + call MPI_Bcast(dt_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(yr1st_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(mon1st_census,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + call MPI_Bcast(min_recruit_dbh,1,MPI_REAL,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(idetailed,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) call MPI_Bcast(patch_keep,1,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) - -!------------------------------------------------------------------------------------------! -! Receiving the layer index based on soil_depth. This is allocatable, so I first ! -! allocate, then let the master know that it is safe to send to me and I reveive the data. ! -!------------------------------------------------------------------------------------------! + + !---------------------------------------------------------------------------------------! + ! Receive the layer index based on soil_depth. This is allocatable, so we first ! + ! allocate, then let the master know that it is safe to send to this node and then the ! + ! node reveives the data. ! + !---------------------------------------------------------------------------------------! if (allocated(layer_index)) deallocate(layer_index) allocate(layer_index(nlat_lyr,nlon_lyr)) call MPI_Barrier(MPI_COMM_WORLD,ierr) ! Safe to receive the data. call MPI_Bcast(layer_index,nlat_lyr*nlon_lyr,MPI_INTEGER,master_num,MPI_COMM_WORLD,ierr) + !---------------------------------------------------------------------------------------! return end subroutine ed_nodeget_nl diff --git a/ED/src/mpi/ed_para_init.F90 b/ED/src/mpi/ed_para_init.F90 index 80b1eeb50..e22de6911 100644 --- a/ED/src/mpi/ed_para_init.F90 +++ b/ED/src/mpi/ed_para_init.F90 @@ -586,6 +586,7 @@ subroutine ed_load_work_from_history() integer :: ipyz logical :: exists logical :: success + logical :: foundvar real(kind=8) :: dbletime real :: maxwork real, dimension(13,huge_polygon) :: worklastyear @@ -728,8 +729,10 @@ subroutine ed_load_work_from_history() chnkoffs (1) = 0_8 memoffs (1) = 0_8 - call hdf_getslab_r(histolon(ipya:ipyz),'LONGITUDE ',dsetrank,iparallel,.true.) - call hdf_getslab_r(histolat(ipya:ipyz),'LATITUDE ' ,dsetrank,iparallel,.true.) + call hdf_getslab_r(histolon(ipya:ipyz),'LONGITUDE ',dsetrank,iparallel,.true. & + ,foundvar) + call hdf_getslab_r(histolat(ipya:ipyz),'LATITUDE ' ,dsetrank,iparallel,.true. & + ,foundvar) !----- Load the workload into a temporary array. ---------------------------------! @@ -748,7 +751,7 @@ subroutine ed_load_work_from_history() memoffs (2) = 0_8 call hdf_getslab_r(worklastyear(:,ipya:ipyz),'WORKLOAD ' & - ,dsetrank,iparallel,.false.) + ,dsetrank,iparallel,.false.,foundvar) !----- Here we close the HDF5 file. ----------------------------------------------! call h5fclose_f(file_id, hdferr) @@ -764,7 +767,7 @@ subroutine ed_load_work_from_history() ! generated by an earlier version. Here we check whether anything was read. In ! ! case not, we assume that all polygons have the same workload. ! !---------------------------------------------------------------------------------! - if (all(worklastyear(:,ipya:ipyz) == 0.)) then + if (.not. foundvar) then write (unit=*,fmt='(a)') ' - Failed reading the workload :( ...' !------------------------------------------------------------------------------! ! No workload was found, assign ones to all nodes, even if some files ! diff --git a/ED/src/utils/allometry.f90 b/ED/src/utils/allometry.f90 index fcb5a0170..367e24f1d 100644 --- a/ED/src/utils/allometry.f90 +++ b/ED/src/utils/allometry.f90 @@ -12,7 +12,7 @@ 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 + , hgt_ref ! ! intent(in) use ed_misc_coms, only : iallom ! ! intent(in) implicit none @@ -20,6 +20,12 @@ real function h2dbh(h,ipft) real , intent(in) :: h integer, intent(in) :: ipft !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Select which type of model we are running. ! + !------------------------------------------------------------------------------------! + !----- Size- and age-structure (typical ED model). ----------------------------------! if (is_tropical(ipft)) then select case (iallom) case (0,1) @@ -33,6 +39,7 @@ real function h2dbh(h,ipft) else ! Temperate h2dbh = log(1.0-(h-hgt_ref(ipft))/b1Ht(ipft))/b2Ht(ipft) end if + !------------------------------------------------------------------------------------! return end function h2dbh @@ -51,8 +58,10 @@ real function dbh2h(ipft, dbh) , dbh_crit & ! intent(in) , b1Ht & ! intent(in) , b2Ht & ! intent(in) - , hgt_ref ! ! intent(in) - use ed_misc_coms, only : iallom ! ! intent(in) + , hgt_ref & ! intent(in) + , hgt_max ! ! intent(in) + use ed_misc_coms, only : iallom & ! intent(in) + , ibigleaf ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! integer , intent(in) :: ipft @@ -61,19 +70,37 @@ real function dbh2h(ipft, dbh) real :: mdbh !------------------------------------------------------------------------------------! - if (is_tropical(ipft)) then - 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 + + !------------------------------------------------------------------------------------! + ! Select which type of model we are running. ! + !------------------------------------------------------------------------------------! + select case (ibigleaf) + case (0) + !----- Size- and age-structure (typical ED model). -------------------------------! + if (is_tropical(ipft)) then + 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 + + case (1) + !---------------------------------------------------------------------------------! + ! Big-leaf version of ED. DBH is not really meaningful, but in the big-leaf ! + ! model the typical allometry doesn't really make sense so we impose maximum ! + ! height. ! + !---------------------------------------------------------------------------------! + dbh2h = hgt_max(ipft) + !---------------------------------------------------------------------------------! + end select + !------------------------------------------------------------------------------------! return end function dbh2h @@ -162,10 +189,15 @@ end function bd2dbh + + !=======================================================================================! - ! Intended to replace dbh2bl and h2bl with a single generic function. This simplifies ! - ! the code in many other places for grasses. !=======================================================================================! + ! This function computes the maximum leaf biomass [kgC/m2] given the size (either ! + ! height or DBH). Trees would always use DBH as the starting point, but grasses may ! + ! use DBH (old style) or height (new style). This replaces dbh2bl and h2bl with a ! + ! single generic function that should be used by all plants. ! + !---------------------------------------------------------------------------------------! real function size2bl(dbh,hite,ipft) use pft_coms , only : dbh_crit & ! intent(in), lookup table , C2B & ! intent(in), lookup table @@ -185,12 +217,12 @@ real function size2bl(dbh,hite,ipft) real :: mdbh !------------------------------------------------------------------------------------! - if (is_grass(ipft) .and. igrass==1) then - !-- use height for grasses - mdbh = min(h2dbh(hite,ipft),dbh_crit(ipft)) + if (is_grass(ipft) .and. igrass == 1) then + !---- Use height for new grasses. ------------------------------------------------! + mdbh = min(h2dbh(hite,ipft),dbh_crit(ipft)) else - !--use dbh for trees - mdbh = min(dbh,dbh_crit(ipft)) + !---- Use dbh for trees. ---------------------------------------------------------! + mdbh = min(dbh,dbh_crit(ipft)) end if size2bl = b1Bl(ipft) / C2B * mdbh ** b2Bl(ipft) @@ -202,50 +234,14 @@ end function size2bl - !=======================================================================================! - !=======================================================================================! - ! This function determines the maximum leaf biomass (kgC/plant) - real function dbh2bl(dbh,ipft) - use pft_coms , only : dbh_crit & ! intent(in), lookup table - , C2B & ! intent(in), lookup table - , b1Bl & ! intent(in), lookup table - , b2Bl & ! intent(in), lookup table - , hgt_max & ! intent(in), lookup table - , is_grass ! ! intent(in) - use ed_misc_coms, only : igrass ! ! intent(in) - - implicit none - !----- Arguments --------------------------------------------------------------------! - real , intent(in) :: dbh - integer, intent(in) :: ipft - !----- Local variables --------------------------------------------------------------! - real :: mdbh - !------------------------------------------------------------------------------------! - - if (is_grass(ipft) .and. igrass==1) then - !--- The grasses really shouldent use this function at all - use size2bl - ! test grasses against maximum height rather than maximum dbh - mdbh = min(dbh, h2dbh(hgt_max(ipft),ipft)) - else - mdbh = min(dbh,dbh_crit(ipft)) - end if - - !------------------------------------------------------------------------------------! - ! Find maximum leaf biomass. ! - !------------------------------------------------------------------------------------! - dbh2bl = b1Bl(ipft) / C2B * mdbh ** b2Bl(ipft) - !------------------------------------------------------------------------------------! - - return - end function dbh2bl - !=======================================================================================! - !=======================================================================================! !=======================================================================================! - ! INVERSION OF DBH2BL ! !=======================================================================================! + ! This function determines an effective DBH for grasses given their leaf biomass. ! + ! DBH has no real meaning for grasses with the new allometry. ! + !---------------------------------------------------------------------------------------! real function bl2dbh(bleaf,ipft) use pft_coms, only : is_tropical & ! intent(in), lookup table , rho & ! intent(in), lookup table @@ -281,8 +277,13 @@ end function bl2dbh + + + !=======================================================================================! !=======================================================================================! + ! This function determines the height for grasses given their leaf biomass. ! + !---------------------------------------------------------------------------------------! real function bl2h(bleaf,ipft) use pft_coms, only: hgt_max ! ! intent(in), lookup table @@ -292,12 +293,8 @@ real function bl2h(bleaf,ipft) integer, intent(in) :: ipft !------------------------------------------------------------------------------------! - !---Use existing allometric equations to convert leaves to height - bl2h = dbh2h(ipft,bl2dbh(bleaf,ipft)) - - if (bl2h > hgt_max(ipft)) then - bl2h = hgt_max(ipft) - end if + !----- Use existing allometric equations to convert leaves to height. ---------------! + bl2h = min(hgt_max(ipft),dbh2h(ipft,bl2dbh(bleaf,ipft))) return end function bl2h @@ -306,24 +303,6 @@ end function bl2h - !=======================================================================================! - !=======================================================================================! - real function h2bl(hite,ipft) - - implicit none - !----- Arguments --------------------------------------------------------------------! - real , intent(in) :: hite - integer, intent(in) :: ipft - !------------------------------------------------------------------------------------! - - !---Use existing allometric equations to convert height to leaves - h2bl = dbh2bl(h2dbh(hite,ipft), ipft) - - - return - end function h2bl - !=======================================================================================! - !=======================================================================================! @@ -355,9 +334,8 @@ real function dbh2ca(dbh,hite,sla,ipft) dbh2ca = 0.0 else - !!loclai = sla * dbh2bl(dbh,ipft) - loclai = sla * size2bl(dbh,hite,ipft) ! make this function generic to size, not just dbh - + !----- make this function generic to size, not just dbh. -------------------------! + loclai = sla * size2bl(dbh,hite,ipft) select case (iallom) case (0) !----- No upper bound in the allometry. ---------------------------------------! diff --git a/ED/src/utils/budget_utils.f90 b/ED/src/utils/budget_utils.f90 index 5ce01a77c..e9f9efc5c 100644 --- a/ED/src/utils/budget_utils.f90 +++ b/ED/src/utils/budget_utils.f90 @@ -299,7 +299,10 @@ subroutine compute_budget(csite,lsl,pcpg,qpcpg,ipa,wcurr_loss2atm,ecurr_netrad csite%co2budget_plresp(ipa) = csite%co2budget_plresp(ipa) & + ( leaf_resp + root_resp + growth_resp + storage_resp & + vleaf_resp ) * dtlsm - csite%co2budget_rh(ipa) = csite%co2budget_rh(ipa) + csite%rh(ipa) * dtlsm + csite%co2budget_rh(ipa) = csite%co2budget_rh(ipa) & + + csite%rh(ipa) * dtlsm + csite%co2budget_cwd_rh(ipa) = csite%co2budget_cwd_rh(ipa) & + + csite%cwd_rh(ipa) * dtlsm csite%co2budget_denseffect(ipa) = csite%co2budget_denseffect(ipa) + co2curr_denseffect csite%co2budget_loss2atm(ipa) = csite%co2budget_loss2atm(ipa) + co2curr_loss2atm !----- 2. Energy. ----------------------------------------------------------------------! diff --git a/ED/src/utils/ed_therm_lib.f90 b/ED/src/utils/ed_therm_lib.f90 index a8739b887..b22720b97 100644 --- a/ED/src/utils/ed_therm_lib.f90 +++ b/ED/src/utils/ed_therm_lib.f90 @@ -367,6 +367,8 @@ subroutine ed_grndvap(ksn,nsoil,topsoil_water,topsoil_temp,topsoil_fliq,sfcwater !----- Compute the saturation specific humidity at ground temperature. -----------! ground_ssh = qslif(can_prss,ground_temp) !----- Determine alpha. ----------------------------------------------------------! + + slpotvn = soil(nsoil)%slpots & / (topsoil_water / soil(nsoil)%slmsts) ** soil(nsoil)%slbs lnalpha = gorh2o * slpotvn / ground_temp diff --git a/ED/src/utils/fuse_fiss_utils.f90 b/ED/src/utils/fuse_fiss_utils.f90 index 2350cc98e..61fb4d1c7 100644 --- a/ED/src/utils/fuse_fiss_utils.f90 +++ b/ED/src/utils/fuse_fiss_utils.f90 @@ -269,72 +269,16 @@ subroutine terminate_patches(csite) ,count(remain_table),count(remain_table)) call deallocate_sitetype(tempsite) deallocate(tempsite) + deallocate(remain_table) !------------------------------------------------------------------------------------! - ! Renormalize the total area. We must also rescale all extensive properties from ! - ! cohorts, since they are per unit area and we are effectively changing the area. ! - ! IMPORTANT: Only cohort-level variables that have units per area (m2) should be ! - ! rescaled. Variables whose units are per plant or per leaf area ! - ! (m2_leaf) should _NOT_ be included here. ! + ! Renormalize the total area. ! !------------------------------------------------------------------------------------! new_area=0. area_scale = 1./(1. - elim_area) do ipa = 1,csite%npatches csite%area(ipa) = csite%area(ipa) * area_scale - new_area = new_area + csite%area(ipa) - - cpatch => csite%patch(ipa) - do ico = 1, cpatch%ncohorts - cpatch%nplant (ico) = cpatch%nplant (ico) * area_scale - cpatch%lai (ico) = cpatch%lai (ico) * area_scale - cpatch%wai (ico) = cpatch%wai (ico) * area_scale - cpatch%mean_gpp (ico) = cpatch%mean_gpp (ico) * area_scale - cpatch%mean_leaf_resp (ico) = cpatch%mean_leaf_resp (ico) * area_scale - cpatch%mean_root_resp (ico) = cpatch%mean_root_resp (ico) * area_scale - cpatch%mean_growth_resp (ico) = cpatch%mean_growth_resp (ico) * area_scale - cpatch%mean_storage_resp (ico) = cpatch%mean_storage_resp (ico) * area_scale - cpatch%mean_vleaf_resp (ico) = cpatch%mean_vleaf_resp (ico) * area_scale - cpatch%gpp (ico) = cpatch%gpp (ico) * area_scale - cpatch%leaf_respiration (ico) = cpatch%leaf_respiration (ico) * area_scale - cpatch%root_respiration (ico) = cpatch%root_respiration (ico) * area_scale - cpatch%leaf_water (ico) = cpatch%leaf_water (ico) * area_scale - cpatch%leaf_hcap (ico) = cpatch%leaf_hcap (ico) * area_scale - cpatch%leaf_energy (ico) = cpatch%leaf_energy (ico) * area_scale - cpatch%wood_water (ico) = cpatch%wood_water (ico) * area_scale - cpatch%wood_hcap (ico) = cpatch%wood_hcap (ico) * area_scale - cpatch%wood_energy (ico) = cpatch%wood_energy (ico) * area_scale - cpatch%monthly_dndt (ico) = cpatch%monthly_dndt (ico) * area_scale - cpatch%today_gpp (ico) = cpatch%today_gpp (ico) * area_scale - cpatch%today_nppleaf (ico) = cpatch%today_nppleaf (ico) * area_scale - cpatch%today_nppfroot (ico) = cpatch%today_nppfroot (ico) * area_scale - cpatch%today_nppsapwood (ico) = cpatch%today_nppsapwood (ico) * area_scale - cpatch%today_nppcroot (ico) = cpatch%today_nppcroot (ico) * area_scale - cpatch%today_nppseeds (ico) = cpatch%today_nppseeds (ico) * area_scale - cpatch%today_nppwood (ico) = cpatch%today_nppwood (ico) * area_scale - cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * area_scale - cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * area_scale - cpatch%today_gpp_max (ico) = cpatch%today_gpp_max (ico) * area_scale - cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * area_scale - cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * area_scale - - !----- Crown area shall not exceed one. ---------------------------------------! - cpatch%crown_area (ico) = min(1.,cpatch%crown_area (ico) * area_scale) - if (idoutput > 0 .or. imoutput > 0 .or. iqoutput > 0) then - cpatch%dmean_par_l (ico) = cpatch%dmean_par_l (ico) * area_scale - cpatch%dmean_par_l_beam (ico) = cpatch%dmean_par_l_beam (ico) * area_scale - cpatch%dmean_par_l_diff (ico) = cpatch%dmean_par_l_diff (ico) * area_scale - end if - if (imoutput > 0 .or. iqoutput > 0) then - cpatch%mmean_par_l (ico) = cpatch%mmean_par_l (ico) * area_scale - cpatch%mmean_par_l_beam (ico) = cpatch%mmean_par_l_beam (ico) * area_scale - cpatch%mmean_par_l_diff (ico) = cpatch%mmean_par_l_diff (ico) * area_scale - end if - if (iqoutput > 0) then - cpatch%qmean_par_l (:,ico) = cpatch%qmean_par_l (:,ico) * area_scale - cpatch%qmean_par_l_beam(:,ico) = cpatch%qmean_par_l_beam(:,ico) * area_scale - cpatch%qmean_par_l_diff(:,ico) = cpatch%qmean_par_l_diff(:,ico) * area_scale - end if - end do + new_area = new_area + csite%area(ipa) end do if (abs(new_area-1.0) > 1.e-5) then @@ -367,31 +311,30 @@ subroutine rescale_patches(csite) use ed_misc_coms , only : iqoutput & ! intent(in) , imoutput & ! intent(in) , idoutput ! ! intent(in) - use allometry , only : dbh2bl ! ! function - use ed_max_dims , only : n_dist_types ! ! intent(in) + use allometry , only : size2bl ! ! function + use ed_max_dims , only : n_dist_types & ! intent(in) + , n_pft ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! - type(sitetype) , target :: csite ! Current site + type(sitetype) , target :: csite ! Current site !----- Local variables --------------------------------------------------------------! - type(patchtype) , pointer :: cpatch ! Pointer to current site - type(sitetype) , pointer :: tempsite ! Scratch site - integer :: ipa ! Counter - integer :: ico ! Counter - integer :: lu ! Counter - logical :: norescale ! flag whether rescaling - ! is necessary - logical , dimension(:), allocatable :: remain_table! Flag: this patch will remain. - real , dimension(:), allocatable :: old_area ! Area before rescaling - real , dimension(:), allocatable :: elim_area ! Area of removed patches - real :: new_area ! New area, so the sum of - ! all patches is 1. - real , dimension(:), allocatable :: dist_area ! Area of disturbance type - real :: area_scale ! Scaling area factor. - real :: site_area ! Total area. - real , dimension(:), allocatable :: patch_blmax ! Total bleaf_max for patch - real , dimension(:), allocatable :: dist_blmax ! total bleaf per dist type - real , dimension(:), allocatable :: dist_patch ! number of patches per dist + type(patchtype) , pointer :: cpatch ! Pointer to current site + type(sitetype) , pointer :: tempsite ! Scratch site + integer :: ipa ! Counter + integer :: ico ! Counter + integer :: ilu ! Counter + integer :: ipft ! Counter + logical, dimension (:), allocatable :: remain_table ! Flag: this patch shall remain. + real , dimension (:), allocatable :: old_area ! Area before rescaling + real , dimension (:), allocatable :: elim_area ! Area of removed patches + real :: laimax ! Max. LAI for current cohort + real , dimension (:), allocatable :: lu_area ! Area of disturbance type + real :: n_scale ! Scaling nplant factor. + real :: site_area ! Total site area (must be 1). + real , dimension (:), allocatable :: patch_laimax ! Total LAI_max per patch + real , dimension (:), allocatable :: lu_laimax ! total bleaf per land use type + integer, dimension (:), allocatable :: lu_npatch ! # of patches per land use type !------------------------------------------------------------------------------------! @@ -401,6 +344,7 @@ subroutine rescale_patches(csite) if (csite%npatches == 1) return !------------------------------------------------------------------------------------! + !------------------------------------------------------------------------------------! ! Loop through all the patches in this site and determine which of these patches ! ! is too small in area to be valid. These will be removed and the remaining patches ! @@ -414,52 +358,59 @@ subroutine rescale_patches(csite) do ipa = 1,csite%npatches if (csite%area(ipa) < min_patch_area) then - lu = csite%dist_type(ipa) - elim_area(lu)= elim_area (lu) + csite%area(ipa) + ilu = csite%dist_type(ipa) + elim_area(ilu)= elim_area (ilu) + csite%area(ipa) remain_table(ipa) = .false. end if end do + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Remove patches that are smaller than the minimum non-negligible area. ! + !------------------------------------------------------------------------------------! if ( sum(elim_area) > 0.0 ) then - !----- Use the mask to resize the patch vectors in the current site. ----------------! + !----- Use the mask to resize the patch vectors in the current site. -------------! allocate(tempsite) call allocate_sitetype(tempsite,count(remain_table)) - call copy_sitetype_mask(csite,tempsite,remain_table,size(remain_table) & + call copy_sitetype_mask(csite,tempsite,remain_table,size(remain_table) & ,count(remain_table)) call deallocate_sitetype(csite) call allocate_sitetype(csite,count(remain_table)) remain_table(:) = .false. remain_table(1:tempsite%npatches) = .true. - call copy_sitetype_mask(tempsite,csite,remain_table(1:tempsite%npatches) & + call copy_sitetype_mask(tempsite,csite,remain_table(1:tempsite%npatches) & ,count(remain_table),count(remain_table)) call deallocate_sitetype(tempsite) deallocate(tempsite) end if + !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! ! Allocate a temporary array that will contain the potential leaf biomass of ! ! each patch. This is done so phenology doesn't impact the area. ! !------------------------------------------------------------------------------------! - allocate (patch_blmax(csite%npatches)) - allocate (old_area (csite%npatches)) - patch_blmax(:) = 0.0 - old_area(:) = 0.0 + allocate (patch_laimax(csite%npatches)) + allocate (old_area (csite%npatches)) + patch_laimax (:) = 0.0 + old_area (:) = 0.0 !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! - ! Loop through disturbance types, total area per disturbance type will remain ! + ! Loop through land use types, total area per disturbance type will remain ! ! unchanged. Area of the patches (PFTs) within a disturbance type will be rescaled ! - ! based on their area ! + ! based on their area. ! !------------------------------------------------------------------------------------! - allocate (dist_area(n_dist_types)) - allocate (dist_blmax(n_dist_types)) - allocate (dist_patch(n_dist_types)) - dist_patch(:) = 0.0 - dist_area (:) = 0.0 - dist_blmax(:) = 0.0 - norescale = .true. + allocate (lu_npatch(n_dist_types)) + allocate (lu_laimax(n_dist_types)) + allocate (lu_area (n_dist_types)) + lu_npatch (:) = 0 + lu_area (:) = 0.0 + lu_laimax (:) = 0.0 !------------------------------------------------------------------------------------! @@ -471,133 +422,147 @@ subroutine rescale_patches(csite) do ipa=1,csite%npatches !----- This patch. ---------------------------------------------------------------! cpatch => csite%patch(ipa) - + !---------------------------------------------------------------------------------! + !----- Find the disturbance type. ------------------------------------------------! - lu = csite%dist_type(ipa) + ilu = csite%dist_type(ipa) + !---------------------------------------------------------------------------------! !---------------------------------------------------------------------------------! - ! ACTUALLY USE LAI MAX INSTEAD OF BLEAF MAX ! + ! Determine the maximum attainable leaf area index for each PFT, which will ! + ! be used to rescale the relative area of the patch. ! !---------------------------------------------------------------------------------! do ico = 1,cpatch%ncohorts - patch_blmax(ipa) = patch_blmax(ipa) + cpatch%nplant(ico) * cpatch%sla(ico) & - * dbh2bl(cpatch%dbh(ico),cpatch%pft(ico)) & - * csite%area(ipa) + ipft = cpatch%pft(ico) + laimax = cpatch%nplant(ico) * cpatch%sla(ico) & + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) + patch_laimax(ipa) = patch_laimax(ipa) + laimax * csite%area(ipa) end do - dist_area(lu) = dist_area(lu) + csite%area(ipa) - dist_blmax(lu) = dist_blmax(lu) + patch_blmax(ipa) - dist_patch(lu) = dist_patch(lu) + 1 + lu_area (ilu) = lu_area (ilu) + csite%area (ipa) + lu_laimax(ilu) = lu_laimax(ilu) + patch_laimax(ipa) + lu_npatch(ilu) = lu_npatch(ilu) + 1 - norescale = dist_patch(lu) == 1 site_area = site_area + csite%area(ipa) end do - dist_area(:) = dist_area(:) / site_area !------------------------------------------------------------------------------------! - !------------------------------------------------------------------------------------! - ! No need to re-scale patches if there is only one patch (or less) per ! - ! per disturbance type. ! - !------------------------------------------------------------------------------------! - if (norescale) return + !------ Normalise the area of each land use type so the total is going to be one. ---! + lu_area(:) = lu_area(:) / site_area !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! - ! Renormalize the total area. We must also rescale all extensive properties from ! - ! cohorts, since they are per unit area and we are effectively changing the area. ! - ! IMPORTANT: Only cohort-level variables that have units per area (m2) should be ! - ! rescaled. Variables whose units are per plant should _NOT_ be included ! - ! here. ! + ! Renormalize the total area. ! !------------------------------------------------------------------------------------! - new_area = 0.0 + site_area = 0.0 do ipa = 1,csite%npatches - lu = csite%dist_type(ipa) + + !----- Find the disturbance type. ------------------------------------------------! + ilu = csite%dist_type(ipa) + !---------------------------------------------------------------------------------! + + !----- Find the new area, based on the fraction of biomass. ----------------------! - area_scale = patch_blmax(ipa) / dist_blmax(lu) * dist_area(lu) & - / csite%area(ipa) old_area(ipa) = csite%area(ipa) - csite%area(ipa) = csite%area(ipa) * area_scale - new_area = new_area + csite%area(ipa) + csite%area(ipa) = patch_laimax(ipa) / lu_laimax(ilu) * lu_area(ilu) + site_area = site_area + csite%area(ipa) + !---------------------------------------------------------------------------------! + + + !---------------------------------------------------------------------------------! + ! We must change the scale for nplant (and all "extensive" cohort-level ! + ! variables) so the site-level maximum LAI and maximum biomass stay the same. ! + !---------------------------------------------------------------------------------! + n_scale = old_area(ipa) / csite%area(ipa) + !---------------------------------------------------------------------------------! cpatch => csite%patch(ipa) do ico = 1, cpatch%ncohorts - cpatch%nplant (ico) = cpatch%nplant (ico) * area_scale - cpatch%lai (ico) = cpatch%lai (ico) * area_scale - cpatch%wai (ico) = cpatch%wai (ico) * area_scale - cpatch%mean_gpp (ico) = cpatch%mean_gpp (ico) * area_scale - cpatch%mean_leaf_resp (ico) = cpatch%mean_leaf_resp (ico) * area_scale - cpatch%mean_root_resp (ico) = cpatch%mean_root_resp (ico) * area_scale - cpatch%mean_growth_resp (ico) = cpatch%mean_growth_resp (ico) * area_scale - cpatch%mean_storage_resp (ico) = cpatch%mean_storage_resp (ico) * area_scale - cpatch%mean_vleaf_resp (ico) = cpatch%mean_vleaf_resp (ico) * area_scale - cpatch%Psi_open (ico) = cpatch%Psi_open (ico) * area_scale - cpatch%gpp (ico) = cpatch%gpp (ico) * area_scale - cpatch%leaf_respiration (ico) = cpatch%leaf_respiration (ico) * area_scale - cpatch%root_respiration (ico) = cpatch%root_respiration (ico) * area_scale - cpatch%leaf_water (ico) = cpatch%leaf_water (ico) * area_scale - cpatch%leaf_hcap (ico) = cpatch%leaf_hcap (ico) * area_scale - cpatch%leaf_energy (ico) = cpatch%leaf_energy (ico) * area_scale - cpatch%wood_water (ico) = cpatch%wood_water (ico) * area_scale - cpatch%wood_hcap (ico) = cpatch%wood_hcap (ico) * area_scale - cpatch%wood_energy (ico) = cpatch%wood_energy (ico) * area_scale - cpatch%monthly_dndt (ico) = cpatch%monthly_dndt (ico) * area_scale - cpatch%today_gpp (ico) = cpatch%today_gpp (ico) * area_scale - cpatch%today_nppleaf (ico) = cpatch%today_nppleaf (ico) * area_scale - cpatch%today_nppfroot (ico) = cpatch%today_nppfroot (ico) * area_scale - cpatch%today_nppsapwood (ico) = cpatch%today_nppsapwood (ico) * area_scale - cpatch%today_nppcroot (ico) = cpatch%today_nppcroot (ico) * area_scale - cpatch%today_nppseeds (ico) = cpatch%today_nppseeds (ico) * area_scale - cpatch%today_nppwood (ico) = cpatch%today_nppwood (ico) * area_scale - cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * area_scale - cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * area_scale - cpatch%today_gpp_max (ico) = cpatch%today_gpp_max (ico) * area_scale - cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * area_scale - cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * area_scale + cpatch%nplant (ico) = cpatch%nplant (ico) * n_scale + cpatch%lai (ico) = cpatch%lai (ico) * n_scale + cpatch%wai (ico) = cpatch%wai (ico) * n_scale + cpatch%mean_gpp (ico) = cpatch%mean_gpp (ico) * n_scale + cpatch%mean_leaf_resp (ico) = cpatch%mean_leaf_resp (ico) * n_scale + cpatch%mean_root_resp (ico) = cpatch%mean_root_resp (ico) * n_scale + cpatch%mean_growth_resp (ico) = cpatch%mean_growth_resp (ico) * n_scale + cpatch%mean_storage_resp (ico) = cpatch%mean_storage_resp (ico) * n_scale + cpatch%mean_vleaf_resp (ico) = cpatch%mean_vleaf_resp (ico) * n_scale + cpatch%Psi_open (ico) = cpatch%Psi_open (ico) * n_scale + cpatch%gpp (ico) = cpatch%gpp (ico) * n_scale + cpatch%leaf_respiration (ico) = cpatch%leaf_respiration (ico) * n_scale + cpatch%root_respiration (ico) = cpatch%root_respiration (ico) * n_scale + cpatch%leaf_water (ico) = cpatch%leaf_water (ico) * n_scale + cpatch%leaf_hcap (ico) = cpatch%leaf_hcap (ico) * n_scale + cpatch%leaf_energy (ico) = cpatch%leaf_energy (ico) * n_scale + cpatch%wood_water (ico) = cpatch%wood_water (ico) * n_scale + cpatch%wood_hcap (ico) = cpatch%wood_hcap (ico) * n_scale + cpatch%wood_energy (ico) = cpatch%wood_energy (ico) * n_scale + cpatch%monthly_dndt (ico) = cpatch%monthly_dndt (ico) * n_scale + cpatch%monthly_dlnndt (ico) = cpatch%monthly_dlnndt (ico) * n_scale + cpatch%today_gpp (ico) = cpatch%today_gpp (ico) * n_scale + cpatch%today_nppleaf (ico) = cpatch%today_nppleaf (ico) * n_scale + cpatch%today_nppfroot (ico) = cpatch%today_nppfroot (ico) * n_scale + cpatch%today_nppsapwood (ico) = cpatch%today_nppsapwood (ico) * n_scale + cpatch%today_nppcroot (ico) = cpatch%today_nppcroot (ico) * n_scale + cpatch%today_nppseeds (ico) = cpatch%today_nppseeds (ico) * n_scale + cpatch%today_nppwood (ico) = cpatch%today_nppwood (ico) * n_scale + cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * n_scale + cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * n_scale + cpatch%today_gpp_lightmax (ico) = cpatch%today_gpp_lightmax(ico) * n_scale + cpatch%today_gpp_moistmax (ico) = cpatch%today_gpp_moistmax(ico) * n_scale + cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * n_scale + cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * n_scale !----- Crown area shall not exceed one. ---------------------------------------! - cpatch%crown_area (ico) = min(1.,cpatch%crown_area (ico) * area_scale) + cpatch%crown_area (ico) = min(1.,cpatch%crown_area (ico) * n_scale) if (idoutput > 0 .or. imoutput > 0 .or. iqoutput > 0) then - cpatch%dmean_par_l (ico) = cpatch%dmean_par_l (ico) * area_scale - cpatch%dmean_par_l_beam (ico) = cpatch%dmean_par_l_beam (ico) * area_scale - cpatch%dmean_par_l_diff (ico) = cpatch%dmean_par_l_diff (ico) * area_scale + cpatch%dmean_par_l (ico) = cpatch%dmean_par_l (ico) * n_scale + cpatch%dmean_par_l_beam (ico) = cpatch%dmean_par_l_beam (ico) * n_scale + cpatch%dmean_par_l_diff (ico) = cpatch%dmean_par_l_diff (ico) * n_scale end if if (imoutput > 0 .or. iqoutput > 0) then - cpatch%mmean_par_l (ico) = cpatch%mmean_par_l (ico) * area_scale - cpatch%mmean_par_l_beam (ico) = cpatch%mmean_par_l_beam (ico) * area_scale - cpatch%mmean_par_l_diff (ico) = cpatch%mmean_par_l_diff (ico) * area_scale + cpatch%mmean_par_l (ico) = cpatch%mmean_par_l (ico) * n_scale + cpatch%mmean_par_l_beam (ico) = cpatch%mmean_par_l_beam (ico) * n_scale + cpatch%mmean_par_l_diff (ico) = cpatch%mmean_par_l_diff (ico) * n_scale end if if (iqoutput > 0) then - cpatch%qmean_par_l (:,ico) = cpatch%qmean_par_l (:,ico) * area_scale - cpatch%qmean_par_l_beam(:,ico) = cpatch%qmean_par_l_beam(:,ico) * area_scale - cpatch%qmean_par_l_diff(:,ico) = cpatch%qmean_par_l_diff(:,ico) * area_scale + cpatch%qmean_par_l (:,ico) = cpatch%qmean_par_l (:,ico) * n_scale + cpatch%qmean_par_l_beam(:,ico) = cpatch%qmean_par_l_beam(:,ico) * n_scale + cpatch%qmean_par_l_diff(:,ico) = cpatch%qmean_par_l_diff(:,ico) * n_scale end if + !------------------------------------------------------------------------------! end do + !---------------------------------------------------------------------------------! end do !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! ! Sanity check: total new area must be 1.0. ! !------------------------------------------------------------------------------------! - if (abs(new_area-1.0) > 1.e-5) then + if (abs(site_area-1.0) > 1.e-5) then write (unit=*,fmt='(a)' ) '---------------------------------------------' write (unit=*,fmt='(a)' ) ' PATCH BIOMASS:' write (unit=*,fmt='(a)' ) ' ' - write (unit=*,fmt='(7(1x,a))' ) ' PATCH',' DIST_TYPE',' PATCH_BLMAX' & - ,' DIST_BLMAX',' DIST_AREA',' OLD_AREA' & + write (unit=*,fmt='(7(1x,a))' ) ' PATCH',' LU_TYPE','PATCH_LAIMAX' & + ,' LU_LAIMAX',' LU_AREA',' OLD_AREA' & ,' NEW_AREA' do ipa=1,csite%npatches - lu = csite%dist_type(ipa) + ilu = csite%dist_type(ipa) write(unit=*,fmt='(2(1x,i12),5(1x,es12.5))') & - ipa,lu,patch_blmax(ipa),dist_blmax(lu),dist_area(lu),old_area(ipa) & + ipa,ilu,patch_laimax(ipa),lu_laimax(ilu),lu_area(ilu),old_area(ipa) & ,csite%area(ipa) end do - write (unit=*,fmt='(a,1x,es12.5)') ' SITE BIOMASS :',sum(dist_blmax) - write (unit=*,fmt='(a,1x,es12.5)') ' NEW_AREA :',new_area + write (unit=*,fmt='(a,1x,es12.5)') ' SITE LAIMAX :',sum(lu_laimax) + write (unit=*,fmt='(a,1x,es12.5)') ' SITE_AREA :',site_area write (unit=*,fmt='(a)' ) '---------------------------------------------' call fatal_error('New_area should be 1 but it isn''t!!!','rescale_patches' & ,'fuse_fiss_utils.f90') @@ -609,12 +574,13 @@ subroutine rescale_patches(csite) !------------------------------------------------------------------------------------! ! Free memory before we leave the sub-routine. ! !------------------------------------------------------------------------------------! - deallocate(patch_blmax) - deallocate(old_area) - deallocate(dist_area) - deallocate(dist_blmax) - deallocate(dist_patch) - deallocate(elim_area) + deallocate(patch_laimax) + deallocate(remain_table) + deallocate(old_area ) + deallocate(lu_area ) + deallocate(lu_laimax ) + deallocate(lu_npatch ) + deallocate(elim_area ) !------------------------------------------------------------------------------------! return end subroutine rescale_patches @@ -654,7 +620,7 @@ subroutine fuse_cohorts(csite,ipa, green_leaf_factor, lsl) use mem_polygons , only : maxcohort ! ! intent(in) use canopy_layer_coms , only : crown_mod ! ! intent(in) use allometry , only : dbh2h & ! function - , dbh2bl ! ! function + , size2bl ! ! function use ed_misc_coms , only : igrass ! ! intent(in) implicit none !----- Arguments --------------------------------------------------------------------! @@ -773,9 +739,11 @@ subroutine fuse_cohorts(csite,ipa, green_leaf_factor, lsl) else !--use dbh for trees lai_max = ( cpatch%nplant(recc) & - * dbh2bl(cpatch%dbh(recc),cpatch%pft(recc)) & + * size2bl(cpatch%dbh(recc),cpatch%hite(recc) & + ,cpatch%pft(recc)) & + cpatch%nplant(donc) & - * dbh2bl(cpatch%dbh(donc),cpatch%pft(donc))) & + * size2bl(cpatch%dbh(donc),cpatch%hite(donc) & + ,cpatch%pft(donc))) & * cpatch%sla(recc) end if @@ -791,26 +759,32 @@ subroutine fuse_cohorts(csite,ipa, green_leaf_factor, lsl) !------------------------------------------------------------------------! - ! Five conditions must be met to allow two cohorts to be fused: ! + ! Six conditions must be met to allow two cohorts to be fused: ! ! 1. Both cohorts must have the same PFT; ! ! 2. Combined LAI won't be too large. ! ! 3. Both cohorts must have the same status with respect to the first ! ! census. ! ! 4. Both cohorts must have the same recruit status with respect to the ! ! first census. ! - ! 5. Both cohorts must have the same phenology status. ! + ! 5. Both cohorts must have the same recruitment status with respect to ! + ! the DBH. ! + ! 6. Both cohorts must have the same recruitment status with respect to ! + ! the census. ! + ! 7. Both cohorts must have the same phenology status. ! !------------------------------------------------------------------------! if ( cpatch%pft(donc) == cpatch%pft(recc) & .and. lai_max < lai_fuse_tol*tolerance_mult & .and. cpatch%first_census(donc) == cpatch%first_census(recc) & .and. cpatch%new_recruit_flag(donc) == cpatch%new_recruit_flag(recc) & + .and. cpatch%recruit_dbh (donc) == cpatch%recruit_dbh(recc) & + .and. cpatch%census_status (donc) == cpatch%census_status(recc) & .and. cpatch%phenology_status(donc) == cpatch%phenology_status(recc) & ) then !----- Proceed with fusion -------------------------------------------! call fuse_2_cohorts(cpatch,donc,recc,newn & ,green_leaf_factor(cpatch%pft(donc)) & - ,csite%can_prss(ipa),lsl) + ,csite%can_prss(ipa),csite%can_shv(ipa),lsl) !----- Flag donating cohort as gone, so it won't be checked again. ---! fuse_table(donc) = .false. @@ -1040,7 +1014,8 @@ subroutine split_cohorts(cpatch, green_leaf_factor, lsl) cpatch%today_nppseeds (ico) = cpatch%today_nppseeds (ico) * 0.5 cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * 0.5 cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * 0.5 - cpatch%today_gpp_max (ico) = cpatch%today_gpp_max (ico) * 0.5 + cpatch%today_gpp_lightmax (ico) = cpatch%today_gpp_lightmax(ico) * 0.5 + cpatch%today_gpp_moistmax (ico) = cpatch%today_gpp_moistmax(ico) * 0.5 cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * 0.5 cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * 0.5 cpatch%gpp (ico) = cpatch%gpp (ico) * 0.5 @@ -1156,129 +1131,136 @@ subroutine clone_cohort(cpatch,isc,idt) integer :: imonth !------------------------------------------------------------------------------------! - cpatch%pft(idt) = cpatch%pft(isc) - cpatch%nplant(idt) = cpatch%nplant(isc) - cpatch%hite(idt) = cpatch%hite(isc) - cpatch%dbh(idt) = cpatch%dbh(isc) - cpatch%bdead(idt) = cpatch%bdead(isc) - cpatch%bleaf(idt) = cpatch%bleaf(isc) - cpatch%broot(idt) = cpatch%broot(isc) - cpatch%bsapwooda(idt) = cpatch%bsapwooda(isc) - cpatch%bsapwoodb(idt) = cpatch%bsapwoodb(isc) - cpatch%phenology_status(idt) = cpatch%phenology_status(isc) - cpatch%balive(idt) = cpatch%balive(isc) - cpatch%lai(idt) = cpatch%lai(isc) - cpatch%wai(idt) = cpatch%wai(isc) - cpatch%crown_area(idt) = cpatch%crown_area(isc) - cpatch%bstorage(idt) = cpatch%bstorage(isc) - cpatch%leaf_resolvable(idt) = cpatch%leaf_resolvable(isc) - cpatch%wood_resolvable(idt) = cpatch%wood_resolvable(isc) + cpatch%pft(idt) = cpatch%pft(isc) + cpatch%nplant(idt) = cpatch%nplant(isc) + cpatch%hite(idt) = cpatch%hite(isc) + cpatch%dbh(idt) = cpatch%dbh(isc) + cpatch%bdead(idt) = cpatch%bdead(isc) + cpatch%bleaf(idt) = cpatch%bleaf(isc) + cpatch%broot(idt) = cpatch%broot(isc) + cpatch%bsapwooda(idt) = cpatch%bsapwooda(isc) + cpatch%bsapwoodb(idt) = cpatch%bsapwoodb(isc) + cpatch%phenology_status(idt) = cpatch%phenology_status(isc) + cpatch%recruit_dbh(idt) = cpatch%recruit_dbh(isc) + cpatch%census_status(idt) = cpatch%census_status(isc) + cpatch%balive(idt) = cpatch%balive(isc) + cpatch%lai(idt) = cpatch%lai(isc) + cpatch%wai(idt) = cpatch%wai(isc) + cpatch%crown_area(idt) = cpatch%crown_area(isc) + cpatch%bstorage(idt) = cpatch%bstorage(isc) + cpatch%leaf_resolvable(idt) = cpatch%leaf_resolvable(isc) + cpatch%wood_resolvable(idt) = cpatch%wood_resolvable(isc) do imonth = 1,13 - cpatch%cb(imonth,idt) = cpatch%cb(imonth,isc) - cpatch%cb_max(imonth,idt) = cpatch%cb_max(imonth,isc) + cpatch%cb (imonth,idt) = cpatch%cb (imonth,isc) + cpatch%cb_lightmax(imonth,idt) = cpatch%cb_lightmax(imonth,isc) + cpatch%cb_moistmax(imonth,idt) = cpatch%cb_moistmax(imonth,isc) enddo - cpatch%cbr_bar(idt) = cpatch%cbr_bar(isc) - cpatch%leaf_energy(idt) = cpatch%leaf_energy(isc) - cpatch%leaf_hcap(idt) = cpatch%leaf_hcap(isc) - cpatch%leaf_temp(idt) = cpatch%leaf_temp(isc) - cpatch%leaf_temp_pv(idt) = cpatch%leaf_temp_pv(isc) - cpatch%leaf_fliq(idt) = cpatch%leaf_fliq(isc) - cpatch%leaf_water(idt) = cpatch%leaf_water(isc) - cpatch%wood_energy(idt) = cpatch%wood_energy(isc) - cpatch%wood_hcap(idt) = cpatch%wood_hcap(isc) - cpatch%wood_temp(idt) = cpatch%wood_temp(isc) - cpatch%wood_temp_pv(idt) = cpatch%wood_temp_pv(isc) - cpatch%wood_fliq(idt) = cpatch%wood_fliq(isc) - cpatch%wood_water(idt) = cpatch%wood_water(isc) - cpatch%veg_wind(idt) = cpatch%veg_wind(isc) - cpatch%lsfc_shv_open(idt) = cpatch%lsfc_shv_open(isc) - cpatch%lsfc_shv_closed(idt) = cpatch%lsfc_shv_closed(isc) - cpatch%lsfc_co2_open(idt) = cpatch%lsfc_co2_open(isc) - cpatch%lsfc_co2_closed(idt) = cpatch%lsfc_co2_closed(isc) - cpatch%lint_shv(idt) = cpatch%lint_shv(isc) - cpatch%lint_co2_open(idt) = cpatch%lint_co2_open(isc) - cpatch%lint_co2_closed(idt) = cpatch%lint_co2_closed(isc) - cpatch%mean_gpp(idt) = cpatch%mean_gpp(isc) - cpatch%mean_leaf_resp(idt) = cpatch%mean_leaf_resp(isc) - cpatch%mean_root_resp(idt) = cpatch%mean_root_resp(isc) - cpatch%mean_storage_resp(idt) = cpatch%mean_storage_resp(isc) - cpatch%mean_growth_resp(idt) = cpatch%mean_growth_resp(isc) - cpatch%mean_vleaf_resp(idt) = cpatch%mean_vleaf_resp(isc) - cpatch%today_leaf_resp(idt) = cpatch%today_leaf_resp(isc) - cpatch%today_root_resp(idt) = cpatch%today_root_resp(isc) - cpatch%today_gpp(idt) = cpatch%today_gpp(isc) - cpatch%today_nppleaf(idt) = cpatch%today_nppleaf(isc) - cpatch%today_nppfroot(idt) = cpatch%today_nppfroot(isc) - cpatch%today_nppsapwood(idt) = cpatch%today_nppsapwood(isc) - cpatch%today_nppcroot(idt) = cpatch%today_nppcroot(isc) - cpatch%today_nppseeds(idt) = cpatch%today_nppseeds(isc) - cpatch%today_nppwood(idt) = cpatch%today_nppwood(isc) - cpatch%today_nppdaily(idt) = cpatch%today_nppdaily(isc) - cpatch%today_gpp_pot(idt) = cpatch%today_gpp_pot(isc) - cpatch%today_gpp_max(idt) = cpatch%today_gpp_max(isc) - cpatch%growth_respiration(idt) = cpatch%growth_respiration(isc) - cpatch%storage_respiration(idt) = cpatch%storage_respiration(isc) - cpatch%vleaf_respiration(idt) = cpatch%vleaf_respiration(isc) - cpatch%fsn(idt) = cpatch%fsn(isc) - cpatch%monthly_dndt(idt) = cpatch%monthly_dndt(isc) - cpatch%agb(idt) = cpatch%agb(isc) - cpatch%basarea(idt) = cpatch%basarea(isc) - cpatch%dagb_dt(idt) = cpatch%dagb_dt(isc) - cpatch%dba_dt(idt) = cpatch%dba_dt(isc) - cpatch%ddbh_dt(idt) = cpatch%ddbh_dt(isc) - cpatch%Psi_open(idt) = cpatch%Psi_open(isc) - cpatch%krdepth(idt) = cpatch%krdepth(isc) - cpatch%first_census(idt) = cpatch%first_census(isc) - cpatch%new_recruit_flag(idt) = cpatch%new_recruit_flag(isc) - cpatch%par_l(idt) = cpatch%par_l(isc) - cpatch%par_l_beam(idt) = cpatch%par_l_beam(isc) - cpatch%par_l_diffuse(idt) = cpatch%par_l_diffuse(isc) - cpatch%rshort_l(idt) = cpatch%rshort_l(isc) - cpatch%rshort_l_beam(idt) = cpatch%rshort_l_beam(isc) - cpatch%rshort_l_diffuse(idt) = cpatch%rshort_l_diffuse(isc) - cpatch%rlong_l(idt) = cpatch%rlong_l(isc) - cpatch%rlong_l_surf(idt) = cpatch%rlong_l_surf(isc) - cpatch%rlong_l_incid(idt) = cpatch%rlong_l_incid(isc) - cpatch%rshort_w(idt) = cpatch%rshort_w(isc) - cpatch%rshort_w_beam(idt) = cpatch%rshort_w_beam(isc) - cpatch%rshort_w_diffuse(idt) = cpatch%rshort_w_diffuse(isc) - cpatch%rlong_w(idt) = cpatch%rlong_w(isc) - cpatch%rlong_w_surf(idt) = cpatch%rlong_w_surf(isc) - cpatch%rlong_w_incid(idt) = cpatch%rlong_w_incid(isc) - cpatch%light_level(idt) = cpatch%light_level(isc) - cpatch%light_level_beam(idt) = cpatch%light_level_beam(isc) - cpatch%light_level_diff(idt) = cpatch%light_level_diff(isc) - cpatch%leaf_gbh(idt) = cpatch%leaf_gbh(isc) - cpatch%leaf_gbw(idt) = cpatch%leaf_gbw(isc) - cpatch%wood_gbh(idt) = cpatch%wood_gbh(isc) - cpatch%wood_gbw(idt) = cpatch%wood_gbw(isc) - cpatch%A_open(idt) = cpatch%A_open(isc) - cpatch%A_closed(idt) = cpatch%A_closed(isc) - cpatch%Psi_closed(idt) = cpatch%Psi_closed(isc) - cpatch%gsw_open(idt) = cpatch%gsw_open(isc) - cpatch%gsw_closed(idt) = cpatch%gsw_closed(isc) - cpatch%fsw(idt) = cpatch%fsw(isc) - cpatch%fs_open(idt) = cpatch%fs_open(isc) - cpatch%water_supply(idt) = cpatch%water_supply(isc) - cpatch%stomatal_conductance(idt) = cpatch%stomatal_conductance(isc) - cpatch%leaf_maintenance(idt) = cpatch%leaf_maintenance(isc) - cpatch%root_maintenance(idt) = cpatch%root_maintenance(isc) - cpatch%leaf_drop(idt) = cpatch%leaf_drop(isc) - cpatch%bseeds(idt) = cpatch%bseeds(isc) - cpatch%leaf_respiration(idt) = cpatch%leaf_respiration(isc) - cpatch%root_respiration(idt) = cpatch%root_respiration(isc) - cpatch%mort_rate(:,idt) = cpatch%mort_rate(:,isc) - - cpatch%gpp(idt) = cpatch%gpp(isc) - cpatch%paw_avg(idt) = cpatch%paw_avg(isc) - cpatch%elongf(idt) = cpatch%elongf(isc) - - cpatch%turnover_amp(idt) = cpatch%turnover_amp(isc) - cpatch%llspan(idt) = cpatch%llspan(isc) - cpatch%vm_bar(idt) = cpatch%vm_bar(isc) - cpatch%sla(idt) = cpatch%sla(isc) + cpatch%cbr_bar(idt) = cpatch%cbr_bar(isc) + cpatch%leaf_energy(idt) = cpatch%leaf_energy(isc) + cpatch%leaf_hcap(idt) = cpatch%leaf_hcap(isc) + cpatch%leaf_temp(idt) = cpatch%leaf_temp(isc) + cpatch%leaf_temp_pv(idt) = cpatch%leaf_temp_pv(isc) + cpatch%leaf_fliq(idt) = cpatch%leaf_fliq(isc) + cpatch%leaf_water(idt) = cpatch%leaf_water(isc) + cpatch%leaf_vpdef(idt) = cpatch%leaf_vpdef(isc) + cpatch%wood_energy(idt) = cpatch%wood_energy(isc) + cpatch%wood_hcap(idt) = cpatch%wood_hcap(isc) + cpatch%wood_temp(idt) = cpatch%wood_temp(isc) + cpatch%wood_temp_pv(idt) = cpatch%wood_temp_pv(isc) + cpatch%wood_fliq(idt) = cpatch%wood_fliq(isc) + cpatch%wood_water(idt) = cpatch%wood_water(isc) + cpatch%veg_wind(idt) = cpatch%veg_wind(isc) + cpatch%lsfc_shv_open(idt) = cpatch%lsfc_shv_open(isc) + cpatch%lsfc_shv_closed(idt) = cpatch%lsfc_shv_closed(isc) + cpatch%lsfc_co2_open(idt) = cpatch%lsfc_co2_open(isc) + cpatch%lsfc_co2_closed(idt) = cpatch%lsfc_co2_closed(isc) + cpatch%lint_shv(idt) = cpatch%lint_shv(isc) + cpatch%lint_co2_open(idt) = cpatch%lint_co2_open(isc) + cpatch%lint_co2_closed(idt) = cpatch%lint_co2_closed(isc) + cpatch%mean_gpp(idt) = cpatch%mean_gpp(isc) + cpatch%mean_leaf_resp(idt) = cpatch%mean_leaf_resp(isc) + cpatch%mean_root_resp(idt) = cpatch%mean_root_resp(isc) + cpatch%mean_storage_resp(idt) = cpatch%mean_storage_resp(isc) + cpatch%mean_growth_resp(idt) = cpatch%mean_growth_resp(isc) + cpatch%mean_vleaf_resp(idt) = cpatch%mean_vleaf_resp(isc) + cpatch%today_leaf_resp(idt) = cpatch%today_leaf_resp(isc) + cpatch%today_root_resp(idt) = cpatch%today_root_resp(isc) + cpatch%today_gpp(idt) = cpatch%today_gpp(isc) + cpatch%today_nppleaf(idt) = cpatch%today_nppleaf(isc) + cpatch%today_nppfroot(idt) = cpatch%today_nppfroot(isc) + cpatch%today_nppsapwood(idt) = cpatch%today_nppsapwood(isc) + cpatch%today_nppcroot(idt) = cpatch%today_nppcroot(isc) + cpatch%today_nppseeds(idt) = cpatch%today_nppseeds(isc) + cpatch%today_nppwood(idt) = cpatch%today_nppwood(isc) + cpatch%today_nppdaily(idt) = cpatch%today_nppdaily(isc) + cpatch%today_gpp_pot(idt) = cpatch%today_gpp_pot(isc) + cpatch%today_gpp_lightmax(idt) = cpatch%today_gpp_lightmax(isc) + cpatch%today_gpp_moistmax(idt) = cpatch%today_gpp_moistmax(isc) + cpatch%growth_respiration(idt) = cpatch%growth_respiration(isc) + cpatch%storage_respiration(idt) = cpatch%storage_respiration(isc) + cpatch%vleaf_respiration(idt) = cpatch%vleaf_respiration(isc) + cpatch%fsn(idt) = cpatch%fsn(isc) + cpatch%monthly_dndt(idt) = cpatch%monthly_dndt(isc) + cpatch%monthly_dlnndt(idt) = cpatch%monthly_dlnndt(isc) + cpatch%agb(idt) = cpatch%agb(isc) + cpatch%basarea(idt) = cpatch%basarea(isc) + cpatch%dagb_dt(idt) = cpatch%dagb_dt(isc) + cpatch%dba_dt(idt) = cpatch%dba_dt(isc) + cpatch%ddbh_dt(idt) = cpatch%ddbh_dt(isc) + cpatch%dlndbh_dt(idt) = cpatch%dlndbh_dt(isc) + cpatch%Psi_open(idt) = cpatch%Psi_open(isc) + cpatch%krdepth(idt) = cpatch%krdepth(isc) + cpatch%first_census(idt) = cpatch%first_census(isc) + cpatch%new_recruit_flag(idt) = cpatch%new_recruit_flag(isc) + cpatch%par_l(idt) = cpatch%par_l(isc) + cpatch%par_l_beam(idt) = cpatch%par_l_beam(isc) + cpatch%par_l_diffuse(idt) = cpatch%par_l_diffuse(isc) + cpatch%rshort_l(idt) = cpatch%rshort_l(isc) + cpatch%rshort_l_beam(idt) = cpatch%rshort_l_beam(isc) + cpatch%rshort_l_diffuse(idt) = cpatch%rshort_l_diffuse(isc) + cpatch%rlong_l(idt) = cpatch%rlong_l(isc) + cpatch%rlong_l_surf(idt) = cpatch%rlong_l_surf(isc) + cpatch%rlong_l_incid(idt) = cpatch%rlong_l_incid(isc) + cpatch%rshort_w(idt) = cpatch%rshort_w(isc) + cpatch%rshort_w_beam(idt) = cpatch%rshort_w_beam(isc) + cpatch%rshort_w_diffuse(idt) = cpatch%rshort_w_diffuse(isc) + cpatch%rlong_w(idt) = cpatch%rlong_w(isc) + cpatch%rlong_w_surf(idt) = cpatch%rlong_w_surf(isc) + cpatch%rlong_w_incid(idt) = cpatch%rlong_w_incid(isc) + cpatch%light_level(idt) = cpatch%light_level(isc) + cpatch%light_level_beam(idt) = cpatch%light_level_beam(isc) + cpatch%light_level_diff(idt) = cpatch%light_level_diff(isc) + cpatch%leaf_gbh(idt) = cpatch%leaf_gbh(isc) + cpatch%leaf_gbw(idt) = cpatch%leaf_gbw(isc) + cpatch%wood_gbh(idt) = cpatch%wood_gbh(isc) + cpatch%wood_gbw(idt) = cpatch%wood_gbw(isc) + cpatch%A_open(idt) = cpatch%A_open(isc) + cpatch%A_closed(idt) = cpatch%A_closed(isc) + cpatch%Psi_closed(idt) = cpatch%Psi_closed(isc) + cpatch%gsw_open(idt) = cpatch%gsw_open(isc) + cpatch%gsw_closed(idt) = cpatch%gsw_closed(isc) + cpatch%fsw(idt) = cpatch%fsw(isc) + cpatch%fs_open(idt) = cpatch%fs_open(isc) + cpatch%water_supply(idt) = cpatch%water_supply(isc) + cpatch%stomatal_conductance(idt) = cpatch%stomatal_conductance(isc) + cpatch%leaf_maintenance(idt) = cpatch%leaf_maintenance(isc) + cpatch%root_maintenance(idt) = cpatch%root_maintenance(isc) + cpatch%leaf_drop(idt) = cpatch%leaf_drop(isc) + cpatch%bseeds(idt) = cpatch%bseeds(isc) + cpatch%leaf_respiration(idt) = cpatch%leaf_respiration(isc) + cpatch%root_respiration(idt) = cpatch%root_respiration(isc) + cpatch%mort_rate(:,idt) = cpatch%mort_rate(:,isc) + + cpatch%gpp(idt) = cpatch%gpp(isc) + cpatch%paw_avg(idt) = cpatch%paw_avg(isc) + cpatch%elongf(idt) = cpatch%elongf(isc) + + cpatch%turnover_amp(idt) = cpatch%turnover_amp(isc) + cpatch%llspan(idt) = cpatch%llspan(isc) + cpatch%vm_bar(idt) = cpatch%vm_bar(isc) + cpatch%sla(idt) = cpatch%sla(isc) if (idoutput > 0 .or. imoutput > 0 .or. iqoutput > 0) then @@ -1372,12 +1354,13 @@ end subroutine clone_cohort ! information from both cohorts. ! ! ! !---------------------------------------------------------------------------------------! - subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl) + subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor,can_prss,can_shv,lsl) use ed_state_vars , only : patchtype ! ! Structure use pft_coms , only : q & ! intent(in), lookup table , qsw & ! intent(in), lookup table , is_grass ! ! intent(in) use therm_lib , only : uextcm2tl & ! subroutine + , vpdefil & ! subroutine , qslif ! ! function use allometry , only : dbh2krdepth & ! function , bd2dbh & ! function @@ -1398,6 +1381,7 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl real , intent(in) :: newn ! New nplant real , intent(in) :: green_leaf_factor ! Green leaf factor real , intent(in) :: can_prss ! Canopy air pressure + real , intent(in) :: can_shv ! Canopy air specific humidity integer , intent(in) :: lsl ! Lowest soil level !----- Local variables --------------------------------------------------------------! integer :: imon ! Month for cb loop @@ -1405,8 +1389,6 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl integer :: imty ! Mortality type real :: newni ! Inverse of new nplants real :: newlaii ! Inverse of new LAI - real :: cb_act ! - real :: cb_max ! !------------------------------------------------------------------------------------! @@ -1515,10 +1497,8 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl + cpatch%leaf_temp(donc) * cpatch%nplant(donc)) cpatch%leaf_fliq(recc) = 0.0 end if - - !----- Simply set the previous time-steps temp as the current - - + + if ( cpatch%wood_hcap(recc) > 0. ) then !----- Update temperature using the standard thermodynamics. ---------------------! call uextcm2tl(cpatch%wood_energy(recc),cpatch%wood_water(recc) & @@ -1532,37 +1512,57 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl cpatch%wood_fliq(recc) = 0.0 end if - !----- Set time-steps temp as the current + !----- Set time-steps temperatures as the current. ----------------------------------! cpatch%leaf_temp_pv(recc) = cpatch%leaf_temp(recc) cpatch%wood_temp_pv(recc) = cpatch%wood_temp(recc) + !------------------------------------------------------------------------------------! !------ Find the intercellular value assuming saturation. ---------------------------! cpatch%lint_shv(recc) = qslif(can_prss,cpatch%leaf_temp(recc)) + !------------------------------------------------------------------------------------! - cb_act = 0. - cb_max = 0. - do imon = 1,12 - cpatch%cb(imon,recc) = ( cpatch%cb(imon,recc) * cpatch%nplant(recc) & - + cpatch%cb(imon,donc) * cpatch%nplant(donc) ) * newni + !------ Find the vapour pressure deficit. -------------------------------------------! + cpatch%leaf_vpdef(recc) = vpdefil(can_prss,cpatch%leaf_temp(recc),can_shv,.true.) + !------------------------------------------------------------------------------------! - cpatch%cb_max(imon,recc) = ( cpatch%cb_max(imon,recc) * cpatch%nplant(recc) & - + cpatch%cb_max(imon,donc) * cpatch%nplant(donc)) & - * newni - cb_act = cb_act + cpatch%cb(imon,recc) - cb_max = cb_max + cpatch%cb_max(imon,recc) + + !------------------------------------------------------------------------------------! + ! CB, CB_lightmax, and CB_moistmax are scaled by population, as they are in ! + ! kgC/plant/yr. The relative carbon balance, however, is no longer derived from the ! + ! annual values of CB, CB_LightMax, and CB_MoistMax, but tracked independently as it ! + ! used to be done in ED-1.0. ! + !------------------------------------------------------------------------------------! + do imon = 1,13 + cpatch%cb (imon,recc) = newni & + * ( cpatch%cb (imon,recc) & + * cpatch%nplant (recc) & + + cpatch%cb (imon,donc) & + * cpatch%nplant (donc) ) + + cpatch%cb_lightmax(imon,recc) = newni & + * ( cpatch%cb_lightmax (imon,recc) & + * cpatch%nplant (recc) & + + cpatch%cb_lightmax (imon,donc) & + * cpatch%nplant (donc) ) + + cpatch%cb_moistmax(imon,recc) = newni & + * ( cpatch%cb_moistmax (imon,recc) & + * cpatch%nplant (recc) & + + cpatch%cb_moistmax (imon,donc) & + * cpatch%nplant (donc) ) end do - cpatch%cb(13,recc) = ( cpatch%cb(13,recc) * cpatch%nplant(recc) & - + cpatch%cb(13,donc) * cpatch%nplant(donc) ) * newni + !------------------------------------------------------------------------------------! - cpatch%cb_max(13,recc) = ( cpatch%cb_max(13,recc) * cpatch%nplant(recc) & - + cpatch%cb_max(13,donc) * cpatch%nplant(donc)) & - * newni - if(cb_max > 0.0)then - cpatch%cbr_bar(recc) = cb_act / cb_max - else - cpatch%cbr_bar(recc) = 0.0 - end if + + !------------------------------------------------------------------------------------! + ! Relative carbon balance is also averaged between the cohorts, to avoid wild ! + ! oscillations in mortality when cohorts are fused. This is the original method ! + ! used in ED-1.0. ! + !------------------------------------------------------------------------------------! + cpatch%cbr_bar(recc) = ( cpatch%cbr_bar(recc) * cpatch%nplant(recc) & + + cpatch%cbr_bar(donc) * cpatch%nplant(donc) ) * newni + !------------------------------------------------------------------------------------! @@ -1585,41 +1585,44 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl !------------------------------------------------------------------------------------! - cpatch%today_gpp(recc) = cpatch%today_gpp(recc) & - + cpatch%today_gpp(donc) - - cpatch%today_nppleaf(recc) = cpatch%today_nppleaf(recc) & - + cpatch%today_nppleaf(donc) - - cpatch%today_nppfroot(recc)= cpatch%today_nppfroot(recc) & - + cpatch%today_nppfroot(donc) - - cpatch%today_nppsapwood(recc) = cpatch%today_nppsapwood(recc) & - + cpatch%today_nppsapwood(donc) - - cpatch%today_nppcroot(recc)= cpatch%today_nppcroot(recc) & - + cpatch%today_nppcroot(donc) - - cpatch%today_nppseeds(recc)= cpatch%today_nppseeds(recc) & - + cpatch%today_nppseeds(donc) - - cpatch%today_nppwood(recc) = cpatch%today_nppwood(recc) & - + cpatch%today_nppwood(donc) - - cpatch%today_nppdaily(recc)= cpatch%today_nppdaily(recc) & - + cpatch%today_nppdaily(donc) - - cpatch%today_gpp_pot(recc) = cpatch%today_gpp_pot(recc) & - + cpatch%today_gpp_pot(donc) - - cpatch%today_gpp_max(recc) = cpatch%today_gpp_max(recc) & - + cpatch%today_gpp_max(donc) - - cpatch%today_leaf_resp(recc) = cpatch%today_leaf_resp(recc) & - + cpatch%today_leaf_resp(donc) - - cpatch%today_root_resp(recc) = cpatch%today_root_resp(recc) & - + cpatch%today_root_resp(donc) + cpatch%today_gpp (recc) = cpatch%today_gpp (recc) & + + cpatch%today_gpp (donc) + + cpatch%today_nppleaf (recc) = cpatch%today_nppleaf (recc) & + + cpatch%today_nppleaf (donc) + + cpatch%today_nppfroot (recc) = cpatch%today_nppfroot (recc) & + + cpatch%today_nppfroot (donc) + + cpatch%today_nppsapwood (recc) = cpatch%today_nppsapwood (recc) & + + cpatch%today_nppsapwood (donc) + + cpatch%today_nppcroot (recc) = cpatch%today_nppcroot (recc) & + + cpatch%today_nppcroot (donc) + + cpatch%today_nppseeds (recc) = cpatch%today_nppseeds (recc) & + + cpatch%today_nppseeds (donc) + + cpatch%today_nppwood (recc) = cpatch%today_nppwood (recc) & + + cpatch%today_nppwood (donc) + + cpatch%today_nppdaily (recc) = cpatch%today_nppdaily (recc) & + + cpatch%today_nppdaily (donc) + + cpatch%today_gpp_pot (recc) = cpatch%today_gpp_pot (recc) & + + cpatch%today_gpp_pot (donc) + + cpatch%today_gpp_lightmax (recc) = cpatch%today_gpp_lightmax (recc) & + + cpatch%today_gpp_lightmax (donc) + + cpatch%today_gpp_moistmax (recc) = cpatch%today_gpp_moistmax (recc) & + + cpatch%today_gpp_moistmax (donc) + + cpatch%today_leaf_resp (recc) = cpatch%today_leaf_resp (recc) & + + cpatch%today_leaf_resp (donc) + + cpatch%today_root_resp (recc) = cpatch%today_root_resp (recc) & + + cpatch%today_root_resp (donc) !------------------------------------------------------------------------------------! @@ -1629,24 +1632,24 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl ! properties, they are scaled by the number of plants. These numbers are diagnostic ! ! and this should be used for the output only. ! !------------------------------------------------------------------------------------! - cpatch%lsfc_shv_open(recc) = ( cpatch%lsfc_shv_open(recc) * cpatch%nplant(recc) & - + cpatch%lsfc_shv_open(donc) * cpatch%nplant(donc) ) & - * newni - cpatch%lsfc_shv_closed(recc) = ( cpatch%lsfc_shv_closed(recc) * cpatch%nplant(recc) & - + cpatch%lsfc_shv_closed(donc) * cpatch%nplant(donc)) & - * newni - cpatch%lsfc_co2_open(recc) = ( cpatch%lsfc_co2_open(recc) * cpatch%nplant(recc) & - + cpatch%lsfc_co2_open(donc) * cpatch%nplant(donc) ) & - * newni - cpatch%lsfc_co2_closed(recc) = ( cpatch%lsfc_co2_closed(recc) * cpatch%nplant(recc) & - + cpatch%lsfc_co2_closed(donc) * cpatch%nplant(donc)) & - * newni - cpatch%lint_co2_open(recc) = ( cpatch%lint_co2_open(recc) * cpatch%nplant(recc) & - + cpatch%lint_co2_open(donc) * cpatch%nplant(donc) ) & - * newni - cpatch%lint_co2_closed(recc) = ( cpatch%lint_co2_closed(recc) * cpatch%nplant(recc) & - + cpatch%lint_co2_closed(donc) * cpatch%nplant(donc)) & - * newni + cpatch%lsfc_shv_open (recc) = ( cpatch%lsfc_shv_open (recc) * cpatch%lai(recc) & + + cpatch%lsfc_shv_open (donc) * cpatch%lai(donc) ) & + * newlaii + cpatch%lsfc_shv_closed(recc) = ( cpatch%lsfc_shv_closed(recc) * cpatch%lai(recc) & + + cpatch%lsfc_shv_closed(donc) * cpatch%lai(donc)) & + * newlaii + cpatch%lsfc_co2_open (recc) = ( cpatch%lsfc_co2_open (recc) * cpatch%lai(recc) & + + cpatch%lsfc_co2_open (donc) * cpatch%lai(donc) ) & + * newlaii + cpatch%lsfc_co2_closed(recc) = ( cpatch%lsfc_co2_closed(recc) * cpatch%lai(recc) & + + cpatch%lsfc_co2_closed(donc) * cpatch%lai(donc) ) & + * newlaii + cpatch%lint_co2_open (recc) = ( cpatch%lint_co2_open (recc) * cpatch%lai(recc) & + + cpatch%lint_co2_open (donc) * cpatch%lai(donc) ) & + * newlaii + cpatch%lint_co2_closed(recc) = ( cpatch%lint_co2_closed(recc) * cpatch%lai(recc) & + + cpatch%lint_co2_closed(donc) * cpatch%lai(donc) ) & + * newlaii !------------------------------------------------------------------------------------! @@ -1749,18 +1752,23 @@ subroutine fuse_2_cohorts(cpatch,donc,recc, newn,green_leaf_factor, can_prss,lsl cpatch%dba_dt(recc) = ( cpatch%dba_dt(recc) * cpatch%nplant(recc) & + cpatch%dba_dt(donc) * cpatch%nplant(donc) ) & * newni - cpatch%ddbh_dt(recc) = ( cpatch%ddbh_dt(recc) * cpatch%nplant(recc) & - + cpatch%ddbh_dt(donc) * cpatch%nplant(donc) ) & + cpatch%dlndbh_dt(recc) = ( cpatch%dlndbh_dt(recc) * cpatch%nplant(recc) & + + cpatch%dlndbh_dt(donc) * cpatch%nplant(donc) ) & * newni !------------------------------------------------------------------------------------! !------------------------------------------------------------------------------------! - ! Updating the tendency of plant density. All variables are per unit of area, ! - ! so they should be added, not scaled. ! + ! Updating the tendency of plant density and the relative mortality rate. The ! + ! first is extensive (i.e. per unit of area), so it must be added, not scaled. The ! + ! second is intensive so it must be scaled. ! !------------------------------------------------------------------------------------! - cpatch%monthly_dndt(recc) = cpatch%monthly_dndt(recc) + cpatch%monthly_dndt(donc) + cpatch%monthly_dndt (recc) = cpatch%monthly_dndt(recc) + cpatch%monthly_dndt(donc) + cpatch%monthly_dlnndt(recc) = ( cpatch%monthly_dlnndt(recc) * cpatch%nplant(recc) & + + cpatch%monthly_dlnndt(donc) * cpatch%nplant(donc) ) & + * newni + !------------------------------------------------------------------------------------! @@ -3356,6 +3364,10 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf ( csite%can_theiv(donp) * csite%area(donp) & + csite%can_theiv(recp) * csite%area(recp) ) + csite%can_vpdef(recp) = newareai * & + ( csite%can_vpdef(donp) * csite%area(donp) & + + csite%can_vpdef(recp) * csite%area(recp) ) + csite%can_prss(recp) = newareai * & ( csite%can_prss(donp) * csite%area(donp) & + csite%can_prss(recp) * csite%area(recp) ) @@ -3472,6 +3484,12 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf * csite%area (donp) & + csite%avg_monthly_gndwater (recp) & * csite%area (recp) ) + + csite%avg_monthly_waterdef (recp) = newareai & + * ( csite%avg_monthly_waterdef (donp) & + * csite%area (donp) & + + csite%avg_monthly_waterdef (recp) & + * csite%area (recp) ) !------------------------------------------------------------------------------------! @@ -3497,6 +3515,9 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf csite%mean_rh(recp) = newareai * & ( csite%mean_rh(donp) * csite%area(donp) & + csite%mean_rh(recp) * csite%area(recp) ) + csite%mean_cwd_rh(recp) = newareai * & + ( csite%mean_cwd_rh(donp) * csite%area(donp) & + + csite%mean_cwd_rh(recp) * csite%area(recp) ) csite%today_A_decomp(recp) = newareai * & ( csite%today_A_decomp(donp) * csite%area(donp) & @@ -3641,6 +3662,10 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf ( csite%avg_leaf_hcap(donp) * csite%area(donp) & + csite%avg_leaf_hcap(recp) * csite%area(recp) ) + csite%avg_leaf_vpdef(recp) = newareai * & + ( csite%avg_leaf_vpdef(donp) * csite%area(donp) & + + csite%avg_leaf_vpdef(recp) * csite%area(recp) ) + csite%avg_wood_energy(recp) = newareai * & ( csite%avg_wood_energy(donp) * csite%area(donp) & + csite%avg_wood_energy(recp) * csite%area(recp) ) @@ -3676,6 +3701,9 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf csite%co2budget_rh(recp) = newareai * & ( csite%co2budget_rh(donp) * csite%area(donp) & + csite%co2budget_rh(recp) * csite%area(recp) ) + csite%co2budget_cwd_rh(recp) = newareai * & + ( csite%co2budget_cwd_rh(donp) * csite%area(donp) & + + csite%co2budget_cwd_rh(recp) * csite%area(recp) ) csite%ebudget_residual(recp) = newareai * & ( csite%ebudget_residual(donp) * csite%area(donp) & @@ -3764,6 +3792,9 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf csite%dmean_rh(recp) = newareai & * ( csite%dmean_rh(donp) * csite%area(donp) & + csite%dmean_rh(recp) * csite%area(recp) ) + csite%dmean_cwd_rh(recp) = newareai & + * ( csite%dmean_cwd_rh(donp) * csite%area(donp) & + + csite%dmean_cwd_rh(recp) * csite%area(recp) ) csite%dmean_co2_residual(recp) = newareai & * ( csite%dmean_co2_residual(donp) & * csite%area(donp) & @@ -3800,6 +3831,9 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf csite%mmean_rh(recp) = newareai & * ( csite%mmean_rh(donp) * csite%area(donp) & + csite%mmean_rh(recp) * csite%area(recp) ) + csite%mmean_cwd_rh(recp) = newareai & + * ( csite%mmean_cwd_rh(donp) * csite%area(donp) & + + csite%mmean_cwd_rh(recp) * csite%area(recp) ) csite%mmean_co2_residual(recp) = newareai & * ( csite%mmean_co2_residual(donp) & * csite%area(donp) & @@ -3839,6 +3873,11 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf * csite%area (donp) & + csite%qmean_rh (icyc,recp) & * csite%area (recp)) + csite%qmean_cwd_rh (icyc,recp) = newareai & + * ( csite%qmean_cwd_rh (icyc,donp) & + * csite%area (donp) & + + csite%qmean_cwd_rh (icyc,recp) & + * csite%area (recp)) end do end if @@ -3914,7 +3953,8 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf cpatch%today_nppwood (ico) = cpatch%today_nppwood (ico) * area_scale cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * area_scale cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * area_scale - cpatch%today_gpp_max (ico) = cpatch%today_gpp_max (ico) * area_scale + cpatch%today_gpp_lightmax (ico) = cpatch%today_gpp_lightmax (ico) * area_scale + cpatch%today_gpp_moistmax (ico) = cpatch%today_gpp_moistmax (ico) * area_scale cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * area_scale cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * area_scale cpatch%Psi_open (ico) = cpatch%Psi_open (ico) * area_scale @@ -3974,7 +4014,8 @@ subroutine fuse_2_patches(csite,donp,recp,mzg,mzs,prss,lsl,ntext_soil,green_leaf cpatch%today_nppwood (ico) = cpatch%today_nppwood (ico) * area_scale cpatch%today_nppdaily (ico) = cpatch%today_nppdaily (ico) * area_scale cpatch%today_gpp_pot (ico) = cpatch%today_gpp_pot (ico) * area_scale - cpatch%today_gpp_max (ico) = cpatch%today_gpp_max (ico) * area_scale + cpatch%today_gpp_lightmax (ico) = cpatch%today_gpp_lightmax (ico) * area_scale + cpatch%today_gpp_moistmax (ico) = cpatch%today_gpp_moistmax (ico) * area_scale cpatch%today_leaf_resp (ico) = cpatch%today_leaf_resp (ico) * area_scale cpatch%today_root_resp (ico) = cpatch%today_root_resp (ico) * area_scale cpatch%Psi_open (ico) = cpatch%Psi_open (ico) * area_scale @@ -4094,7 +4135,7 @@ subroutine patch_pft_size_profile(csite,ipa) , patchtype ! ! structure use fusion_fission_coms , only : ff_nhgt & ! intent(in) , hgt_class ! ! intent(in) - use allometry , only : dbh2bl ! ! intent(in) + use allometry , only : size2bl ! ! intent(in) use ed_max_dims , only : n_pft ! ! intent(in) use pft_coms , only : hgt_min & ! intent(in) , is_grass ! ! intent(in) @@ -4151,7 +4192,7 @@ subroutine patch_pft_size_profile(csite,ipa) else !--use dbh for trees lai_pot = cpatch%nplant(ico) * cpatch%sla(ico) & - * dbh2bl(cpatch%dbh(ico),ipft) + * size2bl(cpatch%dbh(ico),cpatch%hite(ico),ipft) end if !---------------------------------------------------------------------------------! diff --git a/ED/src/utils/stable_cohorts.f90 b/ED/src/utils/stable_cohorts.f90 index 44e2822e3..2ce2518a6 100644 --- a/ED/src/utils/stable_cohorts.f90 +++ b/ED/src/utils/stable_cohorts.f90 @@ -35,7 +35,7 @@ subroutine flag_stable_cohorts(cgrid) cohortloop: do ico=1, cpatch%ncohorts !----- Check whether we can resolve this cohort. ---------------------------! - call is_resolvable(csite,ipa,ico,cpoly%green_leaf_factor(:,isi)) + call is_resolvable(csite,ipa,ico) !---------------------------------------------------------------------------! end do cohortloop @@ -66,7 +66,7 @@ end subroutine flag_stable_cohorts ! 3. The cohort is extremely sparse. ! ! 4. The user doesn't want to solve wood thermodynamics (wood only). ! !------------------------------------------------------------------------------------------! -subroutine is_resolvable(csite,ipa,ico,green_leaf_factor) +subroutine is_resolvable(csite,ipa,ico) use ed_state_vars , only : sitetype & ! structure , patchtype ! ! structure use phenology_coms, only : elongf_min ! ! intent(in) @@ -75,15 +75,13 @@ subroutine is_resolvable(csite,ipa,ico,green_leaf_factor) implicit none !----- Arguments -----------------------------------------------------------------------! - type(sitetype) , target :: csite ! Current site - integer , intent(in) :: ipa ! Patch index - integer , intent(in) :: ico ! Cohort index - real, dimension(n_pft), intent(in) :: green_leaf_factor ! Cold phenology scale + type(sitetype) , target :: csite ! Current site + integer , intent(in) :: ipa ! Patch index + integer , intent(in) :: ico ! Cohort index !----- Local variables. ----------------------------------------------------------------! type(patchtype) , pointer :: cpatch ! Current patch integer :: ipft ! Cohort PFT logical :: exposed ! Cohort is above snow [ T|F] - logical :: green ! Cohort has some leaves. [ T|F] logical :: leaf_enough ! Cohort have enough leaves [ T|F] logical :: wood_enough ! Cohort have enough wood [ T|F] !---------------------------------------------------------------------------------------! @@ -113,19 +111,10 @@ subroutine is_resolvable(csite,ipa,ico,green_leaf_factor) - !---------------------------------------------------------------------------------------! - ! 3. Check for relative leaf biomass, which is the product of the drought-phenology ! - ! and cold-phenology elongation factors. ! - !---------------------------------------------------------------------------------------! - green = cpatch%elongf(ico) * green_leaf_factor(ipft) >= elongf_min - !---------------------------------------------------------------------------------------! - - - !---------------------------------------------------------------------------------------! ! Save the tests in the cohort variable, so the checks are done consistently. ! !---------------------------------------------------------------------------------------! - cpatch%leaf_resolvable(ico) = exposed .and. leaf_enough .and. green + cpatch%leaf_resolvable(ico) = exposed .and. leaf_enough cpatch%wood_resolvable(ico) = exposed .and. wood_enough !---------------------------------------------------------------------------------------! diff --git a/ED/src/utils/therm_lib.f90 b/ED/src/utils/therm_lib.f90 index d77cc1396..9476d41ce 100644 --- a/ED/src/utils/therm_lib.f90 +++ b/ED/src/utils/therm_lib.f90 @@ -2073,6 +2073,196 @@ end function rehuil + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! LIQUID PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefl(pres,temp,humi,is_shv) + use consts_coms, only : ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + psat = eslf(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefl = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefl + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! ICE PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefi(pres,temp,humi,is_shv) + use consts_coms, only : ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + psat = esif(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefi = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefi + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: This fucntion may consider whether the temperature is above or below the ! + ! freezing point to choose which saturation to use. It is possible to ! + ! explicitly force not to use ice in case level is 2 or if you have reasons ! + ! not to use ice (e.g. reading data that did not consider ice). ! + !---------------------------------------------------------------------------------------! + real(kind=4) function vpdefil(pres,temp,humi,is_shv,useice) + use consts_coms, only : t3ple & ! intent(in) + , ep & ! intent(in) + , toodry ! ! intent(in) + implicit none + !----- Required arguments. ----------------------------------------------------------! + real(kind=4), intent(in) :: pres ! Air pressure [ Pa] + real(kind=4), intent(in) :: temp ! Temperature [ K] + real(kind=4), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input is specific humidity [ T|F] + !----- Optional arguments. ----------------------------------------------------------! + logical , intent(in), optional :: useice ! May use ice thermodynamics [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=4) :: shv ! Specific humidity [ kg/kg] + real(kind=4) :: pvap ! Vapour pressure [ Pa] + real(kind=4) :: psat ! Saturation vapour pressure [ Pa] + logical :: frozen ! Will use ice saturation now [ T|F] + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Check whether we should use ice or liquid saturation. ! + !------------------------------------------------------------------------------------! + if (present(useice)) then + frozen = useice .and. temp < t3ple + else + frozen = bulk_on .and. temp < t3ple + end if + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry,humi) + else + shv = max(toodry,humi) / ( 1.0 + max(toodry,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep + (1.0 - ep) * shv ) + if (frozen) then + psat = esif(temp) + else + psat = esif(temp) + end if + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefil = max(0.0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefil + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! !=======================================================================================! ! This function finds the actual temperature based on the virtual temperature and ! diff --git a/ED/src/utils/therm_lib8.f90 b/ED/src/utils/therm_lib8.f90 index f3f6c7e13..2c7f70dd6 100644 --- a/ED/src/utils/therm_lib8.f90 +++ b/ED/src/utils/therm_lib8.f90 @@ -1893,7 +1893,7 @@ end function ptrh2rvapil8 !=======================================================================================! ! This function computes the relative humidity [fraction] based on pressure, tem- ! ! perature, and vapour mixing ratio (or specific humidity). Two important points: ! - ! 1. IT ALWAYS ASSUME THAT RELATIVE HUMIDITY IS WITH RESPECT TO THE LIQUID PHASE. ! + ! 1. IT ALWAYS ASSUMES THAT RELATIVE HUMIDITY IS WITH RESPECT TO THE LIQUID PHASE. ! ! If you want to switch between ice and liquid, use rehuil instead. ! ! 2. IT DOESN'T PREVENT SUPERSATURATION TO OCCUR. This is because this subroutine is ! ! also used in the microphysics, where supersaturation does happen and needs to be ! @@ -1951,7 +1951,7 @@ end function rehul8 !=======================================================================================! ! This function computes the relative humidity [fraction] based on pressure, tem- ! ! perature, and vapour mixing ratio (or specific humidity). Two important points: ! - ! 1. IT ALWAYS ASSUME THAT RELATIVE HUMIDITY IS WITH RESPECT TO THE ICE PHASE. ! + ! 1. IT ALWAYS ASSUMES THAT RELATIVE HUMIDITY IS WITH RESPECT TO THE ICE PHASE. ! ! If you want to switch between ice and liquid, use rehuil instead. ! ! 2. IT DOESN'T PREVENT SUPERSATURATION TO OCCUR. This is because this subroutine is ! ! also used in the microphysics, where supersaturation does happen and needs to be ! @@ -2083,6 +2083,196 @@ end function rehuil8 + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! LIQUID PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=8) function vpdefl8(pres,temp,humi,is_shv) + use consts_coms, only : ep8 & ! intent(in) + , toodry8 ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=8), intent(in) :: pres ! Air pressure [ Pa] + real(kind=8), intent(in) :: temp ! Temperature [ K] + real(kind=8), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=8) :: shv ! Specific humidity [ kg/kg] + real(kind=8) :: pvap ! Vapour pressure [ Pa] + real(kind=8) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry8,humi) + else + shv = max(toodry8,humi) / ( 1.d0 + max(toodry8,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep8 + (1.d0 - ep8) * shv ) + psat = eslf8(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefl8 = max(0.d0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefl8 + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: IT ALWAYS ASSUMES THAT VAPOUR PRESSURE DEFICIT IS WITH RESPECT TO THE ! + ! ICE PHASE. If you would like it to switch between ice and liquid, then ! + ! use vpdefil instead. ! + !---------------------------------------------------------------------------------------! + real(kind=8) function vpdefi8(pres,temp,humi,is_shv) + use consts_coms, only : ep8 & ! intent(in) + , toodry8 ! ! intent(in) + implicit none + !----- Arguments --------------------------------------------------------------------! + real(kind=8), intent(in) :: pres ! Air pressure [ Pa] + real(kind=8), intent(in) :: temp ! Temperature [ K] + real(kind=8), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input humidity is specific humidity [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=8) :: shv ! Specific humidity [ kg/kg] + real(kind=8) :: pvap ! Vapour pressure [ Pa] + real(kind=8) :: psat ! Saturation vapour pressure [ Pa] + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry8,humi) + else + shv = max(toodry8,humi) / ( 1.d0 + max(toodry8,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep8 + (1.d0 - ep8) * shv ) + psat = esif8(temp) + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefi8 = max(0.d0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefi8 + !=======================================================================================! + !=======================================================================================! + + + + + + + !=======================================================================================! + !=======================================================================================! + ! This function computes the vapour pressure deficit based on pressure, temper- ! + ! ature, and vapour mixing ratio (or specific humidity). ! + ! ! + ! IMPORTANT: This fucntion may consider whether the temperature is above or below the ! + ! freezing point to choose which saturation to use. It is possible to ! + ! explicitly force not to use ice in case level is 2 or if you have reasons ! + ! not to use ice (e.g. reading data that did not consider ice). ! + !---------------------------------------------------------------------------------------! + real(kind=8) function vpdefil8(pres,temp,humi,is_shv,useice) + use consts_coms, only : t3ple8 & ! intent(in) + , ep8 & ! intent(in) + , toodry8 ! ! intent(in) + implicit none + !----- Required arguments. ----------------------------------------------------------! + real(kind=8), intent(in) :: pres ! Air pressure [ Pa] + real(kind=8), intent(in) :: temp ! Temperature [ K] + real(kind=8), intent(in) :: humi ! Humidity [ kg/kg] + logical , intent(in) :: is_shv ! Input is specific humidity [ T|F] + !----- Optional arguments. ----------------------------------------------------------! + logical , intent(in), optional :: useice ! May use ice thermodynamics [ T|F] + !----- Local variables --------------------------------------------------------------! + real(kind=8) :: shv ! Specific humidity [ kg/kg] + real(kind=8) :: pvap ! Vapour pressure [ Pa] + real(kind=8) :: psat ! Saturation vapour pressure [ Pa] + logical :: frozen ! Will use ice saturation now [ T|F] + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Check whether we should use ice or liquid saturation. ! + !------------------------------------------------------------------------------------! + if (present(useice)) then + frozen = useice .and. temp < t3ple8 + else + frozen = bulk_on .and. temp < t3ple8 + end if + !------------------------------------------------------------------------------------! + + + !---- Make sure that we have specific humidity. -------------------------------------! + if (is_shv) then + shv = max(toodry8,humi) + else + shv = max(toodry8,humi) / ( 1.d0 + max(toodry8,humi) ) + end if + !------------------------------------------------------------------------------------! + + + !------------------------------------------------------------------------------------! + ! Find the vapour pressure and the saturation vapour pressure. ! + !------------------------------------------------------------------------------------! + pvap = ( pres * shv ) / ( ep8 + (1.d0 - ep8) * shv ) + if (frozen) then + psat = esif8(temp) + else + psat = esif8(temp) + end if + !------------------------------------------------------------------------------------! + + !------------------------------------------------------------------------------------! + ! Find the relative humidity. ! + !------------------------------------------------------------------------------------! + vpdefil8 = max(0.d0 , psat - pvap) + !------------------------------------------------------------------------------------! + + return + end function vpdefil8 + !=======================================================================================! + !=======================================================================================! + + + + + + !=======================================================================================! !=======================================================================================! ! This function finds the actual temperature based on the virtual temperature and ! diff --git a/Ramspost/src/driver/variables.f90 b/Ramspost/src/driver/variables.f90 index 787992ffb..8eb9ba3a0 100644 --- a/Ramspost/src/driver/variables.f90 +++ b/Ramspost/src/driver/variables.f90 @@ -2004,6 +2004,34 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname='vegetation class' cdunits='#' + case ('scolour','scolour_bp') + + irecind = 1 + irecsize = nnxp(ngrd) * nnyp(ngrd) * npat + + select case (trim(cvar)) + case ('scolour_bp') + ierr = RAMS_getvar('PATCH_AREA',idim_type,ngrd & + ,a(irecind),b,flnm) + + irecind = irecind + irecsize + end select + + ierr = RAMS_getvar('SOIL_COLOR',idim_type,ngrd & + ,a(irecind),b,flnm) + ierr_getvar = ierr_getvar + ierr + call RAMS_comp_vegclass(irecsize,1,1,a(irecind)) + select case (trim(cvar)) + case ('scolour') + ivar_type = 7 + case ('scolour_bp') + ivar_type = 2 + call RAMS_comp_bigpatch(nnxp(ngrd),nnyp(ngrd),1,npat & + ,a(irecind),a(1),b) + end select + cdname='soil colour class' + cdunits='#' + case ('ndvi','ndvi_bp') irecind = 1 @@ -2183,6 +2211,35 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname=' total leaf area index' cdunits='' + + case ('vegalb','vegalb_ps') + + irecind = 1 + irecsize = nnxp(ngrd) * nnyp(ngrd) * npat + + select case (trim(cvar)) + case ('tai_ps') + ierr = RAMS_getvar('PATCH_AREA',idim_type,ngrd & + ,a(irecind),b,flnm) + + irecind = irecind + irecsize + end select + + ierr = RAMS_getvar('VEG_ALBEDO',idim_type,ngrd & + ,a(irecind),b,flnm) + ierr_getvar = ierr_getvar + ierr + + select case (trim(cvar)) + case ('vegalb') + ivar_type = 7 + case ('vegalb_ps') + ivar_type = 2 + call RAMS_comp_patchsum(nnxp(ngrd),nnyp(ngrd),1,npat,a) + end select + + cdname='vegetation albedo' + cdunits='' + case ('ustar') ivar_type = 7 ierr = RAMS_getvar('USTAR',idim_type,ngrd,a,b,flnm) @@ -2297,7 +2354,7 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname='vegetation roughness' cdunits='m' - case ('vegdisp','veg_disp_ps') + case ('vegdisp','vegdisp_ps') irecind = 1 irecsize = nnxp(ngrd) * nnyp(ngrd) * npat @@ -2310,14 +2367,14 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar irecind = irecind + irecsize end select - ierr = RAMS_getvar('VEG_DISP',idim_type,ngrd & + ierr = RAMS_getvar('VEG_DISPLACE',idim_type,ngrd & ,a(irecind),b,flnm) ierr_getvar = ierr_getvar + ierr select case (trim(cvar)) case ('vegdisp') ivar_type = 7 - case ('veg_disp_ps') + case ('vegdisp_ps') ivar_type = 2 call RAMS_comp_patchsum_l(nnxp(ngrd),nnyp(ngrd),1,npat,a) end select @@ -2325,6 +2382,34 @@ subroutine RAMS_varlib(cvar,nx,ny,nz,nsl,npat,ncld,ngrd,flnm,cdname,cdunits,ivar cdname='vegetation displacement height' cdunits='m' + case ('veghgt','veghgt_ps') + + irecind = 1 + irecsize = nnxp(ngrd) * nnyp(ngrd) * npat + + select case (trim(cvar)) + case ('veg_disp_ps') + ierr = RAMS_getvar('PATCH_AREA',idim_type,ngrd & + ,a(irecind),b,flnm) + + irecind = irecind + irecsize + end select + + ierr = RAMS_getvar('VEG_HEIGHT',idim_type,ngrd & + ,a(irecind),b,flnm) + ierr_getvar = ierr_getvar + ierr + + select case (trim(cvar)) + case ('veghgt') + ivar_type = 7 + case ('veghgt_ps') + ivar_type = 2 + call RAMS_comp_patchsum_l(nnxp(ngrd),nnyp(ngrd),1,npat,a) + end select + + cdname='vegetation height' + cdunits='m' + case ('patch_wetind') ivar_type = 7 diff --git a/cnt_lines.sh b/cnt_lines.sh new file mode 100755 index 000000000..ab055c9f4 --- /dev/null +++ b/cnt_lines.sh @@ -0,0 +1,32 @@ +#!/bin/bash +models="ED BRAMS Ramspost RAPP" + +for model in ${models} +do + echo "=========================================================================" + echo " + Model ${model}: " + echo " " + modellines=0 + direcs=`ls -1 ${model}/src` + for dir in ${direcs} + do + if [ ${dir} != "test_cases" ] && [ ${dir} != "doc" ] && [ ${dir} != "preproc" ] && [ ${dir} != "post" ] + then + echo -n " - Directory ${dir}: " + files=`ls -1 ${model}/src/${dir}` + dirlines=0 + for file in ${files} + do + nlines=`sed '/^ *$/ d' ${model}/src/${dir}/${file} | wc -l` + let dirlines=${dirlines}+${nlines} + done + echo "${dirlines} lines" + let modellines=${modellines}+${dirlines} + fi + done + echo " - Total: ${modellines}" + echo "=========================================================================" + echo " " + echo " " + echo " " +done