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

KPP standalone interface from Obin Sturm #2482

Open
wants to merge 24 commits into
base: dev/no-diff-to-benchmark
Choose a base branch
from

Commits on Sep 26, 2024

  1. Initial version of KPP Standalone Interface

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    c282573 View commit details
    Browse the repository at this point in the history
  2. Initial version w revised header and cell name fix

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    caad4e9 View commit details
    Browse the repository at this point in the history
  3. commenting out verbose diagnostic printing

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    241a486 View commit details
    Browse the repository at this point in the history
  4. Add chemistry operator splitting timestep

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    70264d6 View commit details
    Browse the repository at this point in the history
  5. remove MODEL_GEOS ifdef

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    8b38a68 View commit details
    Browse the repository at this point in the history
  6. Add OutputDir as a backup default output directory

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    37e8647 View commit details
    Browse the repository at this point in the history
  7. Fix early quit conditional so GNU fortran 10.2 stops tripping

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    f092b67 View commit details
    Browse the repository at this point in the history
  8. moved kpp_standalone_interface.yml to run/shared

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    c0be3bb View commit details
    Browse the repository at this point in the history
  9. comment in the YAML file that output_dir must exist

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    165e502 View commit details
    Browse the repository at this point in the history
  10. fix KPP species name mapping

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    bbeb084 View commit details
    Browse the repository at this point in the history
  11. write Hexit last step instead of future step

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    072ba23 View commit details
    Browse the repository at this point in the history
  12. three digit exponent, tip from @nicholasbalasus

    Obin Sturm authored and lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    f611a4c View commit details
    Browse the repository at this point in the history
  13. Updated changelog

    Signed-off-by: Lizzie Lundgren <elundgren@seas.harvard.edu>
    lizziel committed Sep 26, 2024
    Configuration menu
    Copy the full SHA
    e3ddb4a View commit details
    Browse the repository at this point in the history

Commits on Sep 27, 2024

  1. Fixed incorrect YAML tag in kpp_standalone_interface.yml

    run/shared/kpp_standalone_interface.yml
    - Fixed typo: "output_dir" -> "output_directory"
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    5cfc36d View commit details
    Browse the repository at this point in the history
  2. Fixed parallelization error in KPP standalone interface

    GeosCore/fullchem_mod.f90
    - Use keyword arguments, for clarity
    
    GeosCore/kpp_standalone_interface.F90
    - Remove Active_Cell and Active_Cell_Name from KPP_Standalone_YAML
    - Add new derived type KPP_Standalone_ActiveCell_Type, which is now
      declared with !$OMP THREADPRIVATE.  This contains the Active_Cell
      and Active_Cell_Name fields.
    - Added new variable KPP_Standalone_ActiveCell, based on
      new KPP_Standalone_ActiveCell_Type
    
    NOTE: The KPP_Standalone_YAML is initialized outside of a parallel
    loop, so it does not need to be declared !$OMP THREADPRIVATE.  But the
    choice of whether an (I,J,L) location corresponds to one of the
    "active_cells" (listed in the kpp_standalone_interface.yml file) happens
    within a parallelized loop.  Thus we need to move the Active_Cell and
    Active_Cell_Name fields out of KPP_Standalone_YAML and into
    KPP_Standalone_ActiveCell.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Sep 27, 2024
    Configuration menu
    Copy the full SHA
    acbc3a0 View commit details
    Browse the repository at this point in the history

Commits on Oct 3, 2024

  1. Add settings:activate switch in kpp_standalone_interface.yml

    run/shared/kpp_standalone_interface.yml
    - Reorganize file so that "settings:" comes first, then "active_cells:",
      and then "locations:"
    - Add "settings:activate" YAML tag to toggle the KPP standalone
      interface on or off
    
    GeosCore/kpp_standalone_interface.F90
    - Add call to QFYAML_Add_Get to parse the "settings:activate" YAML tag
    - Set KPP_Standalone_YAML%SkipIt to .TRUE. if "settings:activate"
      is false.  This will cause the code to ignore saving out the state
      of the model for the KPP standalone even if kpp_standalone_interface.yml
      is present in the run directory.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 3, 2024
    Configuration menu
    Copy the full SHA
    a12c299 View commit details
    Browse the repository at this point in the history

Commits on Oct 4, 2024

  1. Update run directory scripts for the KPP standalone interface

    run/GCClassic/createRunDir.sh
    - Copy run/shared/kpp_standalone_interface.yml to fullchem rundirs
    
    run/shared/cleanRunDir.sh
    - Skip removing bpch files (and {diag,tracer}info.dat files), we no
      longer generate bpch output
    - Add comments and usage examples
    - Remove all fort.* files
    - Remove OututDir/*.txt files as well (these are KPP standalone
      interface files)
    
    CHANGELOG.md
    - Updated accordingly
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    711e09d View commit details
    Browse the repository at this point in the history
  2. Fix parallel issues in KPP standalone interface; Add structural updates

    .gitignore
    - Also ignore *.exe files
    
    GeosCore/fullchem_mod.F90
    - Remove State_Grid from call to Check_ActiveCell
    
    GeosCore/kpp_standalone_interface.F90
    - Updated subroutine header comments
    - Added cosmetic changes for clarity (mostly making code fit within
      80 characters, for better readability)
    - Removed Active_Cell and Active_Cell_name from the
      KPP_Standalone_Interface_Type (should have been done previously)
    - Remove State_Grid argument from Check_ActiveCell, this was only
      used for debugging.   Also removed commented out debug prints.
    - Use Format statements with write statments where expedient
    - Echo a message when the KPP standalone interface is manually disabled
      (i.e. when settings:activate = false)
    - Added display of location names and lon/lats at end of the routine
      Config_KPP_Standalone
    - In routine Write_Samples, wrap file I/O in an !$OMP CRITICAL block,
      in order to prevent more than one thread from writing to each file.
    - Removed RETURN statement from within !$OMP CRITICAL block, this
      is not allowed.
    - Bug fix: Write Kpp_Standalone_ActiveCell%Active_Cell_Name to file,
      and not Kpp_Standalone_YAML%Active_Cell_Name (which has been removed).
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 4, 2024
    Configuration menu
    Copy the full SHA
    73bd391 View commit details
    Browse the repository at this point in the history

Commits on Oct 8, 2024

  1. Now use consistent nomenclature for KPP standalone interface

    GeosCore/kpp_standalone_interface.F90
    - Moved to kppsa_interface_mod.F90
    
    GeosCore/kppsa_interface_mod.F90
    - Moved from kpp_standalone_interface
    - Renamed types, variables and routines using "KppSa" prefix:
      - KPP_Standalone_Interface_Type -> KppSa_Interface_Type
      - KPP_Standalone_ActiveCell_Type -> KppSa_ActiveCell_Type
      - KPP_Standalone_YAML -> KppSa_State
      - KPP_Standalone_ActiveCell -> KppSa_ActiveCell
      - Check_Domain -> KppSa_Check_Domain
      - Check_ActiveCell -> KppSa_Check_ActiveCell
      - Config_KPP_Standalone -> KppSa_Config
      - Write_Samples -> KppSa_Write_Samples
      - Cleanup_KPP_Standalone -> KppSa_Cleanup
    - Added KppSa_Check_Time function to determine if it is time to
      write KPP standalone output.  This allows you to only write output
      e.g. at the end of a run instead of for each timestep.
    - Added KppSa_State%SkipWriteAtThisTime field, which is used to
      determine if we need to exit a routine early.
    
    GeosCore/fullchem_mod.F90
    - "USE Kpp_Standalone_Interface" -> "USE KppSa_Interface_Mod"
    - Call renamed routines from kppsa_interface_mod.F90
    - Now call KppSa_Check_Domain only if it is the first call to
      DO_FULLCHEM.  This is to avoid repeated computations.
    - Now call KppSa_Check_Time to determine if we are in the time window
      when the model state should be archived to disk.
    - Updated comments and comment headers
    
    run/shared/kpp_standalone_interface.yml
    - Added "start_output_at" to denote starting date time for archiving
      model state
    - Added "stop_output_at" to denote ending date time for archiving
      model state
    - Updated comments
    
    CHANGELOG.md
    GeosCore/CMakeLists.txt
    - Updated accordingly
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    defef0f View commit details
    Browse the repository at this point in the history
  2. Further updates for KPP standalone interface

    GeosCore/kppsa_interface_mod.F90
    - In routine KppSa_Check_Time:
      - rRmoved leftover debug print statements
    - In routine Kpp_Check_ActiveCell
      - Added an IF statement to exit after setting KppSa_State%Active_Cell to .FALSE.
        and  KppSa_Active_Cell_Name to '' if we are outside of the time
        window specified in the kpp_standalone_interface.yml fiel.
      - This will ensure that we only archive model state to disk during
        the specified time window, which helps with computatonal efficiency.
    - In routine KppSa_Config:
      - Now write starting & ending date of archival window to log file
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 8, 2024
    Configuration menu
    Copy the full SHA
    bd24363 View commit details
    Browse the repository at this point in the history

Commits on Oct 9, 2024

  1. Now copy kpp_standalone_interface.yml to GCHP fullchem rundirs

    run/GCHP/createRunDir.sh
    - Added an if statement to copy run/shared/kpp_standalone_interface.yml
      to GCHP fullchem run directories (any option)
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 9, 2024
    Configuration menu
    Copy the full SHA
    8404d6d View commit details
    Browse the repository at this point in the history

Commits on Oct 30, 2024

  1. Now pass ICNTRL and RCNTRL to KppSa_Write_Samples

    GeosCore/fullchem_mod.F90
    - Pass KPP integrator arguments ICNTRL and RCNTRL to KppSa_Write_Samples
      so that we can include it in the KPP standalone output.
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    72f149c View commit details
    Browse the repository at this point in the history
  2. Now write ICNTRL, RCNTRL and ATOL to KPP standalone input files

    GeosCore/CMakeLists.txt
    - Changed permission from chmod 755 to chmod 644
    
    GeosCore/kppsa_interface_mod.F90
    - Now accept ICNTRL and RCNTRL as inputs to routine KppSa_Write_Samples
    - Change number of header lines from 48 to 60
    - Better separate Meteorological metadata and KPP parameters
      for readability
    - Write out ICNTRL as 2 lines of format 10i6
    - Write out RCNTRL as 4 lines of format 5f13.6
    - Changed format e25.16e3 to es25.16e3, which changes the output from
      e.g. 0.5e1 to 5.0e0, etc., which is more standard
    - Write out ATOL after the species concentration with format es10.2e2
    - Cosmetic changes (indentation, comments)
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    69f831b View commit details
    Browse the repository at this point in the history
  3. Added formatting fixes in kppsa_interface_mod.F90

    GeosCore/kppsa_interface_mod.F90
    - In routine KppSa_Write_Samples:
      - Added a "," in between the concentration and abs tolerance output
      - Simplified FORMAT statements 120 and 130
      - Added FORMAT statements 140 and 150
    
    Signed-off-by: Bob Yantosca <yantosca@seas.harvard.edu>
    yantosca committed Oct 30, 2024
    Configuration menu
    Copy the full SHA
    9638814 View commit details
    Browse the repository at this point in the history