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

[DISCUSSION] HCOIO_Read_Std_Mod #19

Closed
jimmielin opened this issue Feb 17, 2020 · 5 comments
Closed

[DISCUSSION] HCOIO_Read_Std_Mod #19

jimmielin opened this issue Feb 17, 2020 · 5 comments
Labels
category: Discussion An extended discussion of a particular topic

Comments

@jimmielin
Copy link
Collaborator

Overview

There seems to be a lot of extra routines in HCOIO_Read_Std_Mod compared to the ESMF version.

HCOIO_Read_Std_Mod:

  PUBLIC  :: HCOIO_ReadOther
  PUBLIC  :: HCOIO_CloseAll
#if !defined(ESMF_)
  PUBLIC  :: HCOIO_read_std
!
! !PRIVATE MEMBER FUNCTIONS:
!
  PRIVATE :: GET_TIMEIDX
  PRIVATE :: Check_AvailYMDhm
  PRIVATE :: prefYMDhm_Adjust
  PRIVATE :: Set_tIdx2
  PRIVATE :: IsClosest
  PRIVATE :: GetIndex2Interp
  PRIVATE :: GetWeights
  PRIVATE :: YMDhm2hrs
  PRIVATE :: Normalize_Area
  PRIVATE :: SrcFile_Parse
  PRIVATE :: SigmaMidToEdges
  PRIVATE :: CheckMissVal
  PRIVATE :: GetArbDimIndex
#endif
  PRIVATE :: HCOIO_ReadCountryValues
  PRIVATE :: HCOIO_ReadFromConfig
  PRIVATE :: GetDataVals
  PRIVATE :: GetSliceIdx
  PRIVATE :: FillMaskBox
  PRIVATE :: ReadMath

HCOIO_Read_ESMF_Mod

#if defined(ESMF_)
  PUBLIC  :: HCOIO_Read_ESMF

Could any of the STD mod routines be moved to somewhere else? Some of these are basically managing IO stuff that is handled by MAPL in GCHP, but they may also be useful for the CESM implementation. Moving them to a more generic component (HCOIO helpers?) would allow less duplication of code as I think the CESM Parallel IO-based interface will be based upon the standard HCOIO interface quite a bit, and 4.7k lines of code is quite a lot of stuff to duplicate.

References

The only public entry points to the HCOIO_Read_* routines in HEMCO are the following:

Searching 114 files for "use HCOIO_Read_Std_Mod"

src\Core\hco_readlist_mod.F90:
  406  !
  407      USE HCOIO_DataRead_Mod, ONLY : HCOIO_DataRead
  408:     USE HCOIO_Read_Std_Mod, ONLY : HCOIO_ReadOther
  409:     USE HCOIO_Read_Std_Mod, ONLY : HCOIO_CloseAll

src\Core\hcoio_dataread_mod.F90:
  169      USE HCOIO_READ_ESMF_MOD,  ONLY : HCOIO_READ_ESMF
  170  #else
  171:     USE HCOIO_READ_STD_MOD,   ONLY : HCOIO_READ_STD
  172  #endif
  173  !

3 matches across 2 files

So shuffling the internal routines around should be OK for compatibility.

After #11 which aims to unify the subroutine calls, maybe it would be nice to clean up all the calls to ReadOther CloseAll etc., maybe adding a cleanup routine to each IO component so they can free up the file handles (standard) or do nothing (MAPL).

@jimmielin jimmielin added the category: Discussion An extended discussion of a particular topic label Feb 17, 2020
@lizziel
Copy link
Contributor

lizziel commented May 14, 2020

I am going to tackle this starting this week. If there is other information related to it that you added to other github issues in this or other repos let me know.

@yantosca
Copy link
Contributor

The only thing I added was #31, which is a quick bug fix for the dry-run. I don't intend on touching anything else in HEMCO in the near future.

@lizziel
Copy link
Contributor

lizziel commented May 14, 2020

Sorry, that question was aimed at @jimmielin. But thanks for the update on that since it does touch this file!

@jimmielin
Copy link
Collaborator Author

Hi @lizziel, I don't have any new updates on this. I will be looking into other parts of the HEMCO code to implement an intermediate grid functionality and ask for everyone's feedback during MDS. Thanks for helping with this!

@lizziel
Copy link
Contributor

lizziel commented Jun 12, 2020

This update is complete in commit b902b23. Additional work to clean up subroutine calls will be ongoing.

@lizziel lizziel closed this as completed Jun 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
category: Discussion An extended discussion of a particular topic
Projects
None yet
Development

No branches or pull requests

3 participants