terminate Subroutine

subroutine terminate()

Uses

  • proc~~terminate~~UsesGraph proc~terminate terminate module~river river proc~terminate->module~river module~subbasin subbasin proc~terminate->module~subbasin module~vegetation vegetation proc~terminate->module~vegetation module~catchment catchment proc~terminate->module~catchment module~output output proc~terminate->module~output module~erosion erosion proc~terminate->module~erosion module~nutrient nutrient proc~terminate->module~nutrient module~crop crop proc~terminate->module~crop module~input input proc~terminate->module~input module~hydrotope hydrotope proc~terminate->module~hydrotope module~reservoir reservoir proc~terminate->module~reservoir module~soil soil proc~terminate->module~soil module~management management proc~terminate->module~management module~evapotranspiration evapotranspiration proc~terminate->module~evapotranspiration module~time time proc~terminate->module~time module~groundwater groundwater proc~terminate->module~groundwater module~snow snow proc~terminate->module~snow module~utilities utilities module~river->module~utilities module~subbasin->module~utilities module~vegetation->module~utilities module~catchment->module~subbasin module~catchment->module~input module~catchment->module~utilities module~output->module~utilities module~erosion->module~utilities module~nutrient->module~utilities module~crop->module~utilities module~input->module~utilities module~hydrotope->module~utilities module~reservoir->module~utilities module~soil->module~utilities module~management->module~utilities module~evapotranspiration->module~utilities module~time->module~utilities module~groundwater->module~utilities module~snow->module~utilities

Arguments

None

Calls

proc~~terminate~~CallsGraph proc~terminate terminate proc~dealloc_reservoir dealloc_reservoir proc~terminate->proc~dealloc_reservoir proc~dealloc_hydrotope dealloc_hydrotope proc~terminate->proc~dealloc_hydrotope proc~dealloc_erosion dealloc_erosion proc~terminate->proc~dealloc_erosion proc~dealloc_nutrient dealloc_nutrient proc~terminate->proc~dealloc_nutrient proc~dealloc_river dealloc_river proc~terminate->proc~dealloc_river proc~subbasin_close subbasin_close proc~terminate->proc~subbasin_close proc~dealloc_vegetation dealloc_vegetation proc~terminate->proc~dealloc_vegetation proc~management_write_user_output management_write_user_output proc~terminate->proc~management_write_user_output proc~dealloc_groundwater dealloc_groundwater proc~terminate->proc~dealloc_groundwater proc~crop_deallocate crop_deallocate proc~terminate->proc~crop_deallocate proc~input_nc_close input_nc_close proc~terminate->proc~input_nc_close proc~get_config_fid get_config_fid proc~terminate->proc~get_config_fid proc~dealloc_output dealloc_output proc~terminate->proc~dealloc_output proc~dealloc_snow dealloc_snow proc~terminate->proc~dealloc_snow proc~dealloc_catchment dealloc_catchment proc~terminate->proc~dealloc_catchment proc~dealloc_soil dealloc_soil proc~terminate->proc~dealloc_soil proc~dealloc_evapotranspiration dealloc_evapotranspiration proc~terminate->proc~dealloc_evapotranspiration proc~gen_filename gen_filename proc~management_write_user_output->proc~gen_filename proc~output_open_file output_open_file proc~management_write_user_output->proc~output_open_file nf90_close nf90_close proc~input_nc_close->nf90_close proc~input_nc_check_error input_nc_check_error proc~input_nc_close->proc~input_nc_check_error proc~open_file open_file proc~get_config_fid->proc~open_file proc~log_error log_error proc~open_file->proc~log_error proc~output_open_file->proc~open_file nf90_strerror nf90_strerror proc~input_nc_check_error->nf90_strerror proc~input_nc_check_error->proc~log_error proc~log_message log_message proc~log_error->proc~log_message proc~log_write log_write proc~log_message->proc~log_write proc~log_format_message log_format_message proc~log_message->proc~log_format_message proc~to_string to_string proc~log_write->proc~to_string proc~date_time_str date_time_str proc~log_format_message->proc~date_time_str proc~colourise colourise proc~log_format_message->proc~colourise proc~string_index string_index proc~colourise->proc~string_index

Called by

proc~~terminate~~CalledByGraph proc~terminate terminate program~swim swim program~swim->proc~terminate

Contents

Source Code


Source Code

  subroutine terminate
    use input, only : &
#ifdef with_netcdf
      input_nc_close, &
#endif
      get_config_fid
    use management, only : bWAM_Module, management_write_user_output
    use subbasin, only : mb
    use time, only : nDaysSim
    use catchment, only : dealloc_catchment
    use crop, only : crop_deallocate
    use erosion, only : dealloc_erosion
    use evapotranspiration, only : dealloc_evapotranspiration
    use groundwater, only : dealloc_groundwater
    use hydrotope, only : dealloc_hydrotope
    use nutrient, only : dealloc_nutrient
    use output, only : dealloc_output
    use reservoir, only : dealloc_reservoir
    use river, only : dealloc_river
    use snow, only : dealloc_snow
    use soil, only : dealloc_soil
    use subbasin, only : subbasin_close
    use vegetation, only : dealloc_vegetation

    if (bWAM_Module) call management_write_user_output(mb, ndayssim)

    close(get_config_fid())

    call dealloc_catchment
    call crop_deallocate
    call dealloc_erosion
    call dealloc_evapotranspiration
    call dealloc_groundwater
    call dealloc_hydrotope
    call dealloc_nutrient
    call dealloc_output
    call dealloc_reservoir
    call dealloc_river
    call dealloc_snow
    call dealloc_soil
    call subbasin_close
    call dealloc_vegetation

    !**** Close netcdf files
#ifdef with_netcdf
    call input_nc_close
#endif

    return
  end subroutine terminate