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

Refactor Chem_MieTableMod2G.F90 #96

Closed
tclune opened this issue Feb 9, 2022 · 9 comments
Closed

Refactor Chem_MieTableMod2G.F90 #96

tclune opened this issue Feb 9, 2022 · 9 comments

Comments

@tclune
Copy link
Contributor

tclune commented Feb 9, 2022

No longer needed as we do not aggregate across tracers.

@weiyuan-jiang
Copy link
Contributor

Where to save channels(:) after deleting Chem_Mie type?

@tclune tclune changed the title Delete Chem_Mie type Refactor Chem_MieTableMod2G.F90 Feb 10, 2022
@tclune
Copy link
Contributor Author

tclune commented Feb 10, 2022

There is a laundry list of changes needed:

  • The module name should change
    • "2G" should be before "Mod"
    • "Table" should go away
    • Filename should be updated accordingly (git mv)
  • Chem_Mie type goes away
  • Chem_MieTable is renamed to Chem_Mie
  • Use modern Fortran
    • POINTER components should be ALLOCATABLE
    • Chem_MieQuery should be a type-bound procedure
    • Constructor should be the same name as the type (requires interface block)
  • "nlambda" component should be "nch" and documented as number of channels
  • Create and Read methods should be fused into a single constructor
  • QueryByInt should be QueryByScalar
  • WithPmom should be QueryByVector
  • New interface should allow passing frequency instead of channel
    • need new helper procedure that computes channel (int) from frequency (float)
    • just use placeholder for now

@tclune
Copy link
Contributor Author

tclune commented Feb 10, 2022

I also want to temporarily write another interface that works with 3D arrays that is not elemental. If ELEMENTAL gives comparable performance, we delete the 3d version (and leave a comment that elemental was benchmarked) Otherwise we eliminate ELEMENTAL and keep both versions and also create a 1D version that is needed outside of GEOS.

@weiyuan-jiang
Copy link
Contributor

In the elemental procedure, I suspect it creates 3d channels and idx which are not necessary when 3d is called

@weiyuan-jiang
Copy link
Contributor

  • WithPmom should be QueryByVector
    Comparing Withpmom with byInt, there is one more 2d optional argument pmom(:,:) in Withpmom. I saw the comment that this subroutine may be deleted.

@weiyuan-jiang
Copy link
Contributor

  • "nlambda" component should be "nch" and documented as number of channels

Should we change lambda(:) to channels(:) in the component too?

@tclune
Copy link
Contributor Author

tclune commented Feb 10, 2022

ELEMENTAL only "creates arrays" for the arguments that are arrays. The "THIS" object remains a scalar, as does idx. Maybe others - have not looked.

  • WithPmom should be QueryByVector
    Comparing Withpmom with byInt, there is one more 2d optional argument pmom(:,:) in Withpmom. I saw the comment that this subroutine may be deleted.

No - pmom is a different shape and thus prevents ELEMENTAL. I pulled it into a separate interface precisely because of that.

@tclune
Copy link
Contributor Author

tclune commented Feb 10, 2022

  • "nlambda" component should be "nch" and documented as number of channels

Should we change lambda(:) to channels(:) in the component too?

Actually, it should be changed to wavelengths(:). Channel is the integer, wavelength is the float.

@amdasilva
Copy link
Collaborator

It has been done with PR on 3/17/2022.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants