├── .gitattributes ├── .gitignore ├── .zenodo.json ├── AUTHORS ├── CHANGELOG.md ├── CITATION.cff ├── COPYRIGHT ├── INSTALL ├── LICENSE ├── LPJ.sln ├── LPJ.vcxproj ├── LPJ_zip.bat ├── Makefile ├── README ├── REFERENCES ├── STYLESHEET.md ├── VERSION ├── bin ├── backtrace ├── filetypes.vim ├── lpjml.sh ├── lpjrun ├── lpjsubmit_aix ├── lpjsubmit_hpc ├── lpjsubmit_intel ├── lpjsubmit_mpich ├── lpjsubmit_slurm ├── output_bsq └── regridlpj ├── config ├── Makefile.aix ├── Makefile.aix_mpi ├── Makefile.cluster2015 ├── Makefile.darwin_cc ├── Makefile.darwin_mpich ├── Makefile.gcc ├── Makefile.hpc2024 ├── Makefile.icx ├── Makefile.intel ├── Makefile.mpich ├── Makefile.template ├── Makefile.win32 └── lpj_paths.txt ├── configure.bat ├── configure.sh ├── fmake.bat ├── include ├── agriculture.h ├── agriculture_grass.h ├── agriculture_tree.h ├── biomass_grass.h ├── biomass_tree.h ├── biomes.h ├── buffer.h ├── cdf.h ├── cell.h ├── channel.h ├── climate.h ├── climbuf.h ├── conf.h ├── config.h ├── coord.h ├── coupler.h ├── couplerpar.h ├── cpl.h ├── crop.h ├── cropdates.h ├── date.h ├── discharge.h ├── efr.h ├── errmsg.h ├── grass.h ├── grassland.h ├── header.h ├── image.h ├── input.h ├── intlist.h ├── landuse.h ├── list.h ├── lpj.h ├── manage.h ├── managepar.h ├── natural.h ├── numeric.h ├── outfile.h ├── output.h ├── param.h ├── pft.h ├── pftlist.h ├── pftpar.h ├── pnet.h ├── queue.h ├── reservoir.h ├── soil.h ├── soilpar.h ├── spitfire.h ├── stand.h ├── swap.h ├── tree.h ├── types.h ├── units.h └── woodplantation.h ├── input.cjson ├── input_netcdf.cjson ├── lib └── README_NETCDF_lib.txt ├── lpjml_config.cjson ├── man ├── Makefile ├── man1 │ ├── Makefile │ ├── adddrain.1 │ ├── addheader.1 │ ├── arr2clm.1 │ ├── asc2clm.1 │ ├── backtrace.1 │ ├── bin2cdf.1 │ ├── cat2bsq.1 │ ├── catclm.1 │ ├── cdf2bin.1 │ ├── cdf2clm.1 │ ├── cdf2coord.1 │ ├── cdf2grid.1 │ ├── cdf2soil.1 │ ├── cft2clm.1 │ ├── clm2cdf.1 │ ├── cmpbin.1 │ ├── configure.sh.1 │ ├── country2cdf.1 │ ├── cru2clm.1 │ ├── cutclm.1 │ ├── cvrtclm.1 │ ├── getcellindex.1 │ ├── getcountry.1 │ ├── grid2clm.1 │ ├── headersize.1 │ ├── lpj_paths.csh.1 │ ├── lpj_paths.sh.1 │ ├── lpjcat.1 │ ├── lpjcheck.1 │ ├── lpjfiles.1 │ ├── lpjml.1 │ ├── lpjprint.1 │ ├── lpjrun.1 │ ├── lpjsubmit.1 │ ├── manage2js.1 │ ├── mathclm.1 │ ├── mergeclm.1 │ ├── output_bsq.1 │ ├── printclm.1 │ ├── printglobal.1 │ ├── printharvest.1 │ ├── printheader.1 │ ├── printreservoir.1 │ ├── regridclm.1 │ ├── regridlpj.1 │ ├── regridsoil.1 │ ├── setclm.1 │ ├── soil2cdf.1 │ ├── statclm.1 │ ├── txt2clm.1 │ └── txt2grid.1 ├── man3 │ ├── Makefile │ ├── close_image.3 │ ├── close_socket.3 │ ├── connect_socket.3 │ ├── failonerror.3 │ ├── fcloseoutput.3 │ ├── flux_sum.3 │ ├── fopenoutput.3 │ ├── fprintconfig.3 │ ├── fprintflux.3 │ ├── freeclimate.3 │ ├── freeconfig.3 │ ├── freegrid.3 │ ├── freeinput.3 │ ├── freelanduse.3 │ ├── freepopdens.3 │ ├── freewateruse.3 │ ├── fwriterestart.3 │ ├── getclimate.3 │ ├── getco2.3 │ ├── getlanduse.3 │ ├── getpopdens.3 │ ├── getwateruse.3 │ ├── initclimate.3 │ ├── initconfig.3 │ ├── initdrain.3 │ ├── initinput.3 │ ├── initlanduse.3 │ ├── initmpiconfig.3 │ ├── initpopdens.3 │ ├── initwateruse.3 │ ├── isopen.3 │ ├── isroot.3 │ ├── iterate.3 │ ├── iterateyear.3 │ ├── newgrid.3 │ ├── open_image.3 │ ├── open_socket.3 │ ├── pnet_addconnect.3 │ ├── pnet_dup.3 │ ├── pnet_exchg.3 │ ├── pnet_free.3 │ ├── pnet_hi.3 │ ├── pnet_inindex.3 │ ├── pnet_init.3 │ ├── pnet_inlen.3 │ ├── pnet_input.3 │ ├── pnet_lo.3 │ ├── pnet_nodes.3 │ ├── pnet_outindex.3 │ ├── pnet_outlen.3 │ ├── pnet_output.3 │ ├── pnet_reverse.3 │ ├── pnet_setup.3 │ ├── pnet_strerror.3 │ ├── printconfig.3 │ ├── printflags.3 │ ├── printlicense.3 │ ├── readconfig.3 │ ├── readint_socket.3 │ ├── readpopdens.3 │ ├── writecoords.3 │ ├── writecountrycode.3 │ ├── writefloat_socket.3 │ ├── writeint_socket.3 │ └── writeregioncode.3 ├── man5 │ ├── Makefile │ └── clm.5 └── whatis ├── par ├── lpjparam.cjson ├── lpjparam_non.cjson ├── manage_irrig_systems_with_dummy_laimax_data.cjson ├── outputvars.cjson ├── pft.cjson ├── pft_non.cjson ├── soil.cjson └── soil_rock_ice.cjson └── src ├── Makefile ├── climate ├── Makefile ├── avgtemp.c ├── checkvalidclimate.c ├── closeclimate.c ├── dailyclimate.c ├── freeclimate.c ├── getclimate.c ├── getco2.c ├── getdeposition.c ├── getmprec.c ├── getmtemp.c ├── initclimate.c ├── initclimate_monthly.c ├── openclimate.c ├── openclmdata.c ├── opendata.c ├── opendata_seq.c ├── openinputdata.c ├── prdaily.c ├── radiation.c ├── readco2.c ├── readdata.c ├── readinputdata.c ├── readintdata.c ├── readintinputdata.c └── storeclimate.c ├── coupler ├── Makefile ├── check_coupler.c ├── close_coupler.c ├── connect_coupler.c ├── open_coupler.c ├── openinput_coupler.c ├── openoutput_coupler.c ├── receive_coupler.c ├── receive_real_coupler.c ├── receive_real_scalar_coupler.c ├── receive_scalar_coupler.c ├── receive_token_coupler.c ├── send_output_coupler.c ├── send_real_scalar_coupler.c ├── send_scalar_coupler.c └── send_token_coupler.c ├── cpl ├── Makefile ├── cpl_free.c └── cpl_init.c ├── crop ├── Makefile ├── agb_crop.c ├── albedo_crop.c ├── allocation_daily_crop.c ├── alphaa_crop.c ├── calc_cropdates.c ├── calc_seasonality.c ├── efr.c ├── fpar_crop.c ├── fpc_crop.c ├── fprint_crop.c ├── fprintcropdates.c ├── fprintpar_crop.c ├── fread_crop.c ├── freadcropdates.c ├── free_crop.c ├── freecropdates.c ├── fscanpft_crop.c ├── fwrite_crop.c ├── fwritecropdates.c ├── harvest_crop.c ├── init_cropdates.c ├── lai_crop.c ├── litter_update_crop.c ├── ndemand_crop.c ├── new_crop.c ├── npp_crop.c ├── nuptake_crop.c ├── phen_variety.c ├── phenology_crop.c ├── separate_harvest.c ├── update_cropdates.c ├── update_fallowdays.c ├── veg_sum_crop.c ├── vmaxlimit_crop.c └── wdf_crop.c ├── getbuild.c ├── grass ├── Makefile ├── adjust_grass.c ├── agb_grass.c ├── albedo_grass.c ├── allocation_grass.c ├── alphaa_grass.c ├── annual_grass.c ├── establishment_grass.c ├── fire_grass.c ├── fpar_grass.c ├── fpc_grass.c ├── fprint_grass.c ├── fprintpar_grass.c ├── fread_grass.c ├── free_grass.c ├── fscanpft_grass.c ├── fwrite_grass.c ├── init_grass.c ├── lai_grass.c ├── light_grass.c ├── litter_update_grass.c ├── livefuel_consum_grass.c ├── mix_veg_grass.c ├── ndemand_grass.c ├── new_grass.c ├── npp_grass.c ├── nuptake_grass.c ├── phenology_grass.c ├── reduce_grass.c ├── turnover_daily_grass.c ├── turnover_grass.c ├── turnover_monthly_grass.c ├── veg_sum_grass.c └── vmaxlimit_grass.c ├── image ├── Makefile ├── biome_classification.c ├── close_image.c ├── getproductpools.c ├── initproductinit.c ├── monthlyoutput_image.c ├── new_image.c ├── open_image.c ├── product_turnover.c ├── receive_image_climate.c ├── receive_image_co2.c ├── receive_image_data.c ├── receive_image_finish.c ├── receive_image_luc.c ├── receive_image_productpools.c ├── send_image_data.c └── setoutput_image.c ├── landuse ├── Makefile ├── agriculture.c ├── agriculture_grass.c ├── agriculture_tree.c ├── allocation_today.c ├── annual_agriculture.c ├── annual_agriculture_grass.c ├── annual_agriculture_tree.c ├── annual_biomass_grass.c ├── annual_biomass_tree.c ├── annual_grassland.c ├── annual_setaside.c ├── annual_woodplantation.c ├── biomass_grass.c ├── biomass_tree.c ├── calc_nir.c ├── check_lu.c ├── createcountrycode.c ├── crop_sum_frac.c ├── cultivate.c ├── cutpfts.c ├── daily_agriculture.c ├── daily_agriculture_grass.c ├── daily_agriculture_tree.c ├── daily_biomass_grass.c ├── daily_biomass_tree.c ├── daily_grassland.c ├── daily_woodplantation.c ├── distribute_water.c ├── fertday_biomass.c ├── fertilize_tree.c ├── findlandusetype.c ├── findstand.c ├── findstandpft.c ├── fprint_agriculture.c ├── fprint_biomass_tree.c ├── fprint_grassland.c ├── fprint_irrigation.c ├── fprintcountrypar.c ├── fread_agriculture.c ├── fread_biomass_tree.c ├── fread_grassland.c ├── fread_irrigation.c ├── free_agriculture.c ├── freecountrypar.c ├── freemanage.c ├── fscanagtreemap.c ├── fscancountrypar.c ├── fscanmowingdays.c ├── fscantreedens.c ├── fwrite_agriculture.c ├── fwrite_biomass_tree.c ├── fwrite_grassland.c ├── fwrite_irrigation.c ├── getnsoil_agr.c ├── grassland.c ├── harvest_stand.c ├── init_irrigation.c ├── initmanage.c ├── irrig_amount.c ├── isirrigevent.c ├── killstand.c ├── landfrac.c ├── landuse.c ├── landusechange.c ├── new_agriculture.c ├── new_biomass_tree.c ├── new_grassland.c ├── opencountrycode.c ├── output_gbw.c ├── output_gbw_agriculture.c ├── readcottondays.c ├── readcountrycode.c ├── reclaim_land.c ├── rw_irrigation.c ├── scancftmap.c ├── setaside.c ├── setotherstocrop.c ├── sowing.c ├── sowing_prescribe.c ├── sowing_season.c ├── sowingcft.c ├── timber_burn.c ├── timber_harvest.c ├── update_irrig.c ├── update_separate_harvests.c ├── wateruse.c ├── withdrawal_demand.c ├── woodplantation.c └── writecountrycode.c ├── lpj ├── FILES ├── Makefile ├── albedo.c ├── albedo_stand.c ├── annual_natural.c ├── celldata.c ├── cflux_sum.c ├── check_balance.c ├── check_fluxes.c ├── check_stand_fracs.c ├── climbuf.c ├── closeoutput_yearly.c ├── copyright.c ├── createconfig.c ├── createpftnames.c ├── daily_natural.c ├── drain.c ├── equilsom.c ├── equilveg.c ├── establish.c ├── establishmentpft.c ├── extflow.c ├── f_lai.c ├── fcloseoutput.c ├── filesexist.c ├── firepft.c ├── flux_sum.c ├── fopenoutput.c ├── fpc_sum.c ├── fprint_natural.c ├── fprintcell.c ├── fprintconfig.c ├── fprintcsvflux.c ├── fprintfiles.c ├── fprintflux.c ├── fprintincludes.c ├── fprintoutputjson.c ├── fprintoutputvar.c ├── fprintparam.c ├── fprintpft.c ├── fprintpftnames.c ├── fprintpftpar.c ├── fprintstand.c ├── fread_natural.c ├── freadcell.c ├── freadoutputdata.c ├── freadpft.c ├── freadstand.c ├── free_natural.c ├── freecell.c ├── freeconfig.c ├── freegrid.c ├── freeinput.c ├── freeoutput.c ├── freeoutputvar.c ├── freepft.c ├── freepftpar.c ├── fscancnratio.c ├── fscanconfig.c ├── fscancultivationtypes.c ├── fscanemissionfactor.c ├── fscanerrorlimit.c ├── fscanlandcovermap.c ├── fscanlimit.c ├── fscanoutput.c ├── fscanoutputvar.c ├── fscanparam.c ├── fscanpftpar.c ├── fscanphenparam.c ├── fwrite_natural.c ├── fwritecell.c ├── fwriteoutput.c ├── fwriteoutputdata.c ├── fwritepft.c ├── fwriterestart.c ├── fwritestand.c ├── getextension.c ├── getmintimestep.c ├── getnculttype.c ├── getngrassnat.c ├── getoutputtype.c ├── getroute.c ├── getsize.c ├── gp_sum.c ├── help.c ├── init_annual.c ├── initconfig.c ├── initdrain.c ├── initgdd.c ├── initinput.c ├── initmpiconfig.c ├── initoutput.c ├── initoutputdata.c ├── interception.c ├── isannual.c ├── isannual_output.c ├── isnitrogen_output.c ├── iterate.c ├── iterateyear.c ├── landcover.c ├── light.c ├── natural.c ├── new_natural.c ├── newgrid.c ├── newpft.c ├── nitrogen_stress.c ├── noadjust.c ├── noestablishment.c ├── nofire.c ├── noinit.c ├── nomix_veg.c ├── nooutput_gbw.c ├── noturnover_monthly.c ├── nowdf.c ├── npp_contr_biol_n_fixation.c ├── openconfig.c ├── outputfilesize.c ├── outputindex.c ├── outputnames.c ├── outputsize.c ├── pftlist.c ├── phenology_gsi.c ├── photosynthesis.c ├── printlicense.c ├── readconfig.c ├── roughnesslength.c ├── standlist.c ├── standstocks.c ├── survive.c ├── temp_stress.c ├── transfer_function.c ├── update_annual.c ├── update_daily.c ├── update_monthly.c ├── updategdd.c ├── water_stressed.c ├── waterusefcns.c ├── writearea.c └── writecoords.c ├── lpj_climber4.c ├── lpjml.c ├── netcdf ├── Makefile ├── checkcoord.c ├── close_netcdf.c ├── closeclimate_netcdf.c ├── coord_netcdf.c ├── create_netcdf.c ├── create_pft_netcdf.c ├── createcoord.c ├── createcoord_all.c ├── createindex.c ├── flush_netcdf.c ├── freecoordarray.c ├── getattr_netcdf.c ├── getlatlon_netcdf.c ├── getvar_netcdf.c ├── getvarname_netcdf.c ├── input_netcdf.c ├── mpi_openclimate_netcdf.c ├── mpi_write_netcdf.c ├── mpi_write_pft_netcdf.c ├── open_netcdf.c ├── openclimate_netcdf.c ├── opendata_netcdf.c ├── openfile_netcdf.c ├── readclimate_netcdf.c ├── readdata_netcdf.c ├── readintdata_netcdf.c ├── readmap_netcdf.c ├── readshortdata_netcdf.c ├── write_float_netcdf.c ├── write_int_netcdf.c ├── write_pft_float_netcdf.c ├── write_pft_short_netcdf.c └── write_short_netcdf.c ├── numeric ├── Makefile ├── bisect.c ├── buffer.c ├── date.c ├── freadseed.c ├── int2date.c ├── interpolate.c ├── ivec_sum.c ├── leftmostzero.c ├── linreg.c ├── permute.c ├── petpar.c ├── petpar2.c ├── petpar3.c ├── rand.c └── setseed.c ├── pnet ├── FILES ├── Makefile ├── intlist.c ├── pnet_addconnect.c ├── pnet_dup.c ├── pnet_free.c ├── pnet_init.c ├── pnet_reverse.c ├── pnet_setup.c └── pnet_strerror.c ├── reservoir ├── Makefile ├── allocate_reservoir.c ├── check_stand_fracs_for_reservoir.c ├── fprintresdata.c ├── freadresdata.c ├── fwriteresdata.c ├── initresdata.c ├── initreservoir.c ├── irrig_amount_reservoir.c ├── landusechange_for_reservoir.c ├── outflow_reservoir.c ├── readreservoir.c ├── reservoir_surface_storage.c ├── update_reservoir_annual.c ├── update_reservoir_daily.c └── update_reservoir_monthly.c ├── socket ├── Makefile ├── close_socket.c ├── connect_socket.c ├── connecttdt_socket.c ├── fclose_socket.c ├── fconnect_socket.c ├── fconnecttdt_socket.c ├── fgetclientname.c ├── fmpi_read_socket.c ├── fmpi_write_socket.c ├── fopen_socket.c ├── fopentdt_socket.c ├── freaddouble_socket.c ├── freadfloat_socket.c ├── freadint_socket.c ├── freadlong_socket.c ├── freadshort_socket.c ├── freadstring_socket.c ├── fwritedouble_socket.c ├── fwritefloat_socket.c ├── fwriteint_socket.c ├── fwritelong_socket.c ├── fwriteshort_socket.c ├── fwritestring_socket.c ├── getclientname.c ├── mpi_read_socket.c ├── mpi_write_socket.c ├── open_socket.c ├── opentdt_socket.c ├── read_socket.c ├── readdouble_socket.c ├── readfloat_socket.c ├── readint_socket.c ├── readlong_socket.c ├── readshort_socket.c ├── readstring_socket.c ├── write_socket.c └── writestring_socket.c ├── soil ├── Makefile ├── addlitter.c ├── albedo_soil.c ├── apply_enth_of_untracked_mass_shifts.c ├── apply_heatconduction_of_a_day.c ├── apply_perc_enthalpy.c ├── biologicalNfixation.c ├── calc_soil_thermal_props.c ├── checklitter.c ├── cmpsoilmap.c ├── compute_mean_layer_temps_from_enth.c ├── convert_water.c ├── copysoil.c ├── defaultsoilmap.c ├── denitrification.c ├── enth2freezefrac.c ├── equilsoil.c ├── findlitter.c ├── fire_prob.c ├── fire_sum.c ├── fopensoilcode.c ├── fprintlitter.c ├── fprintsoil.c ├── fprintsoilpar.c ├── freadlitter.c ├── freadsoil.c ├── freadsoilcode.c ├── freelitter.c ├── freesoil.c ├── freesoilpar.c ├── freezefrac2soil.c ├── fscanpoolpar.c ├── fscansoilmap.c ├── fscansoilpar.c ├── fwritelitter.c ├── fwritesoil.c ├── getlag.c ├── getnsoilcode.c ├── getrootdist.c ├── getsoilmap.c ├── getstate.c ├── getwr.c ├── infil_perc_irr.c ├── infil_perc_rain.c ├── initsoil.c ├── initsoiltemp.c ├── laketemp.c ├── litter_agtop_grass.c ├── litter_agtop_nitrogen_tree.c ├── litter_agtop_sum.c ├── litter_agtop_sum_quick.c ├── litter_agtop_tree.c ├── littercarbon.c ├── littersom.c ├── litterstocks.c ├── moistfactor.c ├── moisture2soilice.c ├── newsoil.c ├── nuptake_temp_fcn.c ├── pedotransfer.c ├── seeksoilcode.c ├── snow.c ├── soilcarbon.c ├── soilconduct.c ├── soilheatcap.c ├── soilice2moisture.c ├── soilpar_output.c ├── soilstocks.c ├── soiltemp.c ├── soilwater.c ├── temp_response.c ├── tillage.c ├── update_soil_thermal_state.c ├── updatelitterproperties.c ├── volatilization.c └── waterbalance.c ├── spitfire ├── Makefile ├── area_burnt.c ├── dailyfire.c ├── deadfuel_consumption.c ├── firedangerindex.c ├── fprintignition.c ├── fraction_of_consumption.c ├── freadignition.c ├── fuel_consum_total.c ├── fuel_consumption_1hr.c ├── fuelload.c ├── fwriteignition.c ├── humanignition.c ├── ignition.c ├── initfuel.c ├── litter_update_fire.c ├── popdens.c ├── rateofspread.c ├── surface_fire_intensity.c ├── update_fbd_grass.c ├── update_fbd_tree.c ├── update_nesterov.c ├── wildfire_ignitions.c └── windspeed_fpc.c ├── test ├── project.yml ├── support │ ├── header_of_lpjml_files_to_link │ │ ├── apply_enth_of_untracked_mass_shifts.h │ │ ├── apply_heatconduction_of_a_day.h │ │ ├── apply_perc_enthalpy.h │ │ ├── calc_soil_thermal_props.h │ │ ├── compute_mean_layer_temps_from_enth.h │ │ ├── enth2freezefrac.h │ │ ├── freezefrac2soil.h │ │ ├── infil_perc_irr.h │ │ ├── infil_perc_rain.h │ │ ├── initsoil.h │ │ ├── setaside.h │ │ ├── update_soil_thermal_state.h │ │ └── updatelitterproperties.h │ └── helper_code │ │ ├── mocks │ │ ├── support_soil_mocks.c │ │ ├── support_soil_mocks.h │ │ ├── support_stand_mocks.c │ │ └── support_stand_mocks.h │ │ ├── other │ │ ├── support_assertions.c │ │ ├── support_assertions.h │ │ ├── support_global_variables.c │ │ ├── support_global_variables.h │ │ ├── support_manipulate_soil.c │ │ └── support_manipulate_soil.h │ │ └── stubs │ │ ├── support_fail_stub.h │ │ ├── support_mixsoilenergy_stubs.h │ │ ├── support_pedotransfer_stub.h │ │ └── support_sprintcoord_stub.h ├── test_apply_heatconduction_of_a_day.c ├── test_apply_perc_enthalpy.c ├── test_calc_soil_therm_prop.c ├── test_compute_mean_layer_temps_from_enth.c ├── test_enth2freezefrac.c ├── test_freezefrac2soil.c ├── test_initsoil.c ├── test_setaside.c ├── test_update_soil_thermal_state.c ├── test_update_soil_thermal_state_AND_infil_perc_irr.c ├── test_update_soil_thermal_state_AND_infil_perc_rain.c └── test_update_soil_thermal_state_high_resolution.c ├── tools ├── Makefile ├── addpath.c ├── bigendian.c ├── catstrvec.c ├── checkfmt.c ├── closeconfig.c ├── cmpmap.c ├── coord.c ├── diskfree.c ├── enablefpe.c ├── fail.c ├── failonerror.c ├── fbanner.c ├── findstr.c ├── fprintattrs.c ├── fprintheader.c ├── fprintintf.c ├── fprintjson.c ├── fprinttime.c ├── fputprintable.c ├── fputstring.c ├── freadanyheader.c ├── freadheader.c ├── freadheaderid.c ├── freadrestartheader.c ├── freemat.c ├── frepeatch.c ├── fscanarray.c ├── fscanarrayindex.c ├── fscanattrs.c ├── fscanbool.c ├── fscanfcns.c ├── fscanfloat.c ├── fscanint.c ├── fscanintarray.c ├── fscaninteof.c ├── fscankeywords.c ├── fscanmap.c ├── fscanreal.c ├── fscanreal01.c ├── fscanrealarray.c ├── fscansize.c ├── fscanstruct.c ├── fscantimestep.c ├── fscanuint.c ├── fwriteheader.c ├── fwriterestartheader.c ├── getcounts.c ├── getdir.c ├── getfiledate.c ├── getfilefrommeta.c ├── getfilesize.c ├── getfilesizep.c ├── gethost.c ├── getpath.c ├── getuser.c ├── hasanysuffix.c ├── hassuffix.c ├── headersize.c ├── isabspath.c ├── isboolean.c ├── isdir.c ├── iserror.c ├── isint.c ├── iskeydefined.c ├── isnull.c ├── isstring.c ├── list.c ├── mergeattrs.c ├── mkfilename.c ├── mpi_write.c ├── mpi_write_txt.c ├── mrun.c ├── newarray.c ├── newmat.c ├── openinputfile.c ├── openmetafile.c ├── openrestart.c ├── parse_json.c ├── printflags.c ├── queue.c ├── readfilename.c ├── readfloatvec.c ├── readintvec.c ├── readrealvec.c ├── readuintvec.c ├── sprinttimestep.c ├── strdate.c ├── strippath.c ├── stripsuffix.c ├── swap.c └── sysname.c ├── tree ├── Makefile ├── adjust_tree.c ├── agb_tree.c ├── albedo_tree.c ├── allocation_tree.c ├── allometry_tree.c ├── alphaa_tree.c ├── annual_tree.c ├── coppice_tree.c ├── establishment_tree.c ├── fire_tree.c ├── firemortality_tree.c ├── fpar_tree.c ├── fpc_tree.c ├── fprint_tree.c ├── fprintpar_tree.c ├── fread_tree.c ├── free_tree.c ├── fscanpft_tree.c ├── fwrite_tree.c ├── harvest_tree.c ├── init_tree.c ├── isneg_tree.c ├── lai_tree.c ├── light_tree.c ├── litter_update_fire_tree.c ├── litter_update_tree.c ├── livefuel_consum_tree.c ├── mix_veg_tree.c ├── mortality_tree.c ├── ndemand_tree.c ├── new_tree.c ├── nitrogen_allocation_tree.c ├── npp_tree.c ├── nuptake_tree.c ├── phenology_tree.c ├── reduce_tree.c ├── turnover_daily_tree.c ├── turnover_monthly_tree.c ├── turnover_tree.c ├── veg_sum_tree.c └── vmaxlimit_tree.c └── utils ├── Makefile ├── adddrain.c ├── addheader.c ├── arr2clm.c ├── asc2clm.c ├── bin2cdf.c ├── binsum.c ├── cat2bsq.c ├── catclm.c ├── cdf2bin.c ├── cdf2clm.c ├── cdf2coord.c ├── cdf2grid.c ├── cdf2soil.c ├── cft2clm.c ├── cfts26_lu2clm.c ├── clm2bsq.c ├── clm2cdf.c ├── cmpbin.c ├── copyheader.c ├── country2cdf.c ├── coupler_demo.c ├── cru2clm.c ├── cutclm.c ├── cvrtclm.c ├── cvrtsoil.c ├── drainage.c ├── drainage2cdf.c ├── getcellindex.c ├── getcountry.c ├── getheadersize.c ├── grd2bsq.c ├── grid2clm.c ├── joingrid.c ├── lpjcat.c ├── lpjcheck.c ├── lpjfiles.c ├── lpjprint.c ├── manage2js.c ├── mathclm.c ├── mergeclm.c ├── printclm.c ├── printdrain.c ├── printglobal.c ├── printharvest.c ├── printreservoir.c ├── regridclm.c ├── regriddrain.c ├── regridirrig.c ├── regridsoil.c ├── river_sections_input_climate.c ├── river_sections_input_countrycode.c ├── river_sections_input_grid.c ├── river_sections_input_irrig.c ├── river_sections_input_landuse.c ├── river_sections_input_soil.c ├── setclm.c ├── statclm.c ├── txt2clm.c ├── txt2grid.c └── water_use_input.c /.gitattributes: -------------------------------------------------------------------------------- 1 | *.cjson gitlab-language=json 2 | -------------------------------------------------------------------------------- /COPYRIGHT: -------------------------------------------------------------------------------- 1 | Copyright (C) 2007-2017 Potsdam Institute for Climate Impact Research 2 | 3 | The LPJmL4 Model Code is free software: you can redistribute it and/or modify it 4 | under the terms of the GNU Affero Public License as published by the Free 5 | Software Foundation, either version 3 of the License, or (at your option) any 6 | later version. LPJmL is distributed in the hope that it will be 7 | useful, but WITHOUT ANY WARRANTY; without even the implied warranty of 8 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero Public 9 | License for more details. You should have received a copy of the GNU Affero 10 | Public License along with this program. If not, see 11 | http://www.gnu.org/licenses/. 12 | 13 | -------------------------------------------------------------------------------- /LPJ.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio 14 4 | VisualStudioVersion = 14.0.24720.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LPJ", "LPJ.vcxproj", "{6F8FA3B6-7238-4043-9734-FA754E4CD117}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Win32 = Debug|Win32 11 | Debug|x64 = Debug|x64 12 | Release|Win32 = Release|Win32 13 | Release|x64 = Release|x64 14 | EndGlobalSection 15 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 16 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Debug|Win32.ActiveCfg = Debug|Win32 17 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Debug|Win32.Build.0 = Debug|Win32 18 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Debug|x64.ActiveCfg = Debug|x64 19 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Debug|x64.Build.0 = Debug|x64 20 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Release|Win32.ActiveCfg = Release|Win32 21 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Release|Win32.Build.0 = Release|Win32 22 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Release|x64.ActiveCfg = Release|x64 23 | {6F8FA3B6-7238-4043-9734-FA754E4CD117}.Release|x64.Build.0 = Release|x64 24 | EndGlobalSection 25 | GlobalSection(SolutionProperties) = preSolution 26 | HideSolutionNode = FALSE 27 | EndGlobalSection 28 | EndGlobal 29 | -------------------------------------------------------------------------------- /LPJ_zip.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | 3 | xcopy /Q /I par lpj_trunk\par 4 | xcopy /Q /I include lpj_trunk\include 5 | copy input_image_win.conf lpj_trunk\input_image_win.conf 6 | copy param.conf lpj_trunk\param.conf 7 | copy param_wp.conf lpj_trunk\param_wp.conf 8 | 9 | :: get revision number 10 | echo - 11 | echo Prepare the zip file. This might take some minutes!! 12 | echo - 13 | 14 | :: set the path from which the revision has to be taken 15 | SET modeldir=.\ 16 | :: get revision number level from working copy 17 | :: FOR /f "tokens=5" %%i IN ('SubWCRev %modeldir%^|find "Last committed at revision"') DO SET version=%%i 18 | SET version="git" 19 | :: remove spaces from end of string 20 | SET _version=%version: =% 21 | :: zip the file 22 | call zip -r zips\lpj_%_version%.zip lpj_trunk 23 | 24 | echo - 25 | echo zip file with revision number %_version% is written to directory: ZIP 26 | echo - 27 | 28 | sleep 10 29 | 30 | rmdir /S /Q lpj_trunk 31 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | README LPJmL 2 | 3 | This file contains some basic information on the open source distribution of the computer simulation model LPJmL. 4 | LPJmL is developed and maintained at the Potsdam Institute for Climate Impact Research (PIK) in Potsdam, Germany. 5 | 6 | All source code, configuration and parameter files are subject to 7 | copyright (C) by the Potsdam Institute for Climate Impact Research, see the file COPYRIGHT 8 | and are licensed under the GNU AFFERO GENERAL PUBLIC LICENSE Version 3, see the file LICENSE 9 | and is the result of collaborative work, see the file AUTHORS 10 | 11 | For setting up the model, see the file INSTALL 12 | 13 | The source code is distributed via the git repository at https://github.com/PIK-LPJmL/LPJmL and zenodo.org via https://doi.org/10.5281/zenodo.3497212. 14 | The registration is free of costs. 15 | 16 | Outside joint collaborative agreements with PIK, there is absolutely no support in model download, setup, development, application or similar. 17 | 18 | New model development can be submitted to the LPJmL git repository in separate repository branches and pull requests can be issued. There is no guarantee or obligation that external model features, bug fixes or other developemnts will be merged into the standard LPJmL distribution at PIK. 19 | Discussions on model development features can only be initiated via issues at https://github.com/PIK-LPJmL/LPJmL. 20 | 21 | We strongly encourrage considering the coding standards and style recommendations in LPJmL. For details see the file STYLESHEET.md. 22 | -------------------------------------------------------------------------------- /VERSION: -------------------------------------------------------------------------------- 1 | 5.9.7 2 | -------------------------------------------------------------------------------- /bin/backtrace: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################################################# 3 | ## ## 4 | ## b a c k t r a c e ## 5 | ## ## 6 | ## sh script to write out backtrace from core file ## 7 | ## Usage: backtrace [core] ## 8 | ## ## 9 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 10 | ## authors, and contributors see AUTHORS file ## 11 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 12 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 13 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 14 | ## ## 15 | ################################################################################# 16 | 17 | if [ $# -lt 1 ] 18 | then 19 | core=core 20 | else 21 | core=$1 22 | fi 23 | if [ "$LPJROOT" == "" ] 24 | then 25 | exe=bin/lpjml 26 | else 27 | exe=$LPJROOT/bin/lpjml 28 | fi 29 | if test -f $core 30 | then 31 | gdb -ex "bt" -ex "q" -q $exe $core 32 | else 33 | echo >&2 "Error: core file '$core' does not exist" 34 | fi 35 | -------------------------------------------------------------------------------- /bin/filetypes.vim: -------------------------------------------------------------------------------- 1 | " ********************************************************************************* 2 | " ** ** 3 | " ** f i l e t y p e s . v i m ** 4 | " ** ** 5 | " ** This files sets for editor vim syntax filetypes for *.cjson files ** 6 | " ** to javascript. ** 7 | " ** To enable put ** 8 | " ** so $LPJROOT/bin/vim/filetypes.vim ** 9 | " ** in $HOME/.vimrc ** 10 | " ** ** 11 | " ** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ** 12 | " ** authors, and contributors see AUTHORS file ** 13 | " ** This file is part of LPJmL and licensed under GNU AGPL Version 3 ** 14 | " ** or later. See LICENSE file or go to http://www.gnu.org/licenses/ ** 15 | " ** Contact: https://github.com/PIK-LPJmL/LPJmL ** 16 | " ** ** 17 | " ********************************************************************************* 18 | augroup filetype 19 | au! 20 | au! BufRead,BufNewFile *.cjson set filetype=javascript 21 | 22 | augroup END 23 | -------------------------------------------------------------------------------- /bin/lpjml.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | ################################################################################# 3 | ## ## 4 | ## l p j m l . s h ## 5 | ## ## 6 | ## sh script to run lpjml on login as well as on batch nodes on cluster2015 ## 7 | ## at PIK ## 8 | ## ## 9 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 10 | ## authors, and contributors see AUTHORS file ## 11 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 12 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 13 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 14 | ## ## 15 | ################################################################################# 16 | 17 | host=$(hostname) 18 | if [ "$host" = "login01" ] || [ "$host" = "login02" ] 19 | then 20 | unset I_MPI_DAPL_UD_PROVIDER 21 | fi 22 | $LPJROOT/bin/lpjml $* 23 | -------------------------------------------------------------------------------- /bin/output_bsq: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/PIK-LPJmL/LPJmL/383a0c510153a0a9f1b7a29f2694cfc1476a919d/bin/output_bsq -------------------------------------------------------------------------------- /config/Makefile.darwin_cc: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e . d a r w i n _ c c ## 4 | ## ## 5 | ## Make include file for compiler and os specific settings ## 6 | ## Compile and link options for Gnu compiler gcc on MacOS X ## 7 | ## ## 8 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 9 | ## authors, and contributors see AUTHORS file ## 10 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 11 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 12 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 13 | ## ## 14 | ################################################################################# 15 | 16 | CC = cc 17 | DEBUGFLAGS = -g 18 | OPTFLAGS= -O3 19 | WFLAG = -Wall -m64 20 | LPJFLAGS = -DUSE_RAND48 -DSAFE 21 | O = o 22 | A = a 23 | E = 24 | AR = ar 25 | ARFLAGS = r 26 | RM = rm 27 | RMFLAGS = -f 28 | LINKMAIN= cc -m64 29 | LINK = cc -m64 30 | MKDIR = mkdir -p 31 | LIBS = -lm 32 | SLASH = / 33 | -------------------------------------------------------------------------------- /config/Makefile.darwin_mpich: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e . d a r w i n _ m p i c h ## 4 | ## ## 5 | ## Make include file for compiler and os specific settings ## 6 | ## Compile and link options for Gnu compiler gcc on MacOS X ## 7 | ## Parallel MPI is enabled using MPICH ## 8 | ## ## 9 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 10 | ## authors, and contributors see AUTHORS file ## 11 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 12 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 13 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 14 | ## ## 15 | ################################################################################# 16 | 17 | CC = mpicc 18 | DEBUGFLAGS = -g 19 | OPTFLAGS= -O3 20 | WFLAG = -Wall -m64 21 | LPJFLAGS = -DUSE_RAND48 -DUSE_MPI -DSAFE 22 | O = o 23 | A = a 24 | E = 25 | AR = ar 26 | ARFLAGS = r 27 | RM = rm 28 | RMFLAGS = -f 29 | LINKMAIN= mpicc 30 | LINK = cc -m64 31 | MKDIR = mkdir -p 32 | LIBS = -lm 33 | SLASH = / 34 | -------------------------------------------------------------------------------- /config/Makefile.gcc: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e . g c c ## 4 | ## ## 5 | ## Make include file for compiler and os specific settings ## 6 | ## Compile and link options for GNU C compiler gcc ## 7 | ## ## 8 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 9 | ## authors, and contributors see AUTHORS file ## 10 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 11 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 12 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 13 | ## ## 14 | ################################################################################# 15 | 16 | CC = gcc 17 | DEBUGFLAGS= -g 18 | WFLAG = -Wall 19 | LPJFLAGS= -DSAFE -DUSE_RAND48 -DWITH_FPE -DUSE_NETCDF -DUSE_UDUNITS -DPERMUTE -DSTRICT_JSON # -DDAILY_ESTABLISHMENT 20 | OPTFLAGS = -O2 21 | O = o 22 | A = a 23 | E = 24 | AR = ar 25 | ARFLAGS = r 26 | RM = rm 27 | RMFLAGS = -f 28 | LIBS = -lm -lnetcdf -ludunits2 -ljson-c 29 | LINK = gcc 30 | LINKMAIN= gcc 31 | MKDIR = mkdir -p 32 | SLASH = / 33 | -------------------------------------------------------------------------------- /config/Makefile.template: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e . t e m p l a t e ## 4 | ## ## 5 | ## Template of makefile for programs using the LPJ libraries ## 6 | ## ## 7 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 8 | ## authors, and contributors see AUTHORS file ## 9 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 10 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 11 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 12 | ## ## 13 | ################################################################################# 14 | 15 | include ${LPJROOT}/Makefile.inc 16 | 17 | LIB = $(LPJROOT)/lib 18 | 19 | INC = $(LPJROOT)/include 20 | 21 | LPJLIBS = $(LIB)/liblpj.$A $(LIB)/libsoil.$A $(LIB)/libimage.$A\ 22 | $(LIB)/libtree.$A $(LIB)/libgrass.$A $(LIB)/liblanduse.$A\ 23 | $(LIB)/libclimate.$A $(LIB)/libnum.$A $(LIB)/libtools.$A\ 24 | $(LIB)/libcrop.$A $(LIB)/libpnet.$A $(LIB)/libsocket.$A 25 | 26 | .c.$O: 27 | $(CC) $(CFLAGS) -I$(INC) -c $*.c 28 | -------------------------------------------------------------------------------- /config/lpj_paths.txt: -------------------------------------------------------------------------------- 1 | rem set search path for LPJmL commands 2 | 3 | path=%path%;%lpjroot%\bin 4 | -------------------------------------------------------------------------------- /configure.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | rem 3 | rem c o n f i g u r e . b a t 4 | rem 5 | rem Configure batch file for Microsoft Windows 6 | rem 7 | rem Last change: 03.03.2009 8 | rem 9 | echo Configuring LPJmL Version 5.9.5 ... 10 | copy config\Makefile.win32 Makefile.inc 11 | echo Create executables with nmake all 12 | set lpjroot=%cd% 13 | echo @echo off>bin\lpj_paths.bat 14 | echo rem>>bin\lpj_paths.bat 15 | echo rem l p j _ p a t h s . b a t>>bin\lpj_paths.bat 16 | echo rem>>bin\lpj_paths.bat 17 | echo set lpjroot="%lpjroot%">>bin\lpj_paths.bat 18 | type config\lpj_paths.txt >>bin\lpj_paths.bat 19 | echo Put %lpjroot%\bin\lpj_paths in your autoexec.bat 20 | -------------------------------------------------------------------------------- /fmake.bat: -------------------------------------------------------------------------------- 1 | set PROJECT=%1 2 | 3 | if "%M_VCVARS%" == "" set M_VCVARS="0" 4 | 5 | :comp_vc14_userdefined 6 | rem ++ everything is set for compiling 7 | 8 | if NOT "%VSINSTALLDIR%"=="" goto comp_vc14_set7 9 | echo "Trying to set Visual Studio Settings for architecture : x64" 10 | @if exist "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" goto comp_vc14_set6 11 | goto comp_vc14_compile 12 | 13 | :comp_vc14_set6 14 | echo "found environment variables for x64" 15 | if %M_VCVARS%=="1" goto comp_vc14_compile 16 | set M_VCVARS="1" 17 | REM optie is x86 (alja) of x86_amd64 (Pascal voor C) 18 | call "%VS140COMNTOOLS%\..\..\VC\vcvarsall.bat" x86_amd64 19 | if NOT "%VSINSTALLDIR%"=="" goto comp_vc14_compile 20 | 21 | :comp_vc14_set7 22 | if %M_VCVARS%=="1" goto comp_vc14_compile 23 | set M_VCVARS="1" 24 | call "%VSINSTALLDIR%\vcvarsall.bat" x86_amd64 25 | goto comp_vc14_compile 26 | 27 | :comp_vc14_compile 28 | REM ++ ready to compile 29 | echo Using Microsoft compiler (vs2015 - v14) 30 | call devenv.com %PROJECT% /Build "Release|win32" 31 | if errorlevel 1 goto failure 32 | goto end 33 | 34 | :end 35 | exit /b 0 36 | 37 | :failure 38 | echo: Error in compiling 39 | -------------------------------------------------------------------------------- /lib/README_NETCDF_lib.txt: -------------------------------------------------------------------------------- 1 | Visual Studio file LPJ.sln can build a 32- or a 64-bit target and expects 2 | the corresponding netcdf binaries for Windows in this directory. If this 3 | directory is empty, building LPJ.exe will end with an LINK error: 4 | LINK : fatal error LNK1181: cannot open input file 'netcdf.lib' 5 | 6 | NetCDF binaries for Windows are not to be checked in on the LPJmL-repository 7 | of PIK. You can find them on the internet or, if you are working at PBL, on the 8 | PBL lpj_devenv repository: 9 | 10 | https://pbl.sliksvn.com/lpj_devenv/lib/netcdf/netcdf_4.3.3.1_32bit 11 | https://pbl.sliksvn.com/lpj_devenv/lib/netcdf/netcdf_4.4.1_64bit 12 | 13 | After a fresh check-out, select directory netcdf_4.3.1.1_32bit and/or netcdf_4.4.1_64bit, 14 | right mouse button -> TortoiseSVN -> Export 15 | and export the contents of 16 | https://pbl.sliksvn.com/lpj_devenv/lib/netcdf/netcdf_4.3.3.1_32bit. 17 | and/or 18 | https://pbl.sliksvn.com/lpj_devenv/lib/netcdf/netcdf_4.4.1_64bit. 19 | to the directory selected. 20 | -------------------------------------------------------------------------------- /man/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e ## 4 | ## ## 5 | ## Makefile to create HTML files from man pages ## 6 | ## ## 7 | ## ## 8 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 9 | ## authors, and contributors see AUTHORS file ## 10 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 11 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 12 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 13 | ## ## 14 | ################################################################################# 15 | 16 | all: 17 | (cd man1; $(MAKE)) 18 | (cd man3; $(MAKE)) 19 | (cd man5; $(MAKE)) 20 | -------------------------------------------------------------------------------- /man/man1/adddrain.1: -------------------------------------------------------------------------------- 1 | .TH adddrain 1 "USER COMMANDS" 2 | .SH NAME 3 | adddrain \- adds river basin to coordinate file 4 | .SH SYNOPSIS 5 | .B adddrain 6 | [\-longheader] [\-downstream] [\-short] 7 | .I coord_all.clm coord.clm drainage.clm coord_basin.clm 8 | .SH DESCRIPTION 9 | Program creates new coordinate file with cells added that are part of the river basin. This has to be done for simulations with river routing enabled. 10 | .SH OPTIONS 11 | .TP 12 | \-longheader 13 | Long (version 2) header assumed for CLM files 14 | .TP 15 | \-downstream 16 | By default only cell from upstream are added. Enabling this flags also cells from downstream will be added 17 | .TP 18 | \-short 19 | The datatype of coordinate data is set to short, default is float 20 | .TP 21 | .I coord_all.clm 22 | Global coordinate file 23 | .TP 24 | .I coord.clm 25 | Coordinate file river basins should be added 26 | .TP 27 | .I drainage.clm 28 | River routing file corresponding to coord_all.clm 29 | .TP 30 | .I coord_basin.clm 31 | New coordinate file created 32 | .SH EXAMPLES 33 | .TP 34 | .B adddrain -short 35 | grid.clm coord.clm drainage.clm coord_basin.clm 36 | .PP 37 | .SH EXIT STATUS 38 | Non zero is returned in case of failure. 39 | 40 | .SH AUTHORS 41 | 42 | For authors and contributors see AUTHORS file 43 | 44 | .SH COPYRIGHT 45 | 46 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 47 | 48 | 49 | .SH SEE ALSO 50 | lpjml(1), txt2clm(1), cru2clm(1), clm(5) 51 | -------------------------------------------------------------------------------- /man/man1/backtrace.1: -------------------------------------------------------------------------------- 1 | .TH backtrace 1 "USER COMMANDS" 2 | .SH NAME 3 | backtrace \- Print backtrace from core file 4 | .SH SYNOPSIS 5 | .B backtrace 6 | [\fIexe\fP [\fIcore\fP]] 7 | .SH DESCRIPTION 8 | Script prints backtrace from core file using the \fBgdb\fP debugger. Full information of 9 | failed program is obtained if it was compiled with \fBconfigure.sh -debug\fP option. 10 | .SH OPTIONS 11 | .TP 12 | \fIexe\fP 13 | Name of the executable. Default name is \fI$LPJROOT/bin/lpjml\fP. 14 | .TP 15 | \fIcore\fP 16 | Name of the core file. Default name is \fIcore\fP. 17 | .SH ENVIRONMENT 18 | .TP 19 | LPJROOT 20 | defines the root directory for LPJmL. 21 | .SH EXIT STATUS 22 | .B backtrace 23 | returns a zero exit status if backtrace has been printed. 24 | Non zero is returned in case of failure. 25 | 26 | .SH AUTHORS 27 | 28 | For authors and contributors see AUTHORS file 29 | 30 | .SH COPYRIGHT 31 | 32 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 33 | 34 | .SH SEE ALSO 35 | lpjml(1), configure.sh(1), gdb(1), core(5) 36 | -------------------------------------------------------------------------------- /man/man1/cat2bsq.1: -------------------------------------------------------------------------------- 1 | .TH cat2bsq 1 "USER COMMANDS" 2 | .SH NAME 3 | cat2bsq \- Concatenates output files from distributed LPJmL simulations. 4 | .SH SYNOPSIS 5 | .B cat2bsq 6 | [-type {float|double|short|int|char}] [-o \fIoutfile\fP] [-bands n] \fIinfilename\fP ... 7 | .SH DESCRIPTION 8 | Program concatenates output files from the LPJmL model to one output file. It used to join output files from 9 | .B 10 | lpjdistribute 11 | and 12 | .B lpjdistribute_river 13 | scripts. Program is obsolete for the MPI version of \fBlpjml\fP. 14 | .SH OPTIONS 15 | .TP 16 | \-type {float|double|short|int|char} 17 | Datatype of output. Default is float. 18 | .TP 19 | \-bands n 20 | Number of bands. Default is 103. 21 | .TP 22 | \-o \fIoutfile\fP 23 | sets filename of the concatenated output file. Default is output to stdout. 24 | .TP 25 | .I infilename 26 | name of output file(s) to join. 27 | .SH EXAMPLE 28 | .TP 29 | Concatenates output files to the file \fIvegc.bin\fP: 30 | .B cat2bsq 31 | \-o vegc.bin vegc_*.bin 32 | .PP 33 | 34 | .SH EXIT STATUS 35 | .B cat2bsq 36 | returns a zero exit status if the output files have been concatenated. 37 | Non zero is returned in case of failure. 38 | 39 | .SH AUTHORS 40 | 41 | For authors and contributors see AUTHORS file 42 | 43 | .SH COPYRIGHT 44 | 45 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 46 | 47 | .SH SEE ALSO 48 | lpjml(1), lpjcat(1), output_bsq(1) 49 | -------------------------------------------------------------------------------- /man/man1/catclm.1: -------------------------------------------------------------------------------- 1 | .TH catclm 1 "USER COMMANDS" 2 | .SH NAME 3 | catclm \- concatenate LPJmL climate data files 4 | .SH SYNOPSIS 5 | .B catclm [-\v] [\-f] [\-longheader] [\-size4] 6 | \fIinfile\fP ... \fIoutfile\fP 7 | .SH DESCRIPTION 8 | Program concatenates climate data files in clm format. 9 | .SH OPTIONS 10 | .TP 11 | \-v 12 | Print filename and start end year of each input file 13 | .TP 14 | \-f 15 | Force overwrite of existing output file 16 | .TP 17 | \-longheader 18 | Long (version 2) header assumed for clm files 19 | .TP 20 | \-size4 21 | Size of data is set to 4 bytes for version 2 clm files, default is 2 bytes 22 | .TP 23 | .I infile 24 | Filename(s) of clm files to concatenate 25 | .TP 26 | .I outfile 27 | Filename of concatenated clm file 28 | .SH EXAMPLE 29 | .TP 30 | Create clm data file from two clm files: 31 | .B catclm 32 | temp_1901-2003.clm temp_2004-2055.clm temp_1901-2055.clm 33 | .PP 34 | .SH EXIT STATUS 35 | .B catclm 36 | returns a zero exit status if the clm file is created. 37 | Non zero is returned in case of failure. 38 | 39 | .SH AUTHORS 40 | 41 | For authors and contributors see AUTHORS file 42 | 43 | .SH COPYRIGHT 44 | 45 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 46 | 47 | .SH SEE ALSO 48 | lpjml(1), mathclm(1), cutclm(1), txt2clm(1), mergeclm(1), grid2clm(1), cft2clm(1), clm(5) 49 | -------------------------------------------------------------------------------- /man/man1/cdf2soil.1: -------------------------------------------------------------------------------- 1 | .TH cdf2soil 1 "USER COMMANDS" 2 | .SH NAME 3 | cdf2soil \- convert NetCDF file into binary file 4 | .SH SYNOPSIS 5 | .B cdf2soil [\-var name] [\-float] [\-scale s] [\-soilmap] 6 | netcdffile gridfile soilfile 7 | .SH DESCRIPTION 8 | Program converts NetCDF input data into soil code or binary input data and writes grid file. 9 | .SH OPTIONS 10 | .TP 11 | \-var name 12 | variable name in NetCDF file, default is 'stexture' 13 | .TP 14 | \-scale factor 15 | scaling factor for clm grid file. Default is 0.01 16 | .TP 17 | \-float 18 | write float values in grid clm file, default is short 19 | .TP 20 | \-soilmap 21 | Use built-in soil map 22 | .TP 23 | .I netcdffile 24 | filename of NetCDF file converted 25 | .TP 26 | .I gridfile 27 | filename of grid data file written 28 | .TP 29 | .I soilfile 30 | filename of soil code data file written 31 | .SH EXAMPLES 32 | .TP 33 | .B cdf2soil 34 | -var soilcode soilcode.nc grid.clm soilcode.bin 35 | .PP 36 | .SH EXIT STATUS 37 | .B cdf2soil 38 | returns a zero exit status if the soil code file is created. 39 | Non zero is returned in case of failure. 40 | 41 | .SH AUTHORS 42 | 43 | For authors and contributors see AUTHORS file 44 | 45 | .SH COPYRIGHT 46 | 47 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 48 | 49 | .SH SEE ALSO 50 | cdf2coord(1), cdf2clm(1), cdf2bin(1), clm2cdf(1), bin2cdf(1), country2cdf(1), regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 51 | -------------------------------------------------------------------------------- /man/man1/cft2clm.1: -------------------------------------------------------------------------------- 1 | .TH cft2clm 1 "USER COMMANDS" 2 | .SH NAME 3 | cft2clm \- convert binary land use data files to clm data files for LPJmL 4 | .SH SYNOPSIS 5 | .B cft2clm 6 | [\-h] [\-firstyear first] [\-lastyear last] [\-nyear n] [\-nbands n] [\-swap] 7 | .I cftfile clmfile 8 | .SH DESCRIPTION 9 | Program converts a raw binary land use data file consisting of 16bit integer values into a file format suitable for LPJmL. 10 | .SH OPTIONS 11 | .TP 12 | \-h 13 | display a short help text 14 | .TP 15 | \-firstyear first 16 | first year in land use file (default is 1700) 17 | .TP 18 | \-lastyear last 19 | last year in land use file 20 | .TP 21 | \-nyear n 22 | number of years in land use file (default is 306) 23 | .TP 24 | \-nbands n 25 | number of bands in output file (default is 26) 26 | .TP 27 | \-swap 28 | change byte order in CRU file 29 | .TP 30 | .I cftfile 31 | filename of binary land use data file 32 | .TP 33 | .I clmfile 34 | filename of clm data file written 35 | .SH EXAMPLES 36 | .TP 37 | Create clm data file from land use dataset changing byte order: 38 | .B cft2clm 39 | \-swap cft26.bin cft2003.clm 40 | .PP 41 | .SH EXIT STATUS 42 | .B cft2clm 43 | returns a zero exit status if the clm file is created. 44 | Non zero is returned in case of failure. 45 | 46 | .SH AUTHORS 47 | 48 | For authors and contributors see AUTHORS file 49 | 50 | .SH COPYRIGHT 51 | 52 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 53 | 54 | .SH SEE ALSO 55 | lpjml(1), cru2clm(1), txt2clm(1), grid2clm(1), clm(5) 56 | -------------------------------------------------------------------------------- /man/man1/cmpbin.1: -------------------------------------------------------------------------------- 1 | .TH cmpbin 1 "USER COMMANDS" 2 | .SH NAME 3 | cmpbin \- compares two binary output files 4 | .SH SYNOPSIS 5 | .B cmpbin 6 | [-metafile] [-verbose] [-csv] \fIfile1.bin\fP \fIfile2.bin\fP 7 | 8 | .SH DESCRIPTION 9 | Program compares two binary output files. The maximum difference and its location, the sum of all absolute differences and the average difference are printed. 10 | .SH OPTIONS 11 | .TP 12 | -metafile 13 | Output files are JSON metafiles describing the structure of the raw binary file 14 | .TP 15 | -verbose 16 | Print values and absolute difference for each different data item 17 | .TP 18 | -csv 19 | Print output in comma-separated format 20 | .TP 21 | .I file1.bin file2.bin 22 | filenames of binary output data files to compare 23 | .SH EXAMPLE 24 | .TP 25 | Compare two binary files in the current directory: 26 | .B cmpbin 27 | vegc1.bin vegc2.bin 28 | .TP 29 | or 30 | .B cmpbin 31 | -metafile vegc1.bin.json vegc2.bin.json 32 | .PP 33 | .SH EXIT STATUS 34 | .B cmpbin 35 | return a zero exit status if binary files could be compared. 36 | Non zero is returned in case of failure. 37 | 38 | .SH AUTHORS 39 | 40 | For authors and contributors see AUTHORS file 41 | 42 | .SH COPYRIGHT 43 | 44 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 45 | 46 | .SH SEE ALSO 47 | setclm(1), headersize(1), lpjml(1), cru2clm(1), grid2clm(1), cft2clm(1), statclm(5), clm(5) 48 | -------------------------------------------------------------------------------- /man/man1/country2cdf.1: -------------------------------------------------------------------------------- 1 | .TH country2cdf 1 "USER COMMANDS" 2 | .SH NAME 3 | country2cdf \- convert country/region code file into NetCDF file 4 | .SH SYNOPSIS 5 | .B country2cdf 6 | [\-global] [-\cellsize size] [\-compress level] [\-descr d] [\-index {0|1}] 7 | .I varname gridfile countryfile netcdffile 8 | .SH DESCRIPTION 9 | Program converts country/region input file into NetCDF file. 10 | .SH OPTIONS 11 | .TP 12 | \-global 13 | use global grid for NetCDF file 14 | .TP 15 | \-cellsize size 16 | set cell size in grid file to size 17 | .TP 18 | \-compress level 19 | compression level for NetCDF4 files 20 | .TP 21 | \-descr d 22 | set long name in NetCDF file 23 | .TP 24 | \-index {0|1} 25 | set country (0) or region (1) in file. Default is 0 26 | .TP 27 | varname 28 | variable name in NetCDF file 29 | .TP 30 | .I gridfile 31 | filename of grid data file 32 | .TP 33 | .I countryfile 34 | filename of country/region code data file 35 | .TP 36 | .I netcdffile 37 | filename of NetCDF file created 38 | .SH EXAMPLES 39 | .TP 40 | Create data file for country and region: 41 | .B country2cdf 42 | country grid.bin cow.bin country.nc 43 | .B country2cdf 44 | [-index 1] region grid.bin cow.bin region.nc 45 | .PP 46 | .SH EXIT STATUS 47 | .B country2cdf 48 | returns a zero exit status if the NetCDF file is created. 49 | Non zero is returned in case of failure. 50 | 51 | .SH AUTHORS 52 | 53 | See AUTHORS file 54 | 55 | .SH COPYRIGHT 56 | 57 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 58 | 59 | .SH SEE ALSO 60 | bin2cdf(1), clm2cdf(1), soil2cdf(1), regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 61 | -------------------------------------------------------------------------------- /man/man1/cutclm.1: -------------------------------------------------------------------------------- 1 | .TH catclm 1 "USER COMMANDS" 2 | .SH NAME 3 | cutclm \- cuts clm data files 4 | .SH SYNOPSIS 5 | .B cutclm [\-longheader] [\-end] year 6 | \fIinfile\fP \fIoutfile\fP 7 | .SH DESCRIPTION 8 | Program cuts climate data files in clm format. 9 | .SH OPTIONS 10 | .TP 11 | \-longheader 12 | Long (version 2) header assumed for clm files 13 | .TP 14 | \-end 15 | copy clm data till year, default is copy clm data from year 16 | .TP 17 | year 18 | year to start/end copying 19 | .TP 20 | .I infile 21 | Filename(s) of clm files to be cut 22 | .TP 23 | .I outfile 24 | Filename of new clm file 25 | .SH EXAMPLE 26 | .TP 27 | Create clm data file staring from year 1950: 28 | .B cutclm 29 | 1950 temp_1901-2003.bin temp_1950-2003.clm 30 | .PP 31 | .SH EXIT STATUS 32 | .B cutclm 33 | returns a zero exit status if the clm file is created. 34 | Non zero is returned in case of failure. 35 | 36 | .SH AUTHORS 37 | 38 | For authors and contributors see AUTHORS file 39 | 40 | .SH COPYRIGHT 41 | 42 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 43 | 44 | .SH SEE ALSO 45 | lpjml(1), mathclm(1), catclm(1), txt2clm(1), grid2clm(1), cft2clm(1), clm(5) 46 | -------------------------------------------------------------------------------- /man/man1/getcellindex.1: -------------------------------------------------------------------------------- 1 | .TH getcellindex 1 "USER COMMANDS" 2 | .SH NAME 3 | getcellindex \- get cell index for coordinates in grid clm file 4 | .SH SYNOPSIS 5 | .B getcellindex 6 | [\-search] [\-longheader] 7 | .I gridfile 8 | [lat[N|S] lon[E|W]] ...] 9 | .SH DESCRIPTION 10 | Program gets cell index for coordinates in grid file. If no cell coordinates are provided, all coordinates in the grid file are listed. 11 | .SH OPTIONS 12 | .TP 13 | \-search 14 | search for nearest coordinate in grid file if coordinate was not found 15 | .TP 16 | .I gridfile 17 | filename of binary grid data file in CLM format 18 | .TP 19 | .I lat 20 | latitude in degree 21 | .TP 22 | .I lon 23 | longitude in degree 24 | .SH EXAMPLES 25 | .TP 26 | Get cell index for 48.25 12.25: 27 | .B getcountry 28 | grid.clm 48.25 12.25 29 | .PP 30 | .SH EXIT STATUS 31 | Non zero is returned in case of failure. 32 | 33 | .SH AUTHORS 34 | 35 | For authors and contributors see AUTHORS file 36 | 37 | .SH COPYRIGHT 38 | 39 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 40 | 41 | .SH SEE ALSO 42 | regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 43 | -------------------------------------------------------------------------------- /man/man1/getcountry.1: -------------------------------------------------------------------------------- 1 | .TH getcountry 1 "USER COMMANDS" 2 | .SH NAME 3 | getcountry \- extract grid cells for specified countries 4 | .SH SYNOPSIS 5 | .B getcountry 6 | [\-list] [\-longheader] 7 | .I countryfile gridfile outfile countrycode ... 8 | .SH DESCRIPTION 9 | Program extracts country grid cells from grid file. 10 | .SH OPTIONS 11 | .TP 12 | \-list 13 | print list of country codes defined 14 | .TP 15 | \-longheader 16 | set long header in grid and country code file 17 | .TP 18 | .I countryfile 19 | country code file 20 | .TP 21 | .I gridfile 22 | filename of binary grid data file 23 | .TP 24 | .I outfile 25 | filename of grid data file written 26 | .TP 27 | .I countrycode 28 | ISO 3166-1 alpha-3 abbreviations for countries. or country codes as numbers defined in 29 | .I include/managepar.h 30 | .SH EXAMPLES 31 | .TP 32 | Create grid data file for USA: 33 | .B getcountry 34 | grid.bin grid_usa.clm USA 35 | .PP 36 | .SH EXIT STATUS 37 | .B getcountry 38 | returns a zero exit status if the grid file is created. 39 | Non zero is returned in case of failure. 40 | 41 | .SH AUTHORS 42 | 43 | For authors and contributors see AUTHORS file 44 | 45 | .SH COPYRIGHT 46 | 47 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 48 | 49 | .SH SEE ALSO 50 | regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 51 | -------------------------------------------------------------------------------- /man/man1/grid2clm.1: -------------------------------------------------------------------------------- 1 | .TH grid2clm 1 "USER COMMANDS" 2 | .SH NAME 3 | grid2clm \- convert grid data file to clm data files for LPJmL 4 | .SH SYNOPSIS 5 | .B grid2clm 6 | [\-h] [\-swap] [\-scale s] [\-cellsize c] 7 | .I gridfile clmfile 8 | .SH DESCRIPTION 9 | Program converts raw binary data file consisting of 16bit integer values in a file format suitable for LPJmL. 10 | .SH OPTIONS 11 | .TP 12 | \-h 13 | display a short help text 14 | .TP 15 | \-swap 16 | change byte order in grid file 17 | .TP 18 | \-scale s 19 | set scale factor, default is 0.01 20 | .TP 21 | \-cellsize c 22 | set cell size, default is 0.5 23 | .TP 24 | .I gridfile 25 | filename of binary grid data file 26 | .TP 27 | .I clmfile 28 | filename of clm data file written 29 | .SH EXAMPLES 30 | .TP 31 | Create clm data file from grid dataset changing byte order: 32 | .B grid2clm 33 | \-swap grid.bin grid.clm 34 | .PP 35 | .SH EXIT STATUS 36 | .B grid2clm 37 | returns a zero exit status if the clm file is created. 38 | Non zero is returned in case of failure. 39 | 40 | .SH AUTHORS 41 | 42 | For authors and contributors see AUTHORS file 43 | 44 | .SH COPYRIGHT 45 | 46 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 47 | 48 | .SH SEE ALSO 49 | lpjml(1), txt2clm(1), cru2clm(1), clm(5) 50 | -------------------------------------------------------------------------------- /man/man1/headersize.1: -------------------------------------------------------------------------------- 1 | .TH headersize 1 "USER COMMANDS" 2 | .SH NAME 3 | headersize \- print header size of clm files 4 | .SH SYNOPSIS 5 | .B headersize [\-version v] 6 | \fIclmfile\fP ... 7 | .SH DESCRIPTION 8 | File header of clm files is read and size of header in bytes printed. 9 | .SH OPTIONS 10 | .TP 11 | \-version v 12 | version of clm file set to v, by default version is read from file 13 | .TP 14 | .I infile 15 | Filename(s) of clm files 16 | .TP 17 | Print header size of clm data file: 18 | .B headersize 19 | temp_1901-2003.clm 20 | .PP 21 | .SH EXIT STATUS 22 | .B headersize 23 | returns a zero exit status if file header of clm file can be read. 24 | Non zero is returned in case of failure. 25 | 26 | .SH AUTHORS 27 | 28 | For authors and contributors see AUTHORS file 29 | 30 | .SH COPYRIGHT 31 | 32 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 33 | 34 | .SH SEE ALSO 35 | printclm(1), lpjml(1), catclm(1), txt2clm(1), grid2clm(1), cft2clm(1), clm(5) 36 | -------------------------------------------------------------------------------- /man/man1/lpj_paths.csh.1: -------------------------------------------------------------------------------- 1 | .TH lpj_paths.csh 1 "USER COMMANDS" 2 | .SH NAME 3 | lpj_paths.csh \- Set environmental variables used by LPJmL for C shell 4 | .SH SYNOPSIS 5 | . 6 | .B lpj_paths.sh 7 | .SH DESCRIPTION 8 | Script sets environmental variables used by LPJmL. The root directory is defined and the search path for commands and man pages are extended. The call of 9 | .TI 10 | source $LPJROOT/bin/lpj_paths.csh 11 | 12 | should be added to the \fI~./cshrc \fP file. 13 | 14 | .SH AUTHORS 15 | 16 | For authors and contributors see AUTHORS file 17 | 18 | .SH COPYRIGHT 19 | 20 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 21 | 22 | .SH SEE ALSO 23 | lpjml(1), lpj_paths.sh(1) 24 | -------------------------------------------------------------------------------- /man/man1/lpj_paths.sh.1: -------------------------------------------------------------------------------- 1 | .TH lpj_paths.sh 1 "USER COMMANDS" 2 | .SH NAME 3 | lpj_paths.sh \- Set environmental variables used by LPJmL 4 | .SH SYNOPSIS 5 | . 6 | .B lpj_paths.sh 7 | .SH DESCRIPTION 8 | Script sets environmental variables used by LPJmL. The root directory is defined and the search path for commands and man pages are extended. The call of 9 | .TI 10 | . $LPJROOT/bin/lpj_paths.sh 11 | 12 | should be added to the 13 | .I ~./profile 14 | 15 | .SH AUTHORS 16 | 17 | For authors and contributors see AUTHORS file 18 | 19 | .SH COPYRIGHT 20 | 21 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 22 | 23 | .SH SEE ALSO 24 | lpjml(1), lpj_paths.csh(1) 25 | -------------------------------------------------------------------------------- /man/man1/lpjcat.1: -------------------------------------------------------------------------------- 1 | .TH lpjcat 1 "USER COMMANDS" 2 | .SH NAME 3 | lpjcat \- Concatenates restart files from distributed LPJmL simulations. 4 | .SH SYNOPSIS 5 | .B lpjcat 6 | [\-o \fIoutfile\fP] \fIfilename\fP ... 7 | .SH DESCRIPTION 8 | Program concatenates restart files from the LPJmL model to one joint restart file. Is used to create a restart file from distributed runs started by the 9 | .B 10 | lpjdistribute 11 | and 12 | .B lpjdistribute_river 13 | scripts. Program is obsolete for the MPI version of \fBlpjml\fP. 14 | .SH OPTIONS 15 | .TP 16 | \-o \fIoutfile\fP 17 | sets filename of the concatenated restart file. Default is output to stdout. 18 | .TP 19 | .I filename 20 | name of restart file(s). 21 | .SH EXAMPLE 22 | .TP 23 | Concatenates restart files to the file \fIrestart.lpj\fP: 24 | .B lpjcat 25 | \-o restart.lpj restart_*.lpj 26 | .PP 27 | 28 | .SH EXIT STATUS 29 | .B lpjcat 30 | returns a zero exit status if the restart files have been concatenated. 31 | Non zero is returned in case of failure. 32 | 33 | .SH AUTHORS 34 | 35 | For authors and contributors see AUTHORS file 36 | 37 | .SH COPYRIGHT 38 | 39 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 40 | 41 | .SH SEE ALSO 42 | lpjml(1), cat2bsq(1), output_bsq(1) 43 | -------------------------------------------------------------------------------- /man/man1/lpjrun.1: -------------------------------------------------------------------------------- 1 | .TH lpjrun 1 "USER COMMANDS" 2 | .SH NAME 3 | lpjrun \- Run parallel LPJmL program interactively. 4 | .SH SYNOPSIS 5 | .B lpjrun [-hostfile hosts.lists] 6 | ntasks [args ...] 7 | .SH DESCRIPTION 8 | Script runs LPJmL simulation in parallel invoking the 9 | .B mpirun 10 | command. Has been tested on Apple MacOS X and Ubuntu. 11 | .SH OPTIONS 12 | .TP 13 | -hostfile hosts.list 14 | Distribute tasks on hosts specified in the host.lists file. The number of entries in hosts.list must be at least the number of task specified. 15 | .TP 16 | ntasks 17 | set the number of parallel MPI tasks. 18 | .TP 19 | args 20 | set command line arguments for the 21 | .B lpjml 22 | program 23 | .SH EXAMPLES 24 | .TP 25 | Run program job with 8 parallel MPI tasks starting from a restart file: 26 | .B lpjrun 27 | 8 -DFROM_RESTART 28 | .PP 29 | .SH ENVIRONMENT 30 | .TP 31 | LPJROOT 32 | defines the root directory for LPJmL. The variable has to be defined before calling 33 | .B lpjrun 34 | . 35 | 36 | .SH EXIT STATUS 37 | .B lpjrun 38 | returns a zero exit status if LPJmL run fails. 39 | Non zero is returned in case of failure. 40 | 41 | .SH AUTHORS 42 | 43 | For authors and contributors see AUTHORS file 44 | 45 | .SH COPYRIGHT 46 | 47 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 48 | 49 | .SH SEE ALSO 50 | lpjml(1), lpjcheck(1), lpjsubmit(1) 51 | -------------------------------------------------------------------------------- /man/man1/manage2js.1: -------------------------------------------------------------------------------- 1 | .TH manage2js 1 "USER COMMANDS" 2 | .SH NAME 3 | manage2js \- convert management *.par files to JSON file 4 | .SH SYNOPSIS 5 | .B manage2js 6 | .I laimaxfile managefile 7 | .SH DESCRIPTION 8 | Program converts management parameter files into JSON file. Converted file output is redirected to standard output. 9 | .SH OPTIONS 10 | .TP 11 | laimaxfile 12 | Parameter file containing LAImax values for all crop types 13 | .TP 14 | managefile 15 | Parameter file containing LAImax values for temperate cereals and maize and EP and EC values 16 | .SH EXAMPLES 17 | .TP 18 | Create data file for temperature: 19 | .B manage2js 20 | manage_laimax.par manage.par >manage.cjson 21 | .SH EXIT STATUS 22 | .B manage2js 23 | returns a zero exit status if output was converted successfully. 24 | Non zero is returned in case of failure. 25 | 26 | .SH AUTHORS 27 | 28 | See AUTHORS file 29 | 30 | .SH COPYRIGHT 31 | 32 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 33 | 34 | .SH SEE ALSO 35 | bin2cdf(1), country2cdf(1), regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 36 | -------------------------------------------------------------------------------- /man/man1/mergeclm.1: -------------------------------------------------------------------------------- 1 | .TH mergeclm 1 "USER COMMANDS" 2 | .SH NAME 3 | mergeclm \- merge LPJmL climate data files 4 | .SH SYNOPSIS 5 | .B mergeclm [\-v] [\-f] [\-longheader] [\-size4] 6 | \fIinfile\fP ... \fIoutfile\fP 7 | .SH DESCRIPTION 8 | Program merges bands of climate data files in clm format into one clm file. 9 | .SH OPTIONS 10 | .TP 11 | \-v,\--verbose 12 | Print filename and number of bands of each input file 13 | .TP 14 | \-f 15 | Force overwriting of existing output file 16 | .TP 17 | \-longheader 18 | Long (version 2) header assumed for clm files 19 | .TP 20 | \-size4 21 | Size of data is set to 4 bytes for version 2 clm files, default is 2 bytes 22 | .I infile 23 | Filename(s) of clm files to paste. If filename is "zero" one band containing all zero values is added 24 | .TP 25 | .I outfile 26 | Filename of merged clm file 27 | .SH EXAMPLE 28 | .TP 29 | Merge clm data file from 12 clm files: 30 | .B mergeclm temp_1901-2003_01.clm temp_1901-2003_02.clm temp_1901-2003_03.clm temp_1901-2003_04.clm temp_1901-2003_05.clm temp_1901-2003_06.clm temp_1901-2003_07.clm temp_1901-2003_08.clm temp_1901-2003_09.clm temp_1901-2003_10.clm temp_1901-2003_11.clm temp_1901-2003_12.clm temp_1901-2003.clm 31 | .PP 32 | .SH EXIT STATUS 33 | .B mergeclm 34 | returns a zero exit status if the clm file is created. 35 | Non zero is returned in case of failure. 36 | 37 | .SH AUTHORS 38 | 39 | For authors and contributors see AUTHORS file 40 | 41 | .SH COPYRIGHT 42 | 43 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 44 | 45 | .SH SEE ALSO 46 | lpjml(1), cutclm(1), txt2clm(1), grid2clm(1), cft2clm(1), clm(5) 47 | -------------------------------------------------------------------------------- /man/man1/output_bsq.1: -------------------------------------------------------------------------------- 1 | .TH output_bsq 1 "USER COMMANDS" 2 | .SH NAME 3 | output_bsq \- Concatenates all output files from distributed LPJmL simulations. 4 | .SH SYNOPSIS 5 | .B output_bsq 6 | [-outpath \fIdir\fP] [-inpath \fIdir\fP] [-nyear year] 7 | .SH DESCRIPTION 8 | Script concatenates all output files created by the LPJmL model to one output file. It used to join output files from 9 | .B 10 | lpjdistribute 11 | and 12 | .B lpjdistribute_river 13 | scripts. Script is obsolete for the MPI version of \fBlpjml\fP. 14 | .SH OPTIONS 15 | .TP 16 | \-outpath \fIdir\fP 17 | sets directory of the concatenated output files. Default is output. 18 | .TP 19 | \-inpath \fIdir\fP 20 | sets directory of the output files to be joined. Default is output. 21 | .TP 22 | \-nyear n 23 | Number of simulation years. Default is 103. 24 | .SH EXIT STATUS 25 | .B output_bsq 26 | returns a zero exit status if the output files have been concatenated. 27 | Non zero is returned in case of failure. 28 | 29 | .SH AUTHORS 30 | 31 | For authors and contributors see AUTHORS file 32 | 33 | .SH COPYRIGHT 34 | 35 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 36 | 37 | .SH SEE ALSO 38 | lpjml(1), lpjcat(1), cat2bsq(1), lpjdistribute(1), lpjdistribute_river(1)) 39 | -------------------------------------------------------------------------------- /man/man1/printheader.1: -------------------------------------------------------------------------------- 1 | printclm.1 -------------------------------------------------------------------------------- /man/man1/printreservoir.1: -------------------------------------------------------------------------------- 1 | .TH printreservoir 1 "USER COMMANDS" 2 | .SH NAME 3 | printreservoir \- Print contents of reservoir file for LPJmL 4 | .SH SYNOPSIS 5 | .B printreservoir 6 | \fIclmfile\fP ... 7 | 8 | .SH DESCRIPTION 9 | Program prints contents of reservoir file stored in clm data files for LPJmL. 10 | .SH OPTIONS 11 | .I clmfile 12 | filename of reservoir data file 13 | .PP 14 | .SH EXIT STATUS 15 | .B printreservoir 16 | return a zero exit status if clm file could be printed. 17 | Non zero is returned in case of failure. 18 | 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | lpjml(1), printclm(1), printheader(1), cru2clm(1), grid2clm(1), cft2clm(1), lpjprint(1), clm(5) 29 | -------------------------------------------------------------------------------- /man/man1/regridsoil.1: -------------------------------------------------------------------------------- 1 | .TH regridsoil 1 "USER COMMANDS" 2 | .SH NAME 3 | regridsoil \- regrid soil file to new grid 4 | .SH SYNOPSIS 5 | .B regridclm 6 | [\-search] [\-zero] [\-longheader] [\-json] 7 | .I grid_old.clm grid_new.clm soil_old.clm soil_new.clm 8 | .SH DESCRIPTION 9 | Program reads soil file and corresponding grid file to regrid the soil data to a new grid file. 10 | .SH OPTIONS 11 | .TP 12 | \-search 13 | If grid coordinate cannot be found in old grid nearest grid cell is used 14 | .TP 15 | \-zero 16 | If grid coordinate cannot be found in old grid soil code is set to zero 17 | .TP 18 | \-longheader 19 | Version of CLM grid file is set to 2. By default version is read from file header 20 | .TP 21 | \-json 22 | An additional JSON metafile with suffix \fI.json\fP is written. 23 | .TP 24 | .I grid_old.clm 25 | Corresponding grid filename of input data 26 | .TP 27 | .I grid_new.clm 28 | New grid filename data should be regridded to 29 | .TP 30 | .I soil_old.clm 31 | Filename of soil file that should be regridded 32 | .TP 33 | .I soil_new.clm 34 | Filename of soil file where regridded data is written 35 | .SH EXAMPLES 36 | .TP 37 | Regrid soil file to the grid file of the amazon basin: 38 | .B regridclm 39 | grid.clm grid_amazon.clm soil.bin soil_amazon.bin 40 | .SH EXIT STATUS 41 | Non zero is returned in case of failure. 42 | 43 | .SH AUTHORS 44 | 45 | For authors and contributors see AUTHORS file 46 | 47 | .SH COPYRIGHT 48 | 49 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 50 | 51 | .SH SEE ALSO 52 | regridlpj(1), regridclm(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 53 | -------------------------------------------------------------------------------- /man/man1/setclm.1: -------------------------------------------------------------------------------- 1 | .TH setclm 1 "USER COMMANDS" 2 | .SH NAME 3 | setclm \- set value for specified record in header of clm files for LPJmL 4 | .SH SYNOPSIS 5 | .B setclm 6 | {id|version|order|firstyear|nyear|firstcell|ncell|nbands|nstep|scalar|type|cellsize|cellsize_lon|cellsize_lat} \fIvalue\fP \fIclmfile\fP 7 | 8 | .SH DESCRIPTION 9 | Program sets file header and data stored in clm data files for LPJmL. 10 | .SH OPTIONS 11 | .TP 12 | {id|version|order|firstyear|nyear|firstcell|ncell|nbands|nstep|scalar|type|cellsize_lon|cellsize_lat} 13 | Define record to be set 14 | .TP 15 | .I value 16 | value written in clm file 17 | .TP 18 | .I clmfile 19 | filename of clm data file 20 | .SH EXAMPLE 21 | .TP 22 | Set version of clm file to 2: 23 | .B setclm 24 | version 2 tmp.clm 25 | .PP 26 | .SH EXIT STATUS 27 | .B setclm 28 | return a zero exit status if value in clm file could be set. 29 | Non zero is returned in case of failure. 30 | 31 | .SH AUTHORS 32 | 33 | For authors and contributors see AUTHORS file 34 | 35 | .SH COPYRIGHT 36 | 37 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 38 | 39 | .SH SEE ALSO 40 | printclm(1), printheader(1), headersize(1), cru2clm(1), grid2clm(1), cft2clm(1), clm(5) 41 | -------------------------------------------------------------------------------- /man/man1/soil2cdf.1: -------------------------------------------------------------------------------- 1 | .TH soil2cdf 1 "USER COMMANDS" 2 | .SH NAME 3 | soil2cdf \- convert binary files into NetCDF files 4 | .SH SYNOPSIS 5 | .B soil2cdf 6 | [\-global] [\-cellsize size] [\-compress level] [\-descr d] 7 | .I varname gridfile soilfile netcdffile 8 | .SH DESCRIPTION 9 | Program converts binary input files into NetCDF file. 10 | .SH OPTIONS 11 | .TP 12 | \-global 13 | use global grid for NetCDF file 14 | .TP 15 | \-cellsize size 16 | set cell size in grid file to size 17 | .TP 18 | \-compress level 19 | compression level for NetCDF4 files 20 | .TP 21 | \-descr d 22 | set long name in NetCDF file 23 | .TP 24 | varname 25 | variable name in NetCDF file 26 | .TP 27 | .I gridfile 28 | filename of grid data file 29 | .TP 30 | .I soilfile 31 | filename of binary soil data file 32 | .TP 33 | .I netcdffile 34 | filename of NetCDF file created 35 | .SH EXAMPLES 36 | .TP 37 | Create data file for soil: 38 | .B soil2cdf 39 | soilcode grid.bin soil.bin soil.nc 40 | .PP 41 | .SH EXIT STATUS 42 | .B soil2cdf 43 | returns a zero exit status if the NetCDF file is created. 44 | Non zero is returned in case of failure. 45 | 46 | .SH AUTHORS 47 | 48 | For authors and contributors see AUTHORS file 49 | 50 | .SH COPYRIGHT 51 | 52 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 53 | 54 | .SH SEE ALSO 55 | clm2cdf(1), country2cdf(1), bin2cdf(1), regridlpj(1), lpjml(1), txt2clm(1), cru2clm(1), clm(5) 56 | -------------------------------------------------------------------------------- /man/man1/statclm.1: -------------------------------------------------------------------------------- 1 | .TH statclm 1 "USER COMMANDS" 2 | .SH NAME 3 | statclm \- print statistics of clm files 4 | .SH SYNOPSIS 5 | .B statclm 6 | [-metafile] [-scale s] [-version] [-verbose] [-csv] [-type {byte|short|int|float|double}] \fIfile.clm ...\fP 7 | 8 | .SH DESCRIPTION 9 | Program prints minimum, maximum and average of all data in a clm file. 10 | .SH OPTIONS 11 | .TP 12 | -metafile 13 | File is a JSON metafile describing the structure of the binary file 14 | .TP 15 | -scale s 16 | Values are scaled by a factor s if version of clm file is less than 2 17 | .TP 18 | -version v 19 | Set version of clm file to v. If not specified version is read from clm file 20 | .TP 21 | -type {byte|short|int|float|double} 22 | Set datatype of clm file if version of clm file is less than 3. Default is short 23 | .TP 24 | -verbose 25 | Print statistics for each year 26 | .TP 27 | -csv 28 | Print statistics in a comma-separated format 29 | .TP 30 | .I file.clm 31 | filename(s) of clm files 32 | .SH EXAMPLE 33 | .TP 34 | Print statistics for each year: 35 | .B statclm 36 | -verbose temp.clm 37 | .PP 38 | .SH EXIT STATUS 39 | .B statclm 40 | return a zero exit status if statistics of clm file could be printed. 41 | Non zero is returned in case of failure. 42 | 43 | .SH AUTHORS 44 | 45 | For authors and contributors see AUTHORS file 46 | 47 | .SH COPYRIGHT 48 | 49 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 50 | 51 | .SH SEE ALSO 52 | printclm(1), setclm(1), headersize(1), lpjml(1), cru2clm(1), grid2clm(1), cft2clm(1), clm(5) 53 | -------------------------------------------------------------------------------- /man/man3/close_image.3: -------------------------------------------------------------------------------- 1 | .TH close_image 3 "LPJmL programmers manual" 2 | .SH NAME 3 | close_image \- Closes socket connection to IMAGE model 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void close_image(const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes communication channel to IMAGE model. Function is only available if LPJmL was compiled with -DIMAGE flag. 13 | The argument of \fBclose_image\fP is: 14 | .TP 15 | .I config 16 | LPJmL configuration data. Must be initialized by \fBinitmpiconfig()\fP or \fBinitconfig()\fP and read by \fBreadconfig()\fP. 17 | .SH RETURN VALUE 18 | None. 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | initmpiconfig(3), initconfig(3), open_image(3) 29 | -------------------------------------------------------------------------------- /man/man3/close_socket.3: -------------------------------------------------------------------------------- 1 | .TH close_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | closeint_socket \- close open socket 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | void close_socket(Socket *\fIsocket\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function closes open socket. 14 | The argument of \fBclose_socket\fP is: 15 | .TP 16 | .I socket 17 | Pointer to socket. Socket must be opened by \fBopen_socket()\fP or \fBconnect_socket()\fP. 18 | .SH RETURN VALUE 19 | None. 20 | 21 | .SH AUTHORS 22 | 23 | For authors and contributors see AUTHORS file 24 | 25 | .SH COPYRIGHT 26 | 27 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 28 | 29 | .SH SEE ALSO 30 | open_socket(3), connect_socket(3) 31 | -------------------------------------------------------------------------------- /man/man3/connect_socket.3: -------------------------------------------------------------------------------- 1 | .TH connect_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | connect_socket \- connects to server socket 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | Socket *connect_socket(const char *\fIhostname\fB,int \fIport\fB,int \fIwait\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | The arguments of \fBconnect_socket\fP are: 14 | .TP 15 | .I hostname 16 | Set name of host to connect. 17 | .TP 18 | .I port 19 | Set port number of TCP/IP connection. 20 | .TP 21 | .I wait 22 | Set maximum time to wait for connection (sec). . 23 | .SH RETURN VALUE 24 | Pointer to socket is returned on success and NULL in case of failure. 25 | 26 | .SH AUTHORS 27 | 28 | For authors and contributors see AUTHORS file 29 | 30 | .SH COPYRIGHT 31 | 32 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 33 | 34 | .SH SEE ALSO 35 | close_socket(3), open_socket(3) 36 | -------------------------------------------------------------------------------- /man/man3/failonerror.3: -------------------------------------------------------------------------------- 1 | .TH failonerror 3 "LPJmL programmers manual" 2 | .SH NAME 3 | failonerror \- Prints error message and terminates program 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void failonerror(const Config *\fIconfig\fB,int \fIrc\fB,int \fIerrcode\fB,const char *\fImsg\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function writes out error message and terminates program. The parallel version checks the return code on all tasks and prints error message only on task zero. 13 | The arguments of \fBfailonerror\fP are: 14 | .TP 15 | .I config 16 | LPJmL configuration data. Must be initialized by \fBinitmpiconfig()\fP or \fBinitconfig()\fP. 17 | .TP 18 | .I rc 19 | Return code of last function call. Program will be terminated if value on any task is greater than zero. 20 | .TP 21 | .I errcode 22 | Value returned from main program. 23 | .TP 24 | .I msg 25 | Error message printed on error stream. 26 | 27 | .SH RETURN VALUE 28 | None. 29 | .SH AUTHORS 30 | 31 | For authors and contributors see AUTHORS file 32 | 33 | .SH COPYRIGHT 34 | 35 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 36 | 37 | .SH SEE ALSO 38 | initconfig(3), initmpiconfig(3) 39 | -------------------------------------------------------------------------------- /man/man3/fcloseoutput.3: -------------------------------------------------------------------------------- 1 | .TH fcloseoutput 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fcloseoutput \- closes LPJmL output files 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void fcloseoutput(Outputfile *\fIoutput\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes output files specified in the LPJmL configuration. 13 | The arguments of \fBfcloseoutput\fP are: 14 | .TP 15 | .I output 16 | Pointer to output data opened by \fBfopenoutput\fP. 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .SH RETURN VALUE 21 | None 22 | .SH AUTHORS 23 | 24 | For authors and contributors see AUTHORS file 25 | 26 | .SH COPYRIGHT 27 | 28 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 29 | 30 | .SH SEE ALSO 31 | fopenoutput(3), isopen(3), readconfig(3) 32 | -------------------------------------------------------------------------------- /man/man3/fopenoutput.3: -------------------------------------------------------------------------------- 1 | .TH fopenoutput 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fopenoutput \- creates LPJmL output files 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Outputfile *fopenoutput(const Cell \fIgrid[]\fB,int \fInout\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function creates and opens output files specified in the LPJmL configuration. 13 | The arguments of \fBfopenoutput\fP are: 14 | .TP 15 | .I grid 16 | Pointer to LPJmL grid. Must be initialized by \fBnewgrid()\fP. 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .TP 21 | .I nout 22 | Maximum number of output files. 23 | .SH RETURN VALUE 24 | Upon successful completion pointer to allocated output data is returned or NULL in case of failure. 25 | .SH AUTHORS 26 | 27 | For authors and contributors see AUTHORS file 28 | 29 | .SH COPYRIGHT 30 | 31 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 32 | 33 | .SH SEE ALSO 34 | fcloseoutput(3), readconfig(3), newgrid(3), iterate(3), isopen(3) 35 | -------------------------------------------------------------------------------- /man/man3/fprintconfig.3: -------------------------------------------------------------------------------- 1 | .TH fprintconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fprintconfig, printconfig \- Print LPJmL configuration 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void fprintconfig(FILE *\fIfile\fB,const Config *\fIconfig\fB); 9 | void printconfig(const Config *\fIconfig\fB); 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function prints LPJmL configuration. \fBprintconfig()\fP writes output to standard output. 14 | The arguments of \fBfprintconfig\fP are: 15 | .TP 16 | .I file 17 | File pointer to output stream. 18 | .TP 19 | .I config 20 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 21 | .SH RETURN VALUE 22 | None. 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | readconfig(3), initmpiconfig(3), initconfig(3),freeconfig(3) 33 | -------------------------------------------------------------------------------- /man/man3/fprintflux.3: -------------------------------------------------------------------------------- 1 | .TH fprintflux 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fprintflux, printflux \- Print global carbon and water fluxes 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void fprintflux(FILE *\fIfile\fB,Flux \fIflux\fB,Real cflux_total\fB,const Config *\fIconfig\fB); 9 | void printflux(Flux \fIflux\fB,Real \fIcflux_total\fB,const Config *\fIconfig\fB); 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function prints global carbon and water fluxes. \fBprintflux()\fP writes output to standard output. 14 | The arguments of \fBfprintflux\fP are: 15 | .TP 16 | .I file 17 | File pointer to output stream. 18 | .TP 19 | .I flux 20 | Global carbon and water fluxes. Must be calculated by \fBflux_sum()\fP. 21 | .TP 22 | .I cflux_total 23 | Total flux of carbon. Must be calculated by \fBflux_sum()\fP. 24 | .TP 25 | .I config 26 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 27 | .SH RETURN VALUE 28 | None. 29 | .SH AUTHORS 30 | 31 | For authors and contributors see AUTHORS file 32 | 33 | .SH COPYRIGHT 34 | 35 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 36 | 37 | .SH SEE ALSO 38 | flux_sum(3), readconfig(3) 39 | -------------------------------------------------------------------------------- /man/man3/freeclimate.3: -------------------------------------------------------------------------------- 1 | .TH freeclimate 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freeclimate \- Closes files and deallocates climate data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freeclimate(Climate *\fIclimate\fB,Bool \fIisroot\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes open files and deallocates climate data. 13 | The argument of \fBfreeclimate\fP is: 14 | .TP 15 | .I climate 16 | Pointer to climate data. Must be initialized by \fBinitclimate()\fP. 17 | .TP 18 | .I isroot 19 | task is root task. 20 | .SH RETURN VALUE 21 | None. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | initclimate(3), getclimate(3) 33 | -------------------------------------------------------------------------------- /man/man3/freeconfig.3: -------------------------------------------------------------------------------- 1 | .TH freeconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freeconfig \- Deallocate memory for LPJmL configuration 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freeconfig(Config *\fIconfig\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function deallocates memory for LPJmL configuration. 13 | The argument of \fBfreeconfig\fP is: 14 | .TP 15 | .I config 16 | LPJmL configuration data. 17 | .SH RETURN VALUE 18 | None. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | readconfig(3), initconfig(3), initmpiconfig(3) 30 | -------------------------------------------------------------------------------- /man/man3/freegrid.3: -------------------------------------------------------------------------------- 1 | .TH freegrid 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freegrid \- Deallocate memory of LPJmL grid 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freegrid(Cell \fIgrid\fB[],int \fInpft\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function deallocates memory of LPJmL grid. 13 | The arguments of \fBfreegrid\fP are: 14 | .TP 15 | .I grid 16 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 17 | .TP 18 | .I npft 19 | Number of natural plant functionial types. 20 | .TP 21 | .I config 22 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 23 | .SH RETURN VALUE 24 | None 25 | .SH AUTHORS 26 | 27 | For authors and contributors see AUTHORS file 28 | 29 | .SH COPYRIGHT 30 | 31 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 32 | 33 | .SH SEE ALSO 34 | readconfig(3), newgrid(3) 35 | -------------------------------------------------------------------------------- /man/man3/freeinput.3: -------------------------------------------------------------------------------- 1 | .TH freeinput 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freeinput \- Closes files and deallocates input data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freeinput(Input \fIinput\fB,Bool \fIisroot\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes open files and deallocates input data. 13 | The argument of \fBfreeinput\fP is: 14 | .TP 15 | .I input 16 | Pointer to input data. Must be initialized by \fBinitinput()\fP. 17 | .TP 18 | .I isroot 19 | task is root task. 20 | .SH RETURN VALUE 21 | None. 22 | .SH AUTHORS 23 | 24 | For authors and contributors see AUTHORS file 25 | 26 | .SH COPYRIGHT 27 | 28 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 29 | 30 | .SH SEE ALSO 31 | initinput(3), freeclimate(3), freelanduse(3), freewateruse(3) 32 | -------------------------------------------------------------------------------- /man/man3/freelanduse.3: -------------------------------------------------------------------------------- 1 | .TH freelanduse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freelanduse \- Closes file and deallocates land use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freelanduse(Landuse \fIlanduse\fB,const Config *\fIconfig\fB)); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes open file and deallocates land use data. 13 | The arguments of \fBfreelanduse\fP are: 14 | .TP 15 | .I landuse 16 | Pointer to land use data. Must be initialized by \fBinitlanduse()\fP. 17 | .TP 18 | .I config 19 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .SH RETURN VALUE 21 | None. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | initlanduse(3), getlanduse(3) 33 | -------------------------------------------------------------------------------- /man/man3/freepopdens.3: -------------------------------------------------------------------------------- 1 | .TH freepodens 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freepopdens \- Closes file and deallocates population density data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freepopdens(Popdens \fIpopdens\fB,Bool \fIisroot\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes open file and deallocates population density data. 13 | The arguments of \fBfreepopdens\fP are: 14 | .TP 15 | .I popdens 16 | Pointer to population density data. Must be initialized by \fBinitpopdens()\fP. 17 | .TP 18 | .I isroot 19 | task is root task. 20 | .SH RETURN VALUE 21 | None. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | initpopdens(3), readpopdens(3), getpopdens(3) 33 | -------------------------------------------------------------------------------- /man/man3/freewateruse.3: -------------------------------------------------------------------------------- 1 | .TH freewateruse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | freewateruse \- Closes file and deallocates water use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void freewateruse(Wateruse \fIwateruse\fB,Bool \fIisroot\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function closes open file and deallocates water use data. 13 | The arguments of \fBfreewateruse\fP are: 14 | .TP 15 | .I wateruse 16 | Pointer to water use data. Must be initialized by \fBinitwateruse()\fP. 17 | .TP 18 | .I isroot 19 | task is root task. 20 | .SH RETURN VALUE 21 | None. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | initwateruse(3), getwateruse(3) 33 | -------------------------------------------------------------------------------- /man/man3/fwriterestart.3: -------------------------------------------------------------------------------- 1 | .TH fwriterestart 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fwriterestart \- write restart file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool fwriterestart(const Cell \fIgrid\fB[], 9 | int \fInpft\fB,int \fIncft\fB, 10 | int \fIyear\fB, 11 | const char *\fIfilename\fB, 12 | const Config *\fIconfig\fB 13 | );\fP 14 | 15 | .fi 16 | .SH DESCRIPTION 17 | Function writes restart file LPJmL. 18 | The arguments of \fBfwriterestart\fP are: 19 | .TP 20 | .I grid 21 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 22 | .TP 23 | .I npft 24 | Number of natural plant functional types. 25 | .TP 26 | .I ncft 27 | Number of crop plant functional types. 28 | .TP 29 | .I year 30 | year restart file is written. 31 | .TP 32 | .I filename 33 | filename of restart file. 34 | .TP 35 | .I config 36 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 37 | .SH RETURN VALUE 38 | Upon successful completion FALSE is returned and TRUE on error. 39 | 40 | .SH AUTHORS 41 | 42 | For authors and contributors see AUTHORS file 43 | 44 | .SH COPYRIGHT 45 | 46 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 47 | 48 | .SH SEE ALSO 49 | readconfig(3), newgrid(3), iterate(3) 50 | -------------------------------------------------------------------------------- /man/man3/getclimate.3: -------------------------------------------------------------------------------- 1 | .TH getclimate 3 "LPJmL programmers manual" 2 | .SH NAME 3 | getclimate \- get climate data for specified year 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool getclimate(Climate *\fIclimate\fB,const Cell \fIgrid[]\fB,int \fI year\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function gets climate data for specified year. 13 | The arguments of \fBgetclimate\fP are: 14 | .TP 15 | .I climate 16 | Pointer to climate data. Must be initialized by \fBinitclimate()\fP. 17 | .TP 18 | .I grid 19 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 20 | .TP 21 | .I year 22 | year climate data is read. 23 | .TP 24 | .I config 25 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 26 | .SH RETURN VALUE 27 | Upon successful read FALSE is returned and TRUE in case of failure. 28 | 29 | .SH AUTHORS 30 | 31 | For authors and contributors see AUTHORS file 32 | 33 | .SH COPYRIGHT 34 | 35 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 36 | 37 | .SH SEE ALSO 38 | initclimate(3), freeclimate(3), getco2(3), readconfig(3), iterate(3) 39 | -------------------------------------------------------------------------------- /man/man3/getco2.3: -------------------------------------------------------------------------------- 1 | .TH getco2 3 "LPJmL programmers manual" 2 | .SH NAME 3 | getco2 \- get atmospheric CO2 concentration 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool getco2(const Climate *\fIclimate\fB,Real *\fIco2\fB,int \fI year\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function gets atmospheric CO2 concentration for specified year. 13 | The arguments of \fBgetco2\fP are: 14 | .TP 15 | .I climate 16 | Pointer to climate data. Must be initialized by \fBinitclimate()\fP. 17 | .TP 18 | .I pco2 19 | pointer to real where atmospheric CO2 concentration (ppmv) is stored. 20 | .TP 21 | .I year 22 | year CO2 data is read. 23 | .SH RETURN VALUE 24 | Upon successful completion FALSE is returned and TRUE in case of error. 25 | 26 | .SH AUTHORS 27 | 28 | For authors and contributors see AUTHORS file 29 | 30 | .SH COPYRIGHT 31 | 32 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 33 | 34 | .SH SEE ALSO 35 | initclimate(3), freeclimate(3), getclimate(3) 36 | -------------------------------------------------------------------------------- /man/man3/getlanduse.3: -------------------------------------------------------------------------------- 1 | .TH getlanduse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | getlanduse \- Get land use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool getlanduse(Landuse \fIlanduse\fB,Cell \fIgrid[]\fB,int \fIyear\fB,int \fIactual_year\fB,int \fIncft\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function reads land use data for specified year. 13 | The arguments of \fBgetlanduse\fP are: 14 | .TP 15 | .I landuse 16 | Pointer to land use data. Must be initialized by \fBinitlanduse()\fP. 17 | .TP 18 | .I grid 19 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 20 | .TP 21 | .I year 22 | Sets year land use is read. 23 | .TP 24 | .I actual_year 25 | The actual year of simulation. 26 | .TP 27 | .I ncft 28 | Number of crop plant functional types. 29 | .TP 30 | .I config 31 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 32 | .SH RETURN VALUE 33 | Upon successful completion FALSE is returned and TRUE on error. 34 | 35 | .SH AUTHORS 36 | 37 | For authors and contributors see AUTHORS file 38 | 39 | .SH COPYRIGHT 40 | 41 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 42 | 43 | .SH SEE ALSO 44 | readconfig(3), initlanduse(3), freelanduse(3) 45 | -------------------------------------------------------------------------------- /man/man3/getpopdens.3: -------------------------------------------------------------------------------- 1 | .TH getpodens 3 "LPJmL programmers manual" 2 | .SH NAME 3 | getpopdens \- Get population density data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Real getpopdens(const Popdens \fIpopdens\fB,int \fIcell\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns population density data for specified cell. 13 | The arguments of \fBgetpopdens\fP are: 14 | .TP 15 | .I popdens 16 | Pointer to population density data. Must be initialized by \fBinitpopdens()\fP and 17 | read by \fBreadpopdens()\fP. 18 | .TP 19 | .I cell 20 | cell index 21 | .SH RETURN VALUE 22 | Population density in capita/km2 is returned. 23 | 24 | .SH AUTHORS 25 | 26 | For authors and contributors see AUTHORS file 27 | 28 | .SH COPYRIGHT 29 | 30 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 31 | 32 | .SH SEE ALSO 33 | initpopdens(3), readpopdens(3), freepopdens(3) 34 | -------------------------------------------------------------------------------- /man/man3/getwateruse.3: -------------------------------------------------------------------------------- 1 | .TH getwateruse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | getwateruse \- Get water use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool getwateruse(Wateruse \fIwateruse\fB,Cell \fIgrid[]\fB,int \fIyear\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function reads water use data for specified year. 13 | The arguments of \fBgetwateruse\fP are: 14 | .TP 15 | .I wateruse 16 | Pointer to water use data. Must be initialized by \fBinitwateruse()\fP. 17 | .TP 18 | .I grid 19 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 20 | .TP 21 | .I year 22 | Sets year water use data is read. 23 | .TP 24 | .I config 25 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 26 | 27 | .SH RETURN VALUE 28 | Upon successful completion FALSE is returned and TRUE on error. 29 | 30 | .SH AUTHORS 31 | 32 | For authors and contributors see AUTHORS file 33 | 34 | .SH COPYRIGHT 35 | 36 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 37 | 38 | .SH SEE ALSO 39 | readconfig(3), initwateruse(3), freewateruse(3), newgrid(3) 40 | -------------------------------------------------------------------------------- /man/man3/initclimate.3: -------------------------------------------------------------------------------- 1 | .TH initclimate 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initclimate \- initialize climate data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Climate *initclimate(const Cell \fIgrid[]\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes climate data and opens related files specified in the LPJmL configuration. 13 | The arguments of \fBinitclimate\fP are: 14 | .TP 15 | .I grid 16 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .SH RETURN VALUE 21 | Upon successful completion pointer to allocated climate data is returned and NULL in case of failure. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | getclimate(3), freeclimate(3), readconfig(3), iterate(3) 33 | -------------------------------------------------------------------------------- /man/man3/initconfig.3: -------------------------------------------------------------------------------- 1 | .TH initconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initconfig \- Initialize LPJmL configuration for the sequential version 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void initconfig(Config *\fIconfig\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes LPJmL configuration. 13 | The argument of \fBinitconfig\fP is: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. 17 | .SH RETURN VALUE 18 | None. 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | readconfig(3), initmpiconfig(3), freeconfig(3) 29 | -------------------------------------------------------------------------------- /man/man3/initdrain.3: -------------------------------------------------------------------------------- 1 | .TH initdrain 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initdrain \- initialize river routing network 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool initdrain(Cell \fIgrid\fB[],Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes river routing network. 13 | The arguments of \fBinitdrain\fP are: 14 | .TP 15 | .I grid 16 | Cell grid array initialized by \fBnewgrid()\fP. 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .SH RETURN VALUE 21 | Upon successful completion FALSE is returned and TRUE in case of failure. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | newgrid(3), readconfig(3), iterate(3) 33 | -------------------------------------------------------------------------------- /man/man3/initinput.3: -------------------------------------------------------------------------------- 1 | .TH initinput 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initinput \- initialize input data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool initinput(Input *\fIinput\fB,const Cell \fIgrid[]\fB,int \fIncft\fB,const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes input data and opens related files specified in the LPJmL configuration. 13 | The arguments of \fBinitinput\fP are: 14 | .TP 15 | .I input 16 | Pointer to input to be initialized. 17 | .TP 18 | .I grid 19 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 20 | .TP 21 | .I ncft 22 | Number of crop plant functional types. 23 | .TP 24 | .I config 25 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 26 | .SH RETURN VALUE 27 | Upon successful completion FALSE is returned and TRUE in case of failure. 28 | 29 | .SH AUTHORS 30 | 31 | For authors and contributors see AUTHORS file 32 | 33 | .SH COPYRIGHT 34 | 35 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 36 | 37 | .SH SEE ALSO 38 | freeinput(3), initclimate(3), initlanduse(3), initwateruse(3), initpopdens(3), freeclimate(3), readconfig(3), iterate(3) 39 | -------------------------------------------------------------------------------- /man/man3/initlanduse.3: -------------------------------------------------------------------------------- 1 | .TH initlanduse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initlanduse \- initialize land use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Landuse initlanduse(const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes land use data and opens related files specified in the LPJmL configuration. 13 | The argument of \fBinitlanduse\fP is: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 17 | .SH RETURN VALUE 18 | Upon successful completion pointer to allocated land use data is returned and NULL in case of failure. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | freelanduse(3), getlanduse(3), readconfig(3), iterate(3) 30 | -------------------------------------------------------------------------------- /man/man3/initmpiconfig.3: -------------------------------------------------------------------------------- 1 | .TH initmpiconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initmpiconfig \- Initialize LPJmL configuration for the MPI version 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void initmpiconfig(Config *\fIconfig\fB,MPI_Comm \fIcomm\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes LPJmL configuration and determines the number of tasks and rank. 13 | The arguments of \fBinitmpiconfig\fP are: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. 17 | .TP 18 | .I comm 19 | MPI communicator. Use MPI_COMM_WORLD to use all processors. 20 | .SH RETURN VALUE 21 | None 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | readconfig(3), initconfig(3), freeconfig(3) 33 | -------------------------------------------------------------------------------- /man/man3/initpopdens.3: -------------------------------------------------------------------------------- 1 | .TH initpopdens 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initpopdens \- initialize population density data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Popdens initpopdens(const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes population density data and opens related files specified in the LPJmL configuration. 13 | The argument of \fBinitpopdens\fP is: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 17 | .SH RETURN VALUE 18 | Upon successful completion pointer to allocated population density data is returned and NULL in case of failure. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | freepopdens(3), getpopdens(3), readconfig(3) 30 | -------------------------------------------------------------------------------- /man/man3/initwateruse.3: -------------------------------------------------------------------------------- 1 | .TH initwateruse 3 "LPJmL programmers manual" 2 | .SH NAME 3 | initwateruse \- initialize water use data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Wateruse initwateruse(const Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes water use data and opens related files specified in the LPJmL configuration. 13 | The argument of \fBinitwateruse\fP is: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 17 | .SH RETURN VALUE 18 | Upon successful completion pointer to allocated water use data is returned and NULL in case of failure. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | getwateruse(3), freewateruse(3), readconfig(3), iterate(3) 30 | -------------------------------------------------------------------------------- /man/man3/isopen.3: -------------------------------------------------------------------------------- 1 | .TH isopen 3 "LPJmL programmers manual" 2 | .SH NAME 3 | isopen \- Determines whether output file is open 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool isopen(const Outputfile *\fIoutput\fB,int \fIindex\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function determines whether output data file has been successfully opened. 13 | The arguments of \fBisopen\fP are: 14 | .TP 15 | .I output 16 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 17 | .TP 18 | .I index 19 | Index of output data file to be checked. 20 | .SH RETURN VALUE 21 | Function returns TRUE if output for \fIindex\fP has been opened, FALSE otherwise. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | fopenoutput(3), fcloseoutput(3) 33 | -------------------------------------------------------------------------------- /man/man3/isroot.3: -------------------------------------------------------------------------------- 1 | .TH isroot 3 "LPJmL programmers manual" 2 | .SH NAME 3 | isroot \- Determines whether task is root task 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool isroot(Config \fIconfig\fB); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function determines whether MPI task is root task. Returns always TRUE in the sequential version. Is implemented as a macro. 13 | The argument of \fBisroot\fP is: 14 | .TP 15 | .I config 16 | LPJmL configuration data. Must be initialized by \fBinitmpiconfig()\fP or \fBinitconfig()\fP. 17 | .SH RETURN VALUE 18 | Returns TRUE if MPI task is root task, FALSE otherwise. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | initconfig(3) 30 | -------------------------------------------------------------------------------- /man/man3/iterate.3: -------------------------------------------------------------------------------- 1 | .TH iterate 3 "LPJmL programmers manual" 2 | .SH NAME 3 | iterate \- Main time loop for LPJmL 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | int iterate(Outputfile *\fIoutput\fB, 9 | Cell \fIgrid\fB[], 10 | Input \fIinput\fB, 11 | int \fInpft\fB, int \fIncft\fB, 12 | Config *\fIconfig\fB 13 | );\fP 14 | 15 | .fi 16 | .SH DESCRIPTION 17 | Function provides main time loop for LPJmL. In each time step the global carbon and water fluxes are printed. 18 | The arguments of \fBiterate\fP are: 19 | .TP 20 | .I output 21 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 22 | .TP 23 | .I grid 24 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 25 | .TP 26 | .I input 27 | Input data initialized by \fBinitinput()\fP. 28 | .TP 29 | .I npft 30 | Number of natural plant functional types. 31 | .TP 32 | .I ncft 33 | Number of crop plant functional types. 34 | .TP 35 | .I config 36 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 37 | .SH RETURN VALUE 38 | Upon successful completion the last simulation year +1 is returned. 39 | 40 | .SH AUTHORS 41 | 42 | For authors and contributors see AUTHORS file 43 | 44 | .SH COPYRIGHT 45 | 46 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 47 | 48 | .SH SEE ALSO 49 | readconfig(3), fopenoutput(3), newgrid(3), initinput(3), iterateyear(3), fwriterestart(3), flux_sum(3), fprintflux(3) 50 | -------------------------------------------------------------------------------- /man/man3/iterateyear.3: -------------------------------------------------------------------------------- 1 | .TH iterateyear 3 "LPJmL programmers manual" 2 | .SH NAME 3 | iterateyear \- year time loop for LPJmL 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void iterateyear(Outputfile *\fIoutput\fB, 9 | Cell \fIgrid\fB[], 10 | Input \fIinput\fB, 11 | Real \fIco2\fB, 12 | int \fInpft\fB, int \fIncft\fB, 13 | int \fIyear\fB, 14 | const Config *\fIconfig\fB 15 | );\fP 16 | 17 | .fi 18 | .SH DESCRIPTION 19 | Function performs year time loop for LPJmL 20 | The arguments of \fBiterateyear\fP are: 21 | .TP 22 | .I output 23 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 24 | .TP 25 | .I grid 26 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 27 | .TP 28 | .I input 29 | Input data initialized by \fBinitinput()\fP. 30 | .TP 31 | .I co2 32 | Atmospheric CO2 concentration (ppmv). 33 | .TP 34 | .I npft 35 | Number of natural plant functional types. 36 | .TP 37 | .I ncft 38 | Number of crop plant functional types. 39 | .TP 40 | .I year 41 | Simulation year 42 | .TP 43 | .I config 44 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 45 | .SH RETURN VALUE 46 | None 47 | 48 | .SH AUTHORS 49 | 50 | For authors and contributors see AUTHORS file 51 | 52 | .SH COPYRIGHT 53 | 54 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 55 | 56 | .SH SEE ALSO 57 | readconfig(3), fopenoutput(3), newgrid(3), initinput(3), getlanduse(3), getclimate(3), iterate(3) 58 | -------------------------------------------------------------------------------- /man/man3/newgrid.3: -------------------------------------------------------------------------------- 1 | .TH newgrid 3 "LPJmL programmers manual" 2 | .SH NAME 3 | newgrid \- Allocates LPJ grid cells 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Cell *newgrid(Config *\fIconfig\fB,const Standtype \fIstandtype\fB[], 9 | int \fInstand\fB,int \fInpft\fB,int \fIncft\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function allocates grid cells and reads soil code, 14 | country code and coordinates. If restart filename is set state 15 | of grid cells is recovered from a restart file. 16 | The arguments of \fBnewgrid\fP are: 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be read by \fBreadconfig()\fP. 20 | .TP 21 | .I standtype 22 | Array of stand type definitions. 23 | .TP 24 | .I nstand 25 | Number of stand types. 26 | .TP 27 | .I npft 28 | Number of natural plant functional types. 29 | .TP 30 | .I ncft 31 | Number of crop plant functional types. 32 | .SH RETURN VALUE 33 | Upon successful completion pointer to allocated grid is returned and NULL in case of failure. 34 | 35 | .SH AUTHORS 36 | 37 | For authors and contributors see AUTHORS file 38 | 39 | .SH COPYRIGHT 40 | 41 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 42 | 43 | .SH SEE ALSO 44 | readconfig(3), freegrid(3) 45 | -------------------------------------------------------------------------------- /man/man3/open_image.3: -------------------------------------------------------------------------------- 1 | .TH open_image 3 "LPJmL programmers manual" 2 | .SH NAME 3 | open_image \- Opens socket connection to IMAGE model 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool open_image(Config *\fIconfig\fB);\fP 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function opens communication channel to IMAGE model. Function is only available if LPJmL was compiled with -DIMAGE flag. 13 | The argument of \fBopen_image\fP is: 14 | .TP 15 | .I config 16 | Pointer to LPJmL configuration data. Must be initialized by \fBinitmpiconfig()\fP or \fBinitconfig()\fP and read by \fBreadconfig()\fP. 17 | .SH RETURN VALUE 18 | Upon successful completion FALSE is returned and TRUE in case of error. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | initmpiconfig(3), initconfig(3), close_image(3) 30 | -------------------------------------------------------------------------------- /man/man3/open_socket.3: -------------------------------------------------------------------------------- 1 | .TH open_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | open_socket \- opens server socket and starts listening 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | Socket *open_socket(int \fIport\fB,int \fIwait\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | The arguments of \fBopen_socket\fP are: 14 | .TP 15 | .I port 16 | Set port number of TCP/IP connection. 17 | .TP 18 | .I wait 19 | Set maximum time to wait for connection (sec). If zero wait for unlimited time. 20 | .SH RETURN VALUE 21 | Pointer to socket is returned on success and NULL in case of failure. 22 | 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | .SH SEE ALSO 31 | close_socket(3), connect_socket(3) 32 | -------------------------------------------------------------------------------- /man/man3/pnet_dup.3: -------------------------------------------------------------------------------- 1 | .TH pnet_dup 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_dup \- Duplicate network 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | Pnet *pnet_dup(const Pnet *\fpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function copies network stored in Pnet struct. Must be called before \fBpnet_setup\fP. 13 | The argument of \fBpnet_dup\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to Pnet struct to be copied. 17 | .SH RETURN VALUE 18 | Upon successful completion of \fBpnet_dup\fP a pointer to copied Pnet struct is returned. 19 | Otherwise NULL is returned. 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_free(3), pnet_setup(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_exchg.3: -------------------------------------------------------------------------------- 1 | .TH pnet_exchg 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_exchg \- Exchange input and output data 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | void pnet_exchg(Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function call collective communication function \fB\MPI_AlltoAllv\fP in order to exchange the data from the output to the input buffer. Is implemented as a macro. Must be called after \fBpnet_setup\fP. 13 | The argument of \fBpnet_setup\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | None 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | pnet_setup(3), pnet_init(3), pnet_addconnect(3), pnet_free(3), pnet_lo(3), pnet_hi(3), pnet_nodes(3) 29 | -------------------------------------------------------------------------------- /man/man3/pnet_free.3: -------------------------------------------------------------------------------- 1 | .TH pnet_free 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_free \- Deallocate memory of Pnet struct 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | void pnet_free(Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function frees allocated memory. Must be the last call. 13 | The argument of \fBpnet_free\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | None 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | pnet_setup(3), pnet_init(3), pnet_addconnect(3), pnet_lo(3), pnet_hi(3), pnet_nodes(3) 29 | -------------------------------------------------------------------------------- /man/man3/pnet_hi.3: -------------------------------------------------------------------------------- 1 | .TH pnet_hi 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_hi \- Get upper bound for local sublattice 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_hi(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns upper bound for local sublattice. Function is implemented as a macro. 13 | The argument of \fBpnet_hi\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion upper bound is returned. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_lo(3), pnet_nodes(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_inindex.3: -------------------------------------------------------------------------------- 1 | .TH pnet_inindex 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_inindex \- Get index for input buffer 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_inindex(const Pnet\fP *\fIpnet\fB,int \fInode\fP, int \fIindex\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns index of in input buffer for specified node and connection. Function is implemented as a macro. 13 | The arguments of \fBpnet_inindex\fP are: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .TP 18 | .I node 19 | Index of node. Must be pnet_lo(pnet)<=node<=pnet_hi(pnet). 20 | .TP 21 | .I index 22 | Index in connection list of specified node. Must be 0<=index 7 | #include "pnet.h" 8 | 9 | Pnet *pnet_init(MPI_Comm\fP \fIcomm\fB, MPI_Datatype \fIdatatype\fB, int \fInodes\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | The Pnet library is used for MPI parallelization of networks. The function has to be called after the initialization of MPI. The arguments of \fBpnet_init\fP are: 13 | .TP 14 | .I comm 15 | MPI communicator 16 | .TP 17 | .I datatype 18 | MPI datatype network for data transfer 19 | .TP 20 | .I nodes 21 | Number of nodes in the network. 22 | .SH RETURN VALUE 23 | Upon successful completion of \fBpnet_init\fP a pointer to allocated Pnet struct is returned and NULL in case of failure. 24 | 25 | .SH AUTHORS 26 | 27 | For authors and contributors see AUTHORS file 28 | 29 | .SH COPYRIGHT 30 | 31 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 32 | 33 | .SH SEE ALSO 34 | pnet_free(3), pnet_setup(3), pnet_nodes(3) 35 | -------------------------------------------------------------------------------- /man/man3/pnet_inlen.3: -------------------------------------------------------------------------------- 1 | .TH pnet_inlen 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_inlen \- Get number of connections 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_inlen(const Pnet\fP *\fIpnet\fB,int \fInode\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns number of connections for specified local node. Function is implemented as a macro. 13 | The arguments of \fBpnet_inlen\fP are: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .TP 18 | .I node 19 | Index of node. Must be pnet_lo(pnet)<=node<=pnet_hi(pnet). 20 | .SH RETURN VALUE 21 | Upon successful completion number of connections is returned. 22 | .SH AUTHORS 23 | 24 | For authors and contributors see AUTHORS file 25 | 26 | .SH COPYRIGHT 27 | 28 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 29 | 30 | .SH SEE ALSO 31 | pnet_inindex(3), pnet_outlen(3), pnet_outindex(3), pnet_init(3), pnet_free(3), pnet_setup(3), pnet_hi(3), pnet_nodes(3) 32 | -------------------------------------------------------------------------------- /man/man3/pnet_input.3: -------------------------------------------------------------------------------- 1 | .TH pnet_input 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_input \- Get pointer to input buffer 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | void *pnet_input(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns pointer to input buffer. Function is implemented as a macro. 13 | The argument of \fBpnet_input\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion pointer to input buffer is returned. 19 | .SH AUTHORS 20 | 21 | For authors and contributors see AUTHORS file 22 | 23 | .SH COPYRIGHT 24 | 25 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 26 | 27 | .SH SEE ALSO 28 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_hi(3), pnet_nodes(3) 29 | -------------------------------------------------------------------------------- /man/man3/pnet_lo.3: -------------------------------------------------------------------------------- 1 | .TH pnet_lo 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_lo \- Get lower bound for local sublattice 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_lo(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns lower bound for local sublattice. Function is implemented as a macro. 13 | The argument of \fBpnet_lo\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion lower bound is returned. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_hi(3), pnet_nodes(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_nodes.3: -------------------------------------------------------------------------------- 1 | .TH pnet_nodes 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_nodes \- Get total number of nodes in the network 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_nodes(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns total number of nodes in the network. Function is implemented as a macro. 13 | The argument of \fBpnet_nodes\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion number of nodes in network is returned. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_lo(3), pnet_hi(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_outindex.3: -------------------------------------------------------------------------------- 1 | .TH pnet_outindex 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_outindex \- Get index for output buffer 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_outindex(const Pnet\fP *\fIpnet\fB,int \fIindex\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns index of node that has to be stored in the output buffer. Function is implemented as a macro. 13 | The arguments of \fBpnet_outindex\fP are: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .TP 18 | .I index 19 | Index in output buffer. Must be 0<=index 7 | #include "pnet.h" 8 | 9 | int pnet_outlen(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns the number of nodes that have to be stored in the output buffer. Function is implemented as a macro. 13 | The argument of \fBpnet_outlen\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion length of output buffer is returned. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_hi(3), pnet_nodes(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_output.3: -------------------------------------------------------------------------------- 1 | .TH pnet_output 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_output \- Get pointer to output buffer 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | void *pnet_output(const Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns pointer to output buffer. Function is implemented as a macro. 13 | The argument of \fBpnet_output\fP is: 14 | .TP 15 | .I pnet 16 | Pointer to initialized Pnet struct 17 | .SH RETURN VALUE 18 | Upon successful completion pointer to output buffer is returned. 19 | 20 | .SH AUTHORS 21 | 22 | For authors and contributors see AUTHORS file 23 | 24 | .SH COPYRIGHT 25 | 26 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 27 | 28 | .SH SEE ALSO 29 | pnet_input(3), pnet_init(3), pnet_free(3), pnet_setup(3), pnet_lo(3), pnet_hi(3), pnet_nodes(3) 30 | -------------------------------------------------------------------------------- /man/man3/pnet_reverse.3: -------------------------------------------------------------------------------- 1 | .TH pnet_reverse 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_reverse \- Reverse direction of all connections 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_reverse(Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function reverses direction of all connections. 13 | 14 | Connection have to be added before by calls of \fBpnet_addconnect\fP. Function must be called before 15 | \fBpnet_setup\fP. 16 | The argument of \fBpnet_reverse\fP is: 17 | .TP 18 | .I pnet 19 | Pointer to initialized Pnet struct 20 | .SH RETURN VALUE 21 | Upon successful completion \fBPNET_OK\fP is returned. 22 | .SH ERRORS 23 | .TP 24 | .B PNET_ALLOC_ERR 25 | Cannot allocate memory. 26 | 27 | .SH AUTHORS 28 | 29 | For authors and contributors see AUTHORS file 30 | 31 | .SH COPYRIGHT 32 | 33 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 34 | 35 | .SH SEE ALSO 36 | pnet_exchg(3), pnet_init(3), pnet_addconnect(3), pnet_setup(3), pnet_free(3), pnet_lo(3), pnet_hi(3), pnet_nodes(3) 37 | -------------------------------------------------------------------------------- /man/man3/pnet_setup.3: -------------------------------------------------------------------------------- 1 | .TH pnet_setup 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_setup \- Initialize communication pattern 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | int pnet_setup(Pnet\fP *\fIpnet\fB);\fP 10 | .fi 11 | .SH DESCRIPTION 12 | Function initializes communication pattern necessary for the 13 | distributed network. This is the core function of the Pnet 14 | library. Pnet has to be initialized by \fBpnet_init\fP and connections have to be added by calls of \fBpnet_addconnect\fP before \fBpnet_setup\fP can be called. Data have to be exchanged by invoking the \fBpnet_exchg\fP 15 | macro. After calling this function connections must not be added. 16 | The argument of \fBpnet_setup\fP is: 17 | .TP 18 | .I pnet 19 | Pointer to initialized Pnet struct 20 | .SH RETURN VALUE 21 | Upon successful completion \fBPNET_OK\fP is returned. 22 | .SH ERRORS 23 | .TP 24 | .B PNET_ALLOC_ERR 25 | Cannot allocate memory. 26 | 27 | .SH AUTHORS 28 | 29 | For authors and contributors see AUTHORS file 30 | 31 | .SH COPYRIGHT 32 | 33 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 34 | 35 | .SH SEE ALSO 36 | pnet_exchg(3), pnet_init(3), pnet_addconnect(3), pnet_free(3), pnet_lo(3), pnet_hi(3), pnet_nodes(3) 37 | -------------------------------------------------------------------------------- /man/man3/pnet_strerror.3: -------------------------------------------------------------------------------- 1 | .TH pnet_strerror 3 "version 1.0.3" "Pnet programmers manual" 2 | .SH NAME 3 | pnet_strerror \- Return string describing Pnet error 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include 7 | #include "pnet.h" 8 | 9 | char *pnet_strerror(void) 10 | .fi 11 | .SH DESCRIPTION 12 | Function returns pointer to string describing the Pnet error 13 | .SH RETURN VALUE 14 | Upon successful completion error message string is returned. 15 | 16 | .SH AUTHORS 17 | 18 | For authors and contributors see AUTHORS file 19 | 20 | .SH COPYRIGHT 21 | 22 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 23 | 24 | .SH SEE ALSO 25 | pnet_init(3), pnet_free(3), pnet_setup(3), pnet_hi(3), pnet_nodes(3) 26 | -------------------------------------------------------------------------------- /man/man3/printconfig.3: -------------------------------------------------------------------------------- 1 | .TH fprintconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | fprintconfig, printconfig \- Print LPJmL configuration 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void fprintconfig(FILE *\fIfile\fB,const Config *\fIconfig\fB); 9 | void printconfig(const Config *\fIconfig\fB); 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function print LPJmL configuration. \fBprintconfig()\fP writes output to standard output. 14 | The arguments of \fBfprintconfig\fP are: 15 | .TP 16 | .I file 17 | File pointer to output stream. 18 | .TP 19 | .I config 20 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 21 | .SH RETURN VALUE 22 | None. 23 | .SH AUTHORS 24 | 25 | For authors and contributors see AUTHORS file 26 | 27 | .SH COPYRIGHT 28 | 29 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 30 | 31 | .SH SEE ALSO 32 | readconfig(3), initmpiconfig(3), initconfig(3),freeconfig(3) 33 | -------------------------------------------------------------------------------- /man/man3/printflags.3: -------------------------------------------------------------------------------- 1 | .TH printflags 3 "LPJmL programmers manual" 2 | .SH NAME 3 | printflags \- Print LPJmL compilation flags and compiler used 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void printflags(void); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function print LPJmL compilation flags, compiler used, endianness and 32/64 bit mode. 13 | .SH RETURN VALUE 14 | None. 15 | .SH AUTHORS 16 | 17 | For authors and contributors see AUTHORS file 18 | 19 | .SH COPYRIGHT 20 | 21 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 22 | 23 | .SH SEE ALSO 24 | printlicence(3), readconfig(3), fprintconfig(3), initmpiconfig(3), initconfig(3), freeconfig(3) 25 | -------------------------------------------------------------------------------- /man/man3/printlicense.3: -------------------------------------------------------------------------------- 1 | .TH printlicense 3 "LPJmL programmers manual" 2 | .SH NAME 3 | printlicense \- Print LPJmL license file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | void printlicense(void); 9 | 10 | .fi 11 | .SH DESCRIPTION 12 | Function prints LPJmL license file on stdout. Environment variable LPJROOT has to be set accordingly to find locaton of license file. 13 | .SH RETURN VALUE 14 | None. 15 | .SH AUTHORS 16 | 17 | For authors and contributors see AUTHORS file 18 | 19 | .SH COPYRIGHT 20 | 21 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 22 | 23 | .SH SEE ALSO 24 | readconfig(3), fprintconfig(3), printflags(3), initmpiconfig(3), initconfig(3), freeconfig(3) 25 | -------------------------------------------------------------------------------- /man/man3/readconfig.3: -------------------------------------------------------------------------------- 1 | .TH readconfig 3 "LPJmL programmers manual" 2 | .SH NAME 3 | readconfig \- Reads LPJmL configuration 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool readconfig(Config *\fIconfig\fB, 9 | Fscanpftparfcn \fIscanfcns\fB[],int \fIntypes\fB, 10 | int \fInout\fB,int *\fIargc\fB,char ***\fIargv\fB, 11 | const char *\fIusage\fB);\fP 12 | 13 | .fi 14 | .SH DESCRIPTION 15 | Function reads LPJmL configuration. 16 | The arguments of \fBreadconfig\fP are: 17 | .TP 18 | .I config 19 | Pointer to LPJmL configuration data. Must be initialized by \fBinitmpiconfig()\fP or \fBinitconfig()\fP. 20 | .TP 21 | .I scanfcns 22 | Vector of scan functions for PFT-specific parameters. 23 | .TP 24 | .I ntypes 25 | Number of plant functional type (PFT) classes. 26 | .TP 27 | .I nout 28 | Maximum number of output files. 29 | .TP 30 | .I argc 31 | Pointer to the number of arguments. 32 | .TP 33 | .I argv 34 | Pointer to argument vector. 35 | .TP 36 | .I usage 37 | Usage string printed in case of error in argument list or NULL. 38 | 39 | .SH RETURN VALUE 40 | Upon successful completion FALSE is returned and TRUE in case of error. 41 | 42 | .SH AUTHORS 43 | 44 | For authors and contributors see AUTHORS file 45 | 46 | .SH COPYRIGHT 47 | 48 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 49 | 50 | .SH SEE ALSO 51 | initmpiconfig(3), initconfig(3), freeconfig(3) 52 | -------------------------------------------------------------------------------- /man/man3/readint_socket.3: -------------------------------------------------------------------------------- 1 | .TH readint_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | readint_socket \- read integers from socket 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | Bool readint_socket(Socket *\fIsocket\fB,int *\fIdata\fB,int \fIn\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function reads integer data from open socket. 14 | The arguments of \fBreadint_socket\fP are: 15 | .TP 16 | .I socket 17 | Pointer to socket. Socket must be opened by \fBopen_socket()\fP or \fBconnect_socket()\fP. 18 | .TP 19 | .I data 20 | Integer data to read from socket. 21 | .TP 22 | .I n 23 | Number of integer values to read. 24 | .SH RETURN VALUE 25 | Upon successful completion FALSE is returned and TRUE on failure. 26 | 27 | .SH AUTHORS 28 | 29 | For authors and contributors see AUTHORS file 30 | 31 | .SH COPYRIGHT 32 | 33 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 34 | 35 | .SH SEE ALSO 36 | close_socket(3), open_socket(3), connect_socket(3), writeint_socket(3) 37 | -------------------------------------------------------------------------------- /man/man3/readpopdens.3: -------------------------------------------------------------------------------- 1 | .TH readpopdens 3 "LPJmL programmers manual" 2 | .SH NAME 3 | readpopdens \- Read population density data from file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | Bool readpopdens(const Popdens \fIpopdens\fB, 9 | int \fIyear\fB, 10 | const Cell \fIgrid[]\fB, 11 | const Config *\fIconfig\fB);\fP 12 | 13 | .fi 14 | .SH DESCRIPTION 15 | Function reads population density data for specified year. 16 | The arguments of \fBreadpopdens\fP are: 17 | .TP 18 | .I popdens 19 | Pointer to population density data. Must be initialized by \fBinitpopdens()\fP. 20 | .TP 21 | .I year 22 | Sets year data is read. 23 | .TP 24 | .I grid 25 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 26 | .TP 27 | .I config 28 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 29 | 30 | .SH RETURN VALUE 31 | Upon successful completion FALSE is returned and TRUE on error. 32 | 33 | .SH AUTHORS 34 | 35 | For authors and contributors see AUTHORS file 36 | 37 | .SH COPYRIGHT 38 | 39 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 40 | 41 | .SH SEE ALSO 42 | initpopdens(3), getpopdens(3), freepopdens(3) 43 | -------------------------------------------------------------------------------- /man/man3/writecoords.3: -------------------------------------------------------------------------------- 1 | .TH writecoords 3 "LPJmL programmers manual" 2 | .SH NAME 3 | writecoords \- Write coordinate file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | int writecoords(Outputfile *\fIoutput\fB, 9 | int \fIindex\fB, 10 | Cell \fIgrid\fB[], 11 | const Config *\fIconfig\fB 12 | );\fP 13 | 14 | .fi 15 | .SH DESCRIPTION 16 | Function writes coordinate data for LPJmL grid. Only cell coordinates with valid soil code are written. The arguments of \fBwritecoords\fP are: 17 | .TP 18 | .I output 19 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 20 | .TP 21 | .I index 22 | Set index of output. 23 | .TP 24 | .I grid 25 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 26 | .TP 27 | .I config 28 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 29 | .SH RETURN VALUE 30 | Upon successful completion the number of coordinates written is returned. 31 | 32 | .SH AUTHORS 33 | 34 | For authors and contributors see AUTHORS file 35 | 36 | .SH COPYRIGHT 37 | 38 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 39 | 40 | .SH SEE ALSO 41 | readconfig(3), fopenoutput(3), newgrid(3), fcloseoutput(3), isopen(3), writecountrycode(3), writeregioncode(3) 42 | -------------------------------------------------------------------------------- /man/man3/writecountrycode.3: -------------------------------------------------------------------------------- 1 | .TH writecountrycode 3 "LPJmL programmers manual" 2 | .SH NAME 3 | writecountrycode \- Write country code file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | int writecountrycode(Outputfile *\fIoutput\fB, 9 | int \fIindex\fB, 10 | const Cell \fIgrid\fB[], 11 | const Config *\fIconfig\fB 12 | );\fP 13 | 14 | .fi 15 | .SH DESCRIPTION 16 | Function writes country code data for LPJmL grid. Only cell coordinates with valid soil code are written. The arguments of \fBwritecountrycode\fP are: 17 | .TP 18 | .I output 19 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 20 | .TP 21 | .I index 22 | Set index of output. 23 | .TP 24 | .I grid 25 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 26 | .TP 27 | .I config 28 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 29 | .SH RETURN VALUE 30 | Upon successful completion the number of country codes written is returned. 31 | .SH AUTHORS 32 | 33 | .SH AUTHORS 34 | 35 | For authors and contributors see AUTHORS file 36 | 37 | .SH COPYRIGHT 38 | 39 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 40 | 41 | .SH SEE ALSO 42 | readconfig(3), fopenoutput(3), newgrid(3), fcloseoutput(3), isopen(3), writecoords(3), writeregioncode(3) 43 | -------------------------------------------------------------------------------- /man/man3/writefloat_socket.3: -------------------------------------------------------------------------------- 1 | .TH writefloat_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | writefloat_socket \- write floats to socket 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | Bool writefloat_socket(Socket *\fIsocket\fB,const float *\fIdata\fB,int \fIn\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function writes float data to open socket. 14 | The arguments of \fBwritefloat_socket\fP are: 15 | .TP 16 | .I socket 17 | Pointer to socket. Socket must be opened by \fBopen_socket()\fP or \fBconnect_socket()\fP. 18 | .TP 19 | .I data 20 | Float data to write from socket. 21 | .TP 22 | .I n 23 | Number of float values to write. 24 | .SH RETURN VALUE 25 | Upon successful completion FALSE is returned and TRUE on failure. 26 | 27 | .SH AUTHORS 28 | 29 | For authors and contributors see AUTHORS file 30 | 31 | .SH COPYRIGHT 32 | 33 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 34 | 35 | .SH SEE ALSO 36 | writeint_socket(3), close_socket(3), open_socket(3), connect_socket(3), readint_socket(3) 37 | -------------------------------------------------------------------------------- /man/man3/writeint_socket.3: -------------------------------------------------------------------------------- 1 | .TH writeint_socket 3 "version 1.0.1" "Socket library manual" 2 | .SH NAME 3 | writeint_socket \- write integers to socket 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "types.h" 7 | #include "channel.h" 8 | 9 | Bool writeint_socket(Socket *\fIsocket\fB,const int *\fIdata\fB,int \fIn\fB);\fP 10 | 11 | .fi 12 | .SH DESCRIPTION 13 | Function writes integer data to open socket. 14 | The arguments of \fBwriteint_socket\fP are: 15 | .TP 16 | .I socket 17 | Pointer to socket. Socket must be opened by \fBopen_socket()\fP or \fBconnect_socket()\fP. 18 | .TP 19 | .I data 20 | Integer data to write from socket. 21 | .TP 22 | .I n 23 | Number of integer values to write. 24 | .SH RETURN VALUE 25 | Upon successful completion FALSE is returned and TRUE on failure. 26 | 27 | .SH AUTHORS 28 | 29 | For authors and contributors see AUTHORS file 30 | 31 | .SH COPYRIGHT 32 | 33 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 34 | 35 | .SH SEE ALSO 36 | writefloat_socket(3), close_socket(3), open_socket(3), connect_socket(3), readint_socket(3) 37 | -------------------------------------------------------------------------------- /man/man3/writeregioncode.3: -------------------------------------------------------------------------------- 1 | .TH writeregioncode 3 "LPJmL programmers manual" 2 | .SH NAME 3 | writeregioncode \- Write region code file 4 | .SH SYNOPSIS 5 | .nf 6 | \fB#include "lpj.h" 7 | 8 | int writeregioncode(Outputfile *\fIoutput\fB, 9 | int \fIindex\fB, 10 | const Cell \fIgrid\fB[], 11 | const Config *\fIconfig\fB 12 | );\fP 13 | 14 | .fi 15 | .SH DESCRIPTION 16 | Function writes region code data for LPJmL grid. Only cell coordinates with valid soil code are written. The arguments of \fBwriteregioncode\fP are: 17 | .TP 18 | .I output 19 | Pointer to initialized output data. \fIoutput\fP must be initialized by \fBfopenoutput()\fP. 20 | .TP 21 | .I index 22 | Set index of output. 23 | .TP 24 | .I grid 25 | Cell grid array allocated and initialized by \fBnewgrid()\fP. 26 | .TP 27 | .I config 28 | LPJmL configuration data. Must be read by \fBreadconfig()\fP. 29 | .SH RETURN VALUE 30 | Upon successful completion the number of region codes written is returned. 31 | 32 | .SH AUTHORS 33 | 34 | For authors and contributors see AUTHORS file 35 | 36 | .SH COPYRIGHT 37 | 38 | (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file 39 | 40 | .SH SEE ALSO 41 | readconfig(3), fopenoutput(3), newgrid(3), fcloseoutput(3), isopen(3), writecoords(3), writecountrycode(3) 42 | -------------------------------------------------------------------------------- /man/man5/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e ## 4 | ## ## 5 | ## Makefile to create HTML files from man pages ## 6 | ## ## 7 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 8 | ## authors, and contributors see AUTHORS file ## 9 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 10 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 11 | ## Contact: https://gitlab.pik-potsdam.de/lpjml ## 12 | ## ## 13 | ################################################################################# 14 | 15 | 16 | SRC = clm.5 17 | 18 | HTMLDIR = ../../html 19 | HTML = $(SRC:%.5=$(HTMLDIR)/%.html) 20 | 21 | html: $(HTML) 22 | 23 | $(HTMLDIR)/%.html: %.5 24 | nroff -man $*.5 |man2html -cgiurl '$$title.html' >$@ 25 | clean: 26 | rm $(HTML) 27 | -------------------------------------------------------------------------------- /src/cpl/Makefile: -------------------------------------------------------------------------------- 1 | ################################################################################# 2 | ## ## 3 | ## M a k e f i l e ## 4 | ## ## 5 | ## Creates library ../../lib/libcpl.a ## 6 | ## ## 7 | ## (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file ## 8 | ## authors, and contributors see AUTHORS file ## 9 | ## This file is part of LPJmL and licensed under GNU AGPL Version 3 ## 10 | ## or later. See LICENSE file or go to http://www.gnu.org/licenses/ ## 11 | ## Contact: https://github.com/PIK-LPJmL/LPJmL ## 12 | ## ## 13 | ################################################################################# 14 | 15 | include ../../Makefile.inc 16 | 17 | OBJS = cpl_init.$O cpl_free.$O 18 | 19 | INC = ../../include 20 | LIBDIR = ../../lib 21 | LIB = libcpl.$A 22 | 23 | HDRS = $(INC)/types.h $(INC)/cpl.h $(INC)/errmsg.h 24 | 25 | 26 | $(LIBDIR)/$(LIB): $(OBJS) 27 | $(AR) $(ARFLAGS)$(LIBDIR)/$(LIB) $(OBJS) 28 | 29 | $(OBJS): $(HDRS) 30 | 31 | .c.$O: 32 | $(CC) $(CFLAGS) -I$(INC) -c $*.c 33 | 34 | clean: 35 | $(RM) $(RMFLAGS) $(OBJS) 36 | (cd $(LIBDIR) && $(RM) $(RMFLAGS) $(LIB)) 37 | -------------------------------------------------------------------------------- /src/crop/agb_crop.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** a g b _ c r o p . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "crop.h" 17 | 18 | Real agb_crop(const Pft *pft /**< pointer to crop PFT */ 19 | ) /** \return above-ground crop carbon (gC/m2) */ 20 | { 21 | const Pftcrop *crop; 22 | crop=pft->data; 23 | return (crop->ind.leaf.carbon+crop->ind.so.carbon+crop->ind.pool.carbon)*pft->nind; 24 | } /* of 'agb_crop' */ 25 | -------------------------------------------------------------------------------- /src/crop/fpc_crop.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** fpc_crop.c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "crop.h" 17 | 18 | Real fpc_crop(Pft *pft /**< pointer to PFT data */ 19 | ) /** \return fractional projective cover */ 20 | { 21 | return pft->fpc; 22 | } /* of 'fpc_crop' */ 23 | -------------------------------------------------------------------------------- /src/crop/freecropdates.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e c r o p d a t e s . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** Function deallocates crop dates data \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include "lpj.h" 18 | 19 | void freecropdates(Cropdates *cropdates /**< array of crop dates */ 20 | ) 21 | { 22 | free(cropdates); 23 | } /* of 'freecropdates' */ 24 | -------------------------------------------------------------------------------- /src/getbuild.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** g e t b u i l d . c \n**/ 4 | /** \n**/ 5 | /** Get build number, build date and SVN revision number \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include "types.h" 17 | 18 | char *getbuilddate(void) 19 | { 20 | static char *s=__DATE__; 21 | return s; 22 | } /* of 'getbuilddate' */ 23 | -------------------------------------------------------------------------------- /src/grass/fpar_grass.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f p a r _ g r a s s . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "grass.h" 17 | 18 | Real fpar_grass(const Pft *pft) 19 | { 20 | return pft->phen*pft->fpc*(1-pft->snowcover); 21 | } /* of 'fpar_grass' */ 22 | -------------------------------------------------------------------------------- /src/grass/free_grass.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e _ g r a s s . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "grass.h" 17 | 18 | void free_grass(Pft *pft) 19 | { 20 | free(pft->data); 21 | } /* of 'free_grass' */ 22 | -------------------------------------------------------------------------------- /src/landuse/free_agriculture.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e _ a g r i c u l t u r e . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** Function deallocates irrigation data of stand \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include "lpj.h" 18 | #include "agriculture.h" 19 | 20 | void free_agriculture(Stand *stand /**< pointer to agriculture stand */ 21 | ) 22 | { 23 | free(stand->data); 24 | } /* of 'free_agriculture' */ 25 | -------------------------------------------------------------------------------- /src/landuse/freemanage.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e m a n a g e . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void freemanage(Manage *manage, /**< pointer to management data */ 18 | int npft /**< number of natural PFTs */ 19 | ) 20 | { 21 | if(manage->par!=NULL && manage->par->laimax_cft==NULL) 22 | free(manage->laimax+npft); 23 | } /* of 'freemanage' */ 24 | -------------------------------------------------------------------------------- /src/lpj/f_lai.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f _ l a i . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** Function implements equation C11 in Smith et al. (2014) \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include "lpj.h" 18 | 19 | #define k_l 0.08 /* changed from 0.12 in Smith et al. (2014) */ 20 | 21 | Real f_lai(Real lai) 22 | { 23 | if(lai<1.0) 24 | return max(0.1,lai); 25 | return exp(k_l*min(lai,7)); 26 | } /* of 'f_lai' */ 27 | -------------------------------------------------------------------------------- /src/lpj/fprint_natural.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f p r i n t _ n a t u r a l . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "natural.h" 17 | 18 | void fprint_natural(FILE * UNUSED(file), 19 | const Stand * UNUSED(stand), 20 | const Pftpar * UNUSED(pftpar)) 21 | { 22 | } /* of 'fprint_natural' */ 23 | -------------------------------------------------------------------------------- /src/lpj/fread_natural.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d _ n a t u r a l . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "natural.h" 17 | 18 | Bool fread_natural(FILE * UNUSED(file),Stand * UNUSED(stand), 19 | Bool UNUSED(swap)) 20 | { 21 | return FALSE; 22 | } /* of 'fread_natural' */ 23 | -------------------------------------------------------------------------------- /src/lpj/free_natural.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e _ n a t u r a l . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "natural.h" 17 | 18 | void free_natural(Stand * UNUSED(stand)) 19 | { 20 | } /* of 'free_natural' */ 21 | -------------------------------------------------------------------------------- /src/lpj/freeoutput.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e o u t p u t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void freeoutput(Output *output /**< Output data */ 18 | ) 19 | { 20 | free(output->data); 21 | free(output->syear2); 22 | free(output->syear); 23 | } /* of 'freeoutput' */ 24 | -------------------------------------------------------------------------------- /src/lpj/freepft.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e p f t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void freepft(Pft *pft /**< Pointer to pft being freed */ 18 | ) 19 | { 20 | pft->par->free(pft); /* call type-specific free function */ 21 | } /* of 'freepft' */ 22 | -------------------------------------------------------------------------------- /src/lpj/freepftpar.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e p f t p a r . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void freepftpar(Pftpar pftpar[], /**< PFT parameter array */ 18 | int ntotpft /**< total number of PFTs */ 19 | ) 20 | { 21 | int i; 22 | for(i=0;irank=0; 24 | config->ntask=1; 25 | } /* of 'initconfig' */ 26 | -------------------------------------------------------------------------------- /src/lpj/new_natural.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n e w _ n a t u r a l . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "natural.h" 17 | 18 | void new_natural(Stand *stand /**< pointer to stand */ 19 | ) 20 | { 21 | stand->data=NULL; 22 | } /* of 'new_natural' */ 23 | -------------------------------------------------------------------------------- /src/lpj/noadjust.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o a d j u s t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** Default adjust function: makes nothing \n**/ 7 | /** \n**/ 8 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 9 | /** authors, and contributors see AUTHORS file \n**/ 10 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 11 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 12 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 13 | /** \n**/ 14 | /**************************************************************************************/ 15 | 16 | #include "lpj.h" 17 | 18 | void noadjust(Litter * UNUSED(litter),Pft * UNUSED(pft),Real UNUSED(fpc), Real UNUSED(fpc_max),const Config * UNUSED(config)) 19 | { 20 | return; 21 | } /* of 'noadjust' */ 22 | -------------------------------------------------------------------------------- /src/lpj/nofire.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o f i r e . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | Stocks nofire(Pft * UNUSED(pft),Real *fireprob) 18 | { 19 | Stocks stocks={0,0}; 20 | *fireprob=0; 21 | return stocks; 22 | } /* of 'nofire' */ 23 | -------------------------------------------------------------------------------- /src/lpj/noinit.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o i n i t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void noinit(Pft * UNUSED(pft)) 18 | { 19 | } /* of 'noinit' */ 20 | -------------------------------------------------------------------------------- /src/lpj/nomix_veg.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o m i x _ v e g . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void nomix_veg(Pft * UNUSED(pft),Real UNUSED(scaler)) 18 | { 19 | return; 20 | } /* of 'nomix_veg' */ 21 | -------------------------------------------------------------------------------- /src/lpj/nooutput_gbw.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o o u t p u t _ g b w . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | #include "lpj.h" 15 | 16 | void nooutput_gbw(const Stand *stand,Output *output,Real frac_g_evap,Real frac_g[NSOILLAYER],Real evap,const Real aet_stand[NSOILLAYER], 17 | Real intercep_stand,int npft,int ncft,Setting setting) 18 | { 19 | } 20 | -------------------------------------------------------------------------------- /src/lpj/noturnover_monthly.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o t u r n o v e r _ m o n t h l y . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void noturnover_monthly(Litter * UNUSED(litter),Pft * UNUSED(pft),const Config * UNUSED(config)) 18 | { 19 | /* do nothing */ 20 | } /* of 'noturnover_monthly' */ 21 | -------------------------------------------------------------------------------- /src/lpj/nowdf.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** n o w d f . c \n**/ 4 | /** \n**/ 5 | /** Default function for calculation of water deficit fraction \n**/ 6 | /** \n**/ 7 | /** C implementation of LPJmL \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include "lpj.h" 18 | 19 | Real nowdf(Pft * UNUSED(pft),Real UNUSED(demand),Real UNUSED(supply)) 20 | { 21 | return NO_WDF; 22 | } /* of 'nowdf' */ 23 | -------------------------------------------------------------------------------- /src/netcdf/freecoordarray.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e c o o r d a r r a y . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** Function deallocates index array \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include "lpj.h" 18 | 19 | void freecoordarray(Coord_array *array) 20 | { 21 | if(array!=NULL) 22 | { 23 | free(array->index); 24 | free(array); 25 | } 26 | } /* of 'freecoordarray' */ 27 | -------------------------------------------------------------------------------- /src/numeric/setseed.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** s e t s e e d . c \n**/ 4 | /** \n**/ 5 | /** Set seed of random number generator \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include "types.h" 19 | #include "numeric.h" 20 | 21 | void setseed(Seed seed,int start) 22 | { 23 | #ifdef USE_RAND48 24 | seed[0]=13070; 25 | seed[1]=(unsigned short)(start % (USHRT_MAX+1)); 26 | seed[2]=(unsigned short)(start / (USHRT_MAX+1)); 27 | seed48(seed); 28 | #else 29 | seed[0]=start; 30 | #endif 31 | } /* of 'setseed' */ 32 | -------------------------------------------------------------------------------- /src/pnet/FILES: -------------------------------------------------------------------------------- 1 | Pnet library files 2 | 3 | Implementation is described in: 4 | W. von Bloh, 2008. Sequential and Parallel Implementation of 5 | Networks. In P. beim Graben, C. Zhou, M. Thiel, and J. Kurths 6 | (eds.), Lectures in Supercomputational Neuroscience, Dynamics in 7 | Complex Brain Networks, Springer, New York, 279-318. 8 | 9 | Filename Description 10 | -------------------- ------------------------------------------ 11 | intlist.c Implementation of integer value array 12 | pnet_addconnect.c Add connection to network 13 | pnet_free.c Frees allocated memoty 14 | pnet_init.c Initializes network 15 | pnet_reverse.c Reverses directions of network 16 | pnet_setup.c Setup communication pattern for network 17 | pnet_strerror.c Returns error string 18 | -------------------- ------------------------------------------ 19 | -------------------------------------------------------------------------------- /src/socket/close_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** c l o s e _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** Function closes socket \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #ifndef _WIN32 18 | #include 19 | #endif 20 | #include "types.h" 21 | #include "channel.h" 22 | 23 | void close_socket(Socket *socket) 24 | { 25 | #ifdef _WIN32 26 | closesocket(socket->channel); 27 | WSACleanup(); 28 | #else 29 | close(socket->channel); 30 | #endif 31 | free(socket); 32 | } /* of 'close_socket' */ 33 | -------------------------------------------------------------------------------- /src/socket/fclose_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f c l o s e _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #ifndef _WIN32 18 | #include 19 | #endif 20 | #include "types.h" 21 | #include "channel.h" 22 | 23 | void close_socket_(Socket *socket,int *err) 24 | { 25 | #ifdef _WIN32 26 | *err=closesocket(socket->channel); 27 | WSACleanup(); 28 | #else 29 | *err=close(socket->channel); 30 | #endif 31 | } /* of 'close_socket' */ 32 | -------------------------------------------------------------------------------- /src/socket/freaddouble_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d d o u b l e _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void readdouble_socket_(Socket *socket,double *data,int *n,int *err) 21 | { 22 | *err=readdouble_socket(socket,data,*n); 23 | } /* of 'readdouble_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/freadfloat_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d f l o a t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "swap.h" 19 | #include "channel.h" 20 | 21 | void readfloat_socket_(Socket *socket,float *data,int *n,int *err) 22 | { 23 | *err=readfloat_socket(socket,data,*n); 24 | } /* of 'readfloat_socket' */ 25 | -------------------------------------------------------------------------------- /src/socket/freadint_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d i n t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** FORTARN interface to readint_socket() \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void readint_socket_(Socket *socket,int *data,int *n,int *err) 21 | { 22 | *err=readint_socket(socket,data,*n); 23 | } /* of 'readint_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/freadlong_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d l o n g _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** FORTARN interface to readlong_socket() \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void readlong_socket_(Socket *socket,long long *data,int *n,int *err) 21 | { 22 | *err=readlong_socket(socket,data,*n); 23 | } /* of 'readlong_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/freadshort_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e a d s h o r t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "swap.h" 19 | #include "channel.h" 20 | 21 | void readshort_socket_(Socket *socket,short *data,int *n,int *err) 22 | { 23 | *err=readshort_socket(socket,data,*n); 24 | } /* of 'readshort_socket' */ 25 | -------------------------------------------------------------------------------- /src/socket/freadstring_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** r e a d s t r i n g _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** Function reads string from socket \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void readstring_socket_(Socket *socket,char *s,int *err,int len) 21 | { 22 | int n; 23 | if(readint_socket(socket,&n,1)) 24 | *err=1; 25 | else if(n>len) 26 | *err=1; 27 | else if(n) 28 | *err=read_socket(socket,s,n); 29 | else 30 | *err=0; 31 | } /* of 'readstring_socket' */ 32 | -------------------------------------------------------------------------------- /src/socket/fwritedouble_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f w r i t e d o u b l e _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void writedouble_socket_(Socket *socket,double *buffer,int *n,int *err) 21 | { 22 | *err=writedouble_socket(socket,buffer,*n); 23 | } /* of 'writedouble_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/fwritefloat_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f w r i t e f l o a t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void writefloat_socket_(Socket *socket,float *buffer,int *n,int *err) 21 | { 22 | *err=writefloat_socket(socket,buffer,*n); 23 | } /* of 'writedouble_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/fwriteint_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f w r i t e i n t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void writeint_socket_(Socket *socket,int *buffer,int *n,int *err) 21 | { 22 | *err=writeint_socket(socket,buffer,*n); 23 | } /* of 'writeint_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/fwritelong_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f w r i t e l o n g _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void writelong_socket_(Socket *socket,long long *buffer,int *n,int *err) 21 | { 22 | *err=writelong_socket(socket,buffer,*n); 23 | } /* of 'writelong_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/fwriteshort_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f w r i t e s h o r t _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | #include "channel.h" 19 | 20 | void writeshort_socket_(Socket *socket,short *buffer,int *n,int *err) 21 | { 22 | *err=writeshort_socket(socket,buffer,*n); 23 | } /* of 'writeshort_socket' */ 24 | -------------------------------------------------------------------------------- /src/socket/fwritestring_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** w r i t e s t r i n g _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** Function writes string to socket \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include "types.h" 19 | #include "channel.h" 20 | 21 | void writestring_socket_(Socket *socket,const char *s,int *err,int len) 22 | { 23 | if(writeint_socket(socket,&len,1)) 24 | *err=1; 25 | else if(len) 26 | *err=write_socket(socket,s,len); 27 | else 28 | *err=0; 29 | } /* of 'writestring_socket' */ 30 | -------------------------------------------------------------------------------- /src/socket/writestring_socket.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** w r i t e s t r i n g _ s o c k e t . c \n**/ 4 | /** \n**/ 5 | /** Function writes string to socket \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include "types.h" 19 | #include "channel.h" 20 | 21 | Bool writestring_socket(Socket *socket,const char *s) 22 | { 23 | unsigned int n; 24 | n=strlen(s); 25 | if(writeint_socket(socket,&n,1)) 26 | return TRUE; 27 | if(n) 28 | return write_socket(socket,s,n); 29 | return FALSE; 30 | } /* of 'writestring_socket' */ 31 | -------------------------------------------------------------------------------- /src/soil/apply_perc_enthalpy.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** apply_perc_enthalpy.c \n**/ 4 | /** \n**/ 5 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 6 | /** authors, and contributors see AUTHORS file \n**/ 7 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 8 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 9 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 10 | /** \n**/ 11 | /**************************************************************************************/ 12 | 13 | #include "lpj.h" 14 | 15 | void apply_perc_enthalpy(Soil *soil /**< pointer to soil data */ 16 | ) 17 | { 18 | int l,j; /* l=layer, j is for sublayer */ 19 | for(l=0; lperc_energy[l] / (soildepth[l]/1000); 22 | for (j=0; jenth[l*GPLHEAT+j] += vol_enth_change; 25 | } 26 | soil->perc_energy[l] = 0; 27 | } 28 | } /* of 'apply_perc_enthalpy' */ 29 | -------------------------------------------------------------------------------- /src/soil/findlitter.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f i n d l i t t e r . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | int findlitter(const Litter *litter, /**< pointer to litter */ 18 | const Pftpar *pft /**< PFT parameter array */ 19 | ) /** \return PFT specific litter pool */ 20 | { 21 | int l; 22 | for(l=0;ln;l++) 23 | if(litter->item[l].pft==pft) 24 | return l; 25 | return NOT_FOUND; 26 | } /* of 'findlitter' */ 27 | -------------------------------------------------------------------------------- /src/soil/freesoilpar.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e s o i l p a r . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | void freesoilpar(Soilpar soilpar[], /**< soil parameter array */ 18 | int nsoil /**< size of soil parameter array */ 19 | ) 20 | { 21 | int i; 22 | for(i=0;iw[l]+soil->ice_depth[l]/soil->whcs[l]); 24 | return wr; 25 | } /* of 'getwr' */ 26 | -------------------------------------------------------------------------------- /src/spitfire/humanignition.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** h u m a n i g n i t i o n . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | Real humanignition(Real popdens, 18 | Ignition* ignition) 19 | { 20 | Real a_nd, human_ign, k_pd; 21 | 22 | a_nd = ignition->human; 23 | k_pd = 30*(exp(param.hum_ign*sqrt(popdens))); 24 | human_ign = k_pd * a_nd * popdens/100; 25 | return human_ign; 26 | } /* of 'humanignition' */ 27 | -------------------------------------------------------------------------------- /src/spitfire/wildfire_ignitions.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** w i l d f i r e _ i g n i t i o n s . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | Real wildfire_ignitions(Real d_fdi, /* daily fire danger index */ 18 | Real ignition, /* ignition */ 19 | Real area /* cell area m^2 */ 20 | ) 21 | { 22 | Real d_numfire; 23 | d_numfire= d_fdi*ignition * (area*1e-4); 24 | return d_numfire; 25 | } /* of 'wildfire_ignitions' */ 26 | -------------------------------------------------------------------------------- /src/spitfire/windspeed_fpc.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** w i n d s p e e d _ f p c . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | 17 | Real windspeed_fpc(Real windspeed,const Pftlist *pftlist) 18 | { 19 | Real windsp_fpc; 20 | const Pft *pft; 21 | int p; 22 | windsp_fpc=0; 23 | foreachpft(pft,p,pftlist) 24 | windsp_fpc+=pft->fpc*pft->par->windspeed; 25 | return windsp_fpc*60*windspeed; 26 | } /* of 'windspeed_fpc' */ 27 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/apply_enth_of_untracked_mass_shifts.h: -------------------------------------------------------------------------------- 1 | void apply_enth_of_untracked_mass_shifts(Real *, const Real *, const Real *, const Real *, const Real *); 2 | void apply_enth_of_untracked_mass_shifts_old(Real *, const Real *, const Real *, Soil_thermal_prop); 3 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/apply_heatconduction_of_a_day.h: -------------------------------------------------------------------------------- 1 | void use_enth_scheme(Real *, const Real *, const Real, const Soil_thermal_prop *); 2 | void use_temp_scheme_implicit(Real *, const Real *, const Real *, const Real *, int); 3 | void arrange_matrix(Real *, Real *, Real *, const Real *, const Real *, const Real *, const Real); 4 | void thomas_algorithm(double *, double *, double *, double *, double *); 5 | void timestep_implicit(Real *, const Real *, const Real *, const Real *, const Real); 6 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/apply_perc_enthalpy.h: -------------------------------------------------------------------------------- 1 | void apply_perc_enthalpy(Soil *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/calc_soil_thermal_props.h: -------------------------------------------------------------------------------- 1 | void calc_soil_thermal_props(Uniform_temp_sign, Soil_thermal_prop *, const Soil *, const Real *, const Real *, Bool, Bool); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/compute_mean_layer_temps_from_enth.h: -------------------------------------------------------------------------------- 1 | void compute_mean_layer_temps_from_enth(Real *, const Real *, const Soil_thermal_prop *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/enth2freezefrac.h: -------------------------------------------------------------------------------- 1 | void enth2freezefrac(Real *, const Real *, const Soil_thermal_prop *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/freezefrac2soil.h: -------------------------------------------------------------------------------- 1 | void freezefrac2soil(Soil *, const Real *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/infil_perc_irr.h: -------------------------------------------------------------------------------- 1 | Real infil_perc_irr(Stand *, Real, Real, Real *, int, int,const Config *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/infil_perc_rain.h: -------------------------------------------------------------------------------- 1 | Real infil_perc_rain(Stand *, Real, Real, Real *, int, int, const Config *); 2 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/initsoil.h: -------------------------------------------------------------------------------- 1 | Real calc_soil_dry_therm_cond(Real); 2 | Bool initsoil(Stand *,const Soilpar *,int,const Config *); 3 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/setaside.h: -------------------------------------------------------------------------------- 1 | void mixsoil(Stand *, const Stand *, int, int, const Config *); 2 | void mixsoilenergy(Stand *, Stand *, const Config *); 3 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/update_soil_thermal_state.h: -------------------------------------------------------------------------------- 1 | void update_soil_thermal_state(Soil *, Real, const Config *); 2 | void setup_heatgrid(Real *); 3 | void get_unaccounted_changes_in_water_and_solids(Real *, Real *, Soil *); 4 | void get_abs_waterice_cont(Real *, Soil *); 5 | void modify_enth_due_to_masschanges(Soil *, Real *, const Config *); 6 | void compute_maxthaw_depth(Soil *); 7 | Real calc_litter_therm_conductivity(Real, Real); 8 | void adjust_grid_and_therm_cond_for_litter(Real *, Soil_thermal_prop *, Soil *); 9 | void adjust_grid_and_therm_cond_for_snow(Real *, Soil_thermal_prop *, Soil *); 10 | void compute_litter_and_snow_temp_from_enth(Soil *, Real, const Soil_thermal_prop *); 11 | -------------------------------------------------------------------------------- /src/test/support/header_of_lpjml_files_to_link/updatelitterproperties.h: -------------------------------------------------------------------------------- 1 | Real calc_litter_dm_sum(const Soil *); 2 | -------------------------------------------------------------------------------- /src/test/support/helper_code/mocks/support_soil_mocks.h: -------------------------------------------------------------------------------- 1 | void teardown_soil_sub_structs(Soil *); 2 | void setup_simple_soil(Soil *); 3 | void setup_complex_soil(Soil *); 4 | -------------------------------------------------------------------------------- /src/test/support/helper_code/mocks/support_stand_mocks.h: -------------------------------------------------------------------------------- 1 | Stand *setup_simple_stand(); 2 | Stand *setup_soilB_stand(); 3 | void teardown_stand(Stand *stand); 4 | -------------------------------------------------------------------------------- /src/test/support/helper_code/other/support_assertions.h: -------------------------------------------------------------------------------- 1 | void no_nas_should_have_been_generated_in_soil(Soil); 2 | void the_temps_should_have_remained_equal(Real *, Real); 3 | -------------------------------------------------------------------------------- /src/test/support/helper_code/other/support_global_variables.c: -------------------------------------------------------------------------------- 1 | #include "lpj.h" 2 | #include "natural.h" 3 | #include "agriculture.h" 4 | #include "grassland.h" 5 | Real soildepth[] = {200.0, 300.0, 500.0, 1000.0, 1000.0, 10000.0}; 6 | Config test_config = {.johansen = TRUE, .percolation_heattransfer = TRUE}; 7 | Param param = {.soil_infil = 6, .percthres = 1, .frac_ro_stored = 0.8, .rw_buffer_max = 20}; 8 | Standtype setaside_rf_stand={}; 9 | Standtype setaside_ir_stand={}; 10 | -------------------------------------------------------------------------------- /src/test/support/helper_code/other/support_global_variables.h: -------------------------------------------------------------------------------- 1 | extern Real soildepth[]; 2 | extern Config test_config; 3 | extern Param param; 4 | extern Standtype setaside_rf_stand; 5 | extern Standtype setaside_ir_stand; 6 | -------------------------------------------------------------------------------- /src/test/support/helper_code/other/support_manipulate_soil.h: -------------------------------------------------------------------------------- 1 | void update_mean_layer_temps(Soil *); 2 | void set_enthalpies_to_half_latent_heat(Soil *); 3 | void set_enthalpies_to_zero(Soil *); 4 | void setEnthalpiesCorrespToRandTemp(Soil *, Real *, Real); 5 | void set_enthalpies_corresponding_to_linearly_increasing_temps(Soil *, Real *); 6 | void set_enthalpies_corresponding_to_const_temp(Soil *, Real); 7 | void set_enthalpies_to_latent_heat(Soil *); 8 | void set_soilwater_to_zero(Soil *); 9 | -------------------------------------------------------------------------------- /src/test/support/helper_code/stubs/support_fail_stub.h: -------------------------------------------------------------------------------- 1 | void fail(int errcode, Bool core, const char *msg, ...) 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /src/test/support/helper_code/stubs/support_mixsoilenergy_stubs.h: -------------------------------------------------------------------------------- 1 | int findlitter(const Litter *x, const struct Pftpar *y) 2 | { 3 | return 0; 4 | } 5 | 6 | int addlitter(Litter *x, const struct Pftpar *y) 7 | { 8 | return 0; 9 | } 10 | 11 | void updatelitterproperties(Stand *x, Real y) 12 | { 13 | 14 | } 15 | 16 | int delpft(Pftlist *x, int y) 17 | { 18 | return 0; 19 | } 20 | 21 | void tillage(Soil *x, Real y) 22 | { 23 | 24 | } 25 | 26 | Pft *addpft(Stand *x, const Pftpar * y,int z,int a,const Config *b) 27 | { 28 | 29 | } 30 | 31 | int findlandusetype(const Standlist x,Landusetype y) 32 | { 33 | return 0; 34 | } 35 | 36 | Bool establish(Real gdd, const Pftpar *pftpar, const Climbuf *climbuf) 37 | { 38 | return 0; 39 | } 40 | -------------------------------------------------------------------------------- /src/test/support/helper_code/stubs/support_pedotransfer_stub.h: -------------------------------------------------------------------------------- 1 | void pedotransfer(Stand *stand, Real *abswmm, Real *absimm, Real standfrac) 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /src/test/support/helper_code/stubs/support_sprintcoord_stub.h: -------------------------------------------------------------------------------- 1 | char *sprintcoord(String s, const Coord *coord) 2 | { 3 | 4 | } 5 | -------------------------------------------------------------------------------- /src/test/test_initsoil.c: -------------------------------------------------------------------------------- 1 | /* --- c libraries --- */ 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | /* --- headers with no corresponding .c files --- */ 8 | #include "lpj.h" 9 | 10 | /* --- headers with corresponding .c files that will be compiled/linked in by ceedling --- */ 11 | #include "unity.h" /* c unit testing framework */ 12 | 13 | /* modules under test */ 14 | #include "initsoil.h" 15 | #include "calc_soil_thermal_props.h" 16 | #include "compute_mean_layer_temps_from_enth.h" 17 | 18 | /* support for tests */ 19 | #include "support_global_variables.h" 20 | #include "support_stand_mocks.h" 21 | #include "support_soil_mocks.h" 22 | #include "support_manipulate_soil.h" 23 | #include "support_pedotransfer_stub.h" 24 | 25 | /* global lpjml variables */ 26 | Real layerbound[NSOILLAYER]; 27 | 28 | void test_highest_bulk_dens_has_expected_thermal_cond(void) 29 | { 30 | Real therm_cond_highest_bulk_density; 31 | therm_cond_highest_bulk_density = calc_soil_dry_therm_cond(2700.0); 32 | 33 | TEST_ASSERT_FLOAT_WITHIN(0.01, 3, therm_cond_highest_bulk_density); 34 | } 35 | 36 | void test_zero_bulk_dens_doesnt_cause_NA(void) 37 | { 38 | Real therm_cond_highest_bulk_density; 39 | int myRock = ROCK; 40 | therm_cond_highest_bulk_density = calc_soil_dry_therm_cond(0); 41 | 42 | TEST_ASSERT_FLOAT_IS_NOT_NAN(therm_cond_highest_bulk_density); 43 | } 44 | -------------------------------------------------------------------------------- /src/tools/closeconfig.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** c l o s e c o n f i g . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** Function closes LPJ configuration file \n**/ 8 | /** \n**/ 9 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 10 | /** authors, and contributors see AUTHORS file \n**/ 11 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 12 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 13 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 14 | /** \n**/ 15 | /**************************************************************************************/ 16 | 17 | #include 18 | #include "lpj.h" 19 | 20 | void closeconfig(LPJfile *file) 21 | { 22 | json_object_put(file); 23 | } /* of 'closeconfig' */ 24 | -------------------------------------------------------------------------------- /src/tools/freemat.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e e m a t . c \n**/ 4 | /** \n**/ 5 | /** Function deallocates 2-dimensional array allocated by newmat() \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include "types.h" 18 | 19 | void freemat(void **mat) 20 | { 21 | if(mat!=NULL) 22 | { 23 | free(mat[0]); 24 | free(mat); 25 | } 26 | } /* of 'freemat' */ 27 | -------------------------------------------------------------------------------- /src/tools/frepeatch.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f r e p e a t c h . c \n**/ 4 | /** \n**/ 5 | /** Function prints character repeatedly \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include "types.h" 17 | 18 | void frepeatch(FILE *file, /**< pointer to text file */ 19 | char c, /**< character to repeat */ 20 | int count /**< repeat count */ 21 | ) 22 | { 23 | int i; 24 | for(i=0;i 14 | #include 15 | #include "types.h" 16 | 17 | #define uSecScale 1.0e-6 /* Microsecond conversions */ 18 | 19 | double mrun(void) /** \return time in sec with microsecond resolution */ 20 | { 21 | struct timeval tp; 22 | struct timezone tzp; 23 | gettimeofday(&tp,&tzp); 24 | return (((double)tp.tv_usec) * uSecScale) + (double)tp.tv_sec; 25 | } /* of 'mrun' */ 26 | -------------------------------------------------------------------------------- /src/tools/strdate.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** s t r d a t e . c \n**/ 4 | /** \n**/ 5 | /** Function implements ctime() without trailing newline \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include 16 | #include 17 | #include 18 | #include "types.h" 19 | 20 | char *strdate(const time_t *t) 21 | { 22 | static String s; 23 | strftime(s,STRING_LEN,"%c",localtime(t)); 24 | return s; 25 | } /* of 'strdate' */ 26 | -------------------------------------------------------------------------------- /src/tree/fpar_tree.c: -------------------------------------------------------------------------------- 1 | /**************************************************************************************/ 2 | /** \n**/ 3 | /** f p a r _ t r e e . c \n**/ 4 | /** \n**/ 5 | /** C implementation of LPJmL \n**/ 6 | /** \n**/ 7 | /** (C) Potsdam Institute for Climate Impact Research (PIK), see COPYRIGHT file \n**/ 8 | /** authors, and contributors see AUTHORS file \n**/ 9 | /** This file is part of LPJmL and licensed under GNU AGPL Version 3 \n**/ 10 | /** or later. See LICENSE file or go to http://www.gnu.org/licenses/ \n**/ 11 | /** Contact: https://github.com/PIK-LPJmL/LPJmL \n**/ 12 | /** \n**/ 13 | /**************************************************************************************/ 14 | 15 | #include "lpj.h" 16 | #include "tree.h" 17 | 18 | Real fpar_tree(const Pft *pft) 19 | { 20 | return pft->phen*pft->fpc*(1-pft->snowcover); 21 | } /* of 'fpar_tree' */ 22 | --------------------------------------------------------------------------------