Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Structure] Reorganize code/logic from canopy driver to separate submodules #23

Open
drnimbusrain opened this issue Sep 27, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@drnimbusrain
Copy link
Member

drnimbusrain commented Sep 27, 2022

Need to move and reorganize significant amount of code/logic from driver and consolidate in their own submodules. Some locations (based on current develop branch) where this is needed is as follows (with suggested module names):

  1. Pull out all physical calculations to separate subroutines:
    canopy_griddx_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L189 (Also improve the dx calculation to be dependent on grid cell lat/lon using haversine formula for distance between two points).
    canopy_foliage_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L255
    canopy_flameh_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L288

  2. Could also make a netcdf_io module based on NACC to read netcdf inputs: https://github.com/noaa-oar-arl/NACC/blob/master/parallel/src/netcdf_io_mod.f90
    canopy_txt_io_mod.F90 (for inputting/reading text file data)
    canopy_netcdf_io_mod.F90 (for inputting/reading netcdf file data)

  3. After Issue Adding NetCDF Input/Output File Options #22 is completed, the output creation could be moved to txt and netcdf output modules:
    canopy_outncf.F90: Based on NACC: https://github.com/noaa-oar-arl/NACC/blob/master/parallel/src/outncf.f90
    canopy_outtxt.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L333

  4. After Issue [Structure] Adding Config Types  #21 is completed, anything else about choosing which things to calculate based on the config or calling computation routines could be consolidated into a subroutine to call on the inputs and config:
    canopy_input_mod.F90: https://github.com/noaa-oar-arl/canopy-app/blob/develop/canopy_driver.F90#L278

@zmoon
@drnimbusrain

@zmoon
Copy link
Member

zmoon commented Oct 20, 2022

@drnimbusrain
Copy link
Member Author

@zmoon I think we have at least in part addressed this organization with latest changes, and with your move from orphaned subroutines to submodules. Do you agree we should close this issue?

@zmoon
Copy link
Member

zmoon commented Feb 15, 2023

There is still a bit more to do here, so let's wait to close, thanks.

@drnimbusrain drnimbusrain changed the title Reorganize code/logic from canopy driver to separate submodules [Structure] Reorganize code/logic from canopy driver to separate submodules Sep 6, 2023
@drnimbusrain
Copy link
Member Author

@zmoon Any further insight into the notes we discussed briefly here, would be helpful before embarking on this and #32 and #21 issues to restructure code to with more streamlined/APIs, config types, modules, and CCPP interface/drivers. Thanks Zach! Just need some other comments or potential helpful code analogs to get a better start. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants