Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@hkershaw-brown
Copy link
Member

@hkershaw-brown hkershaw-brown commented May 6, 2022

Description:

There are science changes to DART in the pipeline that are potentially disruptive changes. However, a large part of the disruption is due to the build system in DART. For example, if you wanted to split filter_assim into two files, you would have to change ~730 path_names files.

The goal is have a build system that lets dart developers refactor code without the tax of altering individual mkmf_ and path_names files. And, ideally, as transparent as possible for DART users.

Slides about the build system are here
Original spec is here

Changes for users:

  1. ./quickbuild.sh rather than ./quickbuild.csh

  2. To build a single program ./quickbuild.sh filter rather than

    ./preprocess
    csh mkmf_filter -mpi
    make
    

    Note you can still iterate over changing code and compiling using make

    ./quickbuild.sh filter
    *edit the code*
    make
    *edit the code*
    make
    
  3. .f90 files in the work directory take precedence over .f90 files with the same name elsewhere. So you can
    have a local version of filter_assim_mod.f90 in work that will be used instead of
    assimilation_code/modules/assimilation/assim_tools_mod.f90

  4. quickdbuild.sh help gives the quickdbuild.sh usage.

For developers, added documentation in guide/quickbuild.rst about build functions and where these functions search for
source code. Html is here

Fixes issues

Fixes #216, fixes #335, fixes #333, fixes #157, fixes #129, fixes #327, fixes #114
developer_tests/time_manager now compiles.
Fixes #141 developer_tests/build_everything uses local obs_def/kind_mod.f90.

Renames obs_diag for streamflow to stream_flow_obs_diag. Note this does not fix issue #334.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Documentation update

This pull request removes 1465 files ~30% of the repo

Documentation changes needed?

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • I have updated the DART tutorial pdfs.

Tests

Please describe any tests you ran to verify your changes.

  • Built DART executables (models, converters, developer tests) mac and Cheyenne

Note I've changed the code in models/wrf_hydro/hydro_dart_py/hydrodartpy/core/dartclasses.py to use quickdbuild.sh. However dartclasses.py expecting to ls the mkmf_ files to get a list of executables. I'm not sure where the list of executables is used so this pull request may break hydro_dart_py.

Checklist for merging

  • Updated changelog entry
  • Documentation updated
  • Version tag

Testing Datasets

  • Dataset needed for testing available upon request
  • Dataset download instructions included
  • No dataset needed

move streamflow_obs_diag to its own directory
cice quickbuild.sh
quickbuild.csh wipes these.  Do we want to make them?
@hkershaw-brown hkershaw-brown marked this pull request as ready for review May 12, 2022 14:52
Copy link
Collaborator

@nancycollins nancycollins left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i will confess to not reviewing all 1829 changed files individually. i did run tests and everything worked as expected. i think this is a positive step in lowering the barrier to making needed software changes and i approve this pull request.

not for this pull request, but in the future we should stop adding extensions to commands (e.g. quickbuild instead of quickbuild.csh or quickbuild.sh or quickbuild.py). then we can change the implementation language from csh to sh to python to a compiled program and it will all be transparent to the end user (and other scripts). commands should never have had .csh extensions. apparently it made it easier to have svn automatically set the permissions to add the executable flags. in my opinion that wasn't a good choice. it's too late for our existing scripts, but for future scripts it would be a better practice to drop the file extension altogether. (end rant)

@hkershaw-brown
Copy link
Member Author

hkershaw-brown commented May 13, 2022 via email

@nancycollins
Copy link
Collaborator

just a warning that with the new build system, i found that
models/wrf/experiments/Radar/IC/sounding_perturbation/pert_sounding_module.f90
does not compile with gfortran v11.2.0 on my mac. there are 3 places with an integer/real mismatch in subroutine arguments. this isn't our code - i'm guessing from the directory and name that it's used to perturb synthetic radar obs for testing/experiments. there are probably no makefiles that use this module but the new build system tries to compile everything and fails the wrf build because of this. i took a quick stab at trying to see if i could resolve the real(4) vs integer(4) mismatch but it wasn't simple to see what could be changed without breaking the code.

@hkershaw-brown
Copy link
Member Author

just a warning that with the new build system, i found that models/wrf/experiments/Radar/IC/sounding_perturbation/pert_sounding_module.f90 does not compile with gfortran v11.2.0 on my mac. there are 3 places with an integer/real mismatch in subroutine arguments. this isn't our code - i'm guessing from the directory and name that it's used to perturb synthetic radar obs for testing/experiments. there are probably no makefiles that use this module but the new build system tries to compile everything and fails the wrf build because of this. i took a quick stab at trying to see if i could resolve the real(4) vs integer(4) mismatch but it wasn't simple to see what could be changed without breaking the code.

There is a script to compile this code:
DART/models/wrf/experiments/Radar/IC/sounding_perturbation/compile_pert_sounding.csh . It does not compile on main with gnu/11.2.0

hkershaw@cheyenne5:/glade/scratch/hkershaw/DART/Bugs/mismatch/DART/models/wrf/experiments/Radar/IC/sounding_perturbation(main)$ gfortran -c pert_sounding_module.f90 
pert_sounding_module.f90:175:27:

  175 |       amp(m) = mag*gaussdev(iseed1)
      |                           1
Error: Type mismatch in argument ‘idum’ at (1); passed REAL(4) to INTEGER(4)
pert_sounding_module.f90:179:34:

  179 |          phs(m) = 2.0*PI*(2.0*ran2(iseed2)-1.0)
      |                                  1
Error: Type mismatch in argument ‘idum’ at (1); passed REAL(4) to INTEGER(4)
pert_sounding_module.f90:192:25:

  192 |       q(k) = mag*gaussdev(iseed1)
      |                         1
Error: Type mismatch in argument ‘idum’ at (1); passed REAL(4) to INTEGER(4)
hkershaw@cheyenne5:/glade/scratch/hkershaw/DART/Bugs/mismatch/DART/models/wrf/experiments/Radar/IC/sounding_perturbation(main)$ gfortran --version
GNU Fortran (GCC) 11.2.0

I will move this to an issue, I think fix or remove this code from the repo, set as EXCLUDE in this pull request

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment