[FLASH-USERS] Compile error from hy_uhd_energyFix declaration in hy_uhd_interface.F90

Lewis,Sean scl63 at drexel.edu
Wed Jun 17 12:31:53 EDT 2020


Hi Klaus,

Thank you for your earlier detailed response and apologies for my late reply. 
I downloaded a fresh FLASH4.6.2.tar.gz and cannot confirm that the following argument blocks agree:

1.  physics/Hydro/HydroMain/unsplit/hy_uhd_energyFix.F90 
2. physics/Hydro/HydroMain/unsplit/hy_uhd_interface.F90


In my fresh 4.6.2 the arguments lists look like this:
hy_uhd_energyFix.F90:
Subroutine hy_uhd_energyFix(blockID,blkLimits,dt,dtOld,del,eosMode,rangeSwitch,noMHD)
  !! ---- Argument List ----------------------------------                                                                                                                                                                                    
  integer, intent(IN) :: blockID
  integer, dimension(LOW:HIGH,MDIM), intent(IN) :: blkLimits
  real, intent(IN) :: dt,dtOld
  real, dimension(MDIM), intent(IN) :: del
  integer, intent(IN) :: eosMode
  integer,OPTIONAL,intent(IN) :: rangeSwitch
  logical,OPTIONAL,intent(IN) :: noMHD
  !! -----------------------------------------------------  

hy_uhd_interface.F90:
  interface
     subroutine hy_uhd_energyFix(blockID,blkLimits,dt,dtOld,del,eosMode,updateMode,doMHD)
       implicit none
       integer, intent(IN) :: blockID
       integer, dimension(LOW:HIGH,MDIM), intent(IN) :: blkLimits
       real, intent(IN) :: dt,dtOld
       real, dimension(MDIM), intent(IN) :: del
       integer, intent(IN) :: eosMode
       integer,OPTIONAL,intent(IN) :: updateMode
       logical,OPTIONAL,intent(IN) :: doMHD
     end subroutine hy_uhd_energyFix
  end interface 

So, the setup call ./setup Sedov -auto -3d +usm +gravMgrid using a fresh FLASH4.6.2 still does not compile properly.
Although the argument lists do agree in FLASH4.6.1 and the setup call ./setup Sedov -auto -3d +usm +gravMgrid does compile properly there, the source files of FLASH4.6.2 do not seem to share that agreement.
I'm unsure where to go from here, do you have any other thoughts? 

Thanks,
Sean

Sean C. Lewis
Doctoral Candidate
Department of Physics
Drexel University

On 5/27/20, 1:04 PM, "Klaus Weide" <klaus at flash.uchicago.edu> wrote:

    External.
    
    On Wed, 27 May 2020, Lewis,Sean wrote:
    
    > A combination of setup parameters in FLASH4.6.2 has revealed a compile error.
    
    Really FLASH4.6.2?  (See below.)
    
    > The setup call:
    >
    > ./setup Sedov -auto -3d +usm +gravMgrid
    >
    > Will result in the following error:
    >
    > hy_uhd_unsplit.F90:1167:80:
    >
    >
    >
    >       call hy_uhd_energyFix(blockID,blkLimits,dt,dtOld,del,hy_eosModeAfter,noMHD=.TRUE.)
    >
    >                                                                                 1
    >
    > Error: Keyword argument 'nomhd' at (1) is not in the procedure
    >
    > The error is seemingly corrected by updating source/physics/Hydro/HydroMain/unsplit/hy_uhd_interface.F90, specifically the following lines in the hy_udh_energyFix subroutine declaration:
    >
    > 593: subroutine hy_uhd_energyFIx(blockID, blkLimits,dt,dtOld,del,eosMode,rangeSwitch,noMHD)
    > 600: integer,OPTIONAL,intent(IN) :: rangeSwitch
    > 601: logical,OPTIONAL,intent(IN) :: noMHD
    >
    > I’d like to confirm that this is a proper fix and if any users or devs expect unforeseen issues stemming from this fix.
    
    The arguments lists of subroutine hy_uhd_energyFix in these two places
    have to agree:
    
     1. the implementation in hy_uhd_energyFix.F90
     2. the interface block in hy_und_interface.F90
    
    As far as I can see, such agreement has existed in recent FLASH code
    releases (at least for instances of these files under
    source/physics/Hydro/HydroMain/unsplit/). So it looks as if you were
    encountering a problem caused by mixed versions of source files;
    like a v4.6.2 hy_und_unsplit.F90 with a pre-4.6.2 hy_und_interface.F90.
    
    The changes that added two new optional arguments, 'rangeSwitch' and
    'noMHD', to subroutine hy_uhd_energyFix happened between FLASH 4.6.1 and
    FLASH 4.6.2. The following entry from RELEASE-NOTES is relevant:
    
    * Corrected wrong order of operations in an MHD code path when using
      flux correction: energy corrections (proper accounting of magnetic
      energy in cells) could be applied too late in interior cells.  The
      problem only occurred in 1D MHD configurations (with the
      MHD_StaggeredMesh code), which could then lead to errors in results
      of 3T simulations.
    
    At least the following files were affected:
    
      physics/Hydro/HydroMain/unsplit/hy_uhd_energyFix.F90
      physics/Hydro/HydroMain/unsplit/MHD_StaggeredMesh/hy_uhd_unsplit.F90 *
      physics/Hydro/HydroMain/unsplit/hy_uhd_interface.F90
    
    You should make sure that these are all at a compatible level, presumably
    FLASH version 4.6.2 (plus any local modification you may have).
    
    *Note the list does not include the non-MHD version
      physics/Hydro/HydroMain/unsplit/Hydro_Unsplit/hy_uhd_unsplit.F90 ;
    even though hy_uhd_energyFix was changed v4.6.1 -> 4.6.2, calls to
    it from THAT version of hy_uhd_unsplit did not have to change
    (they did not need to use the new optional arguments).
    
    
    
    Klaus
    



More information about the flash-users mailing list